All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] Tried to fix git-svn's handling of filenames with embedded '@'.
@ 2006-05-28 18:15 Seth Falcon
  2006-05-28 18:15 ` [PATCH 1/1] " Seth Falcon
  0 siblings, 1 reply; 9+ messages in thread
From: Seth Falcon @ 2006-05-28 18:15 UTC (permalink / raw)
  To: git

Hi Eric, all,

I decided to give git-svn a try for a large svn project and during my
first git-svn fetch operation, I'm seeing a failure that seems related
to recent changes in the handling of svn keywords.

Here is the traceback:

svn: Syntax error parsing revision '.R'
256 at /home/sfalcon/util/scm/bin/git-svn line 1124
        main::safe_qx('svn', 'propget', 'svn:keywords', 'Biobase/inst/Code/R/get@PKGNAME@.R') called at /home/sfalcon/util/scm/bin/git-svn line 900
        main::do_update_index('ARRAY(0x8395840)', 'add', 'undef')
        called at /home/sfalcon/util/scm/bin/git-svn line 926

Unfortunately, my project has a file named "get@PKGNAME@.R" and svn
thinks the '@.R' part is specifying a revision.  Here comes a patch
that got me going again.  Not sure it is the right fix, nor whether it
covers all places where some action will be needed.

Best,

+ seth

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/1] Tried to fix git-svn's handling of filenames with embedded '@'.
  2006-05-28 18:15 [PATCH 0/1] Tried to fix git-svn's handling of filenames with embedded '@' Seth Falcon
@ 2006-05-28 18:15 ` Seth Falcon
  2006-05-28 20:42   ` Junio C Hamano
  2006-05-29  6:35   ` Eric Wong
  0 siblings, 2 replies; 9+ messages in thread
From: Seth Falcon @ 2006-05-28 18:15 UTC (permalink / raw)
  To: git

svn has trouble parsing files with embedded '@' characters.  For
example,

  svn propget svn:keywords foo@bar.c
  svn: Syntax error parsing revision 'bar.c'

I asked about this on #svn and the workaround suggested was to append
an explicit revision specifier:

  svn propget svn:keywords foo@bar.c@BASE

This patch appends '@BASE' to the filename in all calls to 'svn
propget'.
---
 contrib/git-svn/git-svn.perl |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/contrib/git-svn/git-svn.perl b/contrib/git-svn/git-svn.perl
