Mercurial > hg
changeset 26972:4b0c3df5d635
strip: renaming local variables
Renaming local variables to be more precise, i want to store
a different list of bookmarks and it would be hard to
understand what marks represents in that change therefore
renaming it to repomarks. Renamed bookmarks(module)
to bookmarksmod as to free up bookmarks which will be
used when pluralizing bookmark.
author | Shubhanshu Agrawal <agrawal.shubhanshu@gmail.com> |
---|---|
date | Sun, 15 Nov 2015 20:27:27 +0530 |
parents | 9f3410a52f44 |
children | fdd63acf3215 |
files | hgext/strip.py |
diffstat | 1 files changed, 17 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/strip.py Wed Feb 11 22:22:29 2015 -0800 +++ b/hgext/strip.py Sun Nov 15 20:27:27 2015 +0530 @@ -7,7 +7,7 @@ from mercurial.node import nullid from mercurial.lock import release from mercurial import cmdutil, hg, scmutil, util, error -from mercurial import repair, bookmarks, merge +from mercurial import repair, bookmarks as bookmarksmod , merge cmdtable = {} command = cmdutil.command(cmdtable) @@ -62,12 +62,12 @@ repair.strip(ui, repo, revs, backup) - marks = repo._bookmarks + repomarks = repo._bookmarks if bookmark: if bookmark == repo._activebookmark: - bookmarks.deactivate(repo) - del marks[bookmark] - marks.write() + bookmarksmod.deactivate(repo) + del repomarks[bookmark] + repomarks.write() ui.write(_("bookmark '%s' deleted\n") % bookmark) finally: release(lock, wlock) @@ -127,27 +127,27 @@ wlock = repo.wlock() try: - if opts.get('bookmark'): - mark = opts.get('bookmark') - marks = repo._bookmarks - if mark not in marks: - raise error.Abort(_("bookmark '%s' not found") % mark) + bookmark = opts.get('bookmark') + if bookmark: + repomarks = repo._bookmarks + if bookmark not in repomarks: + raise error.Abort(_("bookmark '%s' not found") % bookmark) # If the requested bookmark is not the only one pointing to a # a revision we have to only delete the bookmark and not strip # anything. revsets cannot detect that case. uniquebm = True - for m, n in marks.iteritems(): - if m != mark and n == repo[mark].node(): + for m, n in repomarks.iteritems(): + if m != bookmark and n == repo[bookmark].node(): uniquebm = False break if uniquebm: - rsrevs = repair.stripbmrevset(repo, mark) + rsrevs = repair.stripbmrevset(repo, bookmark) revs.update(set(rsrevs)) if not revs: - del marks[mark] - marks.write() - ui.write(_("bookmark '%s' deleted\n") % mark) + del repomarks[bookmark] + repomarks.write() + ui.write(_("bookmark '%s' deleted\n") % bookmark) if not revs: raise error.Abort(_('empty revision set')) @@ -215,7 +215,7 @@ strip(ui, repo, revs, backup=backup, update=update, - force=opts.get('force'), bookmark=opts.get('bookmark')) + force=opts.get('force'), bookmark=bookmark) finally: wlock.release()