cmd_submit: Adopted to changed gbp API get_upstream_branch
authorEd Bartosh <eduard.bartosh@intel.com>
Wed, 8 Aug 2012 15:01:30 +0000 (18:01 +0300)
committerEd Bartosh <eduard.bartosh@intel.com>
Thu, 9 Aug 2012 07:53:17 +0000 (10:53 +0300)
gbp API get_upstream_branch and set_upstream_branch were changed
according to Markus suggestions (review #799). This change adopts
gbs to new gbp API.

Change-Id: I6051b46904791fb86dd3b9e4153d60821fba91e3

gitbuildsys/cmd_submit.py

index 75bcce5..7417172 100644 (file)
@@ -49,10 +49,9 @@ def do(opts, args):
 
     if not opts.target:
         try:
-            upstream = repo.get_upstream([target_branch])
-            upstream_branch = upstream[target_branch]
-            if upstream_branch and upstream_branch.startswith(opts.remote):
-                target_branch = os.path.basename(upstream_branch)
+            upstream = repo.get_upstream_branch(target_branch)
+            if upstream and upstream.startswith(opts.remote):
+                target_branch = os.path.basename(upstream)
             else:
                 msger.warning('can\'t find upstream branch for current branch '\
                               '%s. Gbs will try to find it by name. Please '\