Show More
@@ -226,7 +226,7 b' class journalentry(collections.namedtupl' | |||||
226 |
|
226 | |||
227 | def __bytes__(self): |
|
227 | def __bytes__(self): | |
228 | """bytes representation for storage""" |
|
228 | """bytes representation for storage""" | |
229 | time = ' '.join(map(str, self.timestamp)) |
|
229 | time = ' '.join(map(pycompat.bytestr, self.timestamp)) | |
230 | oldhashes = ','.join([node.hex(hash) for hash in self.oldhashes]) |
|
230 | oldhashes = ','.join([node.hex(hash) for hash in self.oldhashes]) | |
231 | newhashes = ','.join([node.hex(hash) for hash in self.newhashes]) |
|
231 | newhashes = ','.join([node.hex(hash) for hash in self.newhashes]) | |
232 | return '\n'.join(( |
|
232 | return '\n'.join(( |
@@ -2,13 +2,13 b' Setup:' | |||||
2 | $ cat > eval.py <<EOF |
|
2 | $ cat > eval.py <<EOF | |
3 | > from __future__ import absolute_import |
|
3 | > from __future__ import absolute_import | |
4 | > import filecmp |
|
4 | > import filecmp | |
5 | > from mercurial import commands, context, registrar |
|
5 | > from mercurial import commands, context, pycompat, registrar | |
6 | > cmdtable = {} |
|
6 | > cmdtable = {} | |
7 | > command = registrar.command(cmdtable) |
|
7 | > command = registrar.command(cmdtable) | |
8 | > @command(b'eval', [], b'hg eval CMD') |
|
8 | > @command(b'eval', [], b'hg eval CMD') | |
9 | > def eval_(ui, repo, *cmds, **opts): |
|
9 | > def eval_(ui, repo, *cmds, **opts): | |
10 | > cmd = b" ".join(cmds) |
|
10 | > cmd = b" ".join(cmds) | |
11 | > res = str(eval(cmd, globals(), locals())) |
|
11 | > res = pycompat.bytestr(eval(cmd, globals(), locals())) | |
12 | > ui.warn(b"%s" % res) |
|
12 | > ui.warn(b"%s" % res) | |
13 | > EOF |
|
13 | > EOF | |
14 |
|
14 |
General Comments 0
You need to be logged in to leave comments.
Login now