diff options
author | Robinson Tryon <qubit@runcibility.com> | 2013-12-04 04:56:10 -0500 |
---|---|---|
committer | Björn Michaelsen <bjoern.michaelsen@canonical.com> | 2014-01-23 10:39:08 +0000 |
commit | 7ac23e18c2cc61a7a20f1232263c6820c6e77922 (patch) | |
tree | d9beb15bc9bb9fd51f18535b335facc2595863a4 /bibisect | |
parent | 2ecbecbe78c150aa873de45c8fad88777ef06a48 (diff) |
Bibisect: mergeranges: Allow merge into existing branch
This commit adds functionality to the 'mergeranges' script. It give us
the ability to add bibisect commits to an existing branch in a
repository. Previously, we could only start the merge process by
creating a new branch.
Change-Id: I436ac6490de6993ed57135b72c793f46150f7b07
Reviewed-on: https://gerrit.libreoffice.org/6921
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Diffstat (limited to 'bibisect')
-rwxr-xr-x | bibisect/mergeranges | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/bibisect/mergeranges b/bibisect/mergeranges index 5d9b14a1..b35e9514 100755 --- a/bibisect/mergeranges +++ b/bibisect/mergeranges @@ -7,8 +7,22 @@ def justrunit(arglist): print(subprocess.check_output(arglist).decode('utf-8')) def init_branch(startpoint): - justrunit(['git', 'checkout', '-b', 'mergeranges', startpoint]) + global initBranch, branchName + try: + justrunit(['git', 'checkout', branchName]) + except CalledProcessError as e: + # If the branch does not exist, we need to create it. + justrunit(['git', 'checkout', '-b', branchName, startpoint]) + print("Creating branch " + branchName) + else: + # If the branch already existed, we want to cherry-pick the + # 'startpoint' commit. + cherry_pick_theirs(startpoint) + + initBranch = True + +# Pull a commit into the git repository. def cherry_pick_theirs(revision): try: justrunit(['git', 'rm', '-rf', '.']) @@ -26,6 +40,5 @@ for line in open(sys.argv[1]).readlines(): for revision in revisions: if not initBranch: init_branch(revision) - initBranch = True else: cherry_pick_theirs(revision) |