summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1c6bbbf)
raw | patch | inline | side by side (parent: 1c6bbbf)
author | Eric Wong <normalperson@yhbt.net> | |
Fri, 17 Feb 2006 02:13:32 +0000 (18:13 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 17 Feb 2006 09:01:24 +0000 (01:01 -0800) |
We run svn log against a URL without a working copy for the first fetch,
so we end up a log that's sorted from highest to lowest. That's bad, we
always want lowest to highest. Just default to --revision 0:HEAD now if
-r isn't specified for the first fetch.
Also sort the revisions after we get them just in case somebody
accidentally reverses the argument to --revision for whatever reason.
Thanks again to Emmanuel Guerin for helping me find this.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
so we end up a log that's sorted from highest to lowest. That's bad, we
always want lowest to highest. Just default to --revision 0:HEAD now if
-r isn't specified for the first fetch.
Also sort the revisions after we get them just in case somebody
accidentally reverses the argument to --revision for whatever reason.
Thanks again to Emmanuel Guerin for helping me find this.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
contrib/git-svn/git-svn | patch | blob | history |
index ddd95798012d37025baa01cbd3fc6e2447b8696f..2caf0570ff7753f59b1e9709590a793a7940a2a6 100755 (executable)
--- a/contrib/git-svn/git-svn
+++ b/contrib/git-svn/git-svn
my (@parents) = @_;
$SVN_URL ||= file_to_s("$GIT_DIR/$GIT_SVN/info/url");
my @log_args = -d $SVN_WC ? ($SVN_WC) : ($SVN_URL);
- if (-d $SVN_WC && !$_revision) {
- $_revision = 'BASE:HEAD';
+ unless ($_revision) {
+ $_revision = -d $SVN_WC ? 'BASE:HEAD' : '0:HEAD';
}
- push @log_args, "-r$_revision" if $_revision;
+ push @log_args, "-r$_revision";
push @log_args, '--stop-on-copy' unless $_no_stop_copy;
eval { require XML::Simple or croak $! };
my $svn_log = $@ ? svn_log_raw(@log_args) : svn_log_xml(@log_args);
+ @$svn_log = sort { $a->{revision} <=> $b->{revision} } @$svn_log;
my $base = shift @$svn_log or croak "No base revision!\n";
my $last_commit = undef;