##// END OF EJS Templates
contrib: fix binary file issues with dumprevlog on Windows...
Adrian Buehlmann -
r6466:9c426da6 default
parent child Browse files
Show More
@@ -3,10 +3,14 b''
3 # $ find .hg/store/ -name "*.i" | xargs dumprevlog > repo.dump
3 # $ find .hg/store/ -name "*.i" | xargs dumprevlog > repo.dump
4
4
5 import sys
5 import sys
6 from mercurial import revlog, node
6 from mercurial import revlog, node, util
7
8 for fp in (sys.stdin, sys.stdout, sys.stderr):
9 util.set_binary(fp)
7
10
8 for f in sys.argv[1:]:
11 for f in sys.argv[1:]:
9 r = revlog.revlog(open, f)
12 binopen = lambda fn: open(fn, 'rb')
13 r = revlog.revlog(binopen, f)
10 print "file:", f
14 print "file:", f
11 for i in xrange(r.count()):
15 for i in xrange(r.count()):
12 n = r.node(i)
16 n = r.node(i)
@@ -6,6 +6,9 b''
6 import sys
6 import sys
7 from mercurial import revlog, node, util, transaction
7 from mercurial import revlog, node, util, transaction
8
8
9 for fp in (sys.stdin, sys.stdout, sys.stderr):
10 util.set_binary(fp)
11
9 opener = util.opener('.', False)
12 opener = util.opener('.', False)
10 tr = transaction.transaction(sys.stderr.write, opener, "undump.journal")
13 tr = transaction.transaction(sys.stderr.write, opener, "undump.journal")
11 while 1:
14 while 1:
General Comments 0
You need to be logged in to leave comments. Login now