diff options
-rwxr-xr-x | src/pyfedpkg/initial_merge.py | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/pyfedpkg/initial_merge.py b/src/pyfedpkg/initial_merge.py index be5782f..5bc119f 100755 --- a/src/pyfedpkg/initial_merge.py +++ b/src/pyfedpkg/initial_merge.py @@ -15,12 +15,14 @@ the branches will be a lot easier: Easier to follow in the dependency graph, and easier to perform without conflicts. """ -# TODO: Use more pyfedpkg.* functions instead of direct calls to git. +# TODO: Use more pyfedpkg.* functions and/or git.* functions instead +# of direct calls to git. import argparse import sys import os import subprocess +import pyfedpkg __all__ = [ @@ -80,26 +82,21 @@ class Branch: return "%(sha)s %(origbranch)s" % self.__dict__ -def switch_branch(branch): - ret = run_cmd(['fedpkg', 'switch-branch', branch], dry_run=False) - assert(ret == 0) - - def do_initial_merge(into, to_merge): print print "######## Merging", [ x.localbranch for x in to_merge ], \ "into", into.localbranch, "########" - switch_branch(into.localbranch) + pyfedpkg.switch_branch(into.localbranch) ret = run_cmd(['git', 'merge', '-m', '"Initial peudo merge for dist-git setup"', '-s', 'ours'] + [ x.origbranch for x in to_merge]) assert(ret == 0) for t in to_merge: - switch_branch(t.localbranch) + pyfedpkg.switch_branch(t.localbranch) ret = run_cmd(['git', 'merge', into.localbranch]) assert(ret == 0) - switch_branch(into.localbranch) + pyfedpkg.switch_branch(into.localbranch) class Consumer: |