[PATCH 1 of 5] repair: use _hexlist() to build revset expression from binary nodes

Yuya Nishihara yuya at tcha.org
Fri May 29 09:38:04 CDT 2015


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1432445652 -32400
#      Sun May 24 14:34:12 2015 +0900
# Node ID 5617fab1b1f1905663bd38053144a93a746f34db
# Parent  a4acf019dd5b72e91a1b1321d80d298033be8111
repair: use _hexlist() to build revset expression from binary nodes

_hexlist() should be efficient than _list().

diff --git a/mercurial/repair.py b/mercurial/repair.py
--- a/mercurial/repair.py
+++ b/mercurial/repair.py
@@ -7,7 +7,7 @@
 # GNU General Public License version 2 or any later version.
 
 from mercurial import changegroup, exchange, util, bundle2
-from mercurial.node import short, hex
+from mercurial.node import short
 from mercurial.i18n import _
 import errno
 
@@ -34,9 +34,7 @@ def _bundle(repo, bases, heads, node, su
         vfs.mkdir(backupdir)
 
     # Include a hash of all the nodes in the filename for uniqueness
-    hexbases = (hex(n) for n in bases)
-    hexheads = (hex(n) for n in heads)
-    allcommits = repo.set('%ls::%ls', hexbases, hexheads)
+    allcommits = repo.set('%ln::%ln', bases, heads)
     allhashes = sorted(c.hex() for c in allcommits)
     totalhash = util.sha1(''.join(allhashes)).hexdigest()
     name = "%s/%s-%s-%s.hg" % (backupdir, short(node), totalhash[:8], suffix)


More information about the Mercurial-devel mailing list