##// END OF EJS Templates
chg: forward user-defined signals...
chg: forward user-defined signals SIGUSR1 and SIGUSR2 are reserved for user-defined behaviors. They may be redefined by an hg extension [1], but cannot be easily redefined for chg. Since the default behavior (kill) is not that useful for chg, let's forward them to hg, hoping it got redefined there and could be more useful. [1] https://bitbucket.org/facebook/hg-experimental/commits/e7c883a465

File last commit:

r31216:21fa3d36 default
r31230:cc37b5a0 default
Show More
undumprevlog
46 lines | 1.1 KiB | text/plain | TextLexer
Matt Mackall
add simple dump and undump scripts to contrib/
r6433 #!/usr/bin/env python
# Undump a dump from dumprevlog
# $ hg init
# $ undumprevlog < repo.dump
Pulkit Goyal
py3: make contrib/undumprevlog use absolute_import
r29167 from __future__ import absolute_import
Matt Mackall
add simple dump and undump scripts to contrib/
r6433 import sys
Pulkit Goyal
py3: make contrib/undumprevlog use absolute_import
r29167 from mercurial import (
node,
revlog,
scmutil,
transaction,
util,
)
Matt Mackall
add simple dump and undump scripts to contrib/
r6433
Adrian Buehlmann
contrib: fix binary file issues with dumprevlog on Windows...
r6466 for fp in (sys.stdin, sys.stdout, sys.stderr):
Adrian Buehlmann
rename util.set_binary to setbinary
r14233 util.setbinary(fp)
Adrian Buehlmann
contrib: fix binary file issues with dumprevlog on Windows...
r6466
Pierre-Yves David
vfs: replace 'scmutil.opener' usage with 'scmutil.vfs'...
r31216 opener = scmutil.vfs('.', False)
Pierre-Yves David
transaction: pass a vfs map to the transaction...
r23310 tr = transaction.transaction(sys.stderr.write, opener, {'store': opener},
"undump.journal")
Mads Kiilerich
tests: run check-code on Python files without .py extension
r19022 while True:
Matt Mackall
add simple dump and undump scripts to contrib/
r6433 l = sys.stdin.readline()
if not l:
break
if l.startswith("file:"):
f = l[6:-1]
r = revlog.revlog(opener, f)
print f
elif l.startswith("node:"):
n = node.bin(l[6:-1])
elif l.startswith("linkrev:"):
lr = int(l[9:-1])
elif l.startswith("parents:"):
p = l[9:-1].split()
p1 = node.bin(p[0])
p2 = node.bin(p[1])
elif l.startswith("length:"):
length = int(l[8:-1])
sys.stdin.readline() # start marker
d = sys.stdin.read(length)
sys.stdin.readline() # end marker
r.addrevision(d, tr, lr, p1, p2)
tr.close()