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