shelve: make it python3 compatible

Reviewed By: sfilipco

Differential Revision: D20965583

fbshipit-source-id: c1cfc9c8ecfa8681ddb46cbfa8b71c3da591f265
This commit is contained in:
Xavier Deguillard 2020-04-13 08:50:39 -07:00 committed by Facebook GitHub Bot
parent 5aed0fe552
commit 9d1a53ef48

View File

@ -44,6 +44,7 @@ from edenscm.mercurial import (
node as nodemod,
obsolete,
patch,
pycompat,
registrar,
repair,
scmutil,
@ -643,8 +644,8 @@ def listcmd(ui, repo, pats, opts):
line = fp.readline()
if not line:
break
if not line.startswith("#"):
desc = line.rstrip()
if not line.startswith(b"#"):
desc = pycompat.decodeutf8(line.rstrip())
if ui.formatted:
desc = util.ellipsis(desc, width - used)
ui.write(desc)
@ -655,7 +656,7 @@ def listcmd(ui, repo, pats, opts):
difflines = fp.readlines()
if opts["patch"]:
for chunk, label in patch.difflabel(iter, difflines):
ui.write(chunk, label=label)
ui.writebytes(chunk, label=label)
if opts["stat"]:
for chunk, label in patch.diffstatui(difflines, width=width):
ui.write(chunk, label=label)