aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2011-07-30 09:22:42 +0200
committerGuido Günther <agx@sigxcpu.org>2011-07-30 09:22:42 +0200
commit3330dfa2b51c3f8a1ec39c9123f86d2e2f708a0e (patch)
treea4928208e676263a14735217713cc16a8157551f
parent155d3d6df5f29c451c4853d24502bab1be15a0b9 (diff)
gbp-pq: Drop GitBranch in favour of repo.create_branch()
Git-Dch: Ignore
-rwxr-xr-xgbp-pq12
1 files changed, 7 insertions, 5 deletions
diff --git a/gbp-pq b/gbp-pq
index 5ec73736..253b6105 100755
--- a/gbp-pq
+++ b/gbp-pq
@@ -27,7 +27,7 @@ import sys
from gbp.config import (GbpOptionParser, GbpOptionGroup)
from gbp.git import (GitRepositoryError, GitRepository)
from gbp.command_wrappers import (Command, GitCommand, RunAtCommand,
- GitBranch, CommandExecFailed)
+ CommandExecFailed)
from gbp.errors import GbpError
import gbp.log
from gbp.pq import PatchQueue
@@ -176,11 +176,13 @@ def import_quilt_patches(repo, branch, series):
else:
pq_branch = pq_branch_name(branch)
+ if repo.has_branch(pq_branch):
+ raise GbpError, ("Patch queue branch '%s'. already exists. Try 'rebase' instead."
+
try:
- GitBranch()(pq_branch)
+ repo.create_branch(pq_branch)
except CommandExecFailed:
- raise GbpError, ("Cannot create patch-queue branch '%s'. Try 'rebase' instead."
- % pq_branch)
+ raise GbpError, ("Cannot create patch-queue branch '%s'." % pq_branch)
repo.set_branch(pq_branch)
queue = PatchQueue.read_series_file(series)
@@ -222,7 +224,7 @@ def switch_to_pq_branch(repo, branch):
pq_branch = pq_branch_name(branch)
if not repo.has_branch(pq_branch):
try:
- GitBranch()(pq_branch)
+ repo.create_branch(pq_branch)
except CommandExecFailed:
raise GbpError, ("Cannot create patch-queue branch '%s'. Try 'rebase' instead."
% pq_branch)