author | mpm@selenic.com |
Wed, 18 May 2005 15:21:53 -0800 | |
changeset 91 | 1c212bbb38d5 |
parent 89 | 4cd9145d5b53 |
child 92 | e6fc7ff52246 |
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 |
67 | 4 |
# v0.4f "jane dark" |
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 |
|
23 | 19 |
import sys, os, time |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
20 |
from mercurial import hg, mdiff, fancyopts |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
21 |
|
18
2fd3e1e3783f
Give a friendlier message when repo isn't found
mpm@selenic.com
parents:
17
diff
changeset
|
22 |
def help(): |
49 | 23 |
print """\ |
18
2fd3e1e3783f
Give a friendlier message when repo isn't found
mpm@selenic.com
parents:
17
diff
changeset
|
24 |
commands: |
2fd3e1e3783f
Give a friendlier message when repo isn't found
mpm@selenic.com
parents:
17
diff
changeset
|
25 |
|
2fd3e1e3783f
Give a friendlier message when repo isn't found
mpm@selenic.com
parents:
17
diff
changeset
|
26 |
init create a new repository in this directory |
2fd3e1e3783f
Give a friendlier message when repo isn't found
mpm@selenic.com
parents:
17
diff
changeset
|
27 |
branch <path> create a branch of <path> in this directory |
2fd3e1e3783f
Give a friendlier message when repo isn't found
mpm@selenic.com
parents:
17
diff
changeset
|
28 |
merge <path> merge changes from <path> into local repository |
2fd3e1e3783f
Give a friendlier message when repo isn't found
mpm@selenic.com
parents:
17
diff
changeset
|
29 |
checkout [changeset] checkout the latest or given changeset |
2fd3e1e3783f
Give a friendlier message when repo isn't found
mpm@selenic.com
parents:
17
diff
changeset
|
30 |
status show new, missing, and changed files in working dir |
2fd3e1e3783f
Give a friendlier message when repo isn't found
mpm@selenic.com
parents:
17
diff
changeset
|
31 |
add [files...] add the given files in the next commit |
2fd3e1e3783f
Give a friendlier message when repo isn't found
mpm@selenic.com
parents:
17
diff
changeset
|
32 |
remove [files...] remove the given files in the next commit |
2fd3e1e3783f
Give a friendlier message when repo isn't found
mpm@selenic.com
parents:
17
diff
changeset
|
33 |
addremove add all new files, delete all missing files |
2fd3e1e3783f
Give a friendlier message when repo isn't found
mpm@selenic.com
parents:
17
diff
changeset
|
34 |
commit commit all changes to the repository |
2fd3e1e3783f
Give a friendlier message when repo isn't found
mpm@selenic.com
parents:
17
diff
changeset
|
35 |
history show changeset history |
2fd3e1e3783f
Give a friendlier message when repo isn't found
mpm@selenic.com
parents:
17
diff
changeset
|
36 |
log <file> show revision history of a single file |
2fd3e1e3783f
Give a friendlier message when repo isn't found
mpm@selenic.com
parents:
17
diff
changeset
|
37 |
dump <file> [rev] dump the latest or given revision of a file |
2fd3e1e3783f
Give a friendlier message when repo isn't found
mpm@selenic.com
parents:
17
diff
changeset
|
38 |
dumpmanifest [rev] dump the latest or given revision of the manifest |
22 | 39 |
diff [files...] diff working directory (or selected files) |
67 | 40 |
tags show current changeset tags |
81
17884f79d59d
Add annotate and blame to the command list and README
mpm@selenic.com
parents:
80
diff
changeset
|
41 |
annotate [files...] show changeset number per file line |
17884f79d59d
Add annotate and blame to the command list and README
mpm@selenic.com
parents:
80
diff
changeset
|
42 |
blame [files...] show commit user per file line |
18
2fd3e1e3783f
Give a friendlier message when repo isn't found
mpm@selenic.com
parents:
17
diff
changeset
|
43 |
""" |
2fd3e1e3783f
Give a friendlier message when repo isn't found
mpm@selenic.com
parents:
17
diff
changeset
|
44 |
|
33 | 45 |
def filterfiles(list, files): |
46 |
l = [ x for x in list if x in files ] |
|
31
642058291e74
diffdir tidy in preparation for arg handling
mpm@selenic.com
parents:
29
diff
changeset
|
47 |
|
33 | 48 |
for f in files: |
49 |
if f[-1] != os.sep: f += os.sep |
|
50 |
l += [ x for x in list if x.startswith(f) ] |
|
51 |
return l |
|
31
642058291e74
diffdir tidy in preparation for arg handling
mpm@selenic.com
parents:
29
diff
changeset
|
52 |
|
34 | 53 |
def diff(files = None, node1 = None, node2 = None): |
64 | 54 |
def date(c): |
55 |
return time.asctime(time.gmtime(float(c[2].split(' ')[0]))) |
|
34 | 56 |
|
57 |
if node2: |
|
58 |
change = repo.changelog.read(node2) |
|
59 |
mmap2 = repo.manifest.read(change[0]) |
|
60 |
(c, a, d) = repo.diffrevs(node1, node2) |
|
61 |
def read(f): return repo.file(f).read(mmap2[f]) |
|
64 | 62 |
date2 = date(change) |
34 | 63 |
else: |
64 | 64 |
date2 = time.asctime() |
34 | 65 |
if not node1: |
66 |
node1 = repo.current |
|
67 |
(c, a, d) = repo.diffdir(repo.root, node1) |
|
64 | 68 |
def read(f): return file(os.path.join(repo.root, f)).read() |
34 | 69 |
|
70 |
change = repo.changelog.read(node1) |
|
71 |
mmap = repo.manifest.read(change[0]) |
|
64 | 72 |
date1 = date(change) |
34 | 73 |
|
74 |
if files: |
|
75 |
(c, a, d) = map(lambda x: filterfiles(x, files), (c, a, d)) |
|
76 |
||
77 |
for f in c: |
|
78 |
to = repo.file(f).read(mmap[f]) |
|
79 |
tn = read(f) |
|
64 | 80 |
sys.stdout.write(mdiff.unidiff(to, date1, tn, date2, f)) |
34 | 81 |
for f in a: |
82 |
to = "" |
|
83 |
tn = read(f) |
|
64 | 84 |
sys.stdout.write(mdiff.unidiff(to, date1, tn, date2, f)) |
34 | 85 |
for f in d: |
86 |
to = repo.file(f).read(mmap[f]) |
|
87 |
tn = "" |
|
64 | 88 |
sys.stdout.write(mdiff.unidiff(to, date1, tn, date2, f)) |
34 | 89 |
|
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
90 |
options = {} |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
91 |
opts = [('v', 'verbose', None, 'verbose'), |
83 | 92 |
('d', 'debug', None, 'debug'), |
93 |
('q', 'quiet', None, 'quiet')] |
|
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
94 |
|
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
95 |
args = fancyopts.fancyopts(sys.argv[1:], opts, options, |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
96 |
'hg [options] <command> [command options] [files]') |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
97 |
|
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
98 |
try: |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
99 |
cmd = args[0] |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
100 |
args = args[1:] |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
101 |
except: |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
102 |
cmd = "" |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
103 |
|
83 | 104 |
ui = hg.ui(options["verbose"], options["debug"], options["quiet"]) |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
105 |
|
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
106 |
if cmd == "init": |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
107 |
repo = hg.repository(ui, ".", create=1) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
108 |
sys.exit(0) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
109 |
elif cmd == "branch" or cmd == "clone": |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
110 |
os.system("cp -al %s/.hg .hg" % args[0]) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
111 |
sys.exit(0) |
18
2fd3e1e3783f
Give a friendlier message when repo isn't found
mpm@selenic.com
parents:
17
diff
changeset
|
112 |
elif cmd == "help": |
2fd3e1e3783f
Give a friendlier message when repo isn't found
mpm@selenic.com
parents:
17
diff
changeset
|
113 |
help() |
2fd3e1e3783f
Give a friendlier message when repo isn't found
mpm@selenic.com
parents:
17
diff
changeset
|
114 |
sys.exit(0) |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
115 |
else: |
18
2fd3e1e3783f
Give a friendlier message when repo isn't found
mpm@selenic.com
parents:
17
diff
changeset
|
116 |
try: |
2fd3e1e3783f
Give a friendlier message when repo isn't found
mpm@selenic.com
parents:
17
diff
changeset
|
117 |
repo = hg.repository(ui=ui) |
74 | 118 |
except IOError: |
83 | 119 |
ui.warn("Unable to open repository\n") |
18
2fd3e1e3783f
Give a friendlier message when repo isn't found
mpm@selenic.com
parents:
17
diff
changeset
|
120 |
sys.exit(0) |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
121 |
|
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
122 |
if cmd == "checkout" or cmd == "co": |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
123 |
node = repo.changelog.tip() |
39 | 124 |
if args: |
67 | 125 |
node = repo.lookup(args[0]) |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
126 |
repo.checkout(node) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
127 |
|
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
128 |
elif cmd == "add": |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
129 |
repo.add(args) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
130 |
|
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
131 |
elif cmd == "remove" or cmd == "rm" or cmd == "del" or cmd == "delete": |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
132 |
repo.remove(args) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
133 |
|
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
134 |
elif cmd == "commit" or cmd == "checkin" or cmd == "ci": |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
135 |
if 1: |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
136 |
if len(args) > 0: |
31
642058291e74
diffdir tidy in preparation for arg handling
mpm@selenic.com
parents:
29
diff
changeset
|
137 |
repo.commit(repo.current, args) |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
138 |
else: |
31
642058291e74
diffdir tidy in preparation for arg handling
mpm@selenic.com
parents:
29
diff
changeset
|
139 |
repo.commit(repo.current) |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
140 |
|
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
141 |
elif cmd == "import" or cmd == "patch": |
69
ab03c7a52cf2
Minor changes to import so that we can successfully import Ingo's
mpm@selenic.com
parents:
68
diff
changeset
|
142 |
try: |
ab03c7a52cf2
Minor changes to import so that we can successfully import Ingo's
mpm@selenic.com
parents:
68
diff
changeset
|
143 |
import psyco |
ab03c7a52cf2
Minor changes to import so that we can successfully import Ingo's
mpm@selenic.com
parents:
68
diff
changeset
|
144 |
psyco.full() |
ab03c7a52cf2
Minor changes to import so that we can successfully import Ingo's
mpm@selenic.com
parents:
68
diff
changeset
|
145 |
except: |
ab03c7a52cf2
Minor changes to import so that we can successfully import Ingo's
mpm@selenic.com
parents:
68
diff
changeset
|
146 |
pass |
ab03c7a52cf2
Minor changes to import so that we can successfully import Ingo's
mpm@selenic.com
parents:
68
diff
changeset
|
147 |
|
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
148 |
ioptions = {} |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
149 |
opts = [('p', 'strip', 1, 'path strip'), |
50 | 150 |
('b', 'base', "", 'base path'), |
151 |
('q', 'quiet', "", 'silence diff') |
|
152 |
] |
|
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
153 |
|
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
154 |
args = fancyopts.fancyopts(args, opts, ioptions, |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
155 |
'hg import [options] <patch names>') |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
156 |
d = ioptions["base"] |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
157 |
strip = ioptions["strip"] |
50 | 158 |
quiet = ioptions["quiet"] and "> /dev/null" or "" |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
159 |
|
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
160 |
for patch in args: |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
161 |
ui.status("applying %s\n" % patch) |
49 | 162 |
pf = os.path.join(d, patch) |
163 |
||
62 | 164 |
text = "" |
165 |
for l in file(pf): |
|
69
ab03c7a52cf2
Minor changes to import so that we can successfully import Ingo's
mpm@selenic.com
parents:
68
diff
changeset
|
166 |
if l[:4] == "--- ": break |
62 | 167 |
text += l |
168 |
||
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
169 |
f = os.popen("lsdiff --strip %d %s" % (strip, pf)) |
54 | 170 |
files = filter(None, map(lambda x: x.rstrip(), f.read().splitlines())) |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
171 |
f.close() |
69
ab03c7a52cf2
Minor changes to import so that we can successfully import Ingo's
mpm@selenic.com
parents:
68
diff
changeset
|
172 |
|
ab03c7a52cf2
Minor changes to import so that we can successfully import Ingo's
mpm@selenic.com
parents:
68
diff
changeset
|
173 |
if files: |
ab03c7a52cf2
Minor changes to import so that we can successfully import Ingo's
mpm@selenic.com
parents:
68
diff
changeset
|
174 |
if os.system("patch -p%d < %s %s" % (strip, pf, quiet)): |
ab03c7a52cf2
Minor changes to import so that we can successfully import Ingo's
mpm@selenic.com
parents:
68
diff
changeset
|
175 |
raise "patch failed!" |
49 | 176 |
repo.commit(repo.current, files, text) |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
177 |
|
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
178 |
elif cmd == "status": |
33 | 179 |
(c, a, d) = repo.diffdir(repo.root, repo.current) |
83 | 180 |
for f in c: ui.status("C %s\n" % f) |
181 |
for f in a: ui.status("? %s\n" % f) |
|
182 |
for f in d: ui.status("R %s\n" % f) |
|
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
183 |
|
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
184 |
elif cmd == "diff": |
34 | 185 |
revs = [] |
31
642058291e74
diffdir tidy in preparation for arg handling
mpm@selenic.com
parents:
29
diff
changeset
|
186 |
|
33 | 187 |
if args: |
38 | 188 |
doptions = {} |
33 | 189 |
opts = [('r', 'revision', [], 'revision')] |
190 |
args = fancyopts.fancyopts(args, opts, doptions, |
|
191 |
'hg diff [options] [files]') |
|
67 | 192 |
revs = map(lambda x: repo.lookup(x), doptions['revision']) |
33 | 193 |
|
194 |
if len(revs) > 2: |
|
83 | 195 |
self.ui.warn("too many revisions to diff\n") |
33 | 196 |
sys.exit(1) |
64 | 197 |
|
198 |
if os.getcwd() != repo.root: |
|
199 |
relpath = os.getcwd()[len(repo.root) + 1: ] |
|
200 |
if not args: args = [ relpath ] |
|
201 |
else: args = [ os.path.join(relpath, x) for x in args ] |
|
202 |
||
203 |
diff(args, *revs) |
|
33 | 204 |
|
79 | 205 |
elif cmd == "annotate": |
206 |
aoptions = {} |
|
207 |
opts = [('r', 'revision', '', 'revision')] |
|
208 |
args = fancyopts.fancyopts(args, opts, aoptions, |
|
209 |
'hg annotate [-r id] [files]') |
|
210 |
if args: |
|
211 |
node = repo.current |
|
212 |
if aoptions['revision']: |
|
213 |
node = repo.changelog.lookup(aoptions['revision']) |
|
214 |
change = repo.changelog.read(node) |
|
215 |
mmap = repo.manifest.read(change[0]) |
|
216 |
for f in args: |
|
217 |
for n, l in repo.file(f).annotate(mmap[f]): |
|
80 | 218 |
sys.stdout.write("% 6s:%s"%(n, l)) |
219 |
||
220 |
elif cmd == "blame": |
|
221 |
aoptions = {} |
|
222 |
opts = [('r', 'revision', '', 'revision')] |
|
223 |
args = fancyopts.fancyopts(args, opts, aoptions, |
|
224 |
'hg blame [-r id] [files]') |
|
225 |
if args: |
|
226 |
bcache = {} |
|
227 |
node = repo.current |
|
228 |
if aoptions['revision']: |
|
229 |
node = repo.changelog.lookup(aoptions['revision']) |
|
230 |
change = repo.changelog.read(node) |
|
231 |
mmap = repo.manifest.read(change[0]) |
|
232 |
for f in args: |
|
233 |
for n, l in repo.file(f).annotate(mmap[f]): |
|
234 |
try: |
|
235 |
name = bcache[n] |
|
236 |
except KeyError: |
|
237 |
cl = repo.changelog.read(repo.changelog.node(n)) |
|
238 |
name = cl[1] |
|
239 |
f = name.find('@') |
|
240 |
if f >= 0: |
|
241 |
name = name[:f] |
|
242 |
bcache[n] = name |
|
243 |
sys.stdout.write("% 10s:%s"%(name, l)) |
|
79 | 244 |
|
34 | 245 |
elif cmd == "export": |
67 | 246 |
node = repo.lookup(args[0]) |
68 | 247 |
prev, other = repo.changelog.parents(node) |
248 |
change = repo.changelog.read(node) |
|
249 |
print "# HG changeset patch" |
|
250 |
print "# User %s" % change[1] |
|
251 |
print "# Node ID %s" % hg.hex(node) |
|
252 |
print "# Parent %s" % hg.hex(prev) |
|
253 |
||
254 |
if other != hg.nullid: |
|
255 |
print "# Parent %s" % hg.hex(other) |
|
256 |
print change[4] |
|
257 |
||
34 | 258 |
diff(None, prev, node) |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
259 |
|
46 | 260 |
elif cmd == "debugchangegroup": |
67 | 261 |
newer = repo.newer(map(repo.lookup, args)) |
62 | 262 |
for chunk in repo.changegroup(newer): |
263 |
sys.stdout.write(chunk) |
|
46 | 264 |
|
265 |
elif cmd == "debugaddchangegroup": |
|
266 |
data = sys.stdin.read() |
|
267 |
repo.addchangegroup(data) |
|
268 |
||
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
269 |
elif cmd == "addremove": |
29 | 270 |
(c, a, d) = repo.diffdir(repo.root, repo.current) |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
271 |
repo.add(a) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
272 |
repo.remove(d) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
273 |
|
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
274 |
elif cmd == "history": |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
275 |
for i in range(repo.changelog.count()): |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
276 |
n = repo.changelog.node(i) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
277 |
changes = repo.changelog.read(n) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
278 |
(p1, p2) = repo.changelog.parents(n) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
279 |
(h, h1, h2) = map(hg.hex, (n, p1, p2)) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
280 |
(i1, i2) = map(repo.changelog.rev, (p1, p2)) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
281 |
print "rev: %4d:%s" % (i, h) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
282 |
print "parents: %4d:%s" % (i1, h1) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
283 |
if i2: print " %4d:%s" % (i2, h2) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
284 |
print "manifest: %4d:%s" % (repo.manifest.rev(changes[0]), |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
285 |
hg.hex(changes[0])) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
286 |
print "user:", changes[1] |
21 | 287 |
print "date:", time.asctime( |
288 |
time.localtime(float(changes[2].split(' ')[0]))) |
|
11 | 289 |
print "files:", " ".join(changes[3]) |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
290 |
print "description:" |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
291 |
print changes[4] |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
292 |
|
89 | 293 |
elif cmd == "tip": |
294 |
n = repo.changelog.tip() |
|
295 |
t = repo.changelog.rev(n) |
|
296 |
ui.status("%d:%s\n" % (t, hg.hex(n))) |
|
297 |
||
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
298 |
elif cmd == "log": |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
299 |
if args: |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
300 |
r = repo.file(args[0]) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
301 |
for i in range(r.count()): |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
302 |
n = r.node(i) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
303 |
(p1, p2) = r.parents(n) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
304 |
(h, h1, h2) = map(hg.hex, (n, p1, p2)) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
305 |
(i1, i2) = map(r.rev, (p1, p2)) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
306 |
cr = r.linkrev(n) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
307 |
cn = hg.hex(repo.changelog.node(cr)) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
308 |
print "rev: %4d:%s" % (i, h) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
309 |
print "changeset: %4d:%s" % (cr, cn) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
310 |
print "parents: %4d:%s" % (i1, h1) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
311 |
if i2: print " %4d:%s" % (i2, h2) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
312 |
else: |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
313 |
print "missing filename" |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
314 |
|
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
315 |
elif cmd == "dump": |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
316 |
if args: |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
317 |
r = repo.file(args[0]) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
318 |
n = r.tip() |
39 | 319 |
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
|
320 |
sys.stdout.write(r.read(n)) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
321 |
else: |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
322 |
print "missing filename" |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
323 |
|
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
324 |
elif cmd == "dumpmanifest": |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
325 |
n = repo.manifest.tip() |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
326 |
if len(args) > 0: |
39 | 327 |
n = repo.manifest.lookup(args[0]) |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
328 |
m = repo.manifest.read(n) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
329 |
files = m.keys() |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
330 |
files.sort() |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
331 |
|
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
332 |
for f in files: |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
333 |
print hg.hex(m[f]), f |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
334 |
|
24 | 335 |
elif cmd == "debughash": |
336 |
f = repo.file(args[0]) |
|
337 |
print f.encodepath(args[0]) |
|
338 |
||
339 |
elif cmd == "debugindex": |
|
91 | 340 |
if ".hg" not in args[0]: |
341 |
args[0] = ".hg/data/" + repo.file(args[0]).encodepath(args[0]) + "i" |
|
342 |
||
24 | 343 |
r = hg.revlog(open, args[0], "") |
70 | 344 |
print " rev offset length base linkrev"+\ |
24 | 345 |
" p1 p2 nodeid" |
346 |
for i in range(r.count()): |
|
347 |
e = r.index[i] |
|
70 | 348 |
print "% 6d % 9d % 7d % 6d % 7d %s.. %s.. %s.." % ( |
24 | 349 |
i, e[0], e[1], e[2], e[3], |
350 |
hg.hex(e[4][:5]), hg.hex(e[5][:5]), hg.hex(e[6][:5])) |
|
351 |
||
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
352 |
elif cmd == "merge": |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
353 |
if args: |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
354 |
other = hg.repository(ui, args[0]) |
88 | 355 |
ui.status("requesting changegroup\n") |
62 | 356 |
cg = repo.getchangegroup(other) |
357 |
repo.addchangegroup(cg) |
|
358 |
else: |
|
359 |
print "missing source repository" |
|
360 |
||
67 | 361 |
elif cmd == "tags": |
362 |
repo.lookup(0) # prime the cache |
|
363 |
i = repo.tags.items() |
|
364 |
i.sort() |
|
365 |
for k, n in i: |
|
366 |
try: |
|
367 |
r = repo.changelog.rev(n) |
|
368 |
except KeyError: |
|
369 |
r = "?" |
|
370 |
print "%-30s %5d:%s" % (k, repo.changelog.rev(n), hg.hex(n)) |
|
371 |
||
62 | 372 |
elif cmd == "debugoldmerge": |
373 |
if args: |
|
374 |
other = hg.repository(ui, args[0]) |
|
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
375 |
repo.merge(other) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
376 |
else: |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
377 |
print "missing source repository" |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
378 |
|
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
379 |
elif cmd == "verify": |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
380 |
filelinkrevs = {} |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
381 |
filenodes = {} |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
382 |
manifestchangeset = {} |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
383 |
changesets = revisions = files = 0 |
87 | 384 |
errors = 0 |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
385 |
|
87 | 386 |
ui.status("checking changesets\n") |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
387 |
for i in range(repo.changelog.count()): |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
388 |
changesets += 1 |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
389 |
n = repo.changelog.node(i) |
87 | 390 |
for p in repo.changelog.parents(n): |
391 |
if p not in repo.changelog.nodemap: |
|
392 |
ui.warn("changeset %s has unknown parent %s\n" % |
|
393 |
(hg.short(n), hg.short(p))) |
|
394 |
errors += 1 |
|
395 |
try: |
|
396 |
changes = repo.changelog.read(n) |
|
397 |
except Error, inst: |
|
398 |
ui.warn("unpacking changeset %s: %s\n" % (short(n), inst)) |
|
399 |
errors += 1 |
|
400 |
||
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
401 |
manifestchangeset[changes[0]] = n |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
402 |
for f in changes[3]: |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
403 |
revisions += 1 |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
404 |
filelinkrevs.setdefault(f, []).append(i) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
405 |
|
87 | 406 |
ui.status("checking manifests\n") |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
407 |
for i in range(repo.manifest.count()): |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
408 |
n = repo.manifest.node(i) |
87 | 409 |
for p in repo.manifest.parents(n): |
410 |
if p not in repo.manifest.nodemap: |
|
411 |
ui.warn("manifest %s has unknown parent %s\n" % |
|
412 |
(hg.short(n), hg.short(p))) |
|
413 |
errors += 1 |
|
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
414 |
ca = repo.changelog.node(repo.manifest.linkrev(n)) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
415 |
cc = manifestchangeset[n] |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
416 |
if ca != cc: |
87 | 417 |
ui.warn("manifest %s points to %s, not %s\n" % |
418 |
(hg.hex(n), hg.hex(ca), hg.hex(cc))) |
|
419 |
errors += 1 |
|
420 |
||
421 |
try: |
|
422 |
m = repo.manifest.read(n) |
|
423 |
except Error, inst: |
|
424 |
ui.warn("unpacking manifest %s: %s\n" % (hg.short(n), inst)) |
|
425 |
errors += 1 |
|
426 |
||
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
427 |
for f, fn in m.items(): |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
428 |
filenodes.setdefault(f, {})[fn] = 1 |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
429 |
|
87 | 430 |
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
|
431 |
for f in filenodes: |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
432 |
if f not in filelinkrevs: |
87 | 433 |
ui.warn("file %s in manifest but not in changesets\n" % f) |
434 |
errors += 1 |
|
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
435 |
|
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
436 |
for f in filelinkrevs: |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
437 |
if f not in filenodes: |
87 | 438 |
ui.warn("file %s in changeset but not in manifest" % f) |
439 |
errors += 1 |
|
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
440 |
|
87 | 441 |
ui.status("checking files\n") |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
442 |
for f in filenodes: |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
443 |
files += 1 |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
444 |
fl = repo.file(f) |
87 | 445 |
nodes = { hg.nullid: 1 } |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
446 |
for i in range(fl.count()): |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
447 |
n = fl.node(i) |
17
ffe6a5ca1a89
Make hg verify do more thorough cross-checking.
mpm@selenic.com
parents:
16
diff
changeset
|
448 |
|
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
449 |
if n not in filenodes[f]: |
87 | 450 |
ui.warn("%s:%s not in manifests\n" % (f, hg.short(n))) |
451 |
errors += 1 |
|
17
ffe6a5ca1a89
Make hg verify do more thorough cross-checking.
mpm@selenic.com
parents:
16
diff
changeset
|
452 |
else: |
ffe6a5ca1a89
Make hg verify do more thorough cross-checking.
mpm@selenic.com
parents:
16
diff
changeset
|
453 |
del filenodes[f][n] |
ffe6a5ca1a89
Make hg verify do more thorough cross-checking.
mpm@selenic.com
parents:
16
diff
changeset
|
454 |
|
ffe6a5ca1a89
Make hg verify do more thorough cross-checking.
mpm@selenic.com
parents:
16
diff
changeset
|
455 |
flr = fl.linkrev(n) |
ffe6a5ca1a89
Make hg verify do more thorough cross-checking.
mpm@selenic.com
parents:
16
diff
changeset
|
456 |
if flr not in filelinkrevs[f]: |
87 | 457 |
ui.warn("%s:%s points to unexpected changeset rev %d\n" |
458 |
% (f, hg.short(n), fl.linkrev(n))) |
|
459 |
errors += 1 |
|
17
ffe6a5ca1a89
Make hg verify do more thorough cross-checking.
mpm@selenic.com
parents:
16
diff
changeset
|
460 |
else: |
ffe6a5ca1a89
Make hg verify do more thorough cross-checking.
mpm@selenic.com
parents:
16
diff
changeset
|
461 |
filelinkrevs[f].remove(flr) |
ffe6a5ca1a89
Make hg verify do more thorough cross-checking.
mpm@selenic.com
parents:
16
diff
changeset
|
462 |
|
ffe6a5ca1a89
Make hg verify do more thorough cross-checking.
mpm@selenic.com
parents:
16
diff
changeset
|
463 |
# verify contents |
87 | 464 |
try: |
465 |
t = fl.read(n) |
|
466 |
except Error, inst: |
|
467 |
ui.warn("unpacking file %s %s: %s\n" % (f, short(n), inst)) |
|
468 |
errors += 1 |
|
469 |
||
17
ffe6a5ca1a89
Make hg verify do more thorough cross-checking.
mpm@selenic.com
parents:
16
diff
changeset
|
470 |
# verify parents |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
471 |
(p1, p2) = fl.parents(n) |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
472 |
if p1 not in nodes: |
87 | 473 |
ui.warn("file %s:%s unknown parent 1 %s" % |
474 |
(f, hg.short(n), hg.short(p1))) |
|
475 |
errors += 1 |
|
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
476 |
if p2 not in nodes: |
87 | 477 |
ui.warn("file %s:%s unknown parent 2 %s" % |
478 |
(f, hg.short(n), hg.short(p1))) |
|
479 |
errors += 1 |
|
17
ffe6a5ca1a89
Make hg verify do more thorough cross-checking.
mpm@selenic.com
parents:
16
diff
changeset
|
480 |
nodes[n] = 1 |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
481 |
|
17
ffe6a5ca1a89
Make hg verify do more thorough cross-checking.
mpm@selenic.com
parents:
16
diff
changeset
|
482 |
# cross-check |
ffe6a5ca1a89
Make hg verify do more thorough cross-checking.
mpm@selenic.com
parents:
16
diff
changeset
|
483 |
for flr in filelinkrevs[f]: |
87 | 484 |
ui.warn("changeset rev %d not in %s\n" % (flr, f)) |
485 |
errors += 1 |
|
17
ffe6a5ca1a89
Make hg verify do more thorough cross-checking.
mpm@selenic.com
parents:
16
diff
changeset
|
486 |
|
ffe6a5ca1a89
Make hg verify do more thorough cross-checking.
mpm@selenic.com
parents:
16
diff
changeset
|
487 |
for node in filenodes[f]: |
87 | 488 |
ui.warn("node %s in manifests not in %s\n" % (hg.hex(n), f)) |
489 |
errors += 1 |
|
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
490 |
|
87 | 491 |
ui.status("%d files, %d changesets, %d total revisions\n" % |
492 |
(files, changesets, revisions)) |
|
493 |
||
494 |
if errors: |
|
495 |
ui.warn("%d integrity errors encountered!\n") |
|
496 |
sys.exit(1) |
|
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
497 |
|
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
498 |
else: |
18
2fd3e1e3783f
Give a friendlier message when repo isn't found
mpm@selenic.com
parents:
17
diff
changeset
|
499 |
print "unknown command\n" |
2fd3e1e3783f
Give a friendlier message when repo isn't found
mpm@selenic.com
parents:
17
diff
changeset
|
500 |
help() |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
501 |
sys.exit(1) |