mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 00:45:18 +03:00
bookmark: allowing to use -t -u with no arg if a bookmark is activated
allowing to use -t -u with no arg if a bookmark is activated
This commit is contained in:
parent
2a4e20d541
commit
582dde2e81
@ -873,6 +873,11 @@ def exbookmarks(orig, ui, repo, *args, **opts):
|
|||||||
untrack = opts.get('untrack')
|
untrack = opts.get('untrack')
|
||||||
|
|
||||||
disallowed = set(ui.configlist('remotenames', 'disallowedbookmarks'))
|
disallowed = set(ui.configlist('remotenames', 'disallowedbookmarks'))
|
||||||
|
# Adds local bookmark if one of the options is called and args is empty
|
||||||
|
if not args and (track or untrack):
|
||||||
|
book = bookmarks.readactive(repo)
|
||||||
|
if book:
|
||||||
|
args = (book,)
|
||||||
|
|
||||||
if not delete:
|
if not delete:
|
||||||
for name in args:
|
for name in args:
|
||||||
|
29
tests/test-bookmarks.t
Normal file
29
tests/test-bookmarks.t
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
$ extpath=`dirname $TESTDIR`
|
||||||
|
$ cp $extpath/remotenames.py $TESTTMP # use $TESTTMP substitution in message
|
||||||
|
$ cat >> $HGRCPATH << EOF
|
||||||
|
> [extensions]
|
||||||
|
> remotenames=$TESTTMP/remotenames.py
|
||||||
|
> EOF
|
||||||
|
|
||||||
|
Setup repo
|
||||||
|
|
||||||
|
$ hg init repo
|
||||||
|
$ cd repo
|
||||||
|
$ echo 'foo' > a.txt
|
||||||
|
$ hg add a.txt
|
||||||
|
$ hg commit -m 'a'
|
||||||
|
|
||||||
|
Testing bookmark options without args
|
||||||
|
$ hg bookmark a
|
||||||
|
$ hg bookmark b
|
||||||
|
$ hg bookmark -v
|
||||||
|
a 0:2dcb9139ea49
|
||||||
|
* b 0:2dcb9139ea49
|
||||||
|
$ hg bookmark --track a
|
||||||
|
$ hg bookmark -v
|
||||||
|
a 0:2dcb9139ea49
|
||||||
|
* b 0:2dcb9139ea49 [a]
|
||||||
|
$ hg bookmark --untrack
|
||||||
|
$ hg bookmark -v
|
||||||
|
a 0:2dcb9139ea49
|
||||||
|
* b 0:2dcb9139ea49
|
Loading…
Reference in New Issue
Block a user