index b3e0684..498ffe0 100755
--- a/contrib/git-svn/git-svn.perl
+++ b/contrib/git-svn/git-svn.perl
@@ -336,7 +336,7 @@ sub show_ignore {
 	my %ign;
 	File::Find::find({wanted=>sub{if(lstat $_ && -d _ && -d "$_/.svn"){
 		s#^\./##;
-		@{$ign{$_}} = safe_qx(qw(svn propget svn:ignore),$_);
+		@{$ign{$_}} = safe_qx(qw(svn propget svn:ignore),$_ . "\@BASE");
 		}}, no_chdir=>1},'.');
 
 	print "\n# /\n";
@@ -860,7 +860,7 @@ sub sys { system(@_) == 0 or croak $? }
 
 sub eol_cp {
 	my ($from, $to) = @_;
-	my $es = safe_qx(qw/svn propget svn:eol-style/, $to);
+	my $es = safe_qx(qw/svn propget svn:eol-style/, $to . "\@BASE");
 	open my $rfd, '<', $from or croak $!;
 	binmode $rfd or croak $!;
 	open my $wfd, '>', $to or croak $!;
@@ -898,7 +898,8 @@ sub do_update_index {
 	while (my $x = <$p>) {
 		chomp $x;
 		if (!$no_text_base && lstat $x && ! -l _ &&
-				safe_qx(qw/svn propget svn:keywords/,$x)) {
+				safe_qx(qw/svn propget svn:keywords/,
+                                        $x . "\@BASE")) {
 			my $mode = -x _ ? 0755 : 0644;
 			my ($v,$d,$f) = File::Spec->splitpath($x);
 			my $tb = File::Spec->catfile($d, '.svn', 'tmp',
-- 
1.3.3.gb931

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/1] Tried to fix git-svn's handling of filenames with embedded '@'.
  2006-05-28 18:15 ` [PATCH 1/1] " Seth Falcon
@ 2006-05-28 20:42   ` Junio C Hamano
  2006-05-29  5:25     ` Eric Wong
  2006-05-29  6:35   ` Eric Wong
  1 sibling, 1 reply; 9+ messages in thread
From: Junio C Hamano @ 2006-05-28 20:42 UTC (permalink / raw)
  To: Eric Wong; +Cc: git, Seth Falcon

Seth Falcon <sethfalcon@gmail.com> writes:

> svn has trouble parsing files with embedded '@' characters.  For
> example,
>
>   svn propget svn:keywords foo@bar.c
>   svn: Syntax error parsing revision 'bar.c'
>
> I asked about this on #svn and the workaround suggested was to append
> an explicit revision specifier:
>
>   svn propget svn:keywords foo@bar.c@BASE
>
> This patch appends '@BASE' to the filename in all calls to 'svn
> propget'.

Eric, this sounds sane to me.  Ack?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/1] Tried to fix git-svn's handling of filenames with embedded '@'.
  2006-05-28 20:42   ` Junio C Hamano
@ 2006-05-29  5:25     ` Eric Wong
  0 siblings, 0 replies; 9+ messages in thread
From: Eric Wong @ 2006-05-29  5:25 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Seth Falcon

Junio C Hamano <junkio@cox.net> wrote:
> Seth Falcon <sethfalcon@gmail.com> writes:
> 
> > svn has trouble parsing files with embedded '@' characters.  For
> > example,
> >
> >   svn propget svn:keywords foo@bar.c
> >   svn: Syntax error parsing revision 'bar.c'
> >
> > I asked about this on #svn and the workaround suggested was to append
> > an explicit revision specifier:
> >
> >   svn propget svn:keywords foo@bar.c@BASE
> >
> > This patch appends '@BASE' to the filename in all calls to 'svn
> > propget'.
> 
> Eric, this sounds sane to me.  Ack?

Doesn't work with svn 1.1 (a requirement of mine, unfortunately).  I'll
have a fix for that in a bit.

-- 
Eric Wong

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/1] Tried to fix git-svn's handling of filenames with embedded '@'.
  2006-05-28 18:15 ` [PATCH 1/1] " Seth Falcon
  2006-05-28 20:42   ` Junio C Hamano
@ 2006-05-29  6:35   ` Eric Wong
  2006-05-29 17:47     ` Seth Falcon
                       ` (3 more replies)
  1 sibling, 4 replies; 9+ messages in thread
From: Eric Wong @ 2006-05-29  6:35 UTC (permalink / raw)
  To: Seth Falcon; +Cc: git

Seth: how does this work?

Ick, I just found out keyword killing tests don't pass with
svn 1.1, though...

--- 

svn has trouble parsing files with embedded '@' characters.  For
example,

  svn propget svn:keywords foo@bar.c
  svn: Syntax error parsing revision 'bar.c'

I asked about this on #svn and the workaround suggested was to append
an explicit revision specifier:

  svn propget svn:keywords foo@bar.c@BASE

This patch appends '@BASE' to the filename in all calls to 'svn
propget'.

Patch originally by Seth Falcon <sethfalcon@gmail.com>
Seth: signoff?

[ew: Made to work with older svn that don't support peg revisions]

Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
 contrib/git-svn/git-svn.perl |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/contrib/git-svn/git-svn.perl b/contrib/git-svn/git-svn.perl
index b3e0684..54b93f4 100755
--- a/contrib/git-svn/git-svn.perl
+++ b/contrib/git-svn/git-svn.perl
@@ -34,7 +34,7 @@ my $sha1_short = qr/[a-f\d]{4,40}/;
 my ($_revision,$_stdin,$_no_ignore_ext,$_no_stop_copy,$_help,$_rmdir,$_edit,
 	$_find_copies_harder, $_l, $_version, $_upgrade, $_authors);
 my (@_branch_from, %tree_map, %users);
-my $_svn_co_url_revs;
+my ($_svn_co_url_revs, $_svn_pg_peg_revs);
 
 my %fc_opts = ( 'no-ignore-externals' => \$_no_ignore_ext,
 		'branch|b=s' => \@_branch_from,
@@ -336,7 +336,7 @@ sub show_ignore {
 	my %ign;
 	File::Find::find({wanted=>sub{if(lstat $_ && -d _ && -d "$_/.svn"){
 		s#^\./##;
-		@{$ign{$_}} = safe_qx(qw(svn propget svn:ignore),$_);
+		@{$ign{$_}} = svn_propget_base('svn:ignore', $_);
 		}}, no_chdir=>1},'.');
 
 	print "\n# /\n";
@@ -860,7 +860,7 @@ sub sys { system(@_) == 0 or croak $? }
 
 sub eol_cp {
 	my ($from, $to) = @_;
-	my $es = safe_qx(qw/svn propget svn:eol-style/, $to);
+	my $es = svn_propget_base('svn:eol-style', $to);
 	open my $rfd, '<', $from or croak $!;
 	binmode $rfd or croak $!;
 	open my $wfd, '>', $to or croak $!;
@@ -898,7 +898,7 @@ sub do_update_index {
 	while (my $x = <$p>) {
 		chomp $x;
 		if (!$no_text_base && lstat $x && ! -l _ &&
-				safe_qx(qw/svn propget svn:keywords/,$x)) {
+				svn_propget_base('svn:keywords', $x)) {
 			my $mode = -x _ ? 0755 : 0644;
 			my ($v,$d,$f) = File::Spec->splitpath($x);
 			my $tb = File::Spec->catfile($d, '.svn', 'tmp',
@@ -1136,6 +1136,9 @@ sub svn_compat_check {
 	if (grep /usage: checkout URL\[\@REV\]/,@co_help) {
 		$_svn_co_url_revs = 1;
 	}
+	if (grep /\[TARGET\[\@REV\]\.\.\.\]/, `svn propget -h`) {
+		$_svn_pg_peg_revs = 1;
+	}
 
 	# I really, really hope nobody hits this...
 	unless (grep /stop-on-copy/, (safe_qx(qw(svn log -h)))) {
@@ -1215,6 +1218,12 @@ sub load_authors {
 	close $authors or croak $!;
 }
 
+sub svn_propget_base {
+	my ($p, $f) = @_;
+	$f .= '@BASE' if $_svn_pg_peg_revs;
+	return safe_qx(qw/svn propget/, $p, $f);
+}
+
 __END__
 
 Data structures:
-- 
1.3.3.gef0f

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/1] Tried to fix git-svn's handling of filenames with embedded '@'.
  2006-05-29  6:35   ` Eric Wong
@ 2006-05-29 17:47     ` Seth Falcon
  2006-05-30  2:03     ` [PATCH] git-svn: compat fixes for older svn and dash Eric Wong
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Seth Falcon @ 2006-05-29 17:47 UTC (permalink / raw)
  To: git

Eric Wong <normalperson@yhbt.net> writes:

> Seth: how does this work?

Your revised patch works for me, thanks.

+ seth

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] git-svn: compat fixes for older svn and dash
  2006-05-29  6:35   ` Eric Wong
  2006-05-29 17:47     ` Seth Falcon
@ 2006-05-30  2:03     ` Eric Wong
  2006-05-30  2:03     ` [PATCH] git-svn: t0001: workaround a heredoc bug in old versions of dash Eric Wong
  2006-05-30  2:03     ` [PATCH] git-svn: remove assertion that broke with older versions of svn Eric Wong
  3 siblings, 0 replies; 9+ messages in thread
From: Eric Wong @ 2006-05-30  2:03 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git


The following patches work around problems I had with testing
git-svn on my Debian Sarge box.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] git-svn: t0001: workaround a heredoc bug in old versions of dash
  2006-05-29  6:35   ` Eric Wong
  2006-05-29 17:47     ` Seth Falcon
  2006-05-30  2:03     ` [PATCH] git-svn: compat fixes for older svn and dash Eric Wong
@ 2006-05-30  2:03     ` Eric Wong
  2006-05-30  2:03     ` [PATCH] git-svn: remove assertion that broke with older versions of svn Eric Wong
  3 siblings, 0 replies; 9+ messages in thread
From: Eric Wong @ 2006-05-30  2:03 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Eric Wong

The dash installed on my Debian Sarge boxes don't seem to like
<<'' as a heredoc starter.  Recent versions of dash do not need
this fix.

Signed-off-by: Eric Wong <normalperson@yhbt.net>

---

 contrib/git-svn/t/t0001-contrib-git-svn-props.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

edbca3e1b96747330a4b1459e914b07105b3bc44
diff --git a/contrib/git-svn/t/t0001-contrib-git-svn-props.sh b/contrib/git-svn/t/t0001-contrib-git-svn-props.sh
index 6fa7889..23a5a2a 100644
--- a/contrib/git-svn/t/t0001-contrib-git-svn-props.sh
+++ b/contrib/git-svn/t/t0001-contrib-git-svn-props.sh
@@ -20,9 +20,10 @@ a_empty_cr=
 a_empty_crlf=
 
 cd import
-	cat >> kw.c <<''
+	cat >> kw.c <<\EOF
 /* Make it look like somebody copied a file from CVS into SVN: */
 /* $Id: kw.c,v 1.1.1.1 1994/03/06 00:00:00 eric Exp $ */
+EOF
 
 	printf "Hello\r\nWorld\r\n" > crlf
 	a_crlf=`git-hash-object -w crlf`
-- 
1.3.2.g7d11

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH] git-svn: remove assertion that broke with older versions of svn
  2006-05-29  6:35   ` Eric Wong
                       ` (2 preceding siblings ...)
  2006-05-30  2:03     ` [PATCH] git-svn: t0001: workaround a heredoc bug in old versions of dash Eric Wong
@ 2006-05-30  2:03     ` Eric Wong
  3 siblings, 0 replies; 9+ messages in thread
From: Eric Wong @ 2006-05-30  2:03 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Eric Wong

svn < 1.3.x would display changes to keywords lines as modified
if they aren't expanded in the working copy.  We already check
for changes against the git tree here, so checking against the
svn one is probably excessive.

Signed-off-by: Eric Wong <normalperson@yhbt.net>

---

 contrib/git-svn/git-svn.perl |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

b430de64cb228512b9a817499203827c0ef645aa
diff --git a/contrib/git-svn/git-svn.perl b/contrib/git-svn/git-svn.perl
index b3e0684..aac8779 100755
--- a/contrib/git-svn/git-svn.perl
+++ b/contrib/git-svn/git-svn.perl
@@ -567,7 +567,6 @@ sub precommit_check {
 sub svn_checkout_tree {
 	my ($svn_rev, $treeish) = @_;
 	my $from = file_to_s("$REV_DIR/$svn_rev");
-	assert_svn_wc_clean($svn_rev);
 	assert_tree($from);
 	print "diff-tree $from $treeish\n";
 	my $pid = open my $diff_fh, '-|';
-- 
1.3.2.g7d11

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2006-05-30  2:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-28 18:15 [PATCH 0/1] Tried to fix git-svn's handling of filenames with embedded '@' Seth Falcon
2006-05-28 18:15 ` [PATCH 1/1] " Seth Falcon
2006-05-28 20:42   ` Junio C Hamano
2006-05-29  5:25     ` Eric Wong
2006-05-29  6:35   ` Eric Wong
2006-05-29 17:47     ` Seth Falcon
2006-05-30  2:03     ` [PATCH] git-svn: compat fixes for older svn and dash Eric Wong
2006-05-30  2:03     ` [PATCH] git-svn: t0001: workaround a heredoc bug in old versions of dash Eric Wong
2006-05-30  2:03     ` [PATCH] git-svn: remove assertion that broke with older versions of svn Eric Wong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.