chiark / gitweb /
git-debrebase: wip
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 31 Mar 2017 17:23:10 +0000 (18:23 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 16 Jun 2018 11:25:49 +0000 (12:25 +0100)
git-debrebase

index 2a3804f39c2706f7d1f27a0633a75661185325f5..4cd2203ac03d7e2586f797fe5428a35a6af175d9 100755 (executable)
@@ -324,11 +324,14 @@ sub launder ($$$;$$$) {
        $report->($cl);
        $found{$ty. ( defined($st) ? "-$st" : '' )}++;
        my $p0 = $cl->{Parents}[0]{CommitId};
+       $cl->{Abbrev} = lc substr $ty,0,1;
        if ($ty eq 'AddPatches') {
+           $cl->{Abbrev} = 'P';
            $cur = $p0;
            $rewrite_from_here->();
            next;
        } elsif ($ty eq 'Packaging') {
+           $cl->{Abbrev} = 'd';
            push @deb_cl, $cl;
            push @processed, $cl;
            $cur = $p0;
@@ -349,6 +352,7 @@ sub launder ($$$;$$$) {
            $rewrite_from_here->();
            next;
        } elsif ($ty eq 'Pseudomerge') {
+           $cl->{Abbrev} = 'M';
            if (defined $pseudos_must_overwrite_this &&
                !grep {
                    is_fast_fwd $pseudos_must_overwrite_this, $_->{CommitId}
@@ -368,6 +372,7 @@ sub launder ($$$;$$$) {
            last;
        } elsif ($ty eq 'DgitImportUnpatched' &&
                 @pseudomerges == 1) {
+           $cl->{Abbrev} = 'I';
            # This import has a tree which is just like a breakwater
            # tree, but it has the wrong history.  Its ought to have
            # the previous breakwater (which dgit ought to have
@@ -378,6 +383,7 @@ sub launder ($$$;$$$) {
            # precisely right.  Otherwise, it was a non-gitish upload
            # of a new upstream version.  We can tell these apart
            # by looking at the tree of the supposed upstream.
+           my $differs = get_differs $previous_breakwater, $cl->{Tree};
            if ($differs & D_UPS) {
                push @deb_cl, {
                     %r,
@@ -390,7 +396,6 @@ sub launder ($$$;$$$) {
                SpecialMethod => 'DgitImportDebianUpdate',
                 $xmsg->("convert dgit import: upstream changes")
            };
-           my $differs = get_differs $previous_breakwater, $cl->{Tree};
            $basis = launder $pseudomerges[0]{Overwritten}, undef, 1,
                $report, $depth+1, $nogenerate;
            $rewrite_from_here->();
@@ -401,7 +406,9 @@ sub launder ($$$;$$$) {
     }
     # Now we build it back up again
 
-    
+    if ($nogenerate) {
+       return (undef, $basis);
+    }
 
     workarea_fresh();
 
@@ -499,6 +506,7 @@ sub update_head ($$) {
 }
 
 sub cmd_analyse () {
+    
 
 sub cmd_launder () {
     my $old = get_head();