Show More
@@ -1,25 +1,31 b'' | |||||
1 | #!/usr/bin/env python |
|
1 | #!/usr/bin/env python | |
2 | # Dump revlogs as raw data stream |
|
2 | # Dump revlogs as raw data stream | |
3 | # $ find .hg/store/ -name "*.i" | xargs dumprevlog > repo.dump |
|
3 | # $ find .hg/store/ -name "*.i" | xargs dumprevlog > repo.dump | |
4 |
|
4 | |||
|
5 | from __future__ import absolute_import | |||
|
6 | ||||
5 | import sys |
|
7 | import sys | |
6 |
from mercurial import |
|
8 | from mercurial import ( | |
|
9 | node, | |||
|
10 | revlog, | |||
|
11 | util, | |||
|
12 | ) | |||
7 |
|
13 | |||
8 | for fp in (sys.stdin, sys.stdout, sys.stderr): |
|
14 | for fp in (sys.stdin, sys.stdout, sys.stderr): | |
9 | util.setbinary(fp) |
|
15 | util.setbinary(fp) | |
10 |
|
16 | |||
11 | for f in sys.argv[1:]: |
|
17 | for f in sys.argv[1:]: | |
12 | binopen = lambda fn: open(fn, 'rb') |
|
18 | binopen = lambda fn: open(fn, 'rb') | |
13 | r = revlog.revlog(binopen, f) |
|
19 | r = revlog.revlog(binopen, f) | |
14 | print "file:", f |
|
20 | print "file:", f | |
15 | for i in r: |
|
21 | for i in r: | |
16 | n = r.node(i) |
|
22 | n = r.node(i) | |
17 | p = r.parents(n) |
|
23 | p = r.parents(n) | |
18 | d = r.revision(n) |
|
24 | d = r.revision(n) | |
19 | print "node:", node.hex(n) |
|
25 | print "node:", node.hex(n) | |
20 | print "linkrev:", r.linkrev(i) |
|
26 | print "linkrev:", r.linkrev(i) | |
21 | print "parents:", node.hex(p[0]), node.hex(p[1]) |
|
27 | print "parents:", node.hex(p[0]), node.hex(p[1]) | |
22 | print "length:", len(d) |
|
28 | print "length:", len(d) | |
23 | print "-start-" |
|
29 | print "-start-" | |
24 | print d |
|
30 | print d | |
25 | print "-end-" |
|
31 | print "-end-" |
General Comments 0
You need to be logged in to leave comments.
Login now