summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
8ff4e9e)
Using --branch here is confusing from a UI point of view, and
unnecessarily complicates implementation, making it more delicate to
get rid of the crt-series global. We now use --ref-branch (-B)
instead.
Signed-off-by: Yann Dirson <ydirson@altern.org>
options = [make_option('-a', '--all',
help = 'synchronise all the patches',
action = 'store_true'),
options = [make_option('-a', '--all',
help = 'synchronise all the patches',
action = 'store_true'),
- make_option('-b', '--branch',
+ make_option('-B', '--ref-branch',
help = 'syncronise patches with BRANCH'),
make_option('-s', '--series',
help = 'syncronise patches with SERIES'),
help = 'syncronise patches with BRANCH'),
make_option('-s', '--series',
help = 'syncronise patches with SERIES'),
global crt_series
if options.undo:
global crt_series
if options.undo:
- if options.branch or options.series:
+ if options.ref_branch or options.series:
- '--undo cannot be specified with --branch or --series'
+ '--undo cannot be specified with --ref-branch or --series'
__check_all()
out.start('Undoing the sync of "%s"' % crt_series.get_current())
__check_all()
out.start('Undoing the sync of "%s"' % crt_series.get_current())
# the main function already made crt_series to be the remote
# branch
# the main function already made crt_series to be the remote
# branch
- remote_series = crt_series
- stgit.commands.common.crt_series = crt_series = stack.Series()
- if options.branch == crt_series.get_name():
+ remote_series = stack.Series(options.ref_branch)
+ if options.ref_branch == crt_series.get_name():
raise CmdException, 'Cannot synchronise with the current branch'
remote_patches = remote_series.get_applied()
raise CmdException, 'Cannot synchronise with the current branch'
remote_patches = remote_series.get_applied()
test_expect_success \
'Synchronise second patch with the master branch' \
'
test_expect_success \
'Synchronise second patch with the master branch' \
'
- stg sync -b master p2 &&
+ stg sync -B master p2 &&
[ "$(echo $(stg applied))" = "p1 p2 p3" ] &&
[ "$(echo $(stg unapplied))" = "" ] &&
test $(cat foo2.txt) = "foo2"
[ "$(echo $(stg applied))" = "p1 p2 p3" ] &&
[ "$(echo $(stg unapplied))" = "" ] &&
test $(cat foo2.txt) = "foo2"
test_expect_success \
'Synchronise the first two patches with the master branch' \
'
test_expect_success \
'Synchronise the first two patches with the master branch' \
'
- stg sync -b master -a &&
+ stg sync -B master -a &&
[ "$(echo $(stg applied))" = "p1 p2 p3" ] &&
[ "$(echo $(stg unapplied))" = "" ] &&
test $(cat foo1.txt) = "foo1" &&
[ "$(echo $(stg applied))" = "p1 p2 p3" ] &&
[ "$(echo $(stg unapplied))" = "" ] &&
test $(cat foo1.txt) = "foo1" &&
test_expect_success \
'Synchronise second patch with the master branch' \
'
test_expect_success \
'Synchronise second patch with the master branch' \
'
- stg sync -b master p2 &&
+ stg sync -B master p2 &&
[ "$(echo $(stg applied))" = "p1 p2 p3" ] &&
[ "$(echo $(stg unapplied))" = "" ] &&
test $(cat bar2.txt) = "bar2"
[ "$(echo $(stg applied))" = "p1 p2 p3" ] &&
[ "$(echo $(stg unapplied))" = "" ] &&
test $(cat bar2.txt) = "bar2"
test_expect_failure \
'Synchronise the first two patches with the master branch (to fail)' \
'
test_expect_failure \
'Synchronise the first two patches with the master branch (to fail)' \
'