summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 905f8b7)
raw | patch | inline | side by side (parent: 905f8b7)
author | Eric Wong <normalperson@yhbt.net> | |
Fri, 16 Feb 2007 12:05:33 +0000 (04:05 -0800) | ||
committer | Eric Wong <normalperson@yhbt.net> | |
Fri, 23 Feb 2007 08:57:13 +0000 (00:57 -0800) |
* 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>
* 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>
git-svn.perl | patch | blob | history |
diff --git a/git-svn.perl b/git-svn.perl
index eca08bdd3b16fdec0392e177d3e36dc4e5ecbdf6..d7fc9aad52fc1a9248b12057110ca6e549df4b09 100755 (executable)
--- a/git-svn.perl
+++ b/git-svn.perl
"svn-remote.$repo_id.${t}-maxRev") };
if (defined $max_rev && ($max_rev < $base)) {
$base = $max_rev;
+ } elsif (!defined $max_rev) {
+ $base = 0;
}
}
$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;
}
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";
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";