mirror of
https://github.com/facebook/sapling.git
synced 2024-10-08 07:49:11 +03:00
bookmarks: respect rollbacks dryrun parameter
This commit is contained in:
parent
e5aec633d1
commit
a4bbbca72d
@ -261,10 +261,14 @@ def reposetup(ui, repo):
|
||||
file.close()
|
||||
return mark
|
||||
|
||||
def rollback(self, *args):
|
||||
def rollback(self, dryrun=False):
|
||||
if os.path.exists(self.join('undo.bookmarks')):
|
||||
util.rename(self.join('undo.bookmarks'), self.join('bookmarks'))
|
||||
return super(bookmark_repo, self).rollback(*args)
|
||||
if not dryrun:
|
||||
util.rename(self.join('undo.bookmarks'), self.join('bookmarks'))
|
||||
elif not os.path.exists(self.sjoin("undo")):
|
||||
# avoid "no rollback information available" message
|
||||
return 0
|
||||
return super(bookmark_repo, self).rollback(dryrun)
|
||||
|
||||
def lookup(self, key):
|
||||
if key in self._bookmarks:
|
||||
|
@ -6,6 +6,12 @@
|
||||
|
||||
$ echo qqq>qqq.txt
|
||||
|
||||
rollback dry run without rollback information
|
||||
|
||||
$ hg rollback
|
||||
no rollback information available
|
||||
[1]
|
||||
|
||||
add file
|
||||
|
||||
$ hg add
|
||||
@ -83,5 +89,12 @@ can you be added again?
|
||||
$ hg bookmarks markb
|
||||
$ hg bookmarks
|
||||
* markb 0:07f494440405
|
||||
|
||||
rollback dry run with rollback information
|
||||
|
||||
$ hg rollback -n
|
||||
$ hg bookmarks
|
||||
* markb 0:07f494440405
|
||||
|
||||
$ cd ..
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user