##// END OF EJS Templates
merge: use separate lists for each action type...
merge: use separate lists for each action type This replaces the grand unified action list that had multiple action types as tuples in one big list. That list was iterated multiple times just to find actions of a specific type. This data model also made some code more convoluted than necessary. Instead we now store actions as a tuple of lists. Using multiple lists gives a bit of cut'n'pasted code but also enables other optimizations. This patch uses 'if True:' to preserve indentations and help reviewing. It also limits the number of conflicts with other pending patches. It can trivially be cleaned up later.

File last commit:

r14233:659f34b8 default
r21545:43eecb4e default
Show More
dumprevlog
25 lines | 676 B | text/plain | TextLexer
Matt Mackall
add simple dump and undump scripts to contrib/
r6433 #!/usr/bin/env python
# Dump revlogs as raw data stream
# $ find .hg/store/ -name "*.i" | xargs dumprevlog > repo.dump
import sys
Adrian Buehlmann
contrib: fix binary file issues with dumprevlog on Windows...
r6466 from mercurial import revlog, node, util
for fp in (sys.stdin, sys.stdout, sys.stderr):
Adrian Buehlmann
rename util.set_binary to setbinary
r14233 util.setbinary(fp)
Matt Mackall
add simple dump and undump scripts to contrib/
r6433
for f in sys.argv[1:]:
Adrian Buehlmann
contrib: fix binary file issues with dumprevlog on Windows...
r6466 binopen = lambda fn: open(fn, 'rb')
r = revlog.revlog(binopen, f)
Matt Mackall
add simple dump and undump scripts to contrib/
r6433 print "file:", f
Matt Mackall
add __len__ and __iter__ methods to repo and revlog
r6750 for i in r:
Matt Mackall
add simple dump and undump scripts to contrib/
r6433 n = r.node(i)
p = r.parents(n)
d = r.revision(n)
print "node:", node.hex(n)
Matt Mackall
linkrev: take a revision number rather than a hash
r7361 print "linkrev:", r.linkrev(i)
Matt Mackall
add simple dump and undump scripts to contrib/
r6433 print "parents:", node.hex(p[0]), node.hex(p[1])
print "length:", len(d)
print "-start-"
print d
print "-end-"