Patchwork [4,of,9] bookmarks: clarify that opts['rename'] points to an old bookmark to be renamed

login
register
mail settings
Submitter Yuya Nishihara
Date Sept. 21, 2018, 1:24 p.m.
Message ID <ce660bd0ea0b5df62ca6.1537536246@mimosa>
Download mbox | patch
Permalink /patch/34897/
State Accepted
Headers show

Comments

Yuya Nishihara - Sept. 21, 2018, 1:24 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1536980858 -32400
#      Sat Sep 15 12:07:38 2018 +0900
# Node ID ce660bd0ea0b5df62ca61ed0ae90ab08d2cc53e8
# Parent  7dd56082951ff7977c1b550a5b38d608d655618a
bookmarks: clarify that opts['rename'] points to an old bookmark to be renamed

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -961,7 +961,6 @@  def bookmark(ui, repo, *names, **opts):
     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 @@  def bookmark(ui, repo, *names, **opts):
                     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: