chiark / gitweb /
quilt fixup: break out quilt_fixup_multipatch ready for quilt_fixup_singlepatch
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 21 Aug 2015 12:06:31 +0000 (13:06 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 21 Aug 2015 12:06:33 +0000 (13:06 +0100)
Functional change: bomb out with die if single-debian-patch, rather than going wrong

dgit

diff --git a/dgit b/dgit
index ce858ab98057bd770095ecf2b16b8e322e126922..e5edd551cefd9ee2859165bb97afbd6283b8ce36 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -2744,6 +2744,30 @@ sub build_maybe_quilt_fixup () {
 
     check_for_vendor_patches();
 
+    my $clogp = parsechangelog();
+    my $headref = git_rev_parse('HEAD');
+
+    prep_ud();
+    changedir $ud;
+
+    my $upstreamversion=$version;
+    $upstreamversion =~ s/-[^-]*$//;
+
+    if ($fopts->{'single-debian-patch'}) {
+       #quilt_fixup_singlepatch($clogp, $headref, $upstreamversion);
+       die;
+    } else {
+       quilt_fixup_multipatch($clogp, $headref, $upstreamversion);
+    }
+
+    changedir '../../../..';
+    runcmd_ordryrun_local
+        @git, qw(pull --ff-only -q .git/dgit/unpack/work master);
+}
+
+sub quilt_fixup_multipatch ($$$) {
+    my ($clogp, $headref, $upstreamversion) = @_;
+
     # Our objective is:
     #  - honour any existing .pc in case it has any strangeness
     #  - determine the git commit corresponding to the tip of
@@ -2788,15 +2812,6 @@ sub build_maybe_quilt_fixup () {
     #     5. If we had a .pc in-tree, delete it, and git-commit
     #     6. Back in the main tree, fast forward to the new HEAD
 
-    my $clogp = parsechangelog();
-    my $headref = git_rev_parse('HEAD');
-
-    prep_ud();
-    changedir $ud;
-
-    my $upstreamversion=$version;
-    $upstreamversion =~ s/-[^-]*$//;
-
     my $fakeversion="$upstreamversion-~~DGITFAKE";
 
     my $fakedsc=new IO::File 'fake.dsc', '>' or die $!;
@@ -2872,10 +2887,6 @@ END
         runcmd @git, qw(rm -rqf .pc);
         commit_admin "Commit removal of .pc (quilt series tracking data)";
     }
-
-    changedir '../../../..';
-    runcmd_ordryrun_local
-        @git, qw(pull --ff-only -q .git/dgit/unpack/work master);
 }
 
 sub quilt_fixup_editor () {