From d4d45805c859bc530ed16f84079b21a57bfd0c03 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Fri, 31 Oct 2008 09:59:06 +0100 Subject: use repo.set_branch() --- git-import-dsc | 6 +++--- git-import-orig | 8 +++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/git-import-dsc b/git-import-dsc index 0f5e8548..e0cd5ec8 100755 --- a/git-import-dsc +++ b/git-import-dsc @@ -119,7 +119,7 @@ def create_debian_branch(debian_branch, dirs): if not repo.has_branch(debian_branch): print "Creating Debian branch '%s'" % debian_branch gbpc.GitBranch()(debian_branch) - gbpc.GitCheckoutBranch(debian_branch) + repo.set_branch(debian_branch) os.chdir(dirs['top']) @@ -217,14 +217,14 @@ def main(argv): print "tag %s not found, importing %s tarball" % (tag, format[1]) # FIXME: this is what import-orig does - merge if not src.native: - gbpc.GitCheckoutBranch(options.upstream_branch)() + repo.set_branch(options.upstream_branch) repo.replace_tree(unpack_dir, options.filters, verbose=True) gbpc.GitCommitAll()(msg="Imported %s" % msg) gitTag(tag, msg=msg) if options.pristine_tar and not src.native: gbpc.PristineTar().commit(src.tgz, options.upstream_branch) if not src.native: - gbpc.GitCheckoutBranch(options.debian_branch)() + repo.set_branch(options.debian_branch) if options.merge: print "Merging to %s" % options.debian_branch try: diff --git a/git-import-orig b/git-import-orig index bf5a2b0e..1691426f 100755 --- a/git-import-orig +++ b/git-import-orig @@ -124,7 +124,6 @@ def main(argv): if options.verbose: gbpc.Command.verbose = True - gitCheckoutMaster = gbpc.GitCheckoutBranch(options.debian_branch) gitShowBranch = gbpc.GitShowBranch() try: @@ -191,7 +190,7 @@ on howto create it otherwise use --upstream-branch to specify it. print "Initial import of '%s' %s..." % (archive, filter_msg) else: print "Importing '%s' to branch '%s'%s..." % (archive, options.upstream_branch, filter_msg) - gbpc.GitCheckoutBranch(options.upstream_branch)() + repo.set_branch(options.upstream_branch) import_upstream_tree(repo, orig_dir, version, options.filters, verbose=not is_empty) if options.pristine_tar: @@ -206,9 +205,8 @@ on howto create it otherwise use --upstream-branch to specify it. if is_empty: gbpc.GitBranch()(options.upstream_branch) elif options.merge: - print "Merging to %s" % options.debian_branch - gitCheckoutMaster() - gitShowBranch() + print "Merging to '%s'" % options.debian_branch + repo.set_branch(options.debian_branch) try: gbpc.GitMerge(tag)() except gbpc.CommandExecFailed: -- cgit v1.2.3