threads / patch / 43424

patch, 2 partsgit-svn: don't die on rebuild when --upgrade is specified

Subject: [PATCH 2/2] git-svn: don't die on rebuild when --upgrade is specified

## tl;dr

2 messages between Nov 5, 2006 and Nov 5, 2006. Diffs are folded; open one to read it.

replies: 1people: 1as markdown or json

Eric Wong· Nov 5, 2006, 05:51 UTC · lore

[PATCH 1/2] git-svn: avoid printing filenames of files we're not tracking

This is purely an aesthetic change, we already skip importing of files that don't affect the subdirectory we import.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
 git-svn.perl |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
Show changes to git-svn.perl +4 −5
diff --git a/git-svn.perl b/git-svn.perl
index 37ecc51..cc3335a 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -2662,11 +2662,12 @@ sub libsvn_connect {
 }
 
 sub libsvn_get_file {
-	my ($gui, $f, $rev) = @_;
+	my ($gui, $f, $rev, $chg) = @_;
 	my $p = $f;
 	if (length $SVN_PATH > 0) {
 		return unless ($p =~ s#^\Q$SVN_PATH\E/##);
 	}
+	print "\t$chg\t$f\n" unless $_q;
 
 	my ($hash, $pid, $in, $out);
 	my $pool = SVN::Pool->new;
@@ -2769,8 +2770,7 @@ sub libsvn_fetch {
 		$pool->clear;
 	}
 	foreach (@amr) {
-		print "\t$_->[0]\t$_->[1]\n" unless $_q;
-		libsvn_get_file($gui, $_->[1], $rev)
+		libsvn_get_file($gui, $_->[1], $rev, $_->[0]);
 	}
 	close $gui or croak $?;
 	return libsvn_log_entry($rev, $author, $date, $msg, [$last_commit]);
@@ -2848,8 +2848,7 @@ sub libsvn_traverse {
 			if (defined $files) {
 				push @$files, $file;
 			} else {
-				print "\tA\t$file\n" unless $_q;
-				libsvn_get_file($gui, $file, $rev);
+				libsvn_get_file($gui, $file, $rev, 'A');
 			}
 		}
 	}
-- 
1.4.3.3.ga126
Eric Wong· Nov 5, 2006, 05:51 UTC · re: Eric Wong · lore

--copy-remote and --upgrade are rarely (never?) used together, so if --copy-remote is specified, that means the user really wanted to copy the remote ref, and we should fail if that fails.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
 git-svn.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to git-svn.perl +1 −1
diff --git a/git-svn.perl b/git-svn.perl
index cc3335a..4a56f18 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3139,7 +3139,7 @@ sub copy_remote_ref {
 	my $ref = "refs/remotes/$GIT_SVN";
 	if (safe_qx('git-ls-remote', $origin, $ref)) {
 		sys(qw/git fetch/, $origin, "$ref:$ref");
-	} else {
+	} elsif ($_cp_remote && !$_upgrade) {
 		die "Unable to find remote reference: ",
 				"refs/remotes/$GIT_SVN on $origin\n";
 	}
-- 
1.4.3.3.ga126

← back to recent threads