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>
This commit is contained in:
Eric Wong 2006-06-03 02:56:33 -07:00
Родитель ce475dfcb5
Коммит b63af9b340
1 изменённых файлов: 9 добавлений и 2 удалений

Просмотреть файл

@ -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) {