##// END OF EJS Templates
bookmarks: respect rollbacks dryrun parameter
David Soria Parra -
r13307:7f2b8aac stable
parent child Browse files
Show More
@@ -261,10 +261,14 b' def reposetup(ui, repo):'
261 file.close()
261 file.close()
262 return mark
262 return mark
263
263
264 def rollback(self, *args):
264 def rollback(self, dryrun=False):
265 if os.path.exists(self.join('undo.bookmarks')):
265 if os.path.exists(self.join('undo.bookmarks')):
266 util.rename(self.join('undo.bookmarks'), self.join('bookmarks'))
266 if not dryrun:
267 return super(bookmark_repo, self).rollback(*args)
267 util.rename(self.join('undo.bookmarks'), self.join('bookmarks'))
268 elif not os.path.exists(self.sjoin("undo")):
269 # avoid "no rollback information available" message
270 return 0
271 return super(bookmark_repo, self).rollback(dryrun)
268
272
269 def lookup(self, key):
273 def lookup(self, key):
270 if key in self._bookmarks:
274 if key in self._bookmarks:
@@ -6,6 +6,12 b''
6
6
7 $ echo qqq>qqq.txt
7 $ echo qqq>qqq.txt
8
8
9 rollback dry run without rollback information
10
11 $ hg rollback
12 no rollback information available
13 [1]
14
9 add file
15 add file
10
16
11 $ hg add
17 $ hg add
@@ -83,5 +89,12 b' can you be added again?'
83 $ hg bookmarks markb
89 $ hg bookmarks markb
84 $ hg bookmarks
90 $ hg bookmarks
85 * markb 0:07f494440405
91 * markb 0:07f494440405
92
93 rollback dry run with rollback information
94
95 $ hg rollback -n
96 $ hg bookmarks
97 * markb 0:07f494440405
98
86 $ cd ..
99 $ cd ..
87
100
General Comments 0
You need to be logged in to leave comments. Login now