Patchwork [1,of,7] py3: use portable way to stringify cache key of repoview

login
register
mail settings
Submitter Yuya Nishihara
Date March 13, 2017, 6:59 p.m.
Message ID <b7717d4dc60bcc3a3f4b.1489431542@mimosa>
Download mbox | patch
Permalink /patch/19289/
State Accepted
Headers show

Comments

Yuya Nishihara - March 13, 2017, 6:59 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1489364442 25200
#      Sun Mar 12 17:20:42 2017 -0700
# Node ID b7717d4dc60bcc3a3f4b7b85476954357f52783b
# Parent  3d3109339b57341b333c1112beb41dd281fa944a
py3: use portable way to stringify cache key of repoview

Patch

diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -104,7 +104,7 @@  def cachehash(repo, hideable):
     """
     h = hashlib.sha1()
     h.update(''.join(repo.heads()))
-    h.update(str(hash(frozenset(hideable))))
+    h.update('%d' % hash(frozenset(hideable)))
     return h.digest()
 
 def _writehiddencache(cachefile, cachehash, hidden):