##// END OF EJS Templates
bookmarks: discard current bookmark if absent from the bookmarks (issue2692)...
Benoit Boissinot -
r13627:71a96f6c stable
parent child Browse files
Show More
@@ -45,7 +45,7 b' def readcurrent(repo):'
45 file = repo.opener('bookmarks.current')
45 file = repo.opener('bookmarks.current')
46 # No readline() in posixfile_nt, reading everything is cheap
46 # No readline() in posixfile_nt, reading everything is cheap
47 mark = encoding.tolocal((file.readlines() or [''])[0])
47 mark = encoding.tolocal((file.readlines() or [''])[0])
48 if mark == '':
48 if mark == '' or mark not in repo._bookmarks:
49 mark = None
49 mark = None
50 file.close()
50 file.close()
51 return mark
51 return mark
@@ -84,19 +84,33 b' are you there?'
84 $ hg bookmarks
84 $ hg bookmarks
85 no bookmarks set
85 no bookmarks set
86
86
87 can we commit? (issue2692)
88
89 $ echo c > c
90 $ hg ci -Am rockon
91 adding c
92
87 can you be added again?
93 can you be added again?
88
94
89 $ hg bookmarks markb
95 $ hg bookmarks markb
90 $ hg bookmarks
96 $ hg bookmarks
91 * markb 0:07f494440405
97 * markb 1:fdb34407462c
92
98
93 rollback dry run with rollback information
99 rollback dry run with rollback information
94
100
95 $ hg rollback -n
101 $ hg rollback -n
102 repository tip rolled back to revision 0 (undo commit)
103 $ hg bookmarks
104 * markb 1:fdb34407462c
105
106 rollback dry run with rollback information and no commit undo
107
108 $ rm .hg/store/undo
109 $ hg rollback -n
96 no rollback information available
110 no rollback information available
97 [1]
111 [1]
98 $ hg bookmarks
112 $ hg bookmarks
99 * markb 0:07f494440405
113 * markb 1:fdb34407462c
100
114
101 $ cd ..
115 $ cd ..
102
116
General Comments 0
You need to be logged in to leave comments. Login now