diff options
author | Eric Wong <normalperson@yhbt.net> | 2007-02-16 04:05:33 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2007-02-23 00:57:13 -0800 |
commit | d6d3346babaf19864ea104b0140279e62f32f7e3 (patch) | |
tree | 92e1353b3c90786073c7b193290e44ab5b91c4d2 | |
parent | 905f8b7dfc2c520b91f418ab0f2aecb1c371fbe4 (diff) | |
download | git-d6d3346babaf19864ea104b0140279e62f32f7e3.tar.gz git-d6d3346babaf19864ea104b0140279e62f32f7e3.tar.xz |
git-svn: fix some issues for people migrating from older versions
* Fixed logic for renaming old .rev_db -> .rev_db.$uuid
* correctly handle manual migrations for those who decide to
start use globbing to handle branches/tags over individual
'fetch' keys
Signed-off-by: Eric Wong <normalperson@yhbt.net>
-rwxr-xr-x | git-svn.perl | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/git-svn.perl b/git-svn.perl index eca08bdd3..d7fc9aad5 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -844,6 +844,8 @@ sub fetch_all { "svn-remote.$repo_id.${t}-maxRev") }; if (defined $max_rev && ($max_rev < $base)) { $base = $max_rev; + } elsif (!defined $max_rev) { + $base = 0; } } @@ -1066,10 +1068,7 @@ sub new { $self->{url} = command_oneline('config', '--get', "svn-remote.$repo_id.url") or die "Failed to read \"svn-remote.$repo_id.url\" in config\n"; - if ((-z $self->db_path || ! -e $self->db_path) && - ::verify_ref($self->refname.'^0')) { - $self->rebuild; - } + $self->rebuild; $self; } @@ -1737,6 +1736,8 @@ sub set_tree { sub rebuild { my ($self) = @_; my $db_path = $self->db_path; + return if (-e $db_path && ! -z $db_path); + return unless ::verify_ref($self->refname.'^0'); if (-f $self->{db_root}) { rename $self->{db_root}, $db_path or die "rename $self->{db_root} => $db_path failed: $!\n"; @@ -1863,6 +1864,7 @@ sub rev_db_set { sub rev_db_max { my ($self) = @_; + $self->rebuild; my $db_path = $self->db_path; my @stat = stat $db_path or return 0; ($stat[7] % 41) == 0 or die "$db_path inconsistent size: $stat[7]\n"; |