##// END OF EJS Templates
strip: renaming local variables...
Shubhanshu Agrawal -
r26972:4b0c3df5 default
parent child Browse files
Show More
@@ -7,7 +7,7 b' from mercurial.i18n import _'
7 from mercurial.node import nullid
7 from mercurial.node import nullid
8 from mercurial.lock import release
8 from mercurial.lock import release
9 from mercurial import cmdutil, hg, scmutil, util, error
9 from mercurial import cmdutil, hg, scmutil, util, error
10 from mercurial import repair, bookmarks, merge
10 from mercurial import repair, bookmarks as bookmarksmod , merge
11
11
12 cmdtable = {}
12 cmdtable = {}
13 command = cmdutil.command(cmdtable)
13 command = cmdutil.command(cmdtable)
@@ -62,12 +62,12 b' def strip(ui, repo, revs, update=True, b'
62
62
63 repair.strip(ui, repo, revs, backup)
63 repair.strip(ui, repo, revs, backup)
64
64
65 marks = repo._bookmarks
65 repomarks = repo._bookmarks
66 if bookmark:
66 if bookmark:
67 if bookmark == repo._activebookmark:
67 if bookmark == repo._activebookmark:
68 bookmarks.deactivate(repo)
68 bookmarksmod.deactivate(repo)
69 del marks[bookmark]
69 del repomarks[bookmark]
70 marks.write()
70 repomarks.write()
71 ui.write(_("bookmark '%s' deleted\n") % bookmark)
71 ui.write(_("bookmark '%s' deleted\n") % bookmark)
72 finally:
72 finally:
73 release(lock, wlock)
73 release(lock, wlock)
@@ -127,27 +127,27 b' def stripcmd(ui, repo, *revs, **opts):'
127
127
128 wlock = repo.wlock()
128 wlock = repo.wlock()
129 try:
129 try:
130 if opts.get('bookmark'):
130 bookmark = opts.get('bookmark')
131 mark = opts.get('bookmark')
131 if bookmark:
132 marks = repo._bookmarks
132 repomarks = repo._bookmarks
133 if mark not in marks:
133 if bookmark not in repomarks:
134 raise error.Abort(_("bookmark '%s' not found") % mark)
134 raise error.Abort(_("bookmark '%s' not found") % bookmark)
135
135
136 # If the requested bookmark is not the only one pointing to a
136 # If the requested bookmark is not the only one pointing to a
137 # a revision we have to only delete the bookmark and not strip
137 # a revision we have to only delete the bookmark and not strip
138 # anything. revsets cannot detect that case.
138 # anything. revsets cannot detect that case.
139 uniquebm = True
139 uniquebm = True
140 for m, n in marks.iteritems():
140 for m, n in repomarks.iteritems():
141 if m != mark and n == repo[mark].node():
141 if m != bookmark and n == repo[bookmark].node():
142 uniquebm = False
142 uniquebm = False
143 break
143 break
144 if uniquebm:
144 if uniquebm:
145 rsrevs = repair.stripbmrevset(repo, mark)
145 rsrevs = repair.stripbmrevset(repo, bookmark)
146 revs.update(set(rsrevs))
146 revs.update(set(rsrevs))
147 if not revs:
147 if not revs:
148 del marks[mark]
148 del repomarks[bookmark]
149 marks.write()
149 repomarks.write()
150 ui.write(_("bookmark '%s' deleted\n") % mark)
150 ui.write(_("bookmark '%s' deleted\n") % bookmark)
151
151
152 if not revs:
152 if not revs:
153 raise error.Abort(_('empty revision set'))
153 raise error.Abort(_('empty revision set'))
@@ -215,7 +215,7 b' def stripcmd(ui, repo, *revs, **opts):'
215
215
216
216
217 strip(ui, repo, revs, backup=backup, update=update,
217 strip(ui, repo, revs, backup=backup, update=update,
218 force=opts.get('force'), bookmark=opts.get('bookmark'))
218 force=opts.get('force'), bookmark=bookmark)
219 finally:
219 finally:
220 wlock.release()
220 wlock.release()
221
221
General Comments 0
You need to be logged in to leave comments. Login now