Mercurial > hg
comparison contrib/undumprevlog @ 33872:5d9890d8ca77
undumprevlog: update to valid Python 3 syntax
I didn't do anything to ensure correctness here, just enough to avoid
tracebacks in the import checker, which uses the native ast module to
try and parse all our Python files.
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Tue, 22 Aug 2017 12:58:51 -0400 |
parents | 8d3e8c8c9049 |
children | a8a902d7176e |
comparison
equal
deleted
inserted
replaced
33871:9e8b01d0654f | 33872:5d9890d8ca77 |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Undump a dump from dumprevlog | 2 # Undump a dump from dumprevlog |
3 # $ hg init | 3 # $ hg init |
4 # $ undumprevlog < repo.dump | 4 # $ undumprevlog < repo.dump |
5 | 5 |
6 from __future__ import absolute_import | 6 from __future__ import absolute_import, print_function |
7 | 7 |
8 import sys | 8 import sys |
9 from mercurial import ( | 9 from mercurial import ( |
10 node, | 10 node, |
11 revlog, | 11 revlog, |
25 if not l: | 25 if not l: |
26 break | 26 break |
27 if l.startswith("file:"): | 27 if l.startswith("file:"): |
28 f = l[6:-1] | 28 f = l[6:-1] |
29 r = revlog.revlog(opener, f) | 29 r = revlog.revlog(opener, f) |
30 print f | 30 print(f) |
31 elif l.startswith("node:"): | 31 elif l.startswith("node:"): |
32 n = node.bin(l[6:-1]) | 32 n = node.bin(l[6:-1]) |
33 elif l.startswith("linkrev:"): | 33 elif l.startswith("linkrev:"): |
34 lr = int(l[9:-1]) | 34 lr = int(l[9:-1]) |
35 elif l.startswith("parents:"): | 35 elif l.startswith("parents:"): |