From: Eric Wong <normalperson@yhbt.net>
To: Seth Falcon <sethfalcon@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/1] Tried to fix git-svn's handling of filenames with embedded '@'.
Date: Sun, 28 May 2006 23:35:43 -0700 [thread overview]
Message-ID: <20060529063543.GA8128@localdomain> (raw)
In-Reply-To: <m2verqkobr.fsf@ziti.fhcrc.org>
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
next prev parent reply other threads:[~2006-05-29 6:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060529063543.GA8128@localdomain \
--to=normalperson@yhbt.net \
--cc=git@vger.kernel.org \
--cc=sethfalcon@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).