author | mpm@selenic.com |
Sat, 04 Jun 2005 12:14:14 -0800 | |
changeset 246 | 96cde50a746f |
parent 245 | fef0f8e041aa |
child 247 | 863b508c5b36 |
permissions | -rw-r--r-- |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
1 |
#!/usr/bin/env python |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
2 |
# |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
3 |
# mercurial - a minimal scalable distributed SCM |
193
0a28dfe59f8f
Bump the version number to 0.5b for the protocol change
mpm@selenic.com
parents:
192
diff
changeset
|
4 |
# v0.5b "katje" |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
5 |
# |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
6 |
# Copyright 2005 Matt Mackall <mpm@selenic.com> |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
7 |
# |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
8 |
# This software may be used and distributed according to the terms |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
9 |
# of the GNU General Public License, incorporated herein by reference. |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
10 |
|
46 | 11 |
# the psyco compiler makes commits a bit faster |
12 |
# and makes changegroup merge about 20 times slower! |
|
13 |
# try: |
|
14 |
# import psyco |
|
15 |
# psyco.full() |
|
16 |
# except: |
|
17 |
# pass |
|
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
18 |
|
246
96cde50a746f
Migrate rawcommit, import, export, history, and merge
mpm@selenic.com
parents:
245
diff
changeset
|
19 |
import sys |
209 | 20 |
from mercurial import hg, mdiff, fancyopts, ui, commands |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
21 |
|
209 | 22 |
try: |
23 |
sys.exit(commands.dispatch(sys.argv[1:])) |
|
24 |
except commands.UnknownCommand: |
|
25 |
# fall through |
|
26 |
pass |
|
27 |
||
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
28 |
options = {} |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
29 |
opts = [('v', 'verbose', None, 'verbose'), |
83 | 30 |
('d', 'debug', None, 'debug'), |
107 | 31 |
('q', 'quiet', None, 'quiet'), |
32 |
('y', 'noninteractive', None, 'run non-interactively'), |
|
33 |
] |
|
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
34 |
|
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
35 |
args = fancyopts.fancyopts(sys.argv[1:], opts, options, |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
36 |
'hg [options] <command> [command options] [files]') |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
37 |
|
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
38 |
try: |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
39 |
cmd = args[0] |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
40 |
args = args[1:] |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
41 |
except: |
206
3295b6b508de
hg: don't complain about missing repo with no args
mpm@selenic.com
parents:
203
diff
changeset
|
42 |
cmd = "help" |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
43 |
|
207 | 44 |
ui = ui.ui(options["verbose"], options["debug"], options["quiet"], |
107 | 45 |
not options["noninteractive"]) |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
46 |
|
213 | 47 |
try: |
48 |
repo = hg.repository(ui=ui) |
|
49 |
except IOError: |
|
50 |
ui.warn("Unable to open repository\n") |
|
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
51 |
sys.exit(0) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
52 |
|
246
96cde50a746f
Migrate rawcommit, import, export, history, and merge
mpm@selenic.com
parents:
245
diff
changeset
|
53 |
if cmd == "debugchangegroup": |
67 | 54 |
newer = repo.newer(map(repo.lookup, args)) |
62 | 55 |
for chunk in repo.changegroup(newer): |
56 |
sys.stdout.write(chunk) |
|
46 | 57 |
|
58 |
elif cmd == "debugaddchangegroup": |
|
59 |
data = sys.stdin.read() |
|
60 |
repo.addchangegroup(data) |
|
61 |
||
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
62 |
elif cmd == "dump": |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
63 |
if args: |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
64 |
r = repo.file(args[0]) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
65 |
n = r.tip() |
39 | 66 |
if len(args) > 1: n = r.lookup(args[1]) |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
67 |
sys.stdout.write(r.read(n)) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
68 |
else: |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
69 |
print "missing filename" |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
70 |
|
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
71 |
elif cmd == "dumpmanifest": |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
72 |
n = repo.manifest.tip() |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
73 |
if len(args) > 0: |
39 | 74 |
n = repo.manifest.lookup(args[0]) |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
75 |
m = repo.manifest.read(n) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
76 |
files = m.keys() |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
77 |
files.sort() |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
78 |
|
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
79 |
for f in files: |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
80 |
print hg.hex(m[f]), f |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
81 |
|
24 | 82 |
elif cmd == "debugindex": |
91 | 83 |
if ".hg" not in args[0]: |
84 |
args[0] = ".hg/data/" + repo.file(args[0]).encodepath(args[0]) + "i" |
|
85 |
||
24 | 86 |
r = hg.revlog(open, args[0], "") |
70 | 87 |
print " rev offset length base linkrev"+\ |
24 | 88 |
" p1 p2 nodeid" |
89 |
for i in range(r.count()): |
|
90 |
e = r.index[i] |
|
70 | 91 |
print "% 6d % 9d % 7d % 6d % 7d %s.. %s.. %s.." % ( |
24 | 92 |
i, e[0], e[1], e[2], e[3], |
93 |
hg.hex(e[4][:5]), hg.hex(e[5][:5]), hg.hex(e[6][:5])) |
|
94 |
||
92
e6fc7ff52246
Add debugindexdot to generate graphviz dot files from indexes
mpm@selenic.com
parents:
91
diff
changeset
|
95 |
elif cmd == "debugindexdot": |
e6fc7ff52246
Add debugindexdot to generate graphviz dot files from indexes
mpm@selenic.com
parents:
91
diff
changeset
|
96 |
if ".hg" not in args[0]: |
e6fc7ff52246
Add debugindexdot to generate graphviz dot files from indexes
mpm@selenic.com
parents:
91
diff
changeset
|
97 |
args[0] = ".hg/data/" + repo.file(args[0]).encodepath(args[0]) + "i" |
e6fc7ff52246
Add debugindexdot to generate graphviz dot files from indexes
mpm@selenic.com
parents:
91
diff
changeset
|
98 |
|
e6fc7ff52246
Add debugindexdot to generate graphviz dot files from indexes
mpm@selenic.com
parents:
91
diff
changeset
|
99 |
r = hg.revlog(open, args[0], "") |
e6fc7ff52246
Add debugindexdot to generate graphviz dot files from indexes
mpm@selenic.com
parents:
91
diff
changeset
|
100 |
print "digraph G {" |
e6fc7ff52246
Add debugindexdot to generate graphviz dot files from indexes
mpm@selenic.com
parents:
91
diff
changeset
|
101 |
for i in range(r.count()): |
e6fc7ff52246
Add debugindexdot to generate graphviz dot files from indexes
mpm@selenic.com
parents:
91
diff
changeset
|
102 |
e = r.index[i] |
e6fc7ff52246
Add debugindexdot to generate graphviz dot files from indexes
mpm@selenic.com
parents:
91
diff
changeset
|
103 |
print "\t%d -> %d" % (r.rev(e[4]), i) |
e6fc7ff52246
Add debugindexdot to generate graphviz dot files from indexes
mpm@selenic.com
parents:
91
diff
changeset
|
104 |
if e[5] != hg.nullid: |
e6fc7ff52246
Add debugindexdot to generate graphviz dot files from indexes
mpm@selenic.com
parents:
91
diff
changeset
|
105 |
print "\t%d -> %d" % (r.rev(e[5]), i) |
e6fc7ff52246
Add debugindexdot to generate graphviz dot files from indexes
mpm@selenic.com
parents:
91
diff
changeset
|
106 |
print "}" |
e6fc7ff52246
Add debugindexdot to generate graphviz dot files from indexes
mpm@selenic.com
parents:
91
diff
changeset
|
107 |
|
67 | 108 |
elif cmd == "tags": |
109 |
repo.lookup(0) # prime the cache |
|
110 |
i = repo.tags.items() |
|
111 |
i.sort() |
|
112 |
for k, n in i: |
|
113 |
try: |
|
114 |
r = repo.changelog.rev(n) |
|
115 |
except KeyError: |
|
116 |
r = "?" |
|
117 |
print "%-30s %5d:%s" % (k, repo.changelog.rev(n), hg.hex(n)) |
|
118 |
||
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
119 |
elif cmd == "verify": |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
120 |
filelinkrevs = {} |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
121 |
filenodes = {} |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
122 |
manifestchangeset = {} |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
123 |
changesets = revisions = files = 0 |
87 | 124 |
errors = 0 |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
125 |
|
87 | 126 |
ui.status("checking changesets\n") |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
127 |
for i in range(repo.changelog.count()): |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
128 |
changesets += 1 |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
129 |
n = repo.changelog.node(i) |
87 | 130 |
for p in repo.changelog.parents(n): |
131 |
if p not in repo.changelog.nodemap: |
|
132 |
ui.warn("changeset %s has unknown parent %s\n" % |
|
133 |
(hg.short(n), hg.short(p))) |
|
134 |
errors += 1 |
|
135 |
try: |
|
136 |
changes = repo.changelog.read(n) |
|
145 | 137 |
except Exception, inst: |
87 | 138 |
ui.warn("unpacking changeset %s: %s\n" % (short(n), inst)) |
139 |
errors += 1 |
|
140 |
||
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
141 |
manifestchangeset[changes[0]] = n |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
142 |
for f in changes[3]: |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
143 |
filelinkrevs.setdefault(f, []).append(i) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
144 |
|
87 | 145 |
ui.status("checking manifests\n") |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
146 |
for i in range(repo.manifest.count()): |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
147 |
n = repo.manifest.node(i) |
87 | 148 |
for p in repo.manifest.parents(n): |
149 |
if p not in repo.manifest.nodemap: |
|
150 |
ui.warn("manifest %s has unknown parent %s\n" % |
|
151 |
(hg.short(n), hg.short(p))) |
|
152 |
errors += 1 |
|
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
153 |
ca = repo.changelog.node(repo.manifest.linkrev(n)) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
154 |
cc = manifestchangeset[n] |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
155 |
if ca != cc: |
87 | 156 |
ui.warn("manifest %s points to %s, not %s\n" % |
157 |
(hg.hex(n), hg.hex(ca), hg.hex(cc))) |
|
158 |
errors += 1 |
|
159 |
||
160 |
try: |
|
121
66fb61d9d97d
Use revlog.delta and mdiff.patchtext to massively speed up processing
mpm@selenic.com
parents:
107
diff
changeset
|
161 |
delta = mdiff.patchtext(repo.manifest.delta(n)) |
66fb61d9d97d
Use revlog.delta and mdiff.patchtext to massively speed up processing
mpm@selenic.com
parents:
107
diff
changeset
|
162 |
except KeyboardInterrupt: |
66fb61d9d97d
Use revlog.delta and mdiff.patchtext to massively speed up processing
mpm@selenic.com
parents:
107
diff
changeset
|
163 |
print "aborted" |
66fb61d9d97d
Use revlog.delta and mdiff.patchtext to massively speed up processing
mpm@selenic.com
parents:
107
diff
changeset
|
164 |
sys.exit(0) |
93 | 165 |
except Exception, inst: |
87 | 166 |
ui.warn("unpacking manifest %s: %s\n" % (hg.short(n), inst)) |
167 |
errors += 1 |
|
142 | 168 |
|
121
66fb61d9d97d
Use revlog.delta and mdiff.patchtext to massively speed up processing
mpm@selenic.com
parents:
107
diff
changeset
|
169 |
ff = [ l.split('\0') for l in delta.splitlines() ] |
66fb61d9d97d
Use revlog.delta and mdiff.patchtext to massively speed up processing
mpm@selenic.com
parents:
107
diff
changeset
|
170 |
for f, fn in ff: |
66fb61d9d97d
Use revlog.delta and mdiff.patchtext to massively speed up processing
mpm@selenic.com
parents:
107
diff
changeset
|
171 |
filenodes.setdefault(f, {})[hg.bin(fn)] = 1 |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
172 |
|
87 | 173 |
ui.status("crosschecking files in changesets and manifests\n") |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
174 |
for f in filenodes: |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
175 |
if f not in filelinkrevs: |
87 | 176 |
ui.warn("file %s in manifest but not in changesets\n" % f) |
177 |
errors += 1 |
|
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
178 |
|
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
179 |
for f in filelinkrevs: |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
180 |
if f not in filenodes: |
121
66fb61d9d97d
Use revlog.delta and mdiff.patchtext to massively speed up processing
mpm@selenic.com
parents:
107
diff
changeset
|
181 |
ui.warn("file %s in changeset but not in manifest\n" % f) |
87 | 182 |
errors += 1 |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
183 |
|
87 | 184 |
ui.status("checking files\n") |
121
66fb61d9d97d
Use revlog.delta and mdiff.patchtext to massively speed up processing
mpm@selenic.com
parents:
107
diff
changeset
|
185 |
ff = filenodes.keys() |
66fb61d9d97d
Use revlog.delta and mdiff.patchtext to massively speed up processing
mpm@selenic.com
parents:
107
diff
changeset
|
186 |
ff.sort() |
66fb61d9d97d
Use revlog.delta and mdiff.patchtext to massively speed up processing
mpm@selenic.com
parents:
107
diff
changeset
|
187 |
for f in ff: |
66fb61d9d97d
Use revlog.delta and mdiff.patchtext to massively speed up processing
mpm@selenic.com
parents:
107
diff
changeset
|
188 |
if f == "/dev/null": continue |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
189 |
files += 1 |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
190 |
fl = repo.file(f) |
87 | 191 |
nodes = { hg.nullid: 1 } |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
192 |
for i in range(fl.count()): |
224
ccbcc4d76f81
fix bad assumption about uniqueness of file versions
mpm@selenic.com
parents:
220
diff
changeset
|
193 |
revisions += 1 |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
194 |
n = fl.node(i) |
17
ffe6a5ca1a89
Make hg verify do more thorough cross-checking.
mpm@selenic.com
parents:
16
diff
changeset
|
195 |
|
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
196 |
if n not in filenodes[f]: |
121
66fb61d9d97d
Use revlog.delta and mdiff.patchtext to massively speed up processing
mpm@selenic.com
parents:
107
diff
changeset
|
197 |
ui.warn("%s: %d:%s not in manifests\n" % (f, i, hg.short(n))) |
66fb61d9d97d
Use revlog.delta and mdiff.patchtext to massively speed up processing
mpm@selenic.com
parents:
107
diff
changeset
|
198 |
print len(filenodes[f].keys()), fl.count(), f |
87 | 199 |
errors += 1 |
17
ffe6a5ca1a89
Make hg verify do more thorough cross-checking.
mpm@selenic.com
parents:
16
diff
changeset
|
200 |
else: |
ffe6a5ca1a89
Make hg verify do more thorough cross-checking.
mpm@selenic.com
parents:
16
diff
changeset
|
201 |
del filenodes[f][n] |
ffe6a5ca1a89
Make hg verify do more thorough cross-checking.
mpm@selenic.com
parents:
16
diff
changeset
|
202 |
|
ffe6a5ca1a89
Make hg verify do more thorough cross-checking.
mpm@selenic.com
parents:
16
diff
changeset
|
203 |
flr = fl.linkrev(n) |
ffe6a5ca1a89
Make hg verify do more thorough cross-checking.
mpm@selenic.com
parents:
16
diff
changeset
|
204 |
if flr not in filelinkrevs[f]: |
87 | 205 |
ui.warn("%s:%s points to unexpected changeset rev %d\n" |
206 |
% (f, hg.short(n), fl.linkrev(n))) |
|
207 |
errors += 1 |
|
17
ffe6a5ca1a89
Make hg verify do more thorough cross-checking.
mpm@selenic.com
parents:
16
diff
changeset
|
208 |
else: |
ffe6a5ca1a89
Make hg verify do more thorough cross-checking.
mpm@selenic.com
parents:
16
diff
changeset
|
209 |
filelinkrevs[f].remove(flr) |
ffe6a5ca1a89
Make hg verify do more thorough cross-checking.
mpm@selenic.com
parents:
16
diff
changeset
|
210 |
|
ffe6a5ca1a89
Make hg verify do more thorough cross-checking.
mpm@selenic.com
parents:
16
diff
changeset
|
211 |
# verify contents |
87 | 212 |
try: |
213 |
t = fl.read(n) |
|
145 | 214 |
except Exception, inst: |
215 |
ui.warn("unpacking file %s %s: %s\n" % (f, hg.short(n), inst)) |
|
87 | 216 |
errors += 1 |
217 |
||
17
ffe6a5ca1a89
Make hg verify do more thorough cross-checking.
mpm@selenic.com
parents:
16
diff
changeset
|
218 |
# verify parents |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
219 |
(p1, p2) = fl.parents(n) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
220 |
if p1 not in nodes: |
87 | 221 |
ui.warn("file %s:%s unknown parent 1 %s" % |
222 |
(f, hg.short(n), hg.short(p1))) |
|
223 |
errors += 1 |
|
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
224 |
if p2 not in nodes: |
87 | 225 |
ui.warn("file %s:%s unknown parent 2 %s" % |
226 |
(f, hg.short(n), hg.short(p1))) |
|
227 |
errors += 1 |
|
17
ffe6a5ca1a89
Make hg verify do more thorough cross-checking.
mpm@selenic.com
parents:
16
diff
changeset
|
228 |
nodes[n] = 1 |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
229 |
|
17
ffe6a5ca1a89
Make hg verify do more thorough cross-checking.
mpm@selenic.com
parents:
16
diff
changeset
|
230 |
# cross-check |
ffe6a5ca1a89
Make hg verify do more thorough cross-checking.
mpm@selenic.com
parents:
16
diff
changeset
|
231 |
for node in filenodes[f]: |
87 | 232 |
ui.warn("node %s in manifests not in %s\n" % (hg.hex(n), f)) |
233 |
errors += 1 |
|
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
234 |
|
87 | 235 |
ui.status("%d files, %d changesets, %d total revisions\n" % |
236 |
(files, changesets, revisions)) |
|
237 |
||
238 |
if errors: |
|
93 | 239 |
ui.warn("%d integrity errors encountered!\n" % errors) |
87 | 240 |
sys.exit(1) |
158
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
155
diff
changeset
|
241 |
|
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
242 |
else: |
175
0eb6e2c9800d
hg: remove some debug commands, improve help messages, add .hgpaths file
mpm@selenic.com
parents:
174
diff
changeset
|
243 |
if cmd: ui.warn("unknown command\n\n") |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
244 |
sys.exit(1) |