Patchwork [5,of,5,V3] commands.bookmarks: move hexfn to inside list block

login
register
mail settings
Submitter Siddharth Agarwal
Date Dec. 20, 2013, 4:04 p.m.
Message ID <30d708ce5258551c3e06.1387555445@sid0x220>
Download mbox | patch
Permalink /patch/3223/
State Accepted
Commit a602d2aca8bf16243a5b2d6b5b113e6977771a30
Headers show

Comments

Siddharth Agarwal - Dec. 20, 2013, 4:04 p.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1384893809 28800
#      Tue Nov 19 12:43:29 2013 -0800
# Node ID 30d708ce5258551c3e06697b807aecf9214c291b
# Parent  e04bd1e754d2910a9b3b6051fd5f229f1c4d78d7
commands.bookmarks: move hexfn to inside list block

This isn't used outside this block, nor is it expected to be.
Matt Mackall - Jan. 14, 2014, 5:59 p.m.
On Fri, 2013-12-20 at 21:34 +0530, Siddharth Agarwal wrote:
> # HG changeset patch
> # User Siddharth Agarwal <sid0@fb.com>
> # Date 1384893809 28800
> #      Tue Nov 19 12:43:29 2013 -0800
> # Node ID 30d708ce5258551c3e06697b807aecf9214c291b
> # Parent  e04bd1e754d2910a9b3b6051fd5f229f1c4d78d7
> commands.bookmarks: move hexfn to inside list block

These are queued for default, thanks.

Patch

diff -r e04bd1e754d2910a9b3b6051fd5f229f1c4d78d7 -r 30d708ce5258551c3e06697b807aecf9214c291b mercurial/commands.py
--- a/mercurial/commands.py	Tue Nov 19 12:42:17 2013 -0800
+++ b/mercurial/commands.py	Tue Nov 19 12:43:29 2013 -0800
@@ -807,8 +807,6 @@  def bookmark(ui, repo, *names, **opts):
     rename = opts.get('rename')
     inactive = opts.get('inactive')
 
-    hexfn = ui.debugflag and hex or short
-
     def checkformat(mark):
         mark = mark.strip()
         if not mark:
@@ -920,6 +918,7 @@  def bookmark(ui, repo, *names, **opts):
         finally:
             wlock.release()
     else: # show bookmarks
+        hexfn = ui.debugflag and hex or short
         marks = repo._bookmarks
         if len(marks) == 0:
             ui.status(_("no bookmarks set\n"))