Patchwork D3071: py3: use pycompat.bytestr() intsead of str

login
register
mail settings
Submitter phabricator
Date April 4, 2018, 1:39 p.m.
Message ID <b49f62c1d69c8954e7888bdae59267fb@localhost.localdomain>
Download mbox | patch
Permalink /patch/30252/
State Not Applicable
Headers show

Comments

phabricator - April 4, 2018, 1:39 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG9954d0e2ad00: py3: use pycompat.bytestr() intsead of str (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3071?vs=7615&id=7618

REVISION DETAIL
  https://phab.mercurial-scm.org/D3071

AFFECTED FILES
  hgext/journal.py
  tests/test-arbitraryfilectx.t

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/test-arbitraryfilectx.t b/tests/test-arbitraryfilectx.t
--- a/tests/test-arbitraryfilectx.t
+++ b/tests/test-arbitraryfilectx.t
@@ -2,13 +2,13 @@ 
   $ cat > eval.py <<EOF
   > from __future__ import absolute_import
   > import filecmp
-  > from mercurial import commands, context, registrar
+  > from mercurial import commands, context, pycompat, registrar
   > cmdtable = {}
   > command = registrar.command(cmdtable)
   > @command(b'eval', [], b'hg eval CMD')
   > def eval_(ui, repo, *cmds, **opts):
   >     cmd = b" ".join(cmds)
-  >     res = str(eval(cmd, globals(), locals()))
+  >     res = pycompat.bytestr(eval(cmd, globals(), locals()))
   >     ui.warn(b"%s" % res)
   > EOF
 
diff --git a/hgext/journal.py b/hgext/journal.py
--- a/hgext/journal.py
+++ b/hgext/journal.py
@@ -226,7 +226,7 @@ 
 
     def __bytes__(self):
         """bytes representation for storage"""
-        time = ' '.join(map(str, self.timestamp))
+        time = ' '.join(map(pycompat.bytestr, self.timestamp))
         oldhashes = ','.join([node.hex(hash) for hash in self.oldhashes])
         newhashes = ','.join([node.hex(hash) for hash in self.newhashes])
         return '\n'.join((