diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-02-17 12:21:09 +0000 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-06-16 16:03:12 +0100 |
commit | 615c5264953f09dc873ac65779ec565f1d239af6 (patch) | |
tree | 56c9f0b15ebbbe12d8eca516f08764ed0fd42610 | |
parent | 3e41667e778dfcaa191516b24e49aff99d096ec1 (diff) |
git-debrebase: convert-to-gbp: implementation seems to work
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rwxr-xr-x | git-debrebase | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/git-debrebase b/git-debrebase index 1a62852..c497631 100755 --- a/git-debrebase +++ b/git-debrebase @@ -1277,6 +1277,37 @@ sub cmd_convert_from_gbp () { update_head_checkout $old_head, $work, 'convert-from-gbp'; } +sub cmd_convert_to_gbp_v0 () { + # v0 because very raw; does not make pseudomerges or anything + badusage "no arguments allowed" if @ARGV; + my $head = get_head(); + my $ffq = (ffq_prev_branchinfo())[3]; + my $bw = breakwater_of $head; + fresh_workarea(); + my $out; + in_workarea sub { + runcmd @git, qw(checkout -q -b bw), $bw; + runcmd @git, qw(checkout -q -b patch-queue/bw), $head; + runcmd qw(gbp pq export); + runcmd @git, qw(add debian/patches); + $out = make_commit ['HEAD'], [ + 'Commit patch queue (converted from git-debrebase format)', + '[git-debrebase convert-to-gbp: commit patches]', + ]; + }; + if (defined $ffq) { + runcmd @git, qw(update-ref -m), + "debrebase: converting corresponding main branch to gbp format", + $ffq, $git_null_obj; + } + update_head_checkout $head, $out, "convert to gbp (v0)"; + print <<END or die $!; +git-debrebase: converted to git-buildpackage branch format +git-debrebase: WARNING: do not now run "git-debrebase" any more +git-debrebase: WARNING: doing so would drop all upstream patches! +END +} + sub cmd_downstream_rebase_launder_v0 () { badusage "needs 1 argument, the baseline" unless @ARGV==1; my ($base) = @ARGV; |