diff --git a/eden/scm/edenscm/mercurial/formatter.py b/eden/scm/edenscm/mercurial/formatter.py index d393df2effda8..f09c58935a6b5 100644 --- a/eden/scm/edenscm/mercurial/formatter.py +++ b/eden/scm/edenscm/mercurial/formatter.py @@ -122,10 +122,6 @@ from .node import hex, short -# pyre-fixme[11]: Annotation `pickle` is not defined as a type. -pickle = util.pickle - - class _nullconverter(object): """convert non-primitive data types to be processed by formatter""" @@ -140,9 +136,7 @@ def formatdate(date, fmt): @staticmethod def formatdict(data, key, value, fmt, sep): """convert dict or key-value pairs to appropriate dict format""" - # use plain dict instead of util.sortdict so that data can be - # serialized as a builtin dict in pickle output - return dict(data) + return data @staticmethod def formatlist(data, name, fmt, sep): @@ -355,20 +349,6 @@ def end(self): self._out.write("]\n") -class pickleformatter(baseformatter): - def __init__(self, ui, out, topic, opts): - baseformatter.__init__(self, ui, topic, opts, _nullconverter) - self._out = out - self._data = [] - - def _showitem(self): - self._data.append(self._item) - - def end(self): - baseformatter.end(self) - self._out.write(pickle.dumps(self._data)) - - class jsonformatter(baseformatter): def __init__(self, ui, out, topic, opts): baseformatter.__init__(self, ui, topic, opts, _nullconverter) @@ -587,8 +567,6 @@ def formatter(ui, out, topic, opts): template = opts.get("template", "") if template == "json": return jsonformatter(ui, out, topic, opts) - elif template == "pickle": - return pickleformatter(ui, out, topic, opts) elif template == "debug": return debugformatter(ui, out, topic, opts) elif template != "": diff --git a/eden/scm/tests/test-status.t b/eden/scm/tests/test-status.t index 14e53e7aa3d86..8b05ce5401ca1 100644 --- a/eden/scm/tests/test-status.t +++ b/eden/scm/tests/test-status.t @@ -1,4 +1,3 @@ -#require py2 #chg-compatible $ hg init repo1 @@ -231,13 +230,6 @@ hg status -A: } ] - $ hg status -A -Tpickle > pickle - >>> from __future__ import print_function - >>> import pickle - >>> print(sorted((x['status'], x['path']) for x in pickle.load(open("pickle")))) - [('!', 'deleted'), ('?', 'pickle'), ('?', 'unknown'), ('A', 'added'), ('A', 'copied'), ('C', '.gitignore'), ('C', 'modified'), ('I', 'ignored'), ('R', 'removed')] - $ rm pickle - $ echo "ignoreddir/" > .gitignore $ mkdir ignoreddir $ touch ignoreddir/file @@ -447,12 +439,12 @@ hg status of binary file starting with '\1\n', a separator for metadata: $ hg init repo5 $ cd repo5 - >>> _ = open("010a", "wb").write("\1\nfoo") + >>> _ = open("010a", "wb").write(b"\1\nfoo") $ hg ci -q -A -m 'initial checkin' $ hg status -A C 010a - >>> _ = open("010a", "wb").write("\1\nbar") + >>> _ = open("010a", "wb").write(b"\1\nbar") $ hg status -A M 010a $ hg ci -q -m 'modify 010a'