From d88e961d329be4b95d8bfac1a337a3f169373ca2 Mon Sep 17 00:00:00 2001
From: Paolo Pisati <paolo.pisati@canonical.com>
Date: Thu, 17 Mar 2011 16:18:22 +0100
Subject: [PATCH] Added --skip command line flag

Added ability to git rebase --skip via --skip command line flag.

Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
---
 maintscripts/maint-rebase-branch |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/maintscripts/maint-rebase-branch b/maintscripts/maint-rebase-branch
index 13efd0c..d0b26a9 100755
--- a/maintscripts/maint-rebase-branch
+++ b/maintscripts/maint-rebase-branch
@@ -34,6 +34,8 @@ parser.add_option("--continue", action="store_true", default=False,
     dest="continue_rebase", help="continue a disrupted rebase")
 parser.add_option("--debug", action="store_true", default=False,
     dest="debug", help="print loads of verbose messages that might give a clue as to what's going on")
+parser.add_option("--skip", action="store_true", default=False,
+    dest="skip_rebase", help="continue a disrupted rebase skipping next commit")
 
 (opts, args) = parser.parse_args()
 
@@ -142,7 +144,7 @@ if GetPackageInfo(branch)[2] != "UNRELEASED":
 #------------------------------------------------------------------------------
 # Working tree must be clean
 #------------------------------------------------------------------------------
-if opts.continue_rebase == False:
+if opts.continue_rebase == False and opts.skip_rebase == False:
     print "Checking working tree ...",
     if GitListFiles(opts="--others --modified") != []:
         print "NOT CLEAN!"
@@ -169,11 +171,14 @@ if opts.continue_rebase == False:
 # the version number of it. Then rebase the temporary branch on top of the
 # target release.
 #------------------------------------------------------------------------------
-if opts.continue_rebase == False:
+if opts.continue_rebase == False and opts.skip_rebase == False:
     print "Rebasing from", BaseVersion, "to", TargetVersion
     cmd = "git rebase --onto Ubuntu-{0} {1}".format(TargetVersion, MergeBase)
 else:
-    cmd = "git rebase --continue"
+    if opts.continue_rebase == True:
+        cmd = "git rebase --continue"
+    else:
+        cmd = "git rebase --skip"
 p = Popen(cmd, shell=True)
 status = os.waitpid(p.pid, 0)[1]
 if status > 0:
-- 
1.7.1

