[PATCH 03 of 10 py3] obsolete: use bytestr() instead of str() so the node is bytes on py3

Augie Fackler raf at durin42.com
Tue Aug 1 16:34:31 EDT 2017


# HG changeset patch
# User Augie Fackler <augie at google.com>
# Date 1500907059 14400
#      Mon Jul 24 10:37:39 2017 -0400
# Node ID f50da59f7977c7d796850b95ac7c80a4fd92bd18
# Parent  8b22554199879f80a13ddee556bc540ddcb65a94
obsolete: use bytestr() instead of str() so the node is bytes on py3

I'm not sure this is right, since this should either be bytes or str
to match what's going on in the revlog layer.

diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -79,6 +79,7 @@ from . import (
     obsutil,
     phases,
     policy,
+    pycompat,
     util,
 )
 
@@ -583,7 +584,8 @@ class obsstore(object):
 
         metadata = tuple(sorted(metadata.iteritems()))
 
-        marker = (str(prec), tuple(succs), int(flag), metadata, date, parents)
+        prec = bytes(pycompat.bytestr(prec))
+        marker = (prec, tuple(succs), int(flag), metadata, date, parents)
         return bool(self.add(transaction, [marker]))
 
     def add(self, transaction, markers):


More information about the Mercurial-devel mailing list