summaryrefslogtreecommitdiff
path: root/contrib/git-svn
diff options
context:
space:
mode:
authorLibravatar Eric Wong <normalperson@yhbt.net>2006-06-03 02:56:33 -0700
committerLibravatar Eric Wong <normalperson@yhbt.net>2006-06-16 03:04:19 -0700
commitb63af9b340dd831840c70103c9f609940a910031 (patch)
treee45604bd4cf8ce16a59bc6defd2dd28c1265c050 /contrib/git-svn
parentgit-svn: restore original LC_ALL setting (or unset) for commit (diff)
downloadtgif-b63af9b340dd831840c70103c9f609940a910031.tar.xz
git-svn: don't allow commit if svn tree is not current
If new revisions are fetched, that implies we haven't merged, acked, or nacked them yet, and attempting to write the tree we're committing means we'd silently clobber the newly fetched changes. Signed-off-by: Eric Wong <normalperson@yhbt.net>
Diffstat (limited to 'contrib/git-svn')
-rwxr-xr-xcontrib/git-svn/git-svn.perl11
1 files changed, 9 insertions, 2 deletions
diff --git a/contrib/git-svn/git-svn.perl b/contrib/git-svn/git-svn.perl
index 8bc3d69fdb..72129de6a3 100755
--- a/contrib/git-svn/git-svn.perl
+++ b/contrib/git-svn/git-svn.perl
@@ -309,9 +309,16 @@ sub commit {
}
chomp @revs;
- fetch();
- chdir $SVN_WC or croak $!;
+ chdir $SVN_WC or croak "Unable to chdir $SVN_WC: $!\n";
my $info = svn_info('.');
+ my $fetched = fetch();
+ if ($info->{Revision} != $fetched->{revision}) {
+ print STDERR "There are new revisions that were fetched ",
+ "and need to be merged (or acknowledged) ",
+ "before committing.\n";
+ exit 1;
+ }
+ $info = svn_info('.');
read_uuid($info);
my $svn_current_rev = $info->{'Last Changed Rev'};
foreach my $c (@revs) {