chiark / gitweb /
git-debrebase: walk: Introduce $read_tree_debian
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 12 Aug 2018 18:04:20 +0000 (19:04 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 12 Aug 2018 18:04:20 +0000 (19:04 +0100)
We are going to make these do something more efficient, sometimes.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
git-debrebase

index 24aefbe..1e205c6 100755 (executable)
@@ -1441,6 +1441,11 @@ sub walk ($;$$$) {
            read_tree_upstream $treeish, 0, $build;
        };
 
+       my $read_tree_debian = sub {
+           my ($treeish) = @_;
+           read_tree_debian($treeish);
+       };
+
        foreach my $cl (qw(Debian), (reverse @brw_cl),
                        { SpecialMethod => 'RecordBreakwaterTip' },
                        qw(Upstream), (reverse @upp_cl)) {
@@ -1454,7 +1459,7 @@ sub walk ($;$$$) {
            printdebug "WALK BUILD ".($cltree//'undef').
                " $method (rewriting=$rewriting)\n";
            if ($method eq 'Debian') {
-               read_tree_debian($cltree);
+               $read_tree_debian->($cltree);
            } elsif ($method eq 'Upstream') {
                $read_tree_upstream->($cltree);
            } elsif ($method eq 'StartRewrite') {
@@ -1464,7 +1469,7 @@ sub walk ($;$$$) {
                $breakwater = $build;
                next;
            } elsif ($method eq 'DgitImportDebianUpdate') {
-               read_tree_debian($cltree);
+               $read_tree_debian->($cltree);
            } elsif ($method eq 'DgitImportUpstreamUpdate') {
                confess unless $rewriting;
                my $differs = (get_differs $build, $cltree);
@@ -1475,7 +1480,7 @@ sub walk ($;$$$) {
                print "Found a general merge, will try to tidy it up.\n";
                $rewriting = 1;
                $read_tree_upstream->($cl->{MergeBestAnchor});
-               read_tree_debian($cltree);
+               $read_tree_debian->($cltree);
                @parents = map { $_->{Breakwater} } @{ $cl->{Parents} };
            } elsif ($method eq 'MergeMergeSeries') {
                my $cachehit = reflog_cache_lookup