git-svn: allow dcommit for those who only fetch from SVM with useSvmProps
This allows users to use SVM (SVN::Mirror) to mirror a remote repository to use dcommit to commit to the repository that SVM was mirroring. When dcommit is used in this manner, the automatic fetch + rebase/reset does not happen; in which case the user will have to manually invoke svm/svk, run 'git svn fetch', and finally 'git rebase'. Signed-off-by: Eric Wong <normalperson@yhbt.net>
Eric Wong committed
Feb 14, 2007 at 18:47 UTC
60d9c97adf96533e4f02d3fc2fecec998104e8ea
1 file changed
+8
-2
git-svn.perl
+8
-2
@@ -309,8 +309,7 @@ sub cmd_dcommit {
309
die "Unable to determine upstream SVN information from ",
310
"$head history:\n $ctx\n";
311
}
312
- my $gs = Git::SVN->find_by_url($url) or
313
- die "Can't determine fetch information for $url\n";
312
+ my $gs = Git::SVN->find_by_url($url);
313
my $last_rev;
314
foreach my $d (@refs) {
315
if (!verify_ref("$d~1")) {
@@ -345,6 +344,13 @@ sub cmd_dcommit {
344
}
345
}
346
return if $_dry_run;
347
+ unless ($gs) {
348
+ warn "Could not determine fetch information for $url\n",
349
+ "Will not attempt to fetch and rebase commits.\n",
350
+ "This probably means you have useSvmProps and should\n",
351
+ "now resync your SVN::Mirror repository.\n";
352
+ return;
353
+ }
354
$gs->fetch;
355
# we always want to rebase against the current HEAD, not any
356
# head that was passed to us