changeset 39749:2b91805e34c7

bookmarks: clarify that opts['rename'] points to an old bookmark to be renamed
author Yuya Nishihara <yuya@tcha.org>
date Sat, 15 Sep 2018 12:07:38 +0900
parents 78ee63c77bb3
children ec723284d07a
files mercurial/commands.py
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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: