aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustav Hållberg <gustav@gmail.com>2012-04-07 21:25:10 +0200
committerGustav Hållberg <gustav@gmail.com>2012-04-07 21:25:41 +0200
commit5cabf6cfb3c543853ba3e87cd88309f3fe3479dd (patch)
tree2ca7143695ee4075f25c82c5c6f69a28e94d4b46
parent9a60c57ca3362f5e66646990ae9d8c8f3cd5320a (diff)
downloadstgit-5cabf6cfb3c543853ba3e87cd88309f3fe3479dd.tar.gz
branch: Add --merge flag when switching branches
Signed-off-by: Gustav Hållberg <gustav@gmail.com>
-rw-r--r--stgit/commands/branch.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/stgit/commands/branch.py b/stgit/commands/branch.py
index 98141a6..c248ce5 100644
--- a/stgit/commands/branch.py
+++ b/stgit/commands/branch.py
@@ -26,7 +26,7 @@ from stgit.lib import log
help = 'Branch operations: switch, list, create, rename, delete, ...'
kind = 'stack'
usage = ['',
- '[--] <branch>',
+ '[--merge] [--] <branch>',
'--list',
'--create [--] <new-branch> [<committish>]',
'--clone [--] [<new-branch>]',
@@ -113,6 +113,8 @@ options = [
A cleaned up branch can be re-initialised using the 'stg init'
command."""),
opt('-d', '--description', short = 'Set the branch description'),
+ opt('--merge', action = 'store_true',
+ short = 'Merge work tree changes into the other branch'),
opt('--force', action = 'store_true',
short = 'Force a delete when the series is not empty')]
@@ -362,7 +364,8 @@ def func(parser, options, args):
raise CmdException, 'Branch "%s" is already the current branch' \
% args[0]
- check_local_changes()
+ if not options.merge:
+ check_local_changes()
check_conflicts()
check_head_top_equal(crt_series)