Merge branch 'mg/verify-commit' into maint
[gitweb.git] / perl / Git / SVN.pm
index 4364506ca254fab75dcf949e6105b40a0585e4ef..f24372645b40f81faf75e735e402a1f4c400b2ed 100644 (file)
@@ -14,6 +14,7 @@ package Git::SVN;
 use Memoize;  # core since 5.8.0, Jul 2002
 use Memoize::Storable;
 use POSIX qw(:signal_h);
+use Time::Local;
 
 use Git qw(
     command
@@ -1332,7 +1333,7 @@ sub parse_svn_date {
                $ENV{TZ} = 'UTC';
 
                my $epoch_in_UTC =
-                   POSIX::strftime('%s', $S, $M, $H, $d, $m - 1, $Y - 1900);
+                   Time::Local::timelocal($S, $M, $H, $d, $m - 1, $Y - 1900);
 
                # Determine our local timezone (including DST) at the
                # time of $epoch_in_UTC.  $Git::SVN::Log::TZ stored the
@@ -1433,7 +1434,7 @@ sub check_author {
 }
 
 sub find_extra_svk_parents {
-       my ($self, $ed, $tickets, $parents) = @_;
+       my ($self, $tickets, $parents) = @_;
        # aha!  svk:merge property changed...
        my @tickets = split "\n", $tickets;
        my @known_parents;
@@ -1600,7 +1601,6 @@ sub tie_for_persistent_memoization {
                my %lookup_svn_merge_cache;
                my %check_cherry_pick2_cache;
                my %has_no_changes_cache;
-               my %_rev_list_cache;
 
                tie_for_persistent_memoization(\%lookup_svn_merge_cache,
                    "$cache_path/lookup_svn_merge");
@@ -1622,14 +1622,6 @@ sub tie_for_persistent_memoization {
                        SCALAR_CACHE => ['HASH' => \%has_no_changes_cache],
                        LIST_CACHE => 'FAULT',
                ;
-
-               tie_for_persistent_memoization(\%_rev_list_cache,
-                   "$cache_path/_rev_list");
-               memoize '_rev_list',
-                       SCALAR_CACHE => 'FAULT',
-                       LIST_CACHE => ['HASH' => \%_rev_list_cache],
-               ;
-
        }
 
        sub unmemoize_svn_mergeinfo_functions {
@@ -1639,7 +1631,6 @@ sub tie_for_persistent_memoization {
                Memoize::unmemoize 'lookup_svn_merge';
                Memoize::unmemoize 'check_cherry_pick2';
                Memoize::unmemoize 'has_no_changes';
-               Memoize::unmemoize '_rev_list';
        }
 
        sub clear_memoized_mergeinfo_caches {
@@ -1746,7 +1737,7 @@ sub mergeinfo_changes {
 # note: this function should only be called if the various dirprops
 # have actually changed
 sub find_extra_svn_parents {
-       my ($self, $ed, $mergeinfo, $parents) = @_;
+       my ($self, $mergeinfo, $parents) = @_;
        # aha!  svk:merge property changed...
 
        memoize_svn_mergeinfo_functions();
@@ -1808,12 +1799,10 @@ sub find_extra_svn_parents {
                       );
 
                if ($ninc) {
-                       warn "W:svn cherry-pick ignored ($spec) - missing " .
+                       warn "W: svn cherry-pick ignored ($spec) - missing " .
                                "$ninc commit(s) (eg $ifirst)\n";
                } else {
-                       warn
-                               "Found merge parent ($spec): ",
-                                       $merge_tip, "\n";
+                       warn "Found merge parent ($spec): ", $merge_tip, "\n";
                        push @new_parents, $merge_tip;
                }
        }
@@ -1845,16 +1834,14 @@ sub make_log_entry {
        my @parents = @$parents;
        my $props = $ed->{dir_prop}{$self->path};
        if ( $props->{"svk:merge"} ) {
-               $self->find_extra_svk_parents
-                       ($ed, $props->{"svk:merge"}, \@parents);
+               $self->find_extra_svk_parents($props->{"svk:merge"}, \@parents);
        }
        if ( $props->{"svn:mergeinfo"} ) {
                my $mi_changes = $self->mergeinfo_changes
                        ($parent_path, $parent_rev,
                         $self->path, $rev,
                         $props->{"svn:mergeinfo"});
-               $self->find_extra_svn_parents
-                       ($ed, $mi_changes, \@parents);
+               $self->find_extra_svn_parents($mi_changes, \@parents);
        }
 
        open my $un, '>>', "$self->{dir}/unhandled.log" or croak $!;
@@ -2379,7 +2366,7 @@ sub _new {
 
        # Older repos imported by us used $GIT_DIR/svn/foo instead of
        # $GIT_DIR/svn/refs/remotes/foo when tracking refs/remotes/foo
-       if ($ref_id =~ m{^refs/remotes/(.*)}) {
+       if ($ref_id =~ m{^refs/remotes/(.+)}) {
                my $old_dir = "$ENV{GIT_DIR}/svn/$1";
                if (-d $old_dir && ! -d $dir) {
                        $dir = $old_dir;