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>
This commit is contained in:
10
git-svn.perl
10
git-svn.perl
@ -309,8 +309,7 @@ sub cmd_dcommit {
|
|||||||
die "Unable to determine upstream SVN information from ",
|
die "Unable to determine upstream SVN information from ",
|
||||||
"$head history:\n $ctx\n";
|
"$head history:\n $ctx\n";
|
||||||
}
|
}
|
||||||
my $gs = Git::SVN->find_by_url($url) or
|
my $gs = Git::SVN->find_by_url($url);
|
||||||
die "Can't determine fetch information for $url\n";
|
|
||||||
my $last_rev;
|
my $last_rev;
|
||||||
foreach my $d (@refs) {
|
foreach my $d (@refs) {
|
||||||
if (!verify_ref("$d~1")) {
|
if (!verify_ref("$d~1")) {
|
||||||
@ -345,6 +344,13 @@ sub cmd_dcommit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return if $_dry_run;
|
return if $_dry_run;
|
||||||
|
unless ($gs) {
|
||||||
|
warn "Could not determine fetch information for $url\n",
|
||||||
|
"Will not attempt to fetch and rebase commits.\n",
|
||||||
|
"This probably means you have useSvmProps and should\n",
|
||||||
|
"now resync your SVN::Mirror repository.\n";
|
||||||
|
return;
|
||||||
|
}
|
||||||
$gs->fetch;
|
$gs->fetch;
|
||||||
# we always want to rebase against the current HEAD, not any
|
# we always want to rebase against the current HEAD, not any
|
||||||
# head that was passed to us
|
# head that was passed to us
|
||||||
|
Reference in New Issue
Block a user