contrib/dumprevlog
changeset 6466 9c426da6b03b
parent 6433 ec5d77eb3431
child 6750 fb42030d79d6
--- a/contrib/dumprevlog	Thu Apr 03 17:17:39 2008 +0200
+++ b/contrib/dumprevlog	Fri Apr 04 16:39:44 2008 +0200
@@ -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)