##// END OF EJS Templates
copies: extract value comparison in the python copy tracing...
copies: extract value comparison in the python copy tracing This mirror what we did in the Rust code. This is useful to prepare rework for this comparison logic that we will need to handle more advanced chaining cases (when merges are chained). Differential Revision: https://phab.mercurial-scm.org/D9590

File last commit:

r46729:59fa3890 default
r46776:3a0c4133 default
Show More
dumprevlog
47 lines | 1.1 KiB | text/plain | TextLexer
Gregory Szorc
global: use python3 in shebangs...
r46434 #!/usr/bin/env python3
Matt Mackall
add simple dump and undump scripts to contrib/
r6433 # Dump revlogs as raw data stream
# $ find .hg/store/ -name "*.i" | xargs dumprevlog > repo.dump
Pulkit Goyal
py3: make contrib/dumprevlog use print_function
r29166 from __future__ import absolute_import, print_function
Pulkit Goyal
py3: make contrib/dumprevlog use absolute_import
r29165
Matt Mackall
add simple dump and undump scripts to contrib/
r6433 import sys
Joerg Sonnenberger
node: import symbols explicitly...
r46729 from mercurial.node import hex
Pulkit Goyal
py3: make contrib/dumprevlog use absolute_import
r29165 from mercurial import (
Matt Harbison
py3: byteify contrib/dumprevlog
r39983 encoding,
pycompat,
Pulkit Goyal
py3: make contrib/dumprevlog use absolute_import
r29165 revlog,
Yuya Nishihara
procutil: bulk-replace function calls to point to new module
r37138 )
Gregory Szorc
black: blacken scripts...
r44058 from mercurial.utils import procutil
Adrian Buehlmann
contrib: fix binary file issues with dumprevlog on Windows...
r6466
for fp in (sys.stdin, sys.stdout, sys.stderr):
Yuya Nishihara
procutil: bulk-replace function calls to point to new module
r37138 procutil.setbinary(fp)
Matt Mackall
add simple dump and undump scripts to contrib/
r6433
Gregory Szorc
black: blacken scripts...
r44058
Matt Harbison
py3: byteify contrib/dumprevlog
r39983 def binopen(path, mode=b'rb'):
if b'b' not in mode:
mode = mode + b'b'
return open(path, pycompat.sysstr(mode))
Gregory Szorc
black: blacken scripts...
r44058
vfs: give all vfs an options attribute by default...
r43295 binopen.options = {}
Matt Harbison
py3: byteify contrib/dumprevlog
r39983
Gregory Szorc
black: blacken scripts...
r44058
Matt Harbison
py3: byteify contrib/dumprevlog
r39983 def printb(data, end=b'\n'):
sys.stdout.flush()
Manuel Jacob
pycompat: change users of pycompat.{stdin,stdout,stderr} to use procutil.std*...
r45598 procutil.stdout.write(data + end)
Boris Feld
dumprevlog: handle being passed a mode parameter...
r35982
Gregory Szorc
black: blacken scripts...
r44058
Matt Mackall
add simple dump and undump scripts to contrib/
r6433 for f in sys.argv[1:]:
Matt Harbison
py3: byteify contrib/dumprevlog
r39983 r = revlog.revlog(binopen, encoding.strtolocal(f))
Pulkit Goyal
py3: make contrib/dumprevlog use print_function
r29166 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)
Joerg Sonnenberger
node: import symbols explicitly...
r46729 printb(b"node: %s" % hex(n))
Matt Harbison
py3: byteify contrib/dumprevlog
r39983 printb(b"linkrev: %d" % r.linkrev(i))
Joerg Sonnenberger
node: import symbols explicitly...
r46729 printb(b"parents: %s %s" % (hex(p[0]), hex(p[1])))
Matt Harbison
py3: byteify contrib/dumprevlog
r39983 printb(b"length: %d" % len(d))
printb(b"-start-")
printb(d)
printb(b"-end-")