bookmarks: clarify that opts['rename'] points to an old bookmark to be renamed
authorYuya Nishihara <yuya@tcha.org>
Sat, 15 Sep 2018 12:07:38 +0900
changeset 39749 2b91805e34c7
parent 39748 78ee63c77bb3
child 39750 ec723284d07a
bookmarks: clarify that opts['rename'] points to an old bookmark to be renamed
mercurial/commands.py
--- a/mercurial/commands.py	Sat Sep 15 12:04:29 2018 +0900
+++ b/mercurial/commands.py	Sat Sep 15 12:07:38 2018 +0900
@@ -961,7 +961,6 @@
     opts = pycompat.byteskwargs(opts)
     force = opts.get('force')
     rev = opts.get('rev')
-    rename = opts.get('rename')
     inactive = opts.get('inactive')
 
     selactions = [k for k in ['delete', 'rename', 'active'] if opts.get(k)]
@@ -992,8 +991,8 @@
                     raise error.Abort(_("new bookmark name required"))
                 elif len(names) > 1:
                     raise error.Abort(_("only one new bookmark name allowed"))
-                rename = repo._bookmarks.expandname(rename)
-                bookmarks.rename(repo, tr, rename, names[0], force, inactive)
+                oldname = repo._bookmarks.expandname(opts['rename'])
+                bookmarks.rename(repo, tr, oldname, names[0], force, inactive)
             elif names:
                 bookmarks.addbookmarks(repo, tr, names, rev, force, inactive)
             elif inactive: