##// END OF EJS Templates
strip: use repo._bookmarks.recordchange instead of repo._bookmarks.write...
Laurent Charignon -
r27052:b9d0b45d default
parent child Browse files
Show More
@@ -64,13 +64,19 b' def strip(ui, repo, revs, update=True, b'
64
64
65 repomarks = repo._bookmarks
65 repomarks = repo._bookmarks
66 if bookmarks:
66 if bookmarks:
67 if repo._activebookmark in bookmarks:
67 tr = None
68 bookmarksmod.deactivate(repo)
68 try:
69 for bookmark in bookmarks:
69 tr = repo.transaction('strip')
70 del repomarks[bookmark]
70 if repo._activebookmark in bookmarks:
71 repomarks.write()
71 bookmarksmod.deactivate(repo)
72 for bookmark in sorted(bookmarks):
72 for bookmark in bookmarks:
73 ui.write(_("bookmark '%s' deleted\n") % bookmark)
73 del repomarks[bookmark]
74 repomarks.recordchange(tr)
75 tr.close()
76 for bookmark in sorted(bookmarks):
77 ui.write(_("bookmark '%s' deleted\n") % bookmark)
78 finally:
79 release(tr)
74 finally:
80 finally:
75 release(lock, wlock)
81 release(lock, wlock)
76
82
@@ -147,11 +153,18 b' def stripcmd(ui, repo, *revs, **opts):'
147 rsrevs = repair.stripbmrevset(repo, marks[0])
153 rsrevs = repair.stripbmrevset(repo, marks[0])
148 revs.update(set(rsrevs))
154 revs.update(set(rsrevs))
149 if not revs:
155 if not revs:
150 for bookmark in bookmarks:
156 lock = tr = None
151 del repomarks[bookmark]
157 try:
152 repomarks.write()
158 lock = repo.lock()
153 for bookmark in sorted(bookmarks):
159 tr = repo.transaction('bookmark')
154 ui.write(_("bookmark '%s' deleted\n") % bookmark)
160 for bookmark in bookmarks:
161 del repomarks[bookmark]
162 repomarks.recordchange(tr)
163 tr.close()
164 for bookmark in sorted(bookmarks):
165 ui.write(_("bookmark '%s' deleted\n") % bookmark)
166 finally:
167 release(lock, tr)
155
168
156 if not revs:
169 if not revs:
157 raise error.Abort(_('empty revision set'))
170 raise error.Abort(_('empty revision set'))
General Comments 0
You need to be logged in to leave comments. Login now