use repo.set_branch()
authorGuido Günther <agx@sigxcpu.org>
Fri, 31 Oct 2008 08:59:06 +0000 (09:59 +0100)
committerGuido Guenther <agx@sigxcpu.org>
Fri, 31 Oct 2008 08:59:06 +0000 (09:59 +0100)
git-import-dsc
git-import-orig

index 0f5e8548949092a036f8bae3247cf2c0114427e3..e0cd5ec898e9111aef385946a2e419a614853e4f 100755 (executable)
@@ -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:
index bf5a2b0e000146864ff3b0a81a8b45c759711424..1691426f8b6fceab21d991b3ca71aa68b29bf221 100755 (executable)
@@ -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: