diff --git a/contrib/dumprevlog b/contrib/dumprevlog --- a/contrib/dumprevlog +++ b/contrib/dumprevlog @@ -3,10 +3,14 @@ # $ find .hg/store/ -name "*.i" | xargs dumprevlog > repo.dump import sys -from mercurial import revlog, node +from mercurial import revlog, node, util + +for fp in (sys.stdin, sys.stdout, sys.stderr): + util.set_binary(fp) for f in sys.argv[1:]: - r = revlog.revlog(open, f) + binopen = lambda fn: open(fn, 'rb') + r = revlog.revlog(binopen, f) print "file:", f for i in xrange(r.count()): n = r.node(i) diff --git a/contrib/undumprevlog b/contrib/undumprevlog --- a/contrib/undumprevlog +++ b/contrib/undumprevlog @@ -6,6 +6,9 @@ import sys from mercurial import revlog, node, util, transaction +for fp in (sys.stdin, sys.stdout, sys.stderr): + util.set_binary(fp) + opener = util.opener('.', False) tr = transaction.transaction(sys.stderr.write, opener, "undump.journal") while 1: