From patchwork Sun Mar 12 17:22:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [8,of,9,py3] branchmap: stringify int in a portable way From: Augie Fackler X-Patchwork-Id: 19175 Message-Id: <12fa9b8994f4fa746f11.1489339337@augie-macbookair2.roam.corp.google.com> To: mercurial-devel@mercurial-scm.org Date: Sun, 12 Mar 2017 13:22:17 -0400 # HG changeset patch # User Augie Fackler # Date 1489297366 18000 # Sun Mar 12 00:42:46 2017 -0500 # Node ID 12fa9b8994f4fa746f11d97dd0bc697c5a1f860a # Parent 062d30be868aad888f8d2e51d65999cb8c94b81a branchmap: stringify int in a portable way We actually need a bytes in Python 3, and thanks to our nasty source loader this will portably do the right thing. diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py --- a/mercurial/branchmap.py +++ b/mercurial/branchmap.py @@ -234,7 +234,7 @@ class branchcache(dict): def write(self, repo): try: f = repo.vfs(_filename(repo), "w", atomictemp=True) - cachekey = [hex(self.tipnode), str(self.tiprev)] + cachekey = [hex(self.tipnode), '%d' % self.tiprev] if self.filteredhash is not None: cachekey.append(hex(self.filteredhash)) f.write(" ".join(cachekey) + '\n')