##// END OF EJS Templates
Backed out changeset c2a21fe60994...
Matt Mackall -
r5764:8a5d8fb5 default
parent child Browse files
Show More
@@ -1,2994 +1,2994 b''
1 # commands.py - command processing for mercurial
1 # commands.py - command processing for mercurial
2 #
2 #
3 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
3 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
4 #
4 #
5 # This software may be used and distributed according to the terms
5 # This software may be used and distributed according to the terms
6 # of the GNU General Public License, incorporated herein by reference.
6 # of the GNU General Public License, incorporated herein by reference.
7
7
8 from node import *
8 from node import *
9 from i18n import _
9 from i18n import _
10 import os, re, sys, urllib
10 import os, re, sys, urllib
11 import hg, util, revlog, bundlerepo, extensions
11 import hg, util, revlog, bundlerepo, extensions
12 import difflib, patch, time, help, mdiff, tempfile
12 import difflib, patch, time, help, mdiff, tempfile
13 import errno, version, socket
13 import errno, version, socket
14 import archival, changegroup, cmdutil, hgweb.server, sshserver
14 import archival, changegroup, cmdutil, hgweb.server, sshserver
15
15
16 # Commands start here, listed alphabetically
16 # Commands start here, listed alphabetically
17
17
18 def add(ui, repo, *pats, **opts):
18 def add(ui, repo, *pats, **opts):
19 """add the specified files on the next commit
19 """add the specified files on the next commit
20
20
21 Schedule files to be version controlled and added to the repository.
21 Schedule files to be version controlled and added to the repository.
22
22
23 The files will be added to the repository at the next commit. To
23 The files will be added to the repository at the next commit. To
24 undo an add before that, see hg revert.
24 undo an add before that, see hg revert.
25
25
26 If no names are given, add all files in the repository.
26 If no names are given, add all files in the repository.
27 """
27 """
28
28
29 rejected = None
29 rejected = None
30 exacts = {}
30 exacts = {}
31 names = []
31 names = []
32 for src, abs, rel, exact in cmdutil.walk(repo, pats, opts,
32 for src, abs, rel, exact in cmdutil.walk(repo, pats, opts,
33 badmatch=util.always):
33 badmatch=util.always):
34 if exact:
34 if exact:
35 if ui.verbose:
35 if ui.verbose:
36 ui.status(_('adding %s\n') % rel)
36 ui.status(_('adding %s\n') % rel)
37 names.append(abs)
37 names.append(abs)
38 exacts[abs] = 1
38 exacts[abs] = 1
39 elif abs not in repo.dirstate:
39 elif abs not in repo.dirstate:
40 ui.status(_('adding %s\n') % rel)
40 ui.status(_('adding %s\n') % rel)
41 names.append(abs)
41 names.append(abs)
42 if not opts.get('dry_run'):
42 if not opts.get('dry_run'):
43 rejected = repo.add(names)
43 rejected = repo.add(names)
44 rejected = [p for p in rejected if p in exacts]
44 rejected = [p for p in rejected if p in exacts]
45 return rejected and 1 or 0
45 return rejected and 1 or 0
46
46
47 def addremove(ui, repo, *pats, **opts):
47 def addremove(ui, repo, *pats, **opts):
48 """add all new files, delete all missing files
48 """add all new files, delete all missing files
49
49
50 Add all new files and remove all missing files from the repository.
50 Add all new files and remove all missing files from the repository.
51
51
52 New files are ignored if they match any of the patterns in .hgignore. As
52 New files are ignored if they match any of the patterns in .hgignore. As
53 with add, these changes take effect at the next commit.
53 with add, these changes take effect at the next commit.
54
54
55 Use the -s option to detect renamed files. With a parameter > 0,
55 Use the -s option to detect renamed files. With a parameter > 0,
56 this compares every removed file with every added file and records
56 this compares every removed file with every added file and records
57 those similar enough as renames. This option takes a percentage
57 those similar enough as renames. This option takes a percentage
58 between 0 (disabled) and 100 (files must be identical) as its
58 between 0 (disabled) and 100 (files must be identical) as its
59 parameter. Detecting renamed files this way can be expensive.
59 parameter. Detecting renamed files this way can be expensive.
60 """
60 """
61 try:
61 try:
62 sim = float(opts.get('similarity') or 0)
62 sim = float(opts.get('similarity') or 0)
63 except ValueError:
63 except ValueError:
64 raise util.Abort(_('similarity must be a number'))
64 raise util.Abort(_('similarity must be a number'))
65 if sim < 0 or sim > 100:
65 if sim < 0 or sim > 100:
66 raise util.Abort(_('similarity must be between 0 and 100'))
66 raise util.Abort(_('similarity must be between 0 and 100'))
67 return cmdutil.addremove(repo, pats, opts, similarity=sim/100.)
67 return cmdutil.addremove(repo, pats, opts, similarity=sim/100.)
68
68
69 def annotate(ui, repo, *pats, **opts):
69 def annotate(ui, repo, *pats, **opts):
70 """show changeset information per file line
70 """show changeset information per file line
71
71
72 List changes in files, showing the revision id responsible for each line
72 List changes in files, showing the revision id responsible for each line
73
73
74 This command is useful to discover who did a change or when a change took
74 This command is useful to discover who did a change or when a change took
75 place.
75 place.
76
76
77 Without the -a option, annotate will avoid processing files it
77 Without the -a option, annotate will avoid processing files it
78 detects as binary. With -a, annotate will generate an annotation
78 detects as binary. With -a, annotate will generate an annotation
79 anyway, probably with undesirable results.
79 anyway, probably with undesirable results.
80 """
80 """
81 getdate = util.cachefunc(lambda x: util.datestr(x[0].date()))
81 getdate = util.cachefunc(lambda x: util.datestr(x[0].date()))
82
82
83 if not pats:
83 if not pats:
84 raise util.Abort(_('at least one file name or pattern required'))
84 raise util.Abort(_('at least one file name or pattern required'))
85
85
86 opmap = [('user', lambda x: ui.shortuser(x[0].user())),
86 opmap = [('user', lambda x: ui.shortuser(x[0].user())),
87 ('number', lambda x: str(x[0].rev())),
87 ('number', lambda x: str(x[0].rev())),
88 ('changeset', lambda x: short(x[0].node())),
88 ('changeset', lambda x: short(x[0].node())),
89 ('date', getdate),
89 ('date', getdate),
90 ('follow', lambda x: x[0].path()),
90 ('follow', lambda x: x[0].path()),
91 ]
91 ]
92
92
93 if (not opts['user'] and not opts['changeset'] and not opts['date']
93 if (not opts['user'] and not opts['changeset'] and not opts['date']
94 and not opts['follow']):
94 and not opts['follow']):
95 opts['number'] = 1
95 opts['number'] = 1
96
96
97 linenumber = opts.get('line_number') is not None
97 linenumber = opts.get('line_number') is not None
98 if (linenumber and (not opts['changeset']) and (not opts['number'])):
98 if (linenumber and (not opts['changeset']) and (not opts['number'])):
99 raise util.Abort(_('at least one of -n/-c is required for -l'))
99 raise util.Abort(_('at least one of -n/-c is required for -l'))
100
100
101 funcmap = [func for op, func in opmap if opts.get(op)]
101 funcmap = [func for op, func in opmap if opts.get(op)]
102 if linenumber:
102 if linenumber:
103 lastfunc = funcmap[-1]
103 lastfunc = funcmap[-1]
104 funcmap[-1] = lambda x: "%s:%s" % (lastfunc(x), x[1])
104 funcmap[-1] = lambda x: "%s:%s" % (lastfunc(x), x[1])
105
105
106 ctx = repo.changectx(opts['rev'])
106 ctx = repo.changectx(opts['rev'])
107
107
108 for src, abs, rel, exact in cmdutil.walk(repo, pats, opts,
108 for src, abs, rel, exact in cmdutil.walk(repo, pats, opts,
109 node=ctx.node()):
109 node=ctx.node()):
110 fctx = ctx.filectx(abs)
110 fctx = ctx.filectx(abs)
111 if not opts['text'] and util.binary(fctx.data()):
111 if not opts['text'] and util.binary(fctx.data()):
112 ui.write(_("%s: binary file\n") % ((pats and rel) or abs))
112 ui.write(_("%s: binary file\n") % ((pats and rel) or abs))
113 continue
113 continue
114
114
115 lines = fctx.annotate(follow=opts.get('follow'),
115 lines = fctx.annotate(follow=opts.get('follow'),
116 linenumber=linenumber)
116 linenumber=linenumber)
117 pieces = []
117 pieces = []
118
118
119 for f in funcmap:
119 for f in funcmap:
120 l = [f(n) for n, dummy in lines]
120 l = [f(n) for n, dummy in lines]
121 if l:
121 if l:
122 m = max(map(len, l))
122 m = max(map(len, l))
123 pieces.append(["%*s" % (m, x) for x in l])
123 pieces.append(["%*s" % (m, x) for x in l])
124
124
125 if pieces:
125 if pieces:
126 for p, l in zip(zip(*pieces), lines):
126 for p, l in zip(zip(*pieces), lines):
127 ui.write("%s: %s" % (" ".join(p), l[1]))
127 ui.write("%s: %s" % (" ".join(p), l[1]))
128
128
129 def archive(ui, repo, dest, **opts):
129 def archive(ui, repo, dest, **opts):
130 '''create unversioned archive of a repository revision
130 '''create unversioned archive of a repository revision
131
131
132 By default, the revision used is the parent of the working
132 By default, the revision used is the parent of the working
133 directory; use "-r" to specify a different revision.
133 directory; use "-r" to specify a different revision.
134
134
135 To specify the type of archive to create, use "-t". Valid
135 To specify the type of archive to create, use "-t". Valid
136 types are:
136 types are:
137
137
138 "files" (default): a directory full of files
138 "files" (default): a directory full of files
139 "tar": tar archive, uncompressed
139 "tar": tar archive, uncompressed
140 "tbz2": tar archive, compressed using bzip2
140 "tbz2": tar archive, compressed using bzip2
141 "tgz": tar archive, compressed using gzip
141 "tgz": tar archive, compressed using gzip
142 "uzip": zip archive, uncompressed
142 "uzip": zip archive, uncompressed
143 "zip": zip archive, compressed using deflate
143 "zip": zip archive, compressed using deflate
144
144
145 The exact name of the destination archive or directory is given
145 The exact name of the destination archive or directory is given
146 using a format string; see "hg help export" for details.
146 using a format string; see "hg help export" for details.
147
147
148 Each member added to an archive file has a directory prefix
148 Each member added to an archive file has a directory prefix
149 prepended. Use "-p" to specify a format string for the prefix.
149 prepended. Use "-p" to specify a format string for the prefix.
150 The default is the basename of the archive, with suffixes removed.
150 The default is the basename of the archive, with suffixes removed.
151 '''
151 '''
152
152
153 ctx = repo.changectx(opts['rev'])
153 ctx = repo.changectx(opts['rev'])
154 if not ctx:
154 if not ctx:
155 raise util.Abort(_('repository has no revisions'))
155 raise util.Abort(_('repository has no revisions'))
156 node = ctx.node()
156 node = ctx.node()
157 dest = cmdutil.make_filename(repo, dest, node)
157 dest = cmdutil.make_filename(repo, dest, node)
158 if os.path.realpath(dest) == repo.root:
158 if os.path.realpath(dest) == repo.root:
159 raise util.Abort(_('repository root cannot be destination'))
159 raise util.Abort(_('repository root cannot be destination'))
160 dummy, matchfn, dummy = cmdutil.matchpats(repo, [], opts)
160 dummy, matchfn, dummy = cmdutil.matchpats(repo, [], opts)
161 kind = opts.get('type') or 'files'
161 kind = opts.get('type') or 'files'
162 prefix = opts['prefix']
162 prefix = opts['prefix']
163 if dest == '-':
163 if dest == '-':
164 if kind == 'files':
164 if kind == 'files':
165 raise util.Abort(_('cannot archive plain files to stdout'))
165 raise util.Abort(_('cannot archive plain files to stdout'))
166 dest = sys.stdout
166 dest = sys.stdout
167 if not prefix: prefix = os.path.basename(repo.root) + '-%h'
167 if not prefix: prefix = os.path.basename(repo.root) + '-%h'
168 prefix = cmdutil.make_filename(repo, prefix, node)
168 prefix = cmdutil.make_filename(repo, prefix, node)
169 archival.archive(repo, dest, node, kind, not opts['no_decode'],
169 archival.archive(repo, dest, node, kind, not opts['no_decode'],
170 matchfn, prefix)
170 matchfn, prefix)
171
171
172 def backout(ui, repo, node=None, rev=None, **opts):
172 def backout(ui, repo, node=None, rev=None, **opts):
173 '''reverse effect of earlier changeset
173 '''reverse effect of earlier changeset
174
174
175 Commit the backed out changes as a new changeset. The new
175 Commit the backed out changes as a new changeset. The new
176 changeset is a child of the backed out changeset.
176 changeset is a child of the backed out changeset.
177
177
178 If you back out a changeset other than the tip, a new head is
178 If you back out a changeset other than the tip, a new head is
179 created. This head is the parent of the working directory. If
179 created. This head is the parent of the working directory. If
180 you back out an old changeset, your working directory will appear
180 you back out an old changeset, your working directory will appear
181 old after the backout. You should merge the backout changeset
181 old after the backout. You should merge the backout changeset
182 with another head.
182 with another head.
183
183
184 The --merge option remembers the parent of the working directory
184 The --merge option remembers the parent of the working directory
185 before starting the backout, then merges the new head with that
185 before starting the backout, then merges the new head with that
186 changeset afterwards. This saves you from doing the merge by
186 changeset afterwards. This saves you from doing the merge by
187 hand. The result of this merge is not committed, as for a normal
187 hand. The result of this merge is not committed, as for a normal
188 merge.'''
188 merge.'''
189 if rev and node:
189 if rev and node:
190 raise util.Abort(_("please specify just one revision"))
190 raise util.Abort(_("please specify just one revision"))
191
191
192 if not rev:
192 if not rev:
193 rev = node
193 rev = node
194
194
195 if not rev:
195 if not rev:
196 raise util.Abort(_("please specify a revision to backout"))
196 raise util.Abort(_("please specify a revision to backout"))
197
197
198 cmdutil.bail_if_changed(repo)
198 cmdutil.bail_if_changed(repo)
199 node = repo.lookup(rev)
199 node = repo.lookup(rev)
200
200
201 op1, op2 = repo.dirstate.parents()
201 op1, op2 = repo.dirstate.parents()
202 a = repo.changelog.ancestor(op1, node)
202 a = repo.changelog.ancestor(op1, node)
203 if a != node:
203 if a != node:
204 raise util.Abort(_('cannot back out change on a different branch'))
204 raise util.Abort(_('cannot back out change on a different branch'))
205
205
206 p1, p2 = repo.changelog.parents(node)
206 p1, p2 = repo.changelog.parents(node)
207 if p1 == nullid:
207 if p1 == nullid:
208 raise util.Abort(_('cannot back out a change with no parents'))
208 raise util.Abort(_('cannot back out a change with no parents'))
209 if p2 != nullid:
209 if p2 != nullid:
210 if not opts['parent']:
210 if not opts['parent']:
211 raise util.Abort(_('cannot back out a merge changeset without '
211 raise util.Abort(_('cannot back out a merge changeset without '
212 '--parent'))
212 '--parent'))
213 p = repo.lookup(opts['parent'])
213 p = repo.lookup(opts['parent'])
214 if p not in (p1, p2):
214 if p not in (p1, p2):
215 raise util.Abort(_('%s is not a parent of %s') %
215 raise util.Abort(_('%s is not a parent of %s') %
216 (short(p), short(node)))
216 (short(p), short(node)))
217 parent = p
217 parent = p
218 else:
218 else:
219 if opts['parent']:
219 if opts['parent']:
220 raise util.Abort(_('cannot use --parent on non-merge changeset'))
220 raise util.Abort(_('cannot use --parent on non-merge changeset'))
221 parent = p1
221 parent = p1
222
222
223 hg.clean(repo, node, show_stats=False)
223 hg.clean(repo, node, show_stats=False)
224 revert_opts = opts.copy()
224 revert_opts = opts.copy()
225 revert_opts['date'] = None
225 revert_opts['date'] = None
226 revert_opts['all'] = True
226 revert_opts['all'] = True
227 revert_opts['rev'] = hex(parent)
227 revert_opts['rev'] = hex(parent)
228 revert(ui, repo, **revert_opts)
228 revert(ui, repo, **revert_opts)
229 commit_opts = opts.copy()
229 commit_opts = opts.copy()
230 commit_opts['addremove'] = False
230 commit_opts['addremove'] = False
231 if not commit_opts['message'] and not commit_opts['logfile']:
231 if not commit_opts['message'] and not commit_opts['logfile']:
232 commit_opts['message'] = _("Backed out changeset %s") % (short(node))
232 commit_opts['message'] = _("Backed out changeset %s") % (short(node))
233 commit_opts['force_editor'] = True
233 commit_opts['force_editor'] = True
234 commit(ui, repo, **commit_opts)
234 commit(ui, repo, **commit_opts)
235 def nice(node):
235 def nice(node):
236 return '%d:%s' % (repo.changelog.rev(node), short(node))
236 return '%d:%s' % (repo.changelog.rev(node), short(node))
237 ui.status(_('changeset %s backs out changeset %s\n') %
237 ui.status(_('changeset %s backs out changeset %s\n') %
238 (nice(repo.changelog.tip()), nice(node)))
238 (nice(repo.changelog.tip()), nice(node)))
239 if op1 != node:
239 if op1 != node:
240 if opts['merge']:
240 if opts['merge']:
241 ui.status(_('merging with changeset %s\n') % nice(op1))
241 ui.status(_('merging with changeset %s\n') % nice(op1))
242 hg.merge(repo, hex(op1))
242 hg.merge(repo, hex(op1))
243 else:
243 else:
244 ui.status(_('the backout changeset is a new head - '
244 ui.status(_('the backout changeset is a new head - '
245 'do not forget to merge\n'))
245 'do not forget to merge\n'))
246 ui.status(_('(use "backout --merge" '
246 ui.status(_('(use "backout --merge" '
247 'if you want to auto-merge)\n'))
247 'if you want to auto-merge)\n'))
248
248
249 def branch(ui, repo, label=None, **opts):
249 def branch(ui, repo, label=None, **opts):
250 """set or show the current branch name
250 """set or show the current branch name
251
251
252 With no argument, show the current branch name. With one argument,
252 With no argument, show the current branch name. With one argument,
253 set the working directory branch name (the branch does not exist in
253 set the working directory branch name (the branch does not exist in
254 the repository until the next commit).
254 the repository until the next commit).
255
255
256 Unless --force is specified, branch will not let you set a
256 Unless --force is specified, branch will not let you set a
257 branch name that shadows an existing branch.
257 branch name that shadows an existing branch.
258 """
258 """
259
259
260 if label:
260 if label:
261 if not opts.get('force') and label in repo.branchtags():
261 if not opts.get('force') and label in repo.branchtags():
262 if label not in [p.branch() for p in repo.workingctx().parents()]:
262 if label not in [p.branch() for p in repo.workingctx().parents()]:
263 raise util.Abort(_('a branch of the same name already exists'
263 raise util.Abort(_('a branch of the same name already exists'
264 ' (use --force to override)'))
264 ' (use --force to override)'))
265 repo.dirstate.setbranch(util.fromlocal(label))
265 repo.dirstate.setbranch(util.fromlocal(label))
266 ui.status(_('marked working directory as branch %s\n') % label)
266 ui.status(_('marked working directory as branch %s\n') % label)
267 else:
267 else:
268 ui.write("%s\n" % util.tolocal(repo.dirstate.branch()))
268 ui.write("%s\n" % util.tolocal(repo.dirstate.branch()))
269
269
270 def branches(ui, repo, active=False):
270 def branches(ui, repo, active=False):
271 """list repository named branches
271 """list repository named branches
272
272
273 List the repository's named branches, indicating which ones are
273 List the repository's named branches, indicating which ones are
274 inactive. If active is specified, only show active branches.
274 inactive. If active is specified, only show active branches.
275
275
276 A branch is considered active if it contains unmerged heads.
276 A branch is considered active if it contains unmerged heads.
277 """
277 """
278 b = repo.branchtags()
278 b = repo.branchtags()
279 heads = dict.fromkeys(repo.heads(), 1)
279 heads = dict.fromkeys(repo.heads(), 1)
280 l = [((n in heads), repo.changelog.rev(n), n, t) for t, n in b.items()]
280 l = [((n in heads), repo.changelog.rev(n), n, t) for t, n in b.items()]
281 l.sort()
281 l.sort()
282 l.reverse()
282 l.reverse()
283 for ishead, r, n, t in l:
283 for ishead, r, n, t in l:
284 if active and not ishead:
284 if active and not ishead:
285 # If we're only displaying active branches, abort the loop on
285 # If we're only displaying active branches, abort the loop on
286 # encountering the first inactive head
286 # encountering the first inactive head
287 break
287 break
288 else:
288 else:
289 hexfunc = ui.debugflag and hex or short
289 hexfunc = ui.debugflag and hex or short
290 if ui.quiet:
290 if ui.quiet:
291 ui.write("%s\n" % t)
291 ui.write("%s\n" % t)
292 else:
292 else:
293 spaces = " " * (30 - util.locallen(t))
293 spaces = " " * (30 - util.locallen(t))
294 # The code only gets here if inactive branches are being
294 # The code only gets here if inactive branches are being
295 # displayed or the branch is active.
295 # displayed or the branch is active.
296 isinactive = ((not ishead) and " (inactive)") or ''
296 isinactive = ((not ishead) and " (inactive)") or ''
297 ui.write("%s%s %s:%s%s\n" % (t, spaces, r, hexfunc(n), isinactive))
297 ui.write("%s%s %s:%s%s\n" % (t, spaces, r, hexfunc(n), isinactive))
298
298
299 def bundle(ui, repo, fname, dest=None, **opts):
299 def bundle(ui, repo, fname, dest=None, **opts):
300 """create a changegroup file
300 """create a changegroup file
301
301
302 Generate a compressed changegroup file collecting changesets not
302 Generate a compressed changegroup file collecting changesets not
303 found in the other repository.
303 found in the other repository.
304
304
305 If no destination repository is specified the destination is assumed
305 If no destination repository is specified the destination is assumed
306 to have all the nodes specified by one or more --base parameters.
306 to have all the nodes specified by one or more --base parameters.
307
307
308 The bundle file can then be transferred using conventional means and
308 The bundle file can then be transferred using conventional means and
309 applied to another repository with the unbundle or pull command.
309 applied to another repository with the unbundle or pull command.
310 This is useful when direct push and pull are not available or when
310 This is useful when direct push and pull are not available or when
311 exporting an entire repository is undesirable.
311 exporting an entire repository is undesirable.
312
312
313 Applying bundles preserves all changeset contents including
313 Applying bundles preserves all changeset contents including
314 permissions, copy/rename information, and revision history.
314 permissions, copy/rename information, and revision history.
315 """
315 """
316 revs = opts.get('rev') or None
316 revs = opts.get('rev') or None
317 if revs:
317 if revs:
318 revs = [repo.lookup(rev) for rev in revs]
318 revs = [repo.lookup(rev) for rev in revs]
319 base = opts.get('base')
319 base = opts.get('base')
320 if base:
320 if base:
321 if dest:
321 if dest:
322 raise util.Abort(_("--base is incompatible with specifiying "
322 raise util.Abort(_("--base is incompatible with specifiying "
323 "a destination"))
323 "a destination"))
324 base = [repo.lookup(rev) for rev in base]
324 base = [repo.lookup(rev) for rev in base]
325 # create the right base
325 # create the right base
326 # XXX: nodesbetween / changegroup* should be "fixed" instead
326 # XXX: nodesbetween / changegroup* should be "fixed" instead
327 o = []
327 o = []
328 has = {nullid: None}
328 has = {nullid: None}
329 for n in base:
329 for n in base:
330 has.update(repo.changelog.reachable(n))
330 has.update(repo.changelog.reachable(n))
331 if revs:
331 if revs:
332 visit = list(revs)
332 visit = list(revs)
333 else:
333 else:
334 visit = repo.changelog.heads()
334 visit = repo.changelog.heads()
335 seen = {}
335 seen = {}
336 while visit:
336 while visit:
337 n = visit.pop(0)
337 n = visit.pop(0)
338 parents = [p for p in repo.changelog.parents(n) if p not in has]
338 parents = [p for p in repo.changelog.parents(n) if p not in has]
339 if len(parents) == 0:
339 if len(parents) == 0:
340 o.insert(0, n)
340 o.insert(0, n)
341 else:
341 else:
342 for p in parents:
342 for p in parents:
343 if p not in seen:
343 if p not in seen:
344 seen[p] = 1
344 seen[p] = 1
345 visit.append(p)
345 visit.append(p)
346 else:
346 else:
347 cmdutil.setremoteconfig(ui, opts)
347 cmdutil.setremoteconfig(ui, opts)
348 dest, revs, checkout = hg.parseurl(
348 dest, revs, checkout = hg.parseurl(
349 ui.expandpath(dest or 'default-push', dest or 'default'), revs)
349 ui.expandpath(dest or 'default-push', dest or 'default'), revs)
350 other = hg.repository(ui, dest)
350 other = hg.repository(ui, dest)
351 o = repo.findoutgoing(other, force=opts['force'])
351 o = repo.findoutgoing(other, force=opts['force'])
352
352
353 if revs:
353 if revs:
354 cg = repo.changegroupsubset(o, revs, 'bundle')
354 cg = repo.changegroupsubset(o, revs, 'bundle')
355 else:
355 else:
356 cg = repo.changegroup(o, 'bundle')
356 cg = repo.changegroup(o, 'bundle')
357 changegroup.writebundle(cg, fname, "HG10BZ")
357 changegroup.writebundle(cg, fname, "HG10BZ")
358
358
359 def cat(ui, repo, file1, *pats, **opts):
359 def cat(ui, repo, file1, *pats, **opts):
360 """output the current or given revision of files
360 """output the current or given revision of files
361
361
362 Print the specified files as they were at the given revision.
362 Print the specified files as they were at the given revision.
363 If no revision is given, the parent of the working directory is used,
363 If no revision is given, the parent of the working directory is used,
364 or tip if no revision is checked out.
364 or tip if no revision is checked out.
365
365
366 Output may be to a file, in which case the name of the file is
366 Output may be to a file, in which case the name of the file is
367 given using a format string. The formatting rules are the same as
367 given using a format string. The formatting rules are the same as
368 for the export command, with the following additions:
368 for the export command, with the following additions:
369
369
370 %s basename of file being printed
370 %s basename of file being printed
371 %d dirname of file being printed, or '.' if in repo root
371 %d dirname of file being printed, or '.' if in repo root
372 %p root-relative path name of file being printed
372 %p root-relative path name of file being printed
373 """
373 """
374 ctx = repo.changectx(opts['rev'])
374 ctx = repo.changectx(opts['rev'])
375 err = 1
375 err = 1
376 for src, abs, rel, exact in cmdutil.walk(repo, (file1,) + pats, opts,
376 for src, abs, rel, exact in cmdutil.walk(repo, (file1,) + pats, opts,
377 ctx.node()):
377 ctx.node()):
378 fp = cmdutil.make_file(repo, opts['output'], ctx.node(), pathname=abs)
378 fp = cmdutil.make_file(repo, opts['output'], ctx.node(), pathname=abs)
379 fp.write(ctx.filectx(abs).data())
379 fp.write(ctx.filectx(abs).data())
380 err = 0
380 err = 0
381 return err
381 return err
382
382
383 def clone(ui, source, dest=None, **opts):
383 def clone(ui, source, dest=None, **opts):
384 """make a copy of an existing repository
384 """make a copy of an existing repository
385
385
386 Create a copy of an existing repository in a new directory.
386 Create a copy of an existing repository in a new directory.
387
387
388 If no destination directory name is specified, it defaults to the
388 If no destination directory name is specified, it defaults to the
389 basename of the source.
389 basename of the source.
390
390
391 The location of the source is added to the new repository's
391 The location of the source is added to the new repository's
392 .hg/hgrc file, as the default to be used for future pulls.
392 .hg/hgrc file, as the default to be used for future pulls.
393
393
394 For efficiency, hardlinks are used for cloning whenever the source
394 For efficiency, hardlinks are used for cloning whenever the source
395 and destination are on the same filesystem (note this applies only
395 and destination are on the same filesystem (note this applies only
396 to the repository data, not to the checked out files). Some
396 to the repository data, not to the checked out files). Some
397 filesystems, such as AFS, implement hardlinking incorrectly, but
397 filesystems, such as AFS, implement hardlinking incorrectly, but
398 do not report errors. In these cases, use the --pull option to
398 do not report errors. In these cases, use the --pull option to
399 avoid hardlinking.
399 avoid hardlinking.
400
400
401 You can safely clone repositories and checked out files using full
401 You can safely clone repositories and checked out files using full
402 hardlinks with
402 hardlinks with
403
403
404 $ cp -al REPO REPOCLONE
404 $ cp -al REPO REPOCLONE
405
405
406 which is the fastest way to clone. However, the operation is not
406 which is the fastest way to clone. However, the operation is not
407 atomic (making sure REPO is not modified during the operation is
407 atomic (making sure REPO is not modified during the operation is
408 up to you) and you have to make sure your editor breaks hardlinks
408 up to you) and you have to make sure your editor breaks hardlinks
409 (Emacs and most Linux Kernel tools do so).
409 (Emacs and most Linux Kernel tools do so).
410
410
411 If you use the -r option to clone up to a specific revision, no
411 If you use the -r option to clone up to a specific revision, no
412 subsequent revisions will be present in the cloned repository.
412 subsequent revisions will be present in the cloned repository.
413 This option implies --pull, even on local repositories.
413 This option implies --pull, even on local repositories.
414
414
415 See pull for valid source format details.
415 See pull for valid source format details.
416
416
417 It is possible to specify an ssh:// URL as the destination, but no
417 It is possible to specify an ssh:// URL as the destination, but no
418 .hg/hgrc and working directory will be created on the remote side.
418 .hg/hgrc and working directory will be created on the remote side.
419 Look at the help text for the pull command for important details
419 Look at the help text for the pull command for important details
420 about ssh:// URLs.
420 about ssh:// URLs.
421 """
421 """
422 cmdutil.setremoteconfig(ui, opts)
422 cmdutil.setremoteconfig(ui, opts)
423 hg.clone(ui, source, dest,
423 hg.clone(ui, source, dest,
424 pull=opts['pull'],
424 pull=opts['pull'],
425 stream=opts['uncompressed'],
425 stream=opts['uncompressed'],
426 rev=opts['rev'],
426 rev=opts['rev'],
427 update=not opts['noupdate'])
427 update=not opts['noupdate'])
428
428
429 def commit(ui, repo, *pats, **opts):
429 def commit(ui, repo, *pats, **opts):
430 """commit the specified files or all outstanding changes
430 """commit the specified files or all outstanding changes
431
431
432 Commit changes to the given files into the repository.
432 Commit changes to the given files into the repository.
433
433
434 If a list of files is omitted, all changes reported by "hg status"
434 If a list of files is omitted, all changes reported by "hg status"
435 will be committed.
435 will be committed.
436
436
437 If no commit message is specified, the configured editor is started to
437 If no commit message is specified, the configured editor is started to
438 enter a message.
438 enter a message.
439 """
439 """
440 def commitfunc(ui, repo, files, message, match, opts):
440 def commitfunc(ui, repo, files, message, match, opts):
441 return repo.commit(files, message, opts['user'], opts['date'], match,
441 return repo.commit(files, message, opts['user'], opts['date'], match,
442 force_editor=opts.get('force_editor'))
442 force_editor=opts.get('force_editor'))
443 cmdutil.commit(ui, repo, commitfunc, pats, opts)
443 cmdutil.commit(ui, repo, commitfunc, pats, opts)
444
444
445 def copy(ui, repo, *pats, **opts):
445 def copy(ui, repo, *pats, **opts):
446 """mark files as copied for the next commit
446 """mark files as copied for the next commit
447
447
448 Mark dest as having copies of source files. If dest is a
448 Mark dest as having copies of source files. If dest is a
449 directory, copies are put in that directory. If dest is a file,
449 directory, copies are put in that directory. If dest is a file,
450 there can only be one source.
450 there can only be one source.
451
451
452 By default, this command copies the contents of files as they
452 By default, this command copies the contents of files as they
453 stand in the working directory. If invoked with --after, the
453 stand in the working directory. If invoked with --after, the
454 operation is recorded, but no copying is performed.
454 operation is recorded, but no copying is performed.
455
455
456 This command takes effect in the next commit. To undo a copy
456 This command takes effect in the next commit. To undo a copy
457 before that, see hg revert.
457 before that, see hg revert.
458 """
458 """
459 wlock = repo.wlock(False)
459 wlock = repo.wlock(False)
460 try:
460 try:
461 return cmdutil.copy(ui, repo, pats, opts)
461 return cmdutil.copy(ui, repo, pats, opts)
462 finally:
462 finally:
463 del wlock
463 del wlock
464
464
465 def debugancestor(ui, index, rev1, rev2):
465 def debugancestor(ui, index, rev1, rev2):
466 """find the ancestor revision of two revisions in a given index"""
466 """find the ancestor revision of two revisions in a given index"""
467 r = revlog.revlog(util.opener(os.getcwd(), audit=False), index)
467 r = revlog.revlog(util.opener(os.getcwd(), audit=False), index)
468 a = r.ancestor(r.lookup(rev1), r.lookup(rev2))
468 a = r.ancestor(r.lookup(rev1), r.lookup(rev2))
469 ui.write("%d:%s\n" % (r.rev(a), hex(a)))
469 ui.write("%d:%s\n" % (r.rev(a), hex(a)))
470
470
471 def debugcomplete(ui, cmd='', **opts):
471 def debugcomplete(ui, cmd='', **opts):
472 """returns the completion list associated with the given command"""
472 """returns the completion list associated with the given command"""
473
473
474 if opts['options']:
474 if opts['options']:
475 options = []
475 options = []
476 otables = [globalopts]
476 otables = [globalopts]
477 if cmd:
477 if cmd:
478 aliases, entry = cmdutil.findcmd(ui, cmd, table)
478 aliases, entry = cmdutil.findcmd(ui, cmd, table)
479 otables.append(entry[1])
479 otables.append(entry[1])
480 for t in otables:
480 for t in otables:
481 for o in t:
481 for o in t:
482 if o[0]:
482 if o[0]:
483 options.append('-%s' % o[0])
483 options.append('-%s' % o[0])
484 options.append('--%s' % o[1])
484 options.append('--%s' % o[1])
485 ui.write("%s\n" % "\n".join(options))
485 ui.write("%s\n" % "\n".join(options))
486 return
486 return
487
487
488 clist = cmdutil.findpossible(ui, cmd, table).keys()
488 clist = cmdutil.findpossible(ui, cmd, table).keys()
489 clist.sort()
489 clist.sort()
490 ui.write("%s\n" % "\n".join(clist))
490 ui.write("%s\n" % "\n".join(clist))
491
491
492 def debugfsinfo(ui, path = "."):
492 def debugfsinfo(ui, path = "."):
493 file('.debugfsinfo', 'w').write('')
493 file('.debugfsinfo', 'w').write('')
494 ui.write('exec: %s\n' % (util.checkexec(path) and 'yes' or 'no'))
494 ui.write('exec: %s\n' % (util.checkexec(path) and 'yes' or 'no'))
495 ui.write('symlink: %s\n' % (util.checklink(path) and 'yes' or 'no'))
495 ui.write('symlink: %s\n' % (util.checklink(path) and 'yes' or 'no'))
496 ui.write('case-sensitive: %s\n' % (util.checkfolding('.debugfsinfo')
496 ui.write('case-sensitive: %s\n' % (util.checkfolding('.debugfsinfo')
497 and 'yes' or 'no'))
497 and 'yes' or 'no'))
498 os.unlink('.debugfsinfo')
498 os.unlink('.debugfsinfo')
499
499
500 def debugrebuildstate(ui, repo, rev=""):
500 def debugrebuildstate(ui, repo, rev=""):
501 """rebuild the dirstate as it would look like for the given revision"""
501 """rebuild the dirstate as it would look like for the given revision"""
502 if rev == "":
502 if rev == "":
503 rev = repo.changelog.tip()
503 rev = repo.changelog.tip()
504 ctx = repo.changectx(rev)
504 ctx = repo.changectx(rev)
505 files = ctx.manifest()
505 files = ctx.manifest()
506 wlock = repo.wlock()
506 wlock = repo.wlock()
507 try:
507 try:
508 repo.dirstate.rebuild(rev, files)
508 repo.dirstate.rebuild(rev, files)
509 finally:
509 finally:
510 del wlock
510 del wlock
511
511
512 def debugcheckstate(ui, repo):
512 def debugcheckstate(ui, repo):
513 """validate the correctness of the current dirstate"""
513 """validate the correctness of the current dirstate"""
514 parent1, parent2 = repo.dirstate.parents()
514 parent1, parent2 = repo.dirstate.parents()
515 m1 = repo.changectx(parent1).manifest()
515 m1 = repo.changectx(parent1).manifest()
516 m2 = repo.changectx(parent2).manifest()
516 m2 = repo.changectx(parent2).manifest()
517 errors = 0
517 errors = 0
518 for f in repo.dirstate:
518 for f in repo.dirstate:
519 state = repo.dirstate[f]
519 state = repo.dirstate[f]
520 if state in "nr" and f not in m1:
520 if state in "nr" and f not in m1:
521 ui.warn(_("%s in state %s, but not in manifest1\n") % (f, state))
521 ui.warn(_("%s in state %s, but not in manifest1\n") % (f, state))
522 errors += 1
522 errors += 1
523 if state in "a" and f in m1:
523 if state in "a" and f in m1:
524 ui.warn(_("%s in state %s, but also in manifest1\n") % (f, state))
524 ui.warn(_("%s in state %s, but also in manifest1\n") % (f, state))
525 errors += 1
525 errors += 1
526 if state in "m" and f not in m1 and f not in m2:
526 if state in "m" and f not in m1 and f not in m2:
527 ui.warn(_("%s in state %s, but not in either manifest\n") %
527 ui.warn(_("%s in state %s, but not in either manifest\n") %
528 (f, state))
528 (f, state))
529 errors += 1
529 errors += 1
530 for f in m1:
530 for f in m1:
531 state = repo.dirstate[f]
531 state = repo.dirstate[f]
532 if state not in "nrm":
532 if state not in "nrm":
533 ui.warn(_("%s in manifest1, but listed as state %s") % (f, state))
533 ui.warn(_("%s in manifest1, but listed as state %s") % (f, state))
534 errors += 1
534 errors += 1
535 if errors:
535 if errors:
536 error = _(".hg/dirstate inconsistent with current parent's manifest")
536 error = _(".hg/dirstate inconsistent with current parent's manifest")
537 raise util.Abort(error)
537 raise util.Abort(error)
538
538
539 def showconfig(ui, repo, *values, **opts):
539 def showconfig(ui, repo, *values, **opts):
540 """show combined config settings from all hgrc files
540 """show combined config settings from all hgrc files
541
541
542 With no args, print names and values of all config items.
542 With no args, print names and values of all config items.
543
543
544 With one arg of the form section.name, print just the value of
544 With one arg of the form section.name, print just the value of
545 that config item.
545 that config item.
546
546
547 With multiple args, print names and values of all config items
547 With multiple args, print names and values of all config items
548 with matching section names."""
548 with matching section names."""
549
549
550 untrusted = bool(opts.get('untrusted'))
550 untrusted = bool(opts.get('untrusted'))
551 if values:
551 if values:
552 if len([v for v in values if '.' in v]) > 1:
552 if len([v for v in values if '.' in v]) > 1:
553 raise util.Abort(_('only one config item permitted'))
553 raise util.Abort(_('only one config item permitted'))
554 for section, name, value in ui.walkconfig(untrusted=untrusted):
554 for section, name, value in ui.walkconfig(untrusted=untrusted):
555 sectname = section + '.' + name
555 sectname = section + '.' + name
556 if values:
556 if values:
557 for v in values:
557 for v in values:
558 if v == section:
558 if v == section:
559 ui.write('%s=%s\n' % (sectname, value))
559 ui.write('%s=%s\n' % (sectname, value))
560 elif v == sectname:
560 elif v == sectname:
561 ui.write(value, '\n')
561 ui.write(value, '\n')
562 else:
562 else:
563 ui.write('%s=%s\n' % (sectname, value))
563 ui.write('%s=%s\n' % (sectname, value))
564
564
565 def debugsetparents(ui, repo, rev1, rev2=None):
565 def debugsetparents(ui, repo, rev1, rev2=None):
566 """manually set the parents of the current working directory
566 """manually set the parents of the current working directory
567
567
568 This is useful for writing repository conversion tools, but should
568 This is useful for writing repository conversion tools, but should
569 be used with care.
569 be used with care.
570 """
570 """
571
571
572 if not rev2:
572 if not rev2:
573 rev2 = hex(nullid)
573 rev2 = hex(nullid)
574
574
575 wlock = repo.wlock()
575 wlock = repo.wlock()
576 try:
576 try:
577 repo.dirstate.setparents(repo.lookup(rev1), repo.lookup(rev2))
577 repo.dirstate.setparents(repo.lookup(rev1), repo.lookup(rev2))
578 finally:
578 finally:
579 del wlock
579 del wlock
580
580
581 def debugstate(ui, repo):
581 def debugstate(ui, repo):
582 """show the contents of the current dirstate"""
582 """show the contents of the current dirstate"""
583 k = repo.dirstate._map.items()
583 k = repo.dirstate._map.items()
584 k.sort()
584 k.sort()
585 for file_, ent in k:
585 for file_, ent in k:
586 if ent[3] == -1:
586 if ent[3] == -1:
587 # Pad or slice to locale representation
587 # Pad or slice to locale representation
588 locale_len = len(time.strftime("%x %X", time.localtime(0)))
588 locale_len = len(time.strftime("%x %X", time.localtime(0)))
589 timestr = 'unset'
589 timestr = 'unset'
590 timestr = timestr[:locale_len] + ' '*(locale_len - len(timestr))
590 timestr = timestr[:locale_len] + ' '*(locale_len - len(timestr))
591 else:
591 else:
592 timestr = time.strftime("%x %X", time.localtime(ent[3]))
592 timestr = time.strftime("%x %X", time.localtime(ent[3]))
593 if ent[1] & 020000:
593 if ent[1] & 020000:
594 mode = 'lnk'
594 mode = 'lnk'
595 else:
595 else:
596 mode = '%3o' % (ent[1] & 0777)
596 mode = '%3o' % (ent[1] & 0777)
597 ui.write("%c %s %10d %s %s\n" % (ent[0], mode, ent[2], timestr, file_))
597 ui.write("%c %s %10d %s %s\n" % (ent[0], mode, ent[2], timestr, file_))
598 for f in repo.dirstate.copies():
598 for f in repo.dirstate.copies():
599 ui.write(_("copy: %s -> %s\n") % (repo.dirstate.copied(f), f))
599 ui.write(_("copy: %s -> %s\n") % (repo.dirstate.copied(f), f))
600
600
601 def debugdata(ui, file_, rev):
601 def debugdata(ui, file_, rev):
602 """dump the contents of a data file revision"""
602 """dump the contents of a data file revision"""
603 r = revlog.revlog(util.opener(os.getcwd(), audit=False), file_[:-2] + ".i")
603 r = revlog.revlog(util.opener(os.getcwd(), audit=False), file_[:-2] + ".i")
604 try:
604 try:
605 ui.write(r.revision(r.lookup(rev)))
605 ui.write(r.revision(r.lookup(rev)))
606 except KeyError:
606 except KeyError:
607 raise util.Abort(_('invalid revision identifier %s') % rev)
607 raise util.Abort(_('invalid revision identifier %s') % rev)
608
608
609 def debugdate(ui, date, range=None, **opts):
609 def debugdate(ui, date, range=None, **opts):
610 """parse and display a date"""
610 """parse and display a date"""
611 if opts["extended"]:
611 if opts["extended"]:
612 d = util.parsedate(date, util.extendeddateformats)
612 d = util.parsedate(date, util.extendeddateformats)
613 else:
613 else:
614 d = util.parsedate(date)
614 d = util.parsedate(date)
615 ui.write("internal: %s %s\n" % d)
615 ui.write("internal: %s %s\n" % d)
616 ui.write("standard: %s\n" % util.datestr(d))
616 ui.write("standard: %s\n" % util.datestr(d))
617 if range:
617 if range:
618 m = util.matchdate(range)
618 m = util.matchdate(range)
619 ui.write("match: %s\n" % m(d[0]))
619 ui.write("match: %s\n" % m(d[0]))
620
620
621 def debugindex(ui, file_):
621 def debugindex(ui, file_):
622 """dump the contents of an index file"""
622 """dump the contents of an index file"""
623 r = revlog.revlog(util.opener(os.getcwd(), audit=False), file_)
623 r = revlog.revlog(util.opener(os.getcwd(), audit=False), file_)
624 ui.write(" rev offset length base linkrev" +
624 ui.write(" rev offset length base linkrev" +
625 " nodeid p1 p2\n")
625 " nodeid p1 p2\n")
626 for i in xrange(r.count()):
626 for i in xrange(r.count()):
627 node = r.node(i)
627 node = r.node(i)
628 try:
628 try:
629 pp = r.parents(node)
629 pp = r.parents(node)
630 except:
630 except:
631 pp = [nullid, nullid]
631 pp = [nullid, nullid]
632 ui.write("% 6d % 9d % 7d % 6d % 7d %s %s %s\n" % (
632 ui.write("% 6d % 9d % 7d % 6d % 7d %s %s %s\n" % (
633 i, r.start(i), r.length(i), r.base(i), r.linkrev(node),
633 i, r.start(i), r.length(i), r.base(i), r.linkrev(node),
634 short(node), short(pp[0]), short(pp[1])))
634 short(node), short(pp[0]), short(pp[1])))
635
635
636 def debugindexdot(ui, file_):
636 def debugindexdot(ui, file_):
637 """dump an index DAG as a .dot file"""
637 """dump an index DAG as a .dot file"""
638 r = revlog.revlog(util.opener(os.getcwd(), audit=False), file_)
638 r = revlog.revlog(util.opener(os.getcwd(), audit=False), file_)
639 ui.write("digraph G {\n")
639 ui.write("digraph G {\n")
640 for i in xrange(r.count()):
640 for i in xrange(r.count()):
641 node = r.node(i)
641 node = r.node(i)
642 pp = r.parents(node)
642 pp = r.parents(node)
643 ui.write("\t%d -> %d\n" % (r.rev(pp[0]), i))
643 ui.write("\t%d -> %d\n" % (r.rev(pp[0]), i))
644 if pp[1] != nullid:
644 if pp[1] != nullid:
645 ui.write("\t%d -> %d\n" % (r.rev(pp[1]), i))
645 ui.write("\t%d -> %d\n" % (r.rev(pp[1]), i))
646 ui.write("}\n")
646 ui.write("}\n")
647
647
648 def debuginstall(ui):
648 def debuginstall(ui):
649 '''test Mercurial installation'''
649 '''test Mercurial installation'''
650
650
651 def writetemp(contents):
651 def writetemp(contents):
652 (fd, name) = tempfile.mkstemp(prefix="hg-debuginstall-")
652 (fd, name) = tempfile.mkstemp(prefix="hg-debuginstall-")
653 f = os.fdopen(fd, "wb")
653 f = os.fdopen(fd, "wb")
654 f.write(contents)
654 f.write(contents)
655 f.close()
655 f.close()
656 return name
656 return name
657
657
658 problems = 0
658 problems = 0
659
659
660 # encoding
660 # encoding
661 ui.status(_("Checking encoding (%s)...\n") % util._encoding)
661 ui.status(_("Checking encoding (%s)...\n") % util._encoding)
662 try:
662 try:
663 util.fromlocal("test")
663 util.fromlocal("test")
664 except util.Abort, inst:
664 except util.Abort, inst:
665 ui.write(" %s\n" % inst)
665 ui.write(" %s\n" % inst)
666 ui.write(_(" (check that your locale is properly set)\n"))
666 ui.write(_(" (check that your locale is properly set)\n"))
667 problems += 1
667 problems += 1
668
668
669 # compiled modules
669 # compiled modules
670 ui.status(_("Checking extensions...\n"))
670 ui.status(_("Checking extensions...\n"))
671 try:
671 try:
672 import bdiff, mpatch, base85
672 import bdiff, mpatch, base85
673 except Exception, inst:
673 except Exception, inst:
674 ui.write(" %s\n" % inst)
674 ui.write(" %s\n" % inst)
675 ui.write(_(" One or more extensions could not be found"))
675 ui.write(_(" One or more extensions could not be found"))
676 ui.write(_(" (check that you compiled the extensions)\n"))
676 ui.write(_(" (check that you compiled the extensions)\n"))
677 problems += 1
677 problems += 1
678
678
679 # templates
679 # templates
680 ui.status(_("Checking templates...\n"))
680 ui.status(_("Checking templates...\n"))
681 try:
681 try:
682 import templater
682 import templater
683 t = templater.templater(templater.templatepath("map-cmdline.default"))
683 t = templater.templater(templater.templatepath("map-cmdline.default"))
684 except Exception, inst:
684 except Exception, inst:
685 ui.write(" %s\n" % inst)
685 ui.write(" %s\n" % inst)
686 ui.write(_(" (templates seem to have been installed incorrectly)\n"))
686 ui.write(_(" (templates seem to have been installed incorrectly)\n"))
687 problems += 1
687 problems += 1
688
688
689 # patch
689 # patch
690 ui.status(_("Checking patch...\n"))
690 ui.status(_("Checking patch...\n"))
691 patchproblems = 0
691 patchproblems = 0
692 a = "1\n2\n3\n4\n"
692 a = "1\n2\n3\n4\n"
693 b = "1\n2\n3\ninsert\n4\n"
693 b = "1\n2\n3\ninsert\n4\n"
694 fa = writetemp(a)
694 fa = writetemp(a)
695 d = mdiff.unidiff(a, None, b, None, os.path.basename(fa),
695 d = mdiff.unidiff(a, None, b, None, os.path.basename(fa),
696 os.path.basename(fa))
696 os.path.basename(fa))
697 fd = writetemp(d)
697 fd = writetemp(d)
698
698
699 files = {}
699 files = {}
700 try:
700 try:
701 patch.patch(fd, ui, cwd=os.path.dirname(fa), files=files)
701 patch.patch(fd, ui, cwd=os.path.dirname(fa), files=files)
702 except util.Abort, e:
702 except util.Abort, e:
703 ui.write(_(" patch call failed:\n"))
703 ui.write(_(" patch call failed:\n"))
704 ui.write(" " + str(e) + "\n")
704 ui.write(" " + str(e) + "\n")
705 patchproblems += 1
705 patchproblems += 1
706 else:
706 else:
707 if list(files) != [os.path.basename(fa)]:
707 if list(files) != [os.path.basename(fa)]:
708 ui.write(_(" unexpected patch output!\n"))
708 ui.write(_(" unexpected patch output!\n"))
709 patchproblems += 1
709 patchproblems += 1
710 a = file(fa).read()
710 a = file(fa).read()
711 if a != b:
711 if a != b:
712 ui.write(_(" patch test failed!\n"))
712 ui.write(_(" patch test failed!\n"))
713 patchproblems += 1
713 patchproblems += 1
714
714
715 if patchproblems:
715 if patchproblems:
716 if ui.config('ui', 'patch'):
716 if ui.config('ui', 'patch'):
717 ui.write(_(" (Current patch tool may be incompatible with patch,"
717 ui.write(_(" (Current patch tool may be incompatible with patch,"
718 " or misconfigured. Please check your .hgrc file)\n"))
718 " or misconfigured. Please check your .hgrc file)\n"))
719 else:
719 else:
720 ui.write(_(" Internal patcher failure, please report this error"
720 ui.write(_(" Internal patcher failure, please report this error"
721 " to http://www.selenic.com/mercurial/bts\n"))
721 " to http://www.selenic.com/mercurial/bts\n"))
722 problems += patchproblems
722 problems += patchproblems
723
723
724 os.unlink(fa)
724 os.unlink(fa)
725 os.unlink(fd)
725 os.unlink(fd)
726
726
727 # merge helper
727 # merge helper
728 ui.status(_("Checking merge helper...\n"))
728 ui.status(_("Checking merge helper...\n"))
729 cmd = (os.environ.get("HGMERGE") or ui.config("ui", "merge")
729 cmd = (os.environ.get("HGMERGE") or ui.config("ui", "merge")
730 or "hgmerge")
730 or "hgmerge")
731 cmdpath = util.find_exe(cmd) or util.find_exe(cmd.split()[0])
731 cmdpath = util.find_exe(cmd) or util.find_exe(cmd.split()[0])
732 if not cmdpath:
732 if not cmdpath:
733 if cmd == 'hgmerge':
733 if cmd == 'hgmerge':
734 ui.write(_(" No merge helper set and can't find default"
734 ui.write(_(" No merge helper set and can't find default"
735 " hgmerge script in PATH\n"))
735 " hgmerge script in PATH\n"))
736 ui.write(_(" (specify a merge helper in your .hgrc file)\n"))
736 ui.write(_(" (specify a merge helper in your .hgrc file)\n"))
737 else:
737 else:
738 ui.write(_(" Can't find merge helper '%s' in PATH\n") % cmd)
738 ui.write(_(" Can't find merge helper '%s' in PATH\n") % cmd)
739 ui.write(_(" (specify a merge helper in your .hgrc file)\n"))
739 ui.write(_(" (specify a merge helper in your .hgrc file)\n"))
740 problems += 1
740 problems += 1
741 else:
741 else:
742 # actually attempt a patch here
742 # actually attempt a patch here
743 fa = writetemp("1\n2\n3\n4\n")
743 fa = writetemp("1\n2\n3\n4\n")
744 fl = writetemp("1\n2\n3\ninsert\n4\n")
744 fl = writetemp("1\n2\n3\ninsert\n4\n")
745 fr = writetemp("begin\n1\n2\n3\n4\n")
745 fr = writetemp("begin\n1\n2\n3\n4\n")
746 r = util.system('%s "%s" "%s" "%s"' % (cmd, fl, fa, fr))
746 r = util.system('%s "%s" "%s" "%s"' % (cmd, fl, fa, fr))
747 if r:
747 if r:
748 ui.write(_(" Got unexpected merge error %d!\n") % r)
748 ui.write(_(" Got unexpected merge error %d!\n") % r)
749 problems += 1
749 problems += 1
750 m = file(fl).read()
750 m = file(fl).read()
751 if m != "begin\n1\n2\n3\ninsert\n4\n":
751 if m != "begin\n1\n2\n3\ninsert\n4\n":
752 ui.write(_(" Got unexpected merge results!\n"))
752 ui.write(_(" Got unexpected merge results!\n"))
753 ui.write(_(" (your merge helper may have the"
753 ui.write(_(" (your merge helper may have the"
754 " wrong argument order)\n"))
754 " wrong argument order)\n"))
755 ui.write(_(" Result: %r\n") % m)
755 ui.write(_(" Result: %r\n") % m)
756 problems += 1
756 problems += 1
757 os.unlink(fa)
757 os.unlink(fa)
758 os.unlink(fl)
758 os.unlink(fl)
759 os.unlink(fr)
759 os.unlink(fr)
760
760
761 # editor
761 # editor
762 ui.status(_("Checking commit editor...\n"))
762 ui.status(_("Checking commit editor...\n"))
763 editor = ui.geteditor()
763 editor = ui.geteditor()
764 cmdpath = util.find_exe(editor) or util.find_exe(editor.split()[0])
764 cmdpath = util.find_exe(editor) or util.find_exe(editor.split()[0])
765 if not cmdpath:
765 if not cmdpath:
766 if editor == 'vi':
766 if editor == 'vi':
767 ui.write(_(" No commit editor set and can't find vi in PATH\n"))
767 ui.write(_(" No commit editor set and can't find vi in PATH\n"))
768 ui.write(_(" (specify a commit editor in your .hgrc file)\n"))
768 ui.write(_(" (specify a commit editor in your .hgrc file)\n"))
769 else:
769 else:
770 ui.write(_(" Can't find editor '%s' in PATH\n") % editor)
770 ui.write(_(" Can't find editor '%s' in PATH\n") % editor)
771 ui.write(_(" (specify a commit editor in your .hgrc file)\n"))
771 ui.write(_(" (specify a commit editor in your .hgrc file)\n"))
772 problems += 1
772 problems += 1
773
773
774 # check username
774 # check username
775 ui.status(_("Checking username...\n"))
775 ui.status(_("Checking username...\n"))
776 user = os.environ.get("HGUSER")
776 user = os.environ.get("HGUSER")
777 if user is None:
777 if user is None:
778 user = ui.config("ui", "username")
778 user = ui.config("ui", "username")
779 if user is None:
779 if user is None:
780 user = os.environ.get("EMAIL")
780 user = os.environ.get("EMAIL")
781 if not user:
781 if not user:
782 ui.warn(" ")
782 ui.warn(" ")
783 ui.username()
783 ui.username()
784 ui.write(_(" (specify a username in your .hgrc file)\n"))
784 ui.write(_(" (specify a username in your .hgrc file)\n"))
785
785
786 if not problems:
786 if not problems:
787 ui.status(_("No problems detected\n"))
787 ui.status(_("No problems detected\n"))
788 else:
788 else:
789 ui.write(_("%s problems detected,"
789 ui.write(_("%s problems detected,"
790 " please check your install!\n") % problems)
790 " please check your install!\n") % problems)
791
791
792 return problems
792 return problems
793
793
794 def debugrename(ui, repo, file1, *pats, **opts):
794 def debugrename(ui, repo, file1, *pats, **opts):
795 """dump rename information"""
795 """dump rename information"""
796
796
797 ctx = repo.changectx(opts.get('rev', 'tip'))
797 ctx = repo.changectx(opts.get('rev', 'tip'))
798 for src, abs, rel, exact in cmdutil.walk(repo, (file1,) + pats, opts,
798 for src, abs, rel, exact in cmdutil.walk(repo, (file1,) + pats, opts,
799 ctx.node()):
799 ctx.node()):
800 m = ctx.filectx(abs).renamed()
800 m = ctx.filectx(abs).renamed()
801 if m:
801 if m:
802 ui.write(_("%s renamed from %s:%s\n") % (rel, m[0], hex(m[1])))
802 ui.write(_("%s renamed from %s:%s\n") % (rel, m[0], hex(m[1])))
803 else:
803 else:
804 ui.write(_("%s not renamed\n") % rel)
804 ui.write(_("%s not renamed\n") % rel)
805
805
806 def debugwalk(ui, repo, *pats, **opts):
806 def debugwalk(ui, repo, *pats, **opts):
807 """show how files match on given patterns"""
807 """show how files match on given patterns"""
808 items = list(cmdutil.walk(repo, pats, opts))
808 items = list(cmdutil.walk(repo, pats, opts))
809 if not items:
809 if not items:
810 return
810 return
811 fmt = '%%s %%-%ds %%-%ds %%s' % (
811 fmt = '%%s %%-%ds %%-%ds %%s' % (
812 max([len(abs) for (src, abs, rel, exact) in items]),
812 max([len(abs) for (src, abs, rel, exact) in items]),
813 max([len(rel) for (src, abs, rel, exact) in items]))
813 max([len(rel) for (src, abs, rel, exact) in items]))
814 for src, abs, rel, exact in items:
814 for src, abs, rel, exact in items:
815 line = fmt % (src, abs, rel, exact and 'exact' or '')
815 line = fmt % (src, abs, rel, exact and 'exact' or '')
816 ui.write("%s\n" % line.rstrip())
816 ui.write("%s\n" % line.rstrip())
817
817
818 def diff(ui, repo, *pats, **opts):
818 def diff(ui, repo, *pats, **opts):
819 """diff repository (or selected files)
819 """diff repository (or selected files)
820
820
821 Show differences between revisions for the specified files.
821 Show differences between revisions for the specified files.
822
822
823 Differences between files are shown using the unified diff format.
823 Differences between files are shown using the unified diff format.
824
824
825 NOTE: diff may generate unexpected results for merges, as it will
825 NOTE: diff may generate unexpected results for merges, as it will
826 default to comparing against the working directory's first parent
826 default to comparing against the working directory's first parent
827 changeset if no revisions are specified.
827 changeset if no revisions are specified.
828
828
829 When two revision arguments are given, then changes are shown
829 When two revision arguments are given, then changes are shown
830 between those revisions. If only one revision is specified then
830 between those revisions. If only one revision is specified then
831 that revision is compared to the working directory, and, when no
831 that revision is compared to the working directory, and, when no
832 revisions are specified, the working directory files are compared
832 revisions are specified, the working directory files are compared
833 to its parent.
833 to its parent.
834
834
835 Without the -a option, diff will avoid generating diffs of files
835 Without the -a option, diff will avoid generating diffs of files
836 it detects as binary. With -a, diff will generate a diff anyway,
836 it detects as binary. With -a, diff will generate a diff anyway,
837 probably with undesirable results.
837 probably with undesirable results.
838 """
838 """
839 node1, node2 = cmdutil.revpair(repo, opts['rev'])
839 node1, node2 = cmdutil.revpair(repo, opts['rev'])
840
840
841 fns, matchfn, anypats = cmdutil.matchpats(repo, pats, opts)
841 fns, matchfn, anypats = cmdutil.matchpats(repo, pats, opts)
842
842
843 patch.diff(repo, node1, node2, fns, match=matchfn,
843 patch.diff(repo, node1, node2, fns, match=matchfn,
844 opts=patch.diffopts(ui, opts))
844 opts=patch.diffopts(ui, opts))
845
845
846 def export(ui, repo, *changesets, **opts):
846 def export(ui, repo, *changesets, **opts):
847 """dump the header and diffs for one or more changesets
847 """dump the header and diffs for one or more changesets
848
848
849 Print the changeset header and diffs for one or more revisions.
849 Print the changeset header and diffs for one or more revisions.
850
850
851 The information shown in the changeset header is: author,
851 The information shown in the changeset header is: author,
852 changeset hash, parent(s) and commit comment.
852 changeset hash, parent(s) and commit comment.
853
853
854 NOTE: export may generate unexpected diff output for merge changesets,
854 NOTE: export may generate unexpected diff output for merge changesets,
855 as it will compare the merge changeset against its first parent only.
855 as it will compare the merge changeset against its first parent only.
856
856
857 Output may be to a file, in which case the name of the file is
857 Output may be to a file, in which case the name of the file is
858 given using a format string. The formatting rules are as follows:
858 given using a format string. The formatting rules are as follows:
859
859
860 %% literal "%" character
860 %% literal "%" character
861 %H changeset hash (40 bytes of hexadecimal)
861 %H changeset hash (40 bytes of hexadecimal)
862 %N number of patches being generated
862 %N number of patches being generated
863 %R changeset revision number
863 %R changeset revision number
864 %b basename of the exporting repository
864 %b basename of the exporting repository
865 %h short-form changeset hash (12 bytes of hexadecimal)
865 %h short-form changeset hash (12 bytes of hexadecimal)
866 %n zero-padded sequence number, starting at 1
866 %n zero-padded sequence number, starting at 1
867 %r zero-padded changeset revision number
867 %r zero-padded changeset revision number
868
868
869 Without the -a option, export will avoid generating diffs of files
869 Without the -a option, export will avoid generating diffs of files
870 it detects as binary. With -a, export will generate a diff anyway,
870 it detects as binary. With -a, export will generate a diff anyway,
871 probably with undesirable results.
871 probably with undesirable results.
872
872
873 With the --switch-parent option, the diff will be against the second
873 With the --switch-parent option, the diff will be against the second
874 parent. It can be useful to review a merge.
874 parent. It can be useful to review a merge.
875 """
875 """
876 if not changesets:
876 if not changesets:
877 raise util.Abort(_("export requires at least one changeset"))
877 raise util.Abort(_("export requires at least one changeset"))
878 revs = cmdutil.revrange(repo, changesets)
878 revs = cmdutil.revrange(repo, changesets)
879 if len(revs) > 1:
879 if len(revs) > 1:
880 ui.note(_('exporting patches:\n'))
880 ui.note(_('exporting patches:\n'))
881 else:
881 else:
882 ui.note(_('exporting patch:\n'))
882 ui.note(_('exporting patch:\n'))
883 patch.export(repo, revs, template=opts['output'],
883 patch.export(repo, revs, template=opts['output'],
884 switch_parent=opts['switch_parent'],
884 switch_parent=opts['switch_parent'],
885 opts=patch.diffopts(ui, opts))
885 opts=patch.diffopts(ui, opts))
886
886
887 def grep(ui, repo, pattern, *pats, **opts):
887 def grep(ui, repo, pattern, *pats, **opts):
888 """search for a pattern in specified files and revisions
888 """search for a pattern in specified files and revisions
889
889
890 Search revisions of files for a regular expression.
890 Search revisions of files for a regular expression.
891
891
892 This command behaves differently than Unix grep. It only accepts
892 This command behaves differently than Unix grep. It only accepts
893 Python/Perl regexps. It searches repository history, not the
893 Python/Perl regexps. It searches repository history, not the
894 working directory. It always prints the revision number in which
894 working directory. It always prints the revision number in which
895 a match appears.
895 a match appears.
896
896
897 By default, grep only prints output for the first revision of a
897 By default, grep only prints output for the first revision of a
898 file in which it finds a match. To get it to print every revision
898 file in which it finds a match. To get it to print every revision
899 that contains a change in match status ("-" for a match that
899 that contains a change in match status ("-" for a match that
900 becomes a non-match, or "+" for a non-match that becomes a match),
900 becomes a non-match, or "+" for a non-match that becomes a match),
901 use the --all flag.
901 use the --all flag.
902 """
902 """
903 reflags = 0
903 reflags = 0
904 if opts['ignore_case']:
904 if opts['ignore_case']:
905 reflags |= re.I
905 reflags |= re.I
906 try:
906 try:
907 regexp = re.compile(pattern, reflags)
907 regexp = re.compile(pattern, reflags)
908 except Exception, inst:
908 except Exception, inst:
909 ui.warn(_("grep: invalid match pattern: %s!\n") % inst)
909 ui.warn(_("grep: invalid match pattern: %s!\n") % inst)
910 return None
910 return None
911 sep, eol = ':', '\n'
911 sep, eol = ':', '\n'
912 if opts['print0']:
912 if opts['print0']:
913 sep = eol = '\0'
913 sep = eol = '\0'
914
914
915 fcache = {}
915 fcache = {}
916 def getfile(fn):
916 def getfile(fn):
917 if fn not in fcache:
917 if fn not in fcache:
918 fcache[fn] = repo.file(fn)
918 fcache[fn] = repo.file(fn)
919 return fcache[fn]
919 return fcache[fn]
920
920
921 def matchlines(body):
921 def matchlines(body):
922 begin = 0
922 begin = 0
923 linenum = 0
923 linenum = 0
924 while True:
924 while True:
925 match = regexp.search(body, begin)
925 match = regexp.search(body, begin)
926 if not match:
926 if not match:
927 break
927 break
928 mstart, mend = match.span()
928 mstart, mend = match.span()
929 linenum += body.count('\n', begin, mstart) + 1
929 linenum += body.count('\n', begin, mstart) + 1
930 lstart = body.rfind('\n', begin, mstart) + 1 or begin
930 lstart = body.rfind('\n', begin, mstart) + 1 or begin
931 lend = body.find('\n', mend)
931 lend = body.find('\n', mend)
932 yield linenum, mstart - lstart, mend - lstart, body[lstart:lend]
932 yield linenum, mstart - lstart, mend - lstart, body[lstart:lend]
933 begin = lend + 1
933 begin = lend + 1
934
934
935 class linestate(object):
935 class linestate(object):
936 def __init__(self, line, linenum, colstart, colend):
936 def __init__(self, line, linenum, colstart, colend):
937 self.line = line
937 self.line = line
938 self.linenum = linenum
938 self.linenum = linenum
939 self.colstart = colstart
939 self.colstart = colstart
940 self.colend = colend
940 self.colend = colend
941
941
942 def __eq__(self, other):
942 def __eq__(self, other):
943 return self.line == other.line
943 return self.line == other.line
944
944
945 matches = {}
945 matches = {}
946 copies = {}
946 copies = {}
947 def grepbody(fn, rev, body):
947 def grepbody(fn, rev, body):
948 matches[rev].setdefault(fn, [])
948 matches[rev].setdefault(fn, [])
949 m = matches[rev][fn]
949 m = matches[rev][fn]
950 for lnum, cstart, cend, line in matchlines(body):
950 for lnum, cstart, cend, line in matchlines(body):
951 s = linestate(line, lnum, cstart, cend)
951 s = linestate(line, lnum, cstart, cend)
952 m.append(s)
952 m.append(s)
953
953
954 def difflinestates(a, b):
954 def difflinestates(a, b):
955 sm = difflib.SequenceMatcher(None, a, b)
955 sm = difflib.SequenceMatcher(None, a, b)
956 for tag, alo, ahi, blo, bhi in sm.get_opcodes():
956 for tag, alo, ahi, blo, bhi in sm.get_opcodes():
957 if tag == 'insert':
957 if tag == 'insert':
958 for i in xrange(blo, bhi):
958 for i in xrange(blo, bhi):
959 yield ('+', b[i])
959 yield ('+', b[i])
960 elif tag == 'delete':
960 elif tag == 'delete':
961 for i in xrange(alo, ahi):
961 for i in xrange(alo, ahi):
962 yield ('-', a[i])
962 yield ('-', a[i])
963 elif tag == 'replace':
963 elif tag == 'replace':
964 for i in xrange(alo, ahi):
964 for i in xrange(alo, ahi):
965 yield ('-', a[i])
965 yield ('-', a[i])
966 for i in xrange(blo, bhi):
966 for i in xrange(blo, bhi):
967 yield ('+', b[i])
967 yield ('+', b[i])
968
968
969 prev = {}
969 prev = {}
970 def display(fn, rev, states, prevstates):
970 def display(fn, rev, states, prevstates):
971 found = False
971 found = False
972 filerevmatches = {}
972 filerevmatches = {}
973 r = prev.get(fn, -1)
973 r = prev.get(fn, -1)
974 if opts['all']:
974 if opts['all']:
975 iter = difflinestates(states, prevstates)
975 iter = difflinestates(states, prevstates)
976 else:
976 else:
977 iter = [('', l) for l in prevstates]
977 iter = [('', l) for l in prevstates]
978 for change, l in iter:
978 for change, l in iter:
979 cols = [fn, str(r)]
979 cols = [fn, str(r)]
980 if opts['line_number']:
980 if opts['line_number']:
981 cols.append(str(l.linenum))
981 cols.append(str(l.linenum))
982 if opts['all']:
982 if opts['all']:
983 cols.append(change)
983 cols.append(change)
984 if opts['user']:
984 if opts['user']:
985 cols.append(ui.shortuser(get(r)[1]))
985 cols.append(ui.shortuser(get(r)[1]))
986 if opts['files_with_matches']:
986 if opts['files_with_matches']:
987 c = (fn, r)
987 c = (fn, r)
988 if c in filerevmatches:
988 if c in filerevmatches:
989 continue
989 continue
990 filerevmatches[c] = 1
990 filerevmatches[c] = 1
991 else:
991 else:
992 cols.append(l.line)
992 cols.append(l.line)
993 ui.write(sep.join(cols), eol)
993 ui.write(sep.join(cols), eol)
994 found = True
994 found = True
995 return found
995 return found
996
996
997 fstate = {}
997 fstate = {}
998 skip = {}
998 skip = {}
999 get = util.cachefunc(lambda r: repo.changectx(r).changeset())
999 get = util.cachefunc(lambda r: repo.changectx(r).changeset())
1000 changeiter, matchfn = cmdutil.walkchangerevs(ui, repo, pats, get, opts)
1000 changeiter, matchfn = cmdutil.walkchangerevs(ui, repo, pats, get, opts)
1001 found = False
1001 found = False
1002 follow = opts.get('follow')
1002 follow = opts.get('follow')
1003 for st, rev, fns in changeiter:
1003 for st, rev, fns in changeiter:
1004 if st == 'window':
1004 if st == 'window':
1005 matches.clear()
1005 matches.clear()
1006 elif st == 'add':
1006 elif st == 'add':
1007 mf = repo.changectx(rev).manifest()
1007 mf = repo.changectx(rev).manifest()
1008 matches[rev] = {}
1008 matches[rev] = {}
1009 for fn in fns:
1009 for fn in fns:
1010 if fn in skip:
1010 if fn in skip:
1011 continue
1011 continue
1012 try:
1012 try:
1013 grepbody(fn, rev, getfile(fn).read(mf[fn]))
1013 grepbody(fn, rev, getfile(fn).read(mf[fn]))
1014 fstate.setdefault(fn, [])
1014 fstate.setdefault(fn, [])
1015 if follow:
1015 if follow:
1016 copied = getfile(fn).renamed(mf[fn])
1016 copied = getfile(fn).renamed(mf[fn])
1017 if copied:
1017 if copied:
1018 copies.setdefault(rev, {})[fn] = copied[0]
1018 copies.setdefault(rev, {})[fn] = copied[0]
1019 except KeyError:
1019 except KeyError:
1020 pass
1020 pass
1021 elif st == 'iter':
1021 elif st == 'iter':
1022 states = matches[rev].items()
1022 states = matches[rev].items()
1023 states.sort()
1023 states.sort()
1024 for fn, m in states:
1024 for fn, m in states:
1025 copy = copies.get(rev, {}).get(fn)
1025 copy = copies.get(rev, {}).get(fn)
1026 if fn in skip:
1026 if fn in skip:
1027 if copy:
1027 if copy:
1028 skip[copy] = True
1028 skip[copy] = True
1029 continue
1029 continue
1030 if fn in prev or fstate[fn]:
1030 if fn in prev or fstate[fn]:
1031 r = display(fn, rev, m, fstate[fn])
1031 r = display(fn, rev, m, fstate[fn])
1032 found = found or r
1032 found = found or r
1033 if r and not opts['all']:
1033 if r and not opts['all']:
1034 skip[fn] = True
1034 skip[fn] = True
1035 if copy:
1035 if copy:
1036 skip[copy] = True
1036 skip[copy] = True
1037 fstate[fn] = m
1037 fstate[fn] = m
1038 if copy:
1038 if copy:
1039 fstate[copy] = m
1039 fstate[copy] = m
1040 prev[fn] = rev
1040 prev[fn] = rev
1041
1041
1042 fstate = fstate.items()
1042 fstate = fstate.items()
1043 fstate.sort()
1043 fstate.sort()
1044 for fn, state in fstate:
1044 for fn, state in fstate:
1045 if fn in skip:
1045 if fn in skip:
1046 continue
1046 continue
1047 if fn not in copies.get(prev[fn], {}):
1047 if fn not in copies.get(prev[fn], {}):
1048 found = display(fn, rev, {}, state) or found
1048 found = display(fn, rev, {}, state) or found
1049 return (not found and 1) or 0
1049 return (not found and 1) or 0
1050
1050
1051 def heads(ui, repo, *branchrevs, **opts):
1051 def heads(ui, repo, *branchrevs, **opts):
1052 """show current repository heads or show branch heads
1052 """show current repository heads or show branch heads
1053
1053
1054 With no arguments, show all repository head changesets.
1054 With no arguments, show all repository head changesets.
1055
1055
1056 If branch or revisions names are given this will show the heads of
1056 If branch or revisions names are given this will show the heads of
1057 the specified branches or the branches those revisions are tagged
1057 the specified branches or the branches those revisions are tagged
1058 with.
1058 with.
1059
1059
1060 Repository "heads" are changesets that don't have child
1060 Repository "heads" are changesets that don't have child
1061 changesets. They are where development generally takes place and
1061 changesets. They are where development generally takes place and
1062 are the usual targets for update and merge operations.
1062 are the usual targets for update and merge operations.
1063
1063
1064 Branch heads are changesets that have a given branch tag, but have
1064 Branch heads are changesets that have a given branch tag, but have
1065 no child changesets with that tag. They are usually where
1065 no child changesets with that tag. They are usually where
1066 development on the given branch takes place.
1066 development on the given branch takes place.
1067 """
1067 """
1068 if opts['rev']:
1068 if opts['rev']:
1069 start = repo.lookup(opts['rev'])
1069 start = repo.lookup(opts['rev'])
1070 else:
1070 else:
1071 start = None
1071 start = None
1072 if not branchrevs:
1072 if not branchrevs:
1073 # Assume we're looking repo-wide heads if no revs were specified.
1073 # Assume we're looking repo-wide heads if no revs were specified.
1074 heads = repo.heads(start)
1074 heads = repo.heads(start)
1075 else:
1075 else:
1076 heads = []
1076 heads = []
1077 visitedset = util.set()
1077 visitedset = util.set()
1078 for branchrev in branchrevs:
1078 for branchrev in branchrevs:
1079 branch = repo.changectx(branchrev).branch()
1079 branch = repo.changectx(branchrev).branch()
1080 if branch in visitedset:
1080 if branch in visitedset:
1081 continue
1081 continue
1082 visitedset.add(branch)
1082 visitedset.add(branch)
1083 bheads = repo.branchheads(branch, start)
1083 bheads = repo.branchheads(branch, start)
1084 if not bheads:
1084 if not bheads:
1085 if branch != branchrev:
1085 if branch != branchrev:
1086 ui.warn(_("no changes on branch %s containing %s are "
1086 ui.warn(_("no changes on branch %s containing %s are "
1087 "reachable from %s\n")
1087 "reachable from %s\n")
1088 % (branch, branchrev, opts['rev']))
1088 % (branch, branchrev, opts['rev']))
1089 else:
1089 else:
1090 ui.warn(_("no changes on branch %s are reachable from %s\n")
1090 ui.warn(_("no changes on branch %s are reachable from %s\n")
1091 % (branch, opts['rev']))
1091 % (branch, opts['rev']))
1092 heads.extend(bheads)
1092 heads.extend(bheads)
1093 if not heads:
1093 if not heads:
1094 return 1
1094 return 1
1095 displayer = cmdutil.show_changeset(ui, repo, opts)
1095 displayer = cmdutil.show_changeset(ui, repo, opts)
1096 for n in heads:
1096 for n in heads:
1097 displayer.show(changenode=n)
1097 displayer.show(changenode=n)
1098
1098
1099 def help_(ui, name=None, with_version=False):
1099 def help_(ui, name=None, with_version=False):
1100 """show help for a command, extension, or list of commands
1100 """show help for a command, extension, or list of commands
1101
1101
1102 With no arguments, print a list of commands and short help.
1102 With no arguments, print a list of commands and short help.
1103
1103
1104 Given a command name, print help for that command.
1104 Given a command name, print help for that command.
1105
1105
1106 Given an extension name, print help for that extension, and the
1106 Given an extension name, print help for that extension, and the
1107 commands it provides."""
1107 commands it provides."""
1108 option_lists = []
1108 option_lists = []
1109
1109
1110 def addglobalopts(aliases):
1110 def addglobalopts(aliases):
1111 if ui.verbose:
1111 if ui.verbose:
1112 option_lists.append((_("global options:"), globalopts))
1112 option_lists.append((_("global options:"), globalopts))
1113 if name == 'shortlist':
1113 if name == 'shortlist':
1114 option_lists.append((_('use "hg help" for the full list '
1114 option_lists.append((_('use "hg help" for the full list '
1115 'of commands'), ()))
1115 'of commands'), ()))
1116 else:
1116 else:
1117 if name == 'shortlist':
1117 if name == 'shortlist':
1118 msg = _('use "hg help" for the full list of commands '
1118 msg = _('use "hg help" for the full list of commands '
1119 'or "hg -v" for details')
1119 'or "hg -v" for details')
1120 elif aliases:
1120 elif aliases:
1121 msg = _('use "hg -v help%s" to show aliases and '
1121 msg = _('use "hg -v help%s" to show aliases and '
1122 'global options') % (name and " " + name or "")
1122 'global options') % (name and " " + name or "")
1123 else:
1123 else:
1124 msg = _('use "hg -v help %s" to show global options') % name
1124 msg = _('use "hg -v help %s" to show global options') % name
1125 option_lists.append((msg, ()))
1125 option_lists.append((msg, ()))
1126
1126
1127 def helpcmd(name):
1127 def helpcmd(name):
1128 if with_version:
1128 if with_version:
1129 version_(ui)
1129 version_(ui)
1130 ui.write('\n')
1130 ui.write('\n')
1131 aliases, i = cmdutil.findcmd(ui, name, table)
1131 aliases, i = cmdutil.findcmd(ui, name, table)
1132 # synopsis
1132 # synopsis
1133 ui.write("%s\n\n" % i[2])
1133 ui.write("%s\n\n" % i[2])
1134
1134
1135 # description
1135 # description
1136 doc = i[0].__doc__
1136 doc = i[0].__doc__
1137 if not doc:
1137 if not doc:
1138 doc = _("(No help text available)")
1138 doc = _("(No help text available)")
1139 if ui.quiet:
1139 if ui.quiet:
1140 doc = doc.splitlines(0)[0]
1140 doc = doc.splitlines(0)[0]
1141 ui.write("%s\n" % doc.rstrip())
1141 ui.write("%s\n" % doc.rstrip())
1142
1142
1143 if not ui.quiet:
1143 if not ui.quiet:
1144 # aliases
1144 # aliases
1145 if len(aliases) > 1:
1145 if len(aliases) > 1:
1146 ui.write(_("\naliases: %s\n") % ', '.join(aliases[1:]))
1146 ui.write(_("\naliases: %s\n") % ', '.join(aliases[1:]))
1147
1147
1148 # options
1148 # options
1149 if i[1]:
1149 if i[1]:
1150 option_lists.append((_("options:\n"), i[1]))
1150 option_lists.append((_("options:\n"), i[1]))
1151
1151
1152 addglobalopts(False)
1152 addglobalopts(False)
1153
1153
1154 def helplist(header, select=None):
1154 def helplist(header, select=None):
1155 h = {}
1155 h = {}
1156 cmds = {}
1156 cmds = {}
1157 for c, e in table.items():
1157 for c, e in table.items():
1158 f = c.split("|", 1)[0]
1158 f = c.split("|", 1)[0]
1159 if select and not select(f):
1159 if select and not select(f):
1160 continue
1160 continue
1161 if name == "shortlist" and not f.startswith("^"):
1161 if name == "shortlist" and not f.startswith("^"):
1162 continue
1162 continue
1163 f = f.lstrip("^")
1163 f = f.lstrip("^")
1164 if not ui.debugflag and f.startswith("debug"):
1164 if not ui.debugflag and f.startswith("debug"):
1165 continue
1165 continue
1166 doc = e[0].__doc__
1166 doc = e[0].__doc__
1167 if not doc:
1167 if not doc:
1168 doc = _("(No help text available)")
1168 doc = _("(No help text available)")
1169 h[f] = doc.splitlines(0)[0].rstrip()
1169 h[f] = doc.splitlines(0)[0].rstrip()
1170 cmds[f] = c.lstrip("^")
1170 cmds[f] = c.lstrip("^")
1171
1171
1172 if not h:
1172 if not h:
1173 ui.status(_('no commands defined\n'))
1173 ui.status(_('no commands defined\n'))
1174 return
1174 return
1175
1175
1176 ui.status(header)
1176 ui.status(header)
1177 fns = h.keys()
1177 fns = h.keys()
1178 fns.sort()
1178 fns.sort()
1179 m = max(map(len, fns))
1179 m = max(map(len, fns))
1180 for f in fns:
1180 for f in fns:
1181 if ui.verbose:
1181 if ui.verbose:
1182 commands = cmds[f].replace("|",", ")
1182 commands = cmds[f].replace("|",", ")
1183 ui.write(" %s:\n %s\n"%(commands, h[f]))
1183 ui.write(" %s:\n %s\n"%(commands, h[f]))
1184 else:
1184 else:
1185 ui.write(' %-*s %s\n' % (m, f, h[f]))
1185 ui.write(' %-*s %s\n' % (m, f, h[f]))
1186
1186
1187 if not ui.quiet:
1187 if not ui.quiet:
1188 addglobalopts(True)
1188 addglobalopts(True)
1189
1189
1190 def helptopic(name):
1190 def helptopic(name):
1191 v = None
1191 v = None
1192 for i in help.helptable:
1192 for i in help.helptable:
1193 l = i.split('|')
1193 l = i.split('|')
1194 if name in l:
1194 if name in l:
1195 v = i
1195 v = i
1196 header = l[-1]
1196 header = l[-1]
1197 if not v:
1197 if not v:
1198 raise cmdutil.UnknownCommand(name)
1198 raise cmdutil.UnknownCommand(name)
1199
1199
1200 # description
1200 # description
1201 doc = help.helptable[v]
1201 doc = help.helptable[v]
1202 if not doc:
1202 if not doc:
1203 doc = _("(No help text available)")
1203 doc = _("(No help text available)")
1204 if callable(doc):
1204 if callable(doc):
1205 doc = doc()
1205 doc = doc()
1206
1206
1207 ui.write("%s\n" % header)
1207 ui.write("%s\n" % header)
1208 ui.write("%s\n" % doc.rstrip())
1208 ui.write("%s\n" % doc.rstrip())
1209
1209
1210 def helpext(name):
1210 def helpext(name):
1211 try:
1211 try:
1212 mod = extensions.find(name)
1212 mod = extensions.find(name)
1213 except KeyError:
1213 except KeyError:
1214 raise cmdutil.UnknownCommand(name)
1214 raise cmdutil.UnknownCommand(name)
1215
1215
1216 doc = (mod.__doc__ or _('No help text available')).splitlines(0)
1216 doc = (mod.__doc__ or _('No help text available')).splitlines(0)
1217 ui.write(_('%s extension - %s\n') % (name.split('.')[-1], doc[0]))
1217 ui.write(_('%s extension - %s\n') % (name.split('.')[-1], doc[0]))
1218 for d in doc[1:]:
1218 for d in doc[1:]:
1219 ui.write(d, '\n')
1219 ui.write(d, '\n')
1220
1220
1221 ui.status('\n')
1221 ui.status('\n')
1222
1222
1223 try:
1223 try:
1224 ct = mod.cmdtable
1224 ct = mod.cmdtable
1225 except AttributeError:
1225 except AttributeError:
1226 ct = {}
1226 ct = {}
1227
1227
1228 modcmds = dict.fromkeys([c.split('|', 1)[0] for c in ct])
1228 modcmds = dict.fromkeys([c.split('|', 1)[0] for c in ct])
1229 helplist(_('list of commands:\n\n'), modcmds.has_key)
1229 helplist(_('list of commands:\n\n'), modcmds.has_key)
1230
1230
1231 if name and name != 'shortlist':
1231 if name and name != 'shortlist':
1232 i = None
1232 i = None
1233 for f in (helpcmd, helptopic, helpext):
1233 for f in (helpcmd, helptopic, helpext):
1234 try:
1234 try:
1235 f(name)
1235 f(name)
1236 i = None
1236 i = None
1237 break
1237 break
1238 except cmdutil.UnknownCommand, inst:
1238 except cmdutil.UnknownCommand, inst:
1239 i = inst
1239 i = inst
1240 if i:
1240 if i:
1241 raise i
1241 raise i
1242
1242
1243 else:
1243 else:
1244 # program name
1244 # program name
1245 if ui.verbose or with_version:
1245 if ui.verbose or with_version:
1246 version_(ui)
1246 version_(ui)
1247 else:
1247 else:
1248 ui.status(_("Mercurial Distributed SCM\n"))
1248 ui.status(_("Mercurial Distributed SCM\n"))
1249 ui.status('\n')
1249 ui.status('\n')
1250
1250
1251 # list of commands
1251 # list of commands
1252 if name == "shortlist":
1252 if name == "shortlist":
1253 header = _('basic commands:\n\n')
1253 header = _('basic commands:\n\n')
1254 else:
1254 else:
1255 header = _('list of commands:\n\n')
1255 header = _('list of commands:\n\n')
1256
1256
1257 helplist(header)
1257 helplist(header)
1258
1258
1259 # list all option lists
1259 # list all option lists
1260 opt_output = []
1260 opt_output = []
1261 for title, options in option_lists:
1261 for title, options in option_lists:
1262 opt_output.append(("\n%s" % title, None))
1262 opt_output.append(("\n%s" % title, None))
1263 for shortopt, longopt, default, desc in options:
1263 for shortopt, longopt, default, desc in options:
1264 if "DEPRECATED" in desc and not ui.verbose: continue
1264 if "DEPRECATED" in desc and not ui.verbose: continue
1265 opt_output.append(("%2s%s" % (shortopt and "-%s" % shortopt,
1265 opt_output.append(("%2s%s" % (shortopt and "-%s" % shortopt,
1266 longopt and " --%s" % longopt),
1266 longopt and " --%s" % longopt),
1267 "%s%s" % (desc,
1267 "%s%s" % (desc,
1268 default
1268 default
1269 and _(" (default: %s)") % default
1269 and _(" (default: %s)") % default
1270 or "")))
1270 or "")))
1271
1271
1272 if opt_output:
1272 if opt_output:
1273 opts_len = max([len(line[0]) for line in opt_output if line[1]] or [0])
1273 opts_len = max([len(line[0]) for line in opt_output if line[1]] or [0])
1274 for first, second in opt_output:
1274 for first, second in opt_output:
1275 if second:
1275 if second:
1276 ui.write(" %-*s %s\n" % (opts_len, first, second))
1276 ui.write(" %-*s %s\n" % (opts_len, first, second))
1277 else:
1277 else:
1278 ui.write("%s\n" % first)
1278 ui.write("%s\n" % first)
1279
1279
1280 def identify(ui, repo, source=None,
1280 def identify(ui, repo, source=None,
1281 rev=None, num=None, id=None, branch=None, tags=None):
1281 rev=None, num=None, id=None, branch=None, tags=None):
1282 """identify the working copy or specified revision
1282 """identify the working copy or specified revision
1283
1283
1284 With no revision, print a summary of the current state of the repo.
1284 With no revision, print a summary of the current state of the repo.
1285
1285
1286 With a path, do a lookup in another repository.
1286 With a path, do a lookup in another repository.
1287
1287
1288 This summary identifies the repository state using one or two parent
1288 This summary identifies the repository state using one or two parent
1289 hash identifiers, followed by a "+" if there are uncommitted changes
1289 hash identifiers, followed by a "+" if there are uncommitted changes
1290 in the working directory, a list of tags for this revision and a branch
1290 in the working directory, a list of tags for this revision and a branch
1291 name for non-default branches.
1291 name for non-default branches.
1292 """
1292 """
1293
1293
1294 if not repo and not source:
1294 if not repo and not source:
1295 raise util.Abort(_("There is no Mercurial repository here "
1295 raise util.Abort(_("There is no Mercurial repository here "
1296 "(.hg not found)"))
1296 "(.hg not found)"))
1297
1297
1298 hexfunc = ui.debugflag and hex or short
1298 hexfunc = ui.debugflag and hex or short
1299 default = not (num or id or branch or tags)
1299 default = not (num or id or branch or tags)
1300 output = []
1300 output = []
1301
1301
1302 if source:
1302 if source:
1303 source, revs, checkout = hg.parseurl(ui.expandpath(source), [])
1303 source, revs, checkout = hg.parseurl(ui.expandpath(source), [])
1304 srepo = hg.repository(ui, source)
1304 srepo = hg.repository(ui, source)
1305 if not rev and revs:
1305 if not rev and revs:
1306 rev = revs[0]
1306 rev = revs[0]
1307 if not rev:
1307 if not rev:
1308 rev = "tip"
1308 rev = "tip"
1309 if num or branch or tags:
1309 if num or branch or tags:
1310 raise util.Abort(
1310 raise util.Abort(
1311 "can't query remote revision number, branch, or tags")
1311 "can't query remote revision number, branch, or tags")
1312 output = [hexfunc(srepo.lookup(rev))]
1312 output = [hexfunc(srepo.lookup(rev))]
1313 elif not rev:
1313 elif not rev:
1314 ctx = repo.workingctx()
1314 ctx = repo.workingctx()
1315 parents = ctx.parents()
1315 parents = ctx.parents()
1316 changed = False
1316 changed = False
1317 if default or id or num:
1317 if default or id or num:
1318 changed = ctx.files() + ctx.deleted()
1318 changed = ctx.files() + ctx.deleted()
1319 if default or id:
1319 if default or id:
1320 output = ["%s%s" % ('+'.join([hexfunc(p.node()) for p in parents]),
1320 output = ["%s%s" % ('+'.join([hexfunc(p.node()) for p in parents]),
1321 (changed) and "+" or "")]
1321 (changed) and "+" or "")]
1322 if num:
1322 if num:
1323 output.append("%s%s" % ('+'.join([str(p.rev()) for p in parents]),
1323 output.append("%s%s" % ('+'.join([str(p.rev()) for p in parents]),
1324 (changed) and "+" or ""))
1324 (changed) and "+" or ""))
1325 else:
1325 else:
1326 ctx = repo.changectx(rev)
1326 ctx = repo.changectx(rev)
1327 if default or id:
1327 if default or id:
1328 output = [hexfunc(ctx.node())]
1328 output = [hexfunc(ctx.node())]
1329 if num:
1329 if num:
1330 output.append(str(ctx.rev()))
1330 output.append(str(ctx.rev()))
1331
1331
1332 if not source and default and not ui.quiet:
1332 if not source and default and not ui.quiet:
1333 b = util.tolocal(ctx.branch())
1333 b = util.tolocal(ctx.branch())
1334 if b != 'default':
1334 if b != 'default':
1335 output.append("(%s)" % b)
1335 output.append("(%s)" % b)
1336
1336
1337 # multiple tags for a single parent separated by '/'
1337 # multiple tags for a single parent separated by '/'
1338 t = "/".join(ctx.tags())
1338 t = "/".join(ctx.tags())
1339 if t:
1339 if t:
1340 output.append(t)
1340 output.append(t)
1341
1341
1342 if branch:
1342 if branch:
1343 output.append(util.tolocal(ctx.branch()))
1343 output.append(util.tolocal(ctx.branch()))
1344
1344
1345 if tags:
1345 if tags:
1346 output.extend(ctx.tags())
1346 output.extend(ctx.tags())
1347
1347
1348 ui.write("%s\n" % ' '.join(output))
1348 ui.write("%s\n" % ' '.join(output))
1349
1349
1350 def import_(ui, repo, patch1, *patches, **opts):
1350 def import_(ui, repo, patch1, *patches, **opts):
1351 """import an ordered set of patches
1351 """import an ordered set of patches
1352
1352
1353 Import a list of patches and commit them individually.
1353 Import a list of patches and commit them individually.
1354
1354
1355 If there are outstanding changes in the working directory, import
1355 If there are outstanding changes in the working directory, import
1356 will abort unless given the -f flag.
1356 will abort unless given the -f flag.
1357
1357
1358 You can import a patch straight from a mail message. Even patches
1358 You can import a patch straight from a mail message. Even patches
1359 as attachments work (body part must be type text/plain or
1359 as attachments work (body part must be type text/plain or
1360 text/x-patch to be used). From and Subject headers of email
1360 text/x-patch to be used). From and Subject headers of email
1361 message are used as default committer and commit message. All
1361 message are used as default committer and commit message. All
1362 text/plain body parts before first diff are added to commit
1362 text/plain body parts before first diff are added to commit
1363 message.
1363 message.
1364
1364
1365 If the imported patch was generated by hg export, user and description
1365 If the imported patch was generated by hg export, user and description
1366 from patch override values from message headers and body. Values
1366 from patch override values from message headers and body. Values
1367 given on command line with -m and -u override these.
1367 given on command line with -m and -u override these.
1368
1368
1369 If --exact is specified, import will set the working directory
1369 If --exact is specified, import will set the working directory
1370 to the parent of each patch before applying it, and will abort
1370 to the parent of each patch before applying it, and will abort
1371 if the resulting changeset has a different ID than the one
1371 if the resulting changeset has a different ID than the one
1372 recorded in the patch. This may happen due to character set
1372 recorded in the patch. This may happen due to character set
1373 problems or other deficiencies in the text patch format.
1373 problems or other deficiencies in the text patch format.
1374
1374
1375 To read a patch from standard input, use patch name "-".
1375 To read a patch from standard input, use patch name "-".
1376 """
1376 """
1377 patches = (patch1,) + patches
1377 patches = (patch1,) + patches
1378
1378
1379 if opts.get('exact') or not opts['force']:
1379 if opts.get('exact') or not opts['force']:
1380 cmdutil.bail_if_changed(repo)
1380 cmdutil.bail_if_changed(repo)
1381
1381
1382 d = opts["base"]
1382 d = opts["base"]
1383 strip = opts["strip"]
1383 strip = opts["strip"]
1384 wlock = lock = None
1384 wlock = lock = None
1385 try:
1385 try:
1386 wlock = repo.wlock()
1386 wlock = repo.wlock()
1387 lock = repo.lock()
1387 lock = repo.lock()
1388 for p in patches:
1388 for p in patches:
1389 pf = os.path.join(d, p)
1389 pf = os.path.join(d, p)
1390
1390
1391 if pf == '-':
1391 if pf == '-':
1392 ui.status(_("applying patch from stdin\n"))
1392 ui.status(_("applying patch from stdin\n"))
1393 data = patch.extract(ui, sys.stdin)
1393 data = patch.extract(ui, sys.stdin)
1394 else:
1394 else:
1395 ui.status(_("applying %s\n") % p)
1395 ui.status(_("applying %s\n") % p)
1396 if os.path.exists(pf):
1396 if os.path.exists(pf):
1397 data = patch.extract(ui, file(pf, 'rb'))
1397 data = patch.extract(ui, file(pf, 'rb'))
1398 else:
1398 else:
1399 data = patch.extract(ui, urllib.urlopen(pf))
1399 data = patch.extract(ui, urllib.urlopen(pf))
1400 tmpname, message, user, date, branch, nodeid, p1, p2 = data
1400 tmpname, message, user, date, branch, nodeid, p1, p2 = data
1401
1401
1402 if tmpname is None:
1402 if tmpname is None:
1403 raise util.Abort(_('no diffs found'))
1403 raise util.Abort(_('no diffs found'))
1404
1404
1405 try:
1405 try:
1406 cmdline_message = cmdutil.logmessage(opts)
1406 cmdline_message = cmdutil.logmessage(opts)
1407 if cmdline_message:
1407 if cmdline_message:
1408 # pickup the cmdline msg
1408 # pickup the cmdline msg
1409 message = cmdline_message
1409 message = cmdline_message
1410 elif message:
1410 elif message:
1411 # pickup the patch msg
1411 # pickup the patch msg
1412 message = message.strip()
1412 message = message.strip()
1413 else:
1413 else:
1414 # launch the editor
1414 # launch the editor
1415 message = None
1415 message = None
1416 ui.debug(_('message:\n%s\n') % message)
1416 ui.debug(_('message:\n%s\n') % message)
1417
1417
1418 wp = repo.workingctx().parents()
1418 wp = repo.workingctx().parents()
1419 if opts.get('exact'):
1419 if opts.get('exact'):
1420 if not nodeid or not p1:
1420 if not nodeid or not p1:
1421 raise util.Abort(_('not a mercurial patch'))
1421 raise util.Abort(_('not a mercurial patch'))
1422 p1 = repo.lookup(p1)
1422 p1 = repo.lookup(p1)
1423 p2 = repo.lookup(p2 or hex(nullid))
1423 p2 = repo.lookup(p2 or hex(nullid))
1424
1424
1425 if p1 != wp[0].node():
1425 if p1 != wp[0].node():
1426 hg.clean(repo, p1)
1426 hg.clean(repo, p1)
1427 repo.dirstate.setparents(p1, p2)
1427 repo.dirstate.setparents(p1, p2)
1428 elif p2:
1428 elif p2:
1429 try:
1429 try:
1430 p1 = repo.lookup(p1)
1430 p1 = repo.lookup(p1)
1431 p2 = repo.lookup(p2)
1431 p2 = repo.lookup(p2)
1432 if p1 == wp[0].node():
1432 if p1 == wp[0].node():
1433 repo.dirstate.setparents(p1, p2)
1433 repo.dirstate.setparents(p1, p2)
1434 except hg.RepoError:
1434 except hg.RepoError:
1435 pass
1435 pass
1436 if opts.get('exact') or opts.get('import_branch'):
1436 if opts.get('exact') or opts.get('import_branch'):
1437 repo.dirstate.setbranch(branch or 'default')
1437 repo.dirstate.setbranch(branch or 'default')
1438
1438
1439 files = {}
1439 files = {}
1440 try:
1440 try:
1441 fuzz = patch.patch(tmpname, ui, strip=strip, cwd=repo.root,
1441 fuzz = patch.patch(tmpname, ui, strip=strip, cwd=repo.root,
1442 files=files)
1442 files=files)
1443 finally:
1443 finally:
1444 files = patch.updatedir(ui, repo, files)
1444 files = patch.updatedir(ui, repo, files)
1445 n = repo.commit(files, message, user, date)
1445 n = repo.commit(files, message, user, date)
1446 if opts.get('exact'):
1446 if opts.get('exact'):
1447 if hex(n) != nodeid:
1447 if hex(n) != nodeid:
1448 repo.rollback()
1448 repo.rollback()
1449 raise util.Abort(_('patch is damaged'
1449 raise util.Abort(_('patch is damaged'
1450 ' or loses information'))
1450 ' or loses information'))
1451 finally:
1451 finally:
1452 os.unlink(tmpname)
1452 os.unlink(tmpname)
1453 finally:
1453 finally:
1454 del lock, wlock
1454 del lock, wlock
1455
1455
1456 def incoming(ui, repo, source="default", **opts):
1456 def incoming(ui, repo, source="default", **opts):
1457 """show new changesets found in source
1457 """show new changesets found in source
1458
1458
1459 Show new changesets found in the specified path/URL or the default
1459 Show new changesets found in the specified path/URL or the default
1460 pull location. These are the changesets that would be pulled if a pull
1460 pull location. These are the changesets that would be pulled if a pull
1461 was requested.
1461 was requested.
1462
1462
1463 For remote repository, using --bundle avoids downloading the changesets
1463 For remote repository, using --bundle avoids downloading the changesets
1464 twice if the incoming is followed by a pull.
1464 twice if the incoming is followed by a pull.
1465
1465
1466 See pull for valid source format details.
1466 See pull for valid source format details.
1467 """
1467 """
1468 source, revs, checkout = hg.parseurl(ui.expandpath(source), opts['rev'])
1468 source, revs, checkout = hg.parseurl(ui.expandpath(source), opts['rev'])
1469 cmdutil.setremoteconfig(ui, opts)
1469 cmdutil.setremoteconfig(ui, opts)
1470
1470
1471 other = hg.repository(ui, source)
1471 other = hg.repository(ui, source)
1472 ui.status(_('comparing with %s\n') % util.hidepassword(source))
1472 ui.status(_('comparing with %s\n') % util.hidepassword(source))
1473 if revs:
1473 if revs:
1474 revs = [other.lookup(rev) for rev in revs]
1474 revs = [other.lookup(rev) for rev in revs]
1475 incoming = repo.findincoming(other, heads=revs, force=opts["force"])
1475 incoming = repo.findincoming(other, heads=revs, force=opts["force"])
1476 if not incoming:
1476 if not incoming:
1477 try:
1477 try:
1478 os.unlink(opts["bundle"])
1478 os.unlink(opts["bundle"])
1479 except:
1479 except:
1480 pass
1480 pass
1481 ui.status(_("no changes found\n"))
1481 ui.status(_("no changes found\n"))
1482 return 1
1482 return 1
1483
1483
1484 cleanup = None
1484 cleanup = None
1485 try:
1485 try:
1486 fname = opts["bundle"]
1486 fname = opts["bundle"]
1487 if fname or not other.local():
1487 if fname or not other.local():
1488 # create a bundle (uncompressed if other repo is not local)
1488 # create a bundle (uncompressed if other repo is not local)
1489 if revs is None:
1489 if revs is None:
1490 cg = other.changegroup(incoming, "incoming")
1490 cg = other.changegroup(incoming, "incoming")
1491 else:
1491 else:
1492 cg = other.changegroupsubset(incoming, revs, 'incoming')
1492 cg = other.changegroupsubset(incoming, revs, 'incoming')
1493 bundletype = other.local() and "HG10BZ" or "HG10UN"
1493 bundletype = other.local() and "HG10BZ" or "HG10UN"
1494 fname = cleanup = changegroup.writebundle(cg, fname, bundletype)
1494 fname = cleanup = changegroup.writebundle(cg, fname, bundletype)
1495 # keep written bundle?
1495 # keep written bundle?
1496 if opts["bundle"]:
1496 if opts["bundle"]:
1497 cleanup = None
1497 cleanup = None
1498 if not other.local():
1498 if not other.local():
1499 # use the created uncompressed bundlerepo
1499 # use the created uncompressed bundlerepo
1500 other = bundlerepo.bundlerepository(ui, repo.root, fname)
1500 other = bundlerepo.bundlerepository(ui, repo.root, fname)
1501
1501
1502 o = other.changelog.nodesbetween(incoming, revs)[0]
1502 o = other.changelog.nodesbetween(incoming, revs)[0]
1503 if opts['newest_first']:
1503 if opts['newest_first']:
1504 o.reverse()
1504 o.reverse()
1505 displayer = cmdutil.show_changeset(ui, other, opts)
1505 displayer = cmdutil.show_changeset(ui, other, opts)
1506 for n in o:
1506 for n in o:
1507 parents = [p for p in other.changelog.parents(n) if p != nullid]
1507 parents = [p for p in other.changelog.parents(n) if p != nullid]
1508 if opts['no_merges'] and len(parents) == 2:
1508 if opts['no_merges'] and len(parents) == 2:
1509 continue
1509 continue
1510 displayer.show(changenode=n)
1510 displayer.show(changenode=n)
1511 finally:
1511 finally:
1512 if hasattr(other, 'close'):
1512 if hasattr(other, 'close'):
1513 other.close()
1513 other.close()
1514 if cleanup:
1514 if cleanup:
1515 os.unlink(cleanup)
1515 os.unlink(cleanup)
1516
1516
1517 def init(ui, dest=".", **opts):
1517 def init(ui, dest=".", **opts):
1518 """create a new repository in the given directory
1518 """create a new repository in the given directory
1519
1519
1520 Initialize a new repository in the given directory. If the given
1520 Initialize a new repository in the given directory. If the given
1521 directory does not exist, it is created.
1521 directory does not exist, it is created.
1522
1522
1523 If no directory is given, the current directory is used.
1523 If no directory is given, the current directory is used.
1524
1524
1525 It is possible to specify an ssh:// URL as the destination.
1525 It is possible to specify an ssh:// URL as the destination.
1526 Look at the help text for the pull command for important details
1526 Look at the help text for the pull command for important details
1527 about ssh:// URLs.
1527 about ssh:// URLs.
1528 """
1528 """
1529 cmdutil.setremoteconfig(ui, opts)
1529 cmdutil.setremoteconfig(ui, opts)
1530 hg.repository(ui, dest, create=1)
1530 hg.repository(ui, dest, create=1)
1531
1531
1532 def locate(ui, repo, *pats, **opts):
1532 def locate(ui, repo, *pats, **opts):
1533 """locate files matching specific patterns
1533 """locate files matching specific patterns
1534
1534
1535 Print all files under Mercurial control whose names match the
1535 Print all files under Mercurial control whose names match the
1536 given patterns.
1536 given patterns.
1537
1537
1538 This command searches the entire repository by default. To search
1538 This command searches the entire repository by default. To search
1539 just the current directory and its subdirectories, use
1539 just the current directory and its subdirectories, use
1540 "--include .".
1540 "--include .".
1541
1541
1542 If no patterns are given to match, this command prints all file
1542 If no patterns are given to match, this command prints all file
1543 names.
1543 names.
1544
1544
1545 If you want to feed the output of this command into the "xargs"
1545 If you want to feed the output of this command into the "xargs"
1546 command, use the "-0" option to both this command and "xargs".
1546 command, use the "-0" option to both this command and "xargs".
1547 This will avoid the problem of "xargs" treating single filenames
1547 This will avoid the problem of "xargs" treating single filenames
1548 that contain white space as multiple filenames.
1548 that contain white space as multiple filenames.
1549 """
1549 """
1550 end = opts['print0'] and '\0' or '\n'
1550 end = opts['print0'] and '\0' or '\n'
1551 rev = opts['rev']
1551 rev = opts['rev']
1552 if rev:
1552 if rev:
1553 node = repo.lookup(rev)
1553 node = repo.lookup(rev)
1554 else:
1554 else:
1555 node = None
1555 node = None
1556
1556
1557 ret = 1
1557 ret = 1
1558 for src, abs, rel, exact in cmdutil.walk(repo, pats, opts, node=node,
1558 for src, abs, rel, exact in cmdutil.walk(repo, pats, opts, node=node,
1559 badmatch=util.always,
1559 badmatch=util.always,
1560 default='relglob'):
1560 default='relglob'):
1561 if src == 'b':
1561 if src == 'b':
1562 continue
1562 continue
1563 if not node and abs not in repo.dirstate:
1563 if not node and abs not in repo.dirstate:
1564 continue
1564 continue
1565 if opts['fullpath']:
1565 if opts['fullpath']:
1566 ui.write(os.path.join(repo.root, abs), end)
1566 ui.write(os.path.join(repo.root, abs), end)
1567 else:
1567 else:
1568 ui.write(((pats and rel) or abs), end)
1568 ui.write(((pats and rel) or abs), end)
1569 ret = 0
1569 ret = 0
1570
1570
1571 return ret
1571 return ret
1572
1572
1573 def log(ui, repo, *pats, **opts):
1573 def log(ui, repo, *pats, **opts):
1574 """show revision history of entire repository or files
1574 """show revision history of entire repository or files
1575
1575
1576 Print the revision history of the specified files or the entire
1576 Print the revision history of the specified files or the entire
1577 project.
1577 project.
1578
1578
1579 File history is shown without following rename or copy history of
1579 File history is shown without following rename or copy history of
1580 files. Use -f/--follow with a file name to follow history across
1580 files. Use -f/--follow with a file name to follow history across
1581 renames and copies. --follow without a file name will only show
1581 renames and copies. --follow without a file name will only show
1582 ancestors or descendants of the starting revision. --follow-first
1582 ancestors or descendants of the starting revision. --follow-first
1583 only follows the first parent of merge revisions.
1583 only follows the first parent of merge revisions.
1584
1584
1585 If no revision range is specified, the default is tip:0 unless
1585 If no revision range is specified, the default is tip:0 unless
1586 --follow is set, in which case the working directory parent is
1586 --follow is set, in which case the working directory parent is
1587 used as the starting revision.
1587 used as the starting revision.
1588
1588
1589 By default this command outputs: changeset id and hash, tags,
1589 By default this command outputs: changeset id and hash, tags,
1590 non-trivial parents, user, date and time, and a summary for each
1590 non-trivial parents, user, date and time, and a summary for each
1591 commit. When the -v/--verbose switch is used, the list of changed
1591 commit. When the -v/--verbose switch is used, the list of changed
1592 files and full commit message is shown.
1592 files and full commit message is shown.
1593
1593
1594 NOTE: log -p may generate unexpected diff output for merge
1594 NOTE: log -p may generate unexpected diff output for merge
1595 changesets, as it will compare the merge changeset against its
1595 changesets, as it will compare the merge changeset against its
1596 first parent only. Also, the files: list will only reflect files
1596 first parent only. Also, the files: list will only reflect files
1597 that are different from BOTH parents.
1597 that are different from BOTH parents.
1598
1598
1599 """
1599 """
1600
1600
1601 get = util.cachefunc(lambda r: repo.changectx(r).changeset())
1601 get = util.cachefunc(lambda r: repo.changectx(r).changeset())
1602 changeiter, matchfn = cmdutil.walkchangerevs(ui, repo, pats, get, opts)
1602 changeiter, matchfn = cmdutil.walkchangerevs(ui, repo, pats, get, opts)
1603
1603
1604 if opts['limit']:
1604 if opts['limit']:
1605 try:
1605 try:
1606 limit = int(opts['limit'])
1606 limit = int(opts['limit'])
1607 except ValueError:
1607 except ValueError:
1608 raise util.Abort(_('limit must be a positive integer'))
1608 raise util.Abort(_('limit must be a positive integer'))
1609 if limit <= 0: raise util.Abort(_('limit must be positive'))
1609 if limit <= 0: raise util.Abort(_('limit must be positive'))
1610 else:
1610 else:
1611 limit = sys.maxint
1611 limit = sys.maxint
1612 count = 0
1612 count = 0
1613
1613
1614 if opts['copies'] and opts['rev']:
1614 if opts['copies'] and opts['rev']:
1615 endrev = max(cmdutil.revrange(repo, opts['rev'])) + 1
1615 endrev = max(cmdutil.revrange(repo, opts['rev'])) + 1
1616 else:
1616 else:
1617 endrev = repo.changelog.count()
1617 endrev = repo.changelog.count()
1618 rcache = {}
1618 rcache = {}
1619 ncache = {}
1619 ncache = {}
1620 dcache = []
1620 dcache = []
1621 def getrenamed(fn, rev, man):
1621 def getrenamed(fn, rev, man):
1622 '''looks up all renames for a file (up to endrev) the first
1622 '''looks up all renames for a file (up to endrev) the first
1623 time the file is given. It indexes on the changerev and only
1623 time the file is given. It indexes on the changerev and only
1624 parses the manifest if linkrev != changerev.
1624 parses the manifest if linkrev != changerev.
1625 Returns rename info for fn at changerev rev.'''
1625 Returns rename info for fn at changerev rev.'''
1626 if fn not in rcache:
1626 if fn not in rcache:
1627 rcache[fn] = {}
1627 rcache[fn] = {}
1628 ncache[fn] = {}
1628 ncache[fn] = {}
1629 fl = repo.file(fn)
1629 fl = repo.file(fn)
1630 for i in xrange(fl.count()):
1630 for i in xrange(fl.count()):
1631 node = fl.node(i)
1631 node = fl.node(i)
1632 lr = fl.linkrev(node)
1632 lr = fl.linkrev(node)
1633 renamed = fl.renamed(node)
1633 renamed = fl.renamed(node)
1634 rcache[fn][lr] = renamed
1634 rcache[fn][lr] = renamed
1635 if renamed:
1635 if renamed:
1636 ncache[fn][node] = renamed
1636 ncache[fn][node] = renamed
1637 if lr >= endrev:
1637 if lr >= endrev:
1638 break
1638 break
1639 if rev in rcache[fn]:
1639 if rev in rcache[fn]:
1640 return rcache[fn][rev]
1640 return rcache[fn][rev]
1641 mr = repo.manifest.rev(man)
1641 mr = repo.manifest.rev(man)
1642 if repo.manifest.parentrevs(mr) != (mr - 1, nullrev):
1642 if repo.manifest.parentrevs(mr) != (mr - 1, nullrev):
1643 return ncache[fn].get(repo.manifest.find(man, fn)[0])
1643 return ncache[fn].get(repo.manifest.find(man, fn)[0])
1644 if not dcache or dcache[0] != man:
1644 if not dcache or dcache[0] != man:
1645 dcache[:] = [man, repo.manifest.readdelta(man)]
1645 dcache[:] = [man, repo.manifest.readdelta(man)]
1646 if fn in dcache[1]:
1646 if fn in dcache[1]:
1647 return ncache[fn].get(dcache[1][fn])
1647 return ncache[fn].get(dcache[1][fn])
1648 return None
1648 return None
1649
1649
1650 df = False
1650 df = False
1651 if opts["date"]:
1651 if opts["date"]:
1652 df = util.matchdate(opts["date"])
1652 df = util.matchdate(opts["date"])
1653
1653
1654 displayer = cmdutil.show_changeset(ui, repo, opts, True, matchfn)
1654 displayer = cmdutil.show_changeset(ui, repo, opts, True, matchfn)
1655 for st, rev, fns in changeiter:
1655 for st, rev, fns in changeiter:
1656 if st == 'add':
1656 if st == 'add':
1657 changenode = repo.changelog.node(rev)
1657 changenode = repo.changelog.node(rev)
1658 parents = [p for p in repo.changelog.parentrevs(rev)
1658 parents = [p for p in repo.changelog.parentrevs(rev)
1659 if p != nullrev]
1659 if p != nullrev]
1660 if opts['no_merges'] and len(parents) == 2:
1660 if opts['no_merges'] and len(parents) == 2:
1661 continue
1661 continue
1662 if opts['only_merges'] and len(parents) != 2:
1662 if opts['only_merges'] and len(parents) != 2:
1663 continue
1663 continue
1664
1664
1665 if df:
1665 if df:
1666 changes = get(rev)
1666 changes = get(rev)
1667 if not df(changes[2][0]):
1667 if not df(changes[2][0]):
1668 continue
1668 continue
1669
1669
1670 if opts['keyword']:
1670 if opts['keyword']:
1671 changes = get(rev)
1671 changes = get(rev)
1672 miss = 0
1672 miss = 0
1673 for k in [kw.lower() for kw in opts['keyword']]:
1673 for k in [kw.lower() for kw in opts['keyword']]:
1674 if not (k in changes[1].lower() or
1674 if not (k in changes[1].lower() or
1675 k in changes[4].lower() or
1675 k in changes[4].lower() or
1676 k in " ".join(changes[3]).lower()):
1676 k in " ".join(changes[3]).lower()):
1677 miss = 1
1677 miss = 1
1678 break
1678 break
1679 if miss:
1679 if miss:
1680 continue
1680 continue
1681
1681
1682 copies = []
1682 copies = []
1683 if opts.get('copies') and rev:
1683 if opts.get('copies') and rev:
1684 mf = get(rev)[0]
1684 mf = get(rev)[0]
1685 for fn in get(rev)[3]:
1685 for fn in get(rev)[3]:
1686 rename = getrenamed(fn, rev, mf)
1686 rename = getrenamed(fn, rev, mf)
1687 if rename:
1687 if rename:
1688 copies.append((fn, rename[0]))
1688 copies.append((fn, rename[0]))
1689 displayer.show(rev, changenode, copies=copies)
1689 displayer.show(rev, changenode, copies=copies)
1690 elif st == 'iter':
1690 elif st == 'iter':
1691 if count == limit: break
1691 if count == limit: break
1692 if displayer.flush(rev):
1692 if displayer.flush(rev):
1693 count += 1
1693 count += 1
1694
1694
1695 def manifest(ui, repo, node=None, rev=None):
1695 def manifest(ui, repo, node=None, rev=None):
1696 """output the current or given revision of the project manifest
1696 """output the current or given revision of the project manifest
1697
1697
1698 Print a list of version controlled files for the given revision.
1698 Print a list of version controlled files for the given revision.
1699 If no revision is given, the parent of the working directory is used,
1699 If no revision is given, the parent of the working directory is used,
1700 or tip if no revision is checked out.
1700 or tip if no revision is checked out.
1701
1701
1702 The manifest is the list of files being version controlled. If no revision
1702 The manifest is the list of files being version controlled. If no revision
1703 is given then the first parent of the working directory is used.
1703 is given then the first parent of the working directory is used.
1704
1704
1705 With -v flag, print file permissions, symlink and executable bits. With
1705 With -v flag, print file permissions, symlink and executable bits. With
1706 --debug flag, print file revision hashes.
1706 --debug flag, print file revision hashes.
1707 """
1707 """
1708
1708
1709 if rev and node:
1709 if rev and node:
1710 raise util.Abort(_("please specify just one revision"))
1710 raise util.Abort(_("please specify just one revision"))
1711
1711
1712 if not node:
1712 if not node:
1713 node = rev
1713 node = rev
1714
1714
1715 m = repo.changectx(node).manifest()
1715 m = repo.changectx(node).manifest()
1716 files = m.keys()
1716 files = m.keys()
1717 files.sort()
1717 files.sort()
1718
1718
1719 for f in files:
1719 for f in files:
1720 if ui.debugflag:
1720 if ui.debugflag:
1721 ui.write("%40s " % hex(m[f]))
1721 ui.write("%40s " % hex(m[f]))
1722 if ui.verbose:
1722 if ui.verbose:
1723 type = m.execf(f) and "*" or m.linkf(f) and "@" or " "
1723 type = m.execf(f) and "*" or m.linkf(f) and "@" or " "
1724 perm = m.execf(f) and "755" or "644"
1724 perm = m.execf(f) and "755" or "644"
1725 ui.write("%3s %1s " % (perm, type))
1725 ui.write("%3s %1s " % (perm, type))
1726 ui.write("%s\n" % f)
1726 ui.write("%s\n" % f)
1727
1727
1728 def merge(ui, repo, node=None, force=None, rev=None):
1728 def merge(ui, repo, node=None, force=None, rev=None):
1729 """merge working directory with another revision
1729 """merge working directory with another revision
1730
1730
1731 Merge the contents of the current working directory and the
1731 Merge the contents of the current working directory and the
1732 requested revision. Files that changed between either parent are
1732 requested revision. Files that changed between either parent are
1733 marked as changed for the next commit and a commit must be
1733 marked as changed for the next commit and a commit must be
1734 performed before any further updates are allowed.
1734 performed before any further updates are allowed.
1735
1735
1736 If no revision is specified, the working directory's parent is a
1736 If no revision is specified, the working directory's parent is a
1737 head revision, and the repository contains exactly one other head,
1737 head revision, and the repository contains exactly one other head,
1738 the other head is merged with by default. Otherwise, an explicit
1738 the other head is merged with by default. Otherwise, an explicit
1739 revision to merge with must be provided.
1739 revision to merge with must be provided.
1740 """
1740 """
1741
1741
1742 if rev and node:
1742 if rev and node:
1743 raise util.Abort(_("please specify just one revision"))
1743 raise util.Abort(_("please specify just one revision"))
1744 if not node:
1744 if not node:
1745 node = rev
1745 node = rev
1746
1746
1747 if not node:
1747 if not node:
1748 heads = repo.heads()
1748 heads = repo.heads()
1749 if len(heads) > 2:
1749 if len(heads) > 2:
1750 raise util.Abort(_('repo has %d heads - '
1750 raise util.Abort(_('repo has %d heads - '
1751 'please merge with an explicit rev') %
1751 'please merge with an explicit rev') %
1752 len(heads))
1752 len(heads))
1753 parent = repo.dirstate.parents()[0]
1753 parent = repo.dirstate.parents()[0]
1754 if len(heads) == 1:
1754 if len(heads) == 1:
1755 msg = _('there is nothing to merge')
1755 msg = _('there is nothing to merge')
1756 if parent != repo.lookup(repo.workingctx().branch()):
1756 if parent != repo.lookup(repo.workingctx().branch()):
1757 msg = _('%s - use "hg update" instead') % msg
1757 msg = _('%s - use "hg update" instead') % msg
1758 raise util.Abort(msg)
1758 raise util.Abort(msg)
1759
1759
1760 if parent not in heads:
1760 if parent not in heads:
1761 raise util.Abort(_('working dir not at a head rev - '
1761 raise util.Abort(_('working dir not at a head rev - '
1762 'use "hg update" or merge with an explicit rev'))
1762 'use "hg update" or merge with an explicit rev'))
1763 node = parent == heads[0] and heads[-1] or heads[0]
1763 node = parent == heads[0] and heads[-1] or heads[0]
1764 return hg.merge(repo, node, force=force)
1764 return hg.merge(repo, node, force=force)
1765
1765
1766 def outgoing(ui, repo, dest=None, **opts):
1766 def outgoing(ui, repo, dest=None, **opts):
1767 """show changesets not found in destination
1767 """show changesets not found in destination
1768
1768
1769 Show changesets not found in the specified destination repository or
1769 Show changesets not found in the specified destination repository or
1770 the default push location. These are the changesets that would be pushed
1770 the default push location. These are the changesets that would be pushed
1771 if a push was requested.
1771 if a push was requested.
1772
1772
1773 See pull for valid destination format details.
1773 See pull for valid destination format details.
1774 """
1774 """
1775 dest, revs, checkout = hg.parseurl(
1775 dest, revs, checkout = hg.parseurl(
1776 ui.expandpath(dest or 'default-push', dest or 'default'), opts['rev'])
1776 ui.expandpath(dest or 'default-push', dest or 'default'), opts['rev'])
1777 cmdutil.setremoteconfig(ui, opts)
1777 cmdutil.setremoteconfig(ui, opts)
1778 if revs:
1778 if revs:
1779 revs = [repo.lookup(rev) for rev in revs]
1779 revs = [repo.lookup(rev) for rev in revs]
1780
1780
1781 other = hg.repository(ui, dest)
1781 other = hg.repository(ui, dest)
1782 ui.status(_('comparing with %s\n') % util.hidepassword(dest))
1782 ui.status(_('comparing with %s\n') % util.hidepassword(dest))
1783 o = repo.findoutgoing(other, force=opts['force'])
1783 o = repo.findoutgoing(other, force=opts['force'])
1784 if not o:
1784 if not o:
1785 ui.status(_("no changes found\n"))
1785 ui.status(_("no changes found\n"))
1786 return 1
1786 return 1
1787 o = repo.changelog.nodesbetween(o, revs)[0]
1787 o = repo.changelog.nodesbetween(o, revs)[0]
1788 if opts['newest_first']:
1788 if opts['newest_first']:
1789 o.reverse()
1789 o.reverse()
1790 displayer = cmdutil.show_changeset(ui, repo, opts)
1790 displayer = cmdutil.show_changeset(ui, repo, opts)
1791 for n in o:
1791 for n in o:
1792 parents = [p for p in repo.changelog.parents(n) if p != nullid]
1792 parents = [p for p in repo.changelog.parents(n) if p != nullid]
1793 if opts['no_merges'] and len(parents) == 2:
1793 if opts['no_merges'] and len(parents) == 2:
1794 continue
1794 continue
1795 displayer.show(changenode=n)
1795 displayer.show(changenode=n)
1796
1796
1797 def parents(ui, repo, file_=None, **opts):
1797 def parents(ui, repo, file_=None, **opts):
1798 """show the parents of the working dir or revision
1798 """show the parents of the working dir or revision
1799
1799
1800 Print the working directory's parent revisions. If a
1800 Print the working directory's parent revisions. If a
1801 revision is given via --rev, the parent of that revision
1801 revision is given via --rev, the parent of that revision
1802 will be printed. If a file argument is given, revision in
1802 will be printed. If a file argument is given, revision in
1803 which the file was last changed (before the working directory
1803 which the file was last changed (before the working directory
1804 revision or the argument to --rev if given) is printed.
1804 revision or the argument to --rev if given) is printed.
1805 """
1805 """
1806 rev = opts.get('rev')
1806 rev = opts.get('rev')
1807 if rev:
1807 if rev:
1808 ctx = repo.changectx(rev)
1808 ctx = repo.changectx(rev)
1809 else:
1809 else:
1810 ctx = repo.workingctx()
1810 ctx = repo.workingctx()
1811
1811
1812 if file_:
1812 if file_:
1813 files, match, anypats = cmdutil.matchpats(repo, (file_,), opts)
1813 files, match, anypats = cmdutil.matchpats(repo, (file_,), opts)
1814 if anypats or len(files) != 1:
1814 if anypats or len(files) != 1:
1815 raise util.Abort(_('can only specify an explicit file name'))
1815 raise util.Abort(_('can only specify an explicit file name'))
1816 file_ = files[0]
1816 file_ = files[0]
1817 filenodes = []
1817 filenodes = []
1818 for cp in ctx.parents():
1818 for cp in ctx.parents():
1819 if not cp:
1819 if not cp:
1820 continue
1820 continue
1821 try:
1821 try:
1822 filenodes.append(cp.filenode(file_))
1822 filenodes.append(cp.filenode(file_))
1823 except revlog.LookupError:
1823 except revlog.LookupError:
1824 pass
1824 pass
1825 if not filenodes:
1825 if not filenodes:
1826 raise util.Abort(_("'%s' not found in manifest!") % file_)
1826 raise util.Abort(_("'%s' not found in manifest!") % file_)
1827 fl = repo.file(file_)
1827 fl = repo.file(file_)
1828 p = [repo.lookup(fl.linkrev(fn)) for fn in filenodes]
1828 p = [repo.lookup(fl.linkrev(fn)) for fn in filenodes]
1829 else:
1829 else:
1830 p = [cp.node() for cp in ctx.parents()]
1830 p = [cp.node() for cp in ctx.parents()]
1831
1831
1832 displayer = cmdutil.show_changeset(ui, repo, opts)
1832 displayer = cmdutil.show_changeset(ui, repo, opts)
1833 for n in p:
1833 for n in p:
1834 if n != nullid:
1834 if n != nullid:
1835 displayer.show(changenode=n)
1835 displayer.show(changenode=n)
1836
1836
1837 def paths(ui, repo, search=None):
1837 def paths(ui, repo, search=None):
1838 """show definition of symbolic path names
1838 """show definition of symbolic path names
1839
1839
1840 Show definition of symbolic path name NAME. If no name is given, show
1840 Show definition of symbolic path name NAME. If no name is given, show
1841 definition of available names.
1841 definition of available names.
1842
1842
1843 Path names are defined in the [paths] section of /etc/mercurial/hgrc
1843 Path names are defined in the [paths] section of /etc/mercurial/hgrc
1844 and $HOME/.hgrc. If run inside a repository, .hg/hgrc is used, too.
1844 and $HOME/.hgrc. If run inside a repository, .hg/hgrc is used, too.
1845 """
1845 """
1846 if search:
1846 if search:
1847 for name, path in ui.configitems("paths"):
1847 for name, path in ui.configitems("paths"):
1848 if name == search:
1848 if name == search:
1849 ui.write("%s\n" % path)
1849 ui.write("%s\n" % path)
1850 return
1850 return
1851 ui.warn(_("not found!\n"))
1851 ui.warn(_("not found!\n"))
1852 return 1
1852 return 1
1853 else:
1853 else:
1854 for name, path in ui.configitems("paths"):
1854 for name, path in ui.configitems("paths"):
1855 ui.write("%s = %s\n" % (name, path))
1855 ui.write("%s = %s\n" % (name, path))
1856
1856
1857 def postincoming(ui, repo, modheads, optupdate, checkout):
1857 def postincoming(ui, repo, modheads, optupdate, checkout):
1858 if modheads == 0:
1858 if modheads == 0:
1859 return
1859 return
1860 if optupdate:
1860 if optupdate:
1861 if modheads <= 1 or checkout:
1861 if modheads <= 1 or checkout:
1862 return hg.update(repo, checkout)
1862 return hg.update(repo, checkout)
1863 else:
1863 else:
1864 ui.status(_("not updating, since new heads added\n"))
1864 ui.status(_("not updating, since new heads added\n"))
1865 if modheads > 1:
1865 if modheads > 1:
1866 ui.status(_("(run 'hg heads' to see heads, 'hg merge' to merge)\n"))
1866 ui.status(_("(run 'hg heads' to see heads, 'hg merge' to merge)\n"))
1867 else:
1867 else:
1868 ui.status(_("(run 'hg update' to get a working copy)\n"))
1868 ui.status(_("(run 'hg update' to get a working copy)\n"))
1869
1869
1870 def pull(ui, repo, source="default", **opts):
1870 def pull(ui, repo, source="default", **opts):
1871 """pull changes from the specified source
1871 """pull changes from the specified source
1872
1872
1873 Pull changes from a remote repository to a local one.
1873 Pull changes from a remote repository to a local one.
1874
1874
1875 This finds all changes from the repository at the specified path
1875 This finds all changes from the repository at the specified path
1876 or URL and adds them to the local repository. By default, this
1876 or URL and adds them to the local repository. By default, this
1877 does not update the copy of the project in the working directory.
1877 does not update the copy of the project in the working directory.
1878
1878
1879 Valid URLs are of the form:
1879 Valid URLs are of the form:
1880
1880
1881 local/filesystem/path (or file://local/filesystem/path)
1881 local/filesystem/path (or file://local/filesystem/path)
1882 http://[user@]host[:port]/[path]
1882 http://[user@]host[:port]/[path]
1883 https://[user@]host[:port]/[path]
1883 https://[user@]host[:port]/[path]
1884 ssh://[user@]host[:port]/[path]
1884 ssh://[user@]host[:port]/[path]
1885 static-http://host[:port]/[path]
1885 static-http://host[:port]/[path]
1886
1886
1887 Paths in the local filesystem can either point to Mercurial
1887 Paths in the local filesystem can either point to Mercurial
1888 repositories or to bundle files (as created by 'hg bundle' or
1888 repositories or to bundle files (as created by 'hg bundle' or
1889 'hg incoming --bundle'). The static-http:// protocol, albeit slow,
1889 'hg incoming --bundle'). The static-http:// protocol, albeit slow,
1890 allows access to a Mercurial repository where you simply use a web
1890 allows access to a Mercurial repository where you simply use a web
1891 server to publish the .hg directory as static content.
1891 server to publish the .hg directory as static content.
1892
1892
1893 An optional identifier after # indicates a particular branch, tag,
1893 An optional identifier after # indicates a particular branch, tag,
1894 or changeset to pull.
1894 or changeset to pull.
1895
1895
1896 Some notes about using SSH with Mercurial:
1896 Some notes about using SSH with Mercurial:
1897 - SSH requires an accessible shell account on the destination machine
1897 - SSH requires an accessible shell account on the destination machine
1898 and a copy of hg in the remote path or specified with as remotecmd.
1898 and a copy of hg in the remote path or specified with as remotecmd.
1899 - path is relative to the remote user's home directory by default.
1899 - path is relative to the remote user's home directory by default.
1900 Use an extra slash at the start of a path to specify an absolute path:
1900 Use an extra slash at the start of a path to specify an absolute path:
1901 ssh://example.com//tmp/repository
1901 ssh://example.com//tmp/repository
1902 - Mercurial doesn't use its own compression via SSH; the right thing
1902 - Mercurial doesn't use its own compression via SSH; the right thing
1903 to do is to configure it in your ~/.ssh/config, e.g.:
1903 to do is to configure it in your ~/.ssh/config, e.g.:
1904 Host *.mylocalnetwork.example.com
1904 Host *.mylocalnetwork.example.com
1905 Compression no
1905 Compression no
1906 Host *
1906 Host *
1907 Compression yes
1907 Compression yes
1908 Alternatively specify "ssh -C" as your ssh command in your hgrc or
1908 Alternatively specify "ssh -C" as your ssh command in your hgrc or
1909 with the --ssh command line option.
1909 with the --ssh command line option.
1910 """
1910 """
1911 source, revs, checkout = hg.parseurl(ui.expandpath(source), opts['rev'])
1911 source, revs, checkout = hg.parseurl(ui.expandpath(source), opts['rev'])
1912 cmdutil.setremoteconfig(ui, opts)
1912 cmdutil.setremoteconfig(ui, opts)
1913
1913
1914 other = hg.repository(ui, source)
1914 other = hg.repository(ui, source)
1915 ui.status(_('pulling from %s\n') % util.hidepassword(source))
1915 ui.status(_('pulling from %s\n') % util.hidepassword(source))
1916 if revs:
1916 if revs:
1917 try:
1917 try:
1918 revs = [other.lookup(rev) for rev in revs]
1918 revs = [other.lookup(rev) for rev in revs]
1919 except repo.NoCapability:
1919 except repo.NoCapability:
1920 error = _("Other repository doesn't support revision lookup, "
1920 error = _("Other repository doesn't support revision lookup, "
1921 "so a rev cannot be specified.")
1921 "so a rev cannot be specified.")
1922 raise util.Abort(error)
1922 raise util.Abort(error)
1923
1923
1924 modheads = repo.pull(other, heads=revs, force=opts['force'])
1924 modheads = repo.pull(other, heads=revs, force=opts['force'])
1925 return postincoming(ui, repo, modheads, opts['update'], checkout)
1925 return postincoming(ui, repo, modheads, opts['update'], checkout)
1926
1926
1927 def push(ui, repo, dest=None, **opts):
1927 def push(ui, repo, dest=None, **opts):
1928 """push changes to the specified destination
1928 """push changes to the specified destination
1929
1929
1930 Push changes from the local repository to the given destination.
1930 Push changes from the local repository to the given destination.
1931
1931
1932 This is the symmetrical operation for pull. It helps to move
1932 This is the symmetrical operation for pull. It helps to move
1933 changes from the current repository to a different one. If the
1933 changes from the current repository to a different one. If the
1934 destination is local this is identical to a pull in that directory
1934 destination is local this is identical to a pull in that directory
1935 from the current one.
1935 from the current one.
1936
1936
1937 By default, push will refuse to run if it detects the result would
1937 By default, push will refuse to run if it detects the result would
1938 increase the number of remote heads. This generally indicates the
1938 increase the number of remote heads. This generally indicates the
1939 the client has forgotten to sync and merge before pushing.
1939 the client has forgotten to sync and merge before pushing.
1940
1940
1941 Valid URLs are of the form:
1941 Valid URLs are of the form:
1942
1942
1943 local/filesystem/path (or file://local/filesystem/path)
1943 local/filesystem/path (or file://local/filesystem/path)
1944 ssh://[user@]host[:port]/[path]
1944 ssh://[user@]host[:port]/[path]
1945 http://[user@]host[:port]/[path]
1945 http://[user@]host[:port]/[path]
1946 https://[user@]host[:port]/[path]
1946 https://[user@]host[:port]/[path]
1947
1947
1948 An optional identifier after # indicates a particular branch, tag,
1948 An optional identifier after # indicates a particular branch, tag,
1949 or changeset to push.
1949 or changeset to push.
1950
1950
1951 Look at the help text for the pull command for important details
1951 Look at the help text for the pull command for important details
1952 about ssh:// URLs.
1952 about ssh:// URLs.
1953
1953
1954 Pushing to http:// and https:// URLs is only possible, if this
1954 Pushing to http:// and https:// URLs is only possible, if this
1955 feature is explicitly enabled on the remote Mercurial server.
1955 feature is explicitly enabled on the remote Mercurial server.
1956 """
1956 """
1957 dest, revs, checkout = hg.parseurl(
1957 dest, revs, checkout = hg.parseurl(
1958 ui.expandpath(dest or 'default-push', dest or 'default'), opts['rev'])
1958 ui.expandpath(dest or 'default-push', dest or 'default'), opts['rev'])
1959 cmdutil.setremoteconfig(ui, opts)
1959 cmdutil.setremoteconfig(ui, opts)
1960
1960
1961 other = hg.repository(ui, dest)
1961 other = hg.repository(ui, dest)
1962 ui.status('pushing to %s\n' % util.hidepassword(dest))
1962 ui.status('pushing to %s\n' % util.hidepassword(dest))
1963 if revs:
1963 if revs:
1964 revs = [repo.lookup(rev) for rev in revs]
1964 revs = [repo.lookup(rev) for rev in revs]
1965 r = repo.push(other, opts['force'], revs=revs)
1965 r = repo.push(other, opts['force'], revs=revs)
1966 return r == 0
1966 return r == 0
1967
1967
1968 def rawcommit(ui, repo, *pats, **opts):
1968 def rawcommit(ui, repo, *pats, **opts):
1969 """raw commit interface (DEPRECATED)
1969 """raw commit interface (DEPRECATED)
1970
1970
1971 (DEPRECATED)
1971 (DEPRECATED)
1972 Lowlevel commit, for use in helper scripts.
1972 Lowlevel commit, for use in helper scripts.
1973
1973
1974 This command is not intended to be used by normal users, as it is
1974 This command is not intended to be used by normal users, as it is
1975 primarily useful for importing from other SCMs.
1975 primarily useful for importing from other SCMs.
1976
1976
1977 This command is now deprecated and will be removed in a future
1977 This command is now deprecated and will be removed in a future
1978 release, please use debugsetparents and commit instead.
1978 release, please use debugsetparents and commit instead.
1979 """
1979 """
1980
1980
1981 ui.warn(_("(the rawcommit command is deprecated)\n"))
1981 ui.warn(_("(the rawcommit command is deprecated)\n"))
1982
1982
1983 message = cmdutil.logmessage(opts)
1983 message = cmdutil.logmessage(opts)
1984
1984
1985 files, match, anypats = cmdutil.matchpats(repo, pats, opts)
1985 files, match, anypats = cmdutil.matchpats(repo, pats, opts)
1986 if opts['files']:
1986 if opts['files']:
1987 files += open(opts['files']).read().splitlines()
1987 files += open(opts['files']).read().splitlines()
1988
1988
1989 parents = [repo.lookup(p) for p in opts['parent']]
1989 parents = [repo.lookup(p) for p in opts['parent']]
1990
1990
1991 try:
1991 try:
1992 repo.rawcommit(files, message, opts['user'], opts['date'], *parents)
1992 repo.rawcommit(files, message, opts['user'], opts['date'], *parents)
1993 except ValueError, inst:
1993 except ValueError, inst:
1994 raise util.Abort(str(inst))
1994 raise util.Abort(str(inst))
1995
1995
1996 def recover(ui, repo):
1996 def recover(ui, repo):
1997 """roll back an interrupted transaction
1997 """roll back an interrupted transaction
1998
1998
1999 Recover from an interrupted commit or pull.
1999 Recover from an interrupted commit or pull.
2000
2000
2001 This command tries to fix the repository status after an interrupted
2001 This command tries to fix the repository status after an interrupted
2002 operation. It should only be necessary when Mercurial suggests it.
2002 operation. It should only be necessary when Mercurial suggests it.
2003 """
2003 """
2004 if repo.recover():
2004 if repo.recover():
2005 return hg.verify(repo)
2005 return hg.verify(repo)
2006 return 1
2006 return 1
2007
2007
2008 def remove(ui, repo, *pats, **opts):
2008 def remove(ui, repo, *pats, **opts):
2009 """remove the specified files on the next commit
2009 """remove the specified files on the next commit
2010
2010
2011 Schedule the indicated files for removal from the repository.
2011 Schedule the indicated files for removal from the repository.
2012
2012
2013 This only removes files from the current branch, not from the
2013 This only removes files from the current branch, not from the
2014 entire project history. If the files still exist in the working
2014 entire project history. If the files still exist in the working
2015 directory, they will be deleted from it. If invoked with --after,
2015 directory, they will be deleted from it. If invoked with --after,
2016 files are marked as removed, but not actually unlinked unless --force
2016 files are marked as removed, but not actually unlinked unless --force
2017 is also given. Without exact file names, --after will only mark
2017 is also given. Without exact file names, --after will only mark
2018 files as removed if they are no longer in the working directory.
2018 files as removed if they are no longer in the working directory.
2019
2019
2020 This command schedules the files to be removed at the next commit.
2020 This command schedules the files to be removed at the next commit.
2021 To undo a remove before that, see hg revert.
2021 To undo a remove before that, see hg revert.
2022
2022
2023 Modified files and added files are not removed by default. To
2023 Modified files and added files are not removed by default. To
2024 remove them, use the -f/--force option.
2024 remove them, use the -f/--force option.
2025 """
2025 """
2026 if not opts['after'] and not pats:
2026 if not opts['after'] and not pats:
2027 raise util.Abort(_('no files specified'))
2027 raise util.Abort(_('no files specified'))
2028 files, matchfn, anypats = cmdutil.matchpats(repo, pats, opts)
2028 files, matchfn, anypats = cmdutil.matchpats(repo, pats, opts)
2029 exact = dict.fromkeys(files)
2029 exact = dict.fromkeys(files)
2030 mardu = map(dict.fromkeys, repo.status(files=files, match=matchfn))[:5]
2030 mardu = map(dict.fromkeys, repo.status(files=files, match=matchfn))[:5]
2031 modified, added, removed, deleted, unknown = mardu
2031 modified, added, removed, deleted, unknown = mardu
2032 remove, forget = [], []
2032 remove, forget = [], []
2033 for src, abs, rel, exact in cmdutil.walk(repo, pats, opts):
2033 for src, abs, rel, exact in cmdutil.walk(repo, pats, opts):
2034 reason = None
2034 reason = None
2035 if abs in modified and not opts['force']:
2035 if abs in modified and not opts['force']:
2036 reason = _('is modified (use -f to force removal)')
2036 reason = _('is modified (use -f to force removal)')
2037 elif abs in added:
2037 elif abs in added:
2038 if opts['force']:
2038 if opts['force']:
2039 forget.append(abs)
2039 forget.append(abs)
2040 continue
2040 continue
2041 reason = _('has been marked for add (use -f to force removal)')
2041 reason = _('has been marked for add (use -f to force removal)')
2042 exact = 1 # force the message
2042 exact = 1 # force the message
2043 elif abs not in repo.dirstate:
2043 elif abs not in repo.dirstate:
2044 reason = _('is not managed')
2044 reason = _('is not managed')
2045 elif opts['after'] and not exact and abs not in deleted:
2045 elif opts['after'] and not exact and abs not in deleted:
2046 continue
2046 continue
2047 elif abs in removed:
2047 elif abs in removed:
2048 continue
2048 continue
2049 if reason:
2049 if reason:
2050 if exact:
2050 if exact:
2051 ui.warn(_('not removing %s: file %s\n') % (rel, reason))
2051 ui.warn(_('not removing %s: file %s\n') % (rel, reason))
2052 else:
2052 else:
2053 if ui.verbose or not exact:
2053 if ui.verbose or not exact:
2054 ui.status(_('removing %s\n') % rel)
2054 ui.status(_('removing %s\n') % rel)
2055 remove.append(abs)
2055 remove.append(abs)
2056 repo.forget(forget)
2056 repo.forget(forget)
2057 repo.remove(remove, unlink=opts['force'] or not opts['after'])
2057 repo.remove(remove, unlink=opts['force'] or not opts['after'])
2058
2058
2059 def rename(ui, repo, *pats, **opts):
2059 def rename(ui, repo, *pats, **opts):
2060 """rename files; equivalent of copy + remove
2060 """rename files; equivalent of copy + remove
2061
2061
2062 Mark dest as copies of sources; mark sources for deletion. If
2062 Mark dest as copies of sources; mark sources for deletion. If
2063 dest is a directory, copies are put in that directory. If dest is
2063 dest is a directory, copies are put in that directory. If dest is
2064 a file, there can only be one source.
2064 a file, there can only be one source.
2065
2065
2066 By default, this command copies the contents of files as they
2066 By default, this command copies the contents of files as they
2067 stand in the working directory. If invoked with --after, the
2067 stand in the working directory. If invoked with --after, the
2068 operation is recorded, but no copying is performed.
2068 operation is recorded, but no copying is performed.
2069
2069
2070 This command takes effect in the next commit. To undo a rename
2070 This command takes effect in the next commit. To undo a rename
2071 before that, see hg revert.
2071 before that, see hg revert.
2072 """
2072 """
2073 wlock = repo.wlock(False)
2073 wlock = repo.wlock(False)
2074 try:
2074 try:
2075 return cmdutil.copy(ui, repo, pats, opts, rename=True)
2075 return cmdutil.copy(ui, repo, pats, opts, rename=True)
2076 finally:
2076 finally:
2077 del wlock
2077 del wlock
2078
2078
2079 def revert(ui, repo, *pats, **opts):
2079 def revert(ui, repo, *pats, **opts):
2080 """restore individual files or dirs to an earlier state
2080 """restore individual files or dirs to an earlier state
2081
2081
2082 (use update -r to check out earlier revisions, revert does not
2082 (use update -r to check out earlier revisions, revert does not
2083 change the working dir parents)
2083 change the working dir parents)
2084
2084
2085 With no revision specified, revert the named files or directories
2085 With no revision specified, revert the named files or directories
2086 to the contents they had in the parent of the working directory.
2086 to the contents they had in the parent of the working directory.
2087 This restores the contents of the affected files to an unmodified
2087 This restores the contents of the affected files to an unmodified
2088 state and unschedules adds, removes, copies, and renames. If the
2088 state and unschedules adds, removes, copies, and renames. If the
2089 working directory has two parents, you must explicitly specify the
2089 working directory has two parents, you must explicitly specify the
2090 revision to revert to.
2090 revision to revert to.
2091
2091
2092 Using the -r option, revert the given files or directories to their
2092 Using the -r option, revert the given files or directories to their
2093 contents as of a specific revision. This can be helpful to "roll
2093 contents as of a specific revision. This can be helpful to "roll
2094 back" some or all of an earlier change.
2094 back" some or all of an earlier change.
2095
2095
2096 Revert modifies the working directory. It does not commit any
2096 Revert modifies the working directory. It does not commit any
2097 changes, or change the parent of the working directory. If you
2097 changes, or change the parent of the working directory. If you
2098 revert to a revision other than the parent of the working
2098 revert to a revision other than the parent of the working
2099 directory, the reverted files will thus appear modified
2099 directory, the reverted files will thus appear modified
2100 afterwards.
2100 afterwards.
2101
2101
2102 If a file has been deleted, it is restored. If the executable
2102 If a file has been deleted, it is restored. If the executable
2103 mode of a file was changed, it is reset.
2103 mode of a file was changed, it is reset.
2104
2104
2105 If names are given, all files matching the names are reverted.
2105 If names are given, all files matching the names are reverted.
2106
2106
2107 If no arguments are given, no files are reverted.
2107 If no arguments are given, no files are reverted.
2108
2108
2109 Modified files are saved with a .orig suffix before reverting.
2109 Modified files are saved with a .orig suffix before reverting.
2110 To disable these backups, use --no-backup.
2110 To disable these backups, use --no-backup.
2111 """
2111 """
2112
2112
2113 if opts["date"]:
2113 if opts["date"]:
2114 if opts["rev"]:
2114 if opts["rev"]:
2115 raise util.Abort(_("you can't specify a revision and a date"))
2115 raise util.Abort(_("you can't specify a revision and a date"))
2116 opts["rev"] = cmdutil.finddate(ui, repo, opts["date"])
2116 opts["rev"] = cmdutil.finddate(ui, repo, opts["date"])
2117
2117
2118 if not pats and not opts['all']:
2118 if not pats and not opts['all']:
2119 raise util.Abort(_('no files or directories specified; '
2119 raise util.Abort(_('no files or directories specified; '
2120 'use --all to revert the whole repo'))
2120 'use --all to revert the whole repo'))
2121
2121
2122 parent, p2 = repo.dirstate.parents()
2122 parent, p2 = repo.dirstate.parents()
2123 if not opts['rev'] and p2 != nullid:
2123 if not opts['rev'] and p2 != nullid:
2124 raise util.Abort(_('uncommitted merge - please provide a '
2124 raise util.Abort(_('uncommitted merge - please provide a '
2125 'specific revision'))
2125 'specific revision'))
2126 ctx = repo.changectx(opts['rev'])
2126 ctx = repo.changectx(opts['rev'])
2127 node = ctx.node()
2127 node = ctx.node()
2128 mf = ctx.manifest()
2128 mf = ctx.manifest()
2129 if node == parent:
2129 if node == parent:
2130 pmf = mf
2130 pmf = mf
2131 else:
2131 else:
2132 pmf = None
2132 pmf = None
2133
2133
2134 # need all matching names in dirstate and manifest of target rev,
2134 # need all matching names in dirstate and manifest of target rev,
2135 # so have to walk both. do not print errors if files exist in one
2135 # so have to walk both. do not print errors if files exist in one
2136 # but not other.
2136 # but not other.
2137
2137
2138 names = {}
2138 names = {}
2139 target_only = {}
2139 target_only = {}
2140
2140
2141 wlock = repo.wlock()
2141 wlock = repo.wlock()
2142 try:
2142 try:
2143 # walk dirstate.
2143 # walk dirstate.
2144 for src, abs, rel, exact in cmdutil.walk(repo, pats, opts,
2144 for src, abs, rel, exact in cmdutil.walk(repo, pats, opts,
2145 badmatch=mf.has_key):
2145 badmatch=mf.has_key):
2146 names[abs] = (rel, exact)
2146 names[abs] = (rel, exact)
2147 if src == 'b':
2147 if src == 'b':
2148 target_only[abs] = True
2148 target_only[abs] = True
2149
2149
2150 # walk target manifest.
2150 # walk target manifest.
2151
2151
2152 def badmatch(path):
2152 def badmatch(path):
2153 if path in names:
2153 if path in names:
2154 return True
2154 return True
2155 path_ = path + '/'
2155 path_ = path + '/'
2156 for f in names:
2156 for f in names:
2157 if f.startswith(path_):
2157 if f.startswith(path_):
2158 return True
2158 return True
2159 return False
2159 return False
2160
2160
2161 for src, abs, rel, exact in cmdutil.walk(repo, pats, opts, node=node,
2161 for src, abs, rel, exact in cmdutil.walk(repo, pats, opts, node=node,
2162 badmatch=badmatch):
2162 badmatch=badmatch):
2163 if abs in names or src == 'b':
2163 if abs in names or src == 'b':
2164 continue
2164 continue
2165 names[abs] = (rel, exact)
2165 names[abs] = (rel, exact)
2166 target_only[abs] = True
2166 target_only[abs] = True
2167
2167
2168 changes = repo.status(match=names.has_key)[:5]
2168 changes = repo.status(match=names.has_key)[:5]
2169 modified, added, removed, deleted, unknown = map(dict.fromkeys, changes)
2169 modified, added, removed, deleted, unknown = map(dict.fromkeys, changes)
2170
2170
2171 # if f is a rename, also revert the source
2171 # if f is a rename, also revert the source
2172 cwd = repo.getcwd()
2172 cwd = repo.getcwd()
2173 for f in added:
2173 for f in added:
2174 src = repo.dirstate.copied(f)
2174 src = repo.dirstate.copied(f)
2175 if src and src not in names and repo.dirstate[src] == 'r':
2175 if src and src not in names and repo.dirstate[src] == 'r':
2176 removed[src] = None
2176 removed[src] = None
2177 names[src] = (repo.pathto(src, cwd), True)
2177 names[src] = (repo.pathto(src, cwd), True)
2178
2178
2179 revert = ([], _('reverting %s\n'))
2179 revert = ([], _('reverting %s\n'))
2180 add = ([], _('adding %s\n'))
2180 add = ([], _('adding %s\n'))
2181 remove = ([], _('removing %s\n'))
2181 remove = ([], _('removing %s\n'))
2182 forget = ([], _('forgetting %s\n'))
2182 forget = ([], _('forgetting %s\n'))
2183 undelete = ([], _('undeleting %s\n'))
2183 undelete = ([], _('undeleting %s\n'))
2184 update = {}
2184 update = {}
2185
2185
2186 disptable = (
2186 disptable = (
2187 # dispatch table:
2187 # dispatch table:
2188 # file state
2188 # file state
2189 # action if in target manifest
2189 # action if in target manifest
2190 # action if not in target manifest
2190 # action if not in target manifest
2191 # make backup if in target manifest
2191 # make backup if in target manifest
2192 # make backup if not in target manifest
2192 # make backup if not in target manifest
2193 (modified, revert, remove, True, True),
2193 (modified, revert, remove, True, True),
2194 (added, revert, forget, True, False),
2194 (added, revert, forget, True, False),
2195 (removed, undelete, None, False, False),
2195 (removed, undelete, None, False, False),
2196 (deleted, revert, remove, False, False),
2196 (deleted, revert, remove, False, False),
2197 (unknown, add, None, True, False),
2197 (unknown, add, None, True, False),
2198 (target_only, add, None, False, False),
2198 (target_only, add, None, False, False),
2199 )
2199 )
2200
2200
2201 entries = names.items()
2201 entries = names.items()
2202 entries.sort()
2202 entries.sort()
2203
2203
2204 for abs, (rel, exact) in entries:
2204 for abs, (rel, exact) in entries:
2205 mfentry = mf.get(abs)
2205 mfentry = mf.get(abs)
2206 target = repo.wjoin(abs)
2206 target = repo.wjoin(abs)
2207 def handle(xlist, dobackup):
2207 def handle(xlist, dobackup):
2208 xlist[0].append(abs)
2208 xlist[0].append(abs)
2209 update[abs] = 1
2209 update[abs] = 1
2210 if dobackup and not opts['no_backup'] and util.lexists(target):
2210 if dobackup and not opts['no_backup'] and util.lexists(target):
2211 bakname = "%s.orig" % rel
2211 bakname = "%s.orig" % rel
2212 ui.note(_('saving current version of %s as %s\n') %
2212 ui.note(_('saving current version of %s as %s\n') %
2213 (rel, bakname))
2213 (rel, bakname))
2214 if not opts.get('dry_run'):
2214 if not opts.get('dry_run'):
2215 util.copyfile(target, bakname)
2215 util.copyfile(target, bakname)
2216 if ui.verbose or not exact:
2216 if ui.verbose or not exact:
2217 ui.status(xlist[1] % rel)
2217 ui.status(xlist[1] % rel)
2218 for table, hitlist, misslist, backuphit, backupmiss in disptable:
2218 for table, hitlist, misslist, backuphit, backupmiss in disptable:
2219 if abs not in table: continue
2219 if abs not in table: continue
2220 # file has changed in dirstate
2220 # file has changed in dirstate
2221 if mfentry:
2221 if mfentry:
2222 handle(hitlist, backuphit)
2222 handle(hitlist, backuphit)
2223 elif misslist is not None:
2223 elif misslist is not None:
2224 handle(misslist, backupmiss)
2224 handle(misslist, backupmiss)
2225 else:
2225 else:
2226 if exact: ui.warn(_('file not managed: %s\n') % rel)
2226 if exact: ui.warn(_('file not managed: %s\n') % rel)
2227 break
2227 break
2228 else:
2228 else:
2229 # file has not changed in dirstate
2229 # file has not changed in dirstate
2230 if node == parent:
2230 if node == parent:
2231 if exact: ui.warn(_('no changes needed to %s\n') % rel)
2231 if exact: ui.warn(_('no changes needed to %s\n') % rel)
2232 continue
2232 continue
2233 if pmf is None:
2233 if pmf is None:
2234 # only need parent manifest in this unlikely case,
2234 # only need parent manifest in this unlikely case,
2235 # so do not read by default
2235 # so do not read by default
2236 pmf = repo.changectx(parent).manifest()
2236 pmf = repo.changectx(parent).manifest()
2237 if abs in pmf:
2237 if abs in pmf:
2238 if mfentry:
2238 if mfentry:
2239 # if version of file is same in parent and target
2239 # if version of file is same in parent and target
2240 # manifests, do nothing
2240 # manifests, do nothing
2241 if pmf[abs] != mfentry:
2241 if pmf[abs] != mfentry:
2242 handle(revert, False)
2242 handle(revert, False)
2243 else:
2243 else:
2244 handle(remove, False)
2244 handle(remove, False)
2245
2245
2246 if not opts.get('dry_run'):
2246 if not opts.get('dry_run'):
2247 for f in forget[0]:
2247 for f in forget[0]:
2248 repo.dirstate.forget(f)
2248 repo.dirstate.forget(f)
2249 r = hg.revert(repo, node, update.has_key)
2249 r = hg.revert(repo, node, update.has_key)
2250 for f in add[0]:
2250 for f in add[0]:
2251 repo.dirstate.add(f)
2251 repo.dirstate.add(f)
2252 for f in undelete[0]:
2252 for f in undelete[0]:
2253 repo.dirstate.normal(f)
2253 repo.dirstate.normal(f)
2254 for f in remove[0]:
2254 for f in remove[0]:
2255 repo.dirstate.remove(f)
2255 repo.dirstate.remove(f)
2256 return r
2256 return r
2257 finally:
2257 finally:
2258 del wlock
2258 del wlock
2259
2259
2260 def rollback(ui, repo):
2260 def rollback(ui, repo):
2261 """roll back the last transaction
2261 """roll back the last transaction
2262
2262
2263 This command should be used with care. There is only one level of
2263 This command should be used with care. There is only one level of
2264 rollback, and there is no way to undo a rollback. It will also
2264 rollback, and there is no way to undo a rollback. It will also
2265 restore the dirstate at the time of the last transaction, losing
2265 restore the dirstate at the time of the last transaction, losing
2266 any dirstate changes since that time.
2266 any dirstate changes since that time.
2267
2267
2268 Transactions are used to encapsulate the effects of all commands
2268 Transactions are used to encapsulate the effects of all commands
2269 that create new changesets or propagate existing changesets into a
2269 that create new changesets or propagate existing changesets into a
2270 repository. For example, the following commands are transactional,
2270 repository. For example, the following commands are transactional,
2271 and their effects can be rolled back:
2271 and their effects can be rolled back:
2272
2272
2273 commit
2273 commit
2274 import
2274 import
2275 pull
2275 pull
2276 push (with this repository as destination)
2276 push (with this repository as destination)
2277 unbundle
2277 unbundle
2278
2278
2279 This command is not intended for use on public repositories. Once
2279 This command is not intended for use on public repositories. Once
2280 changes are visible for pull by other users, rolling a transaction
2280 changes are visible for pull by other users, rolling a transaction
2281 back locally is ineffective (someone else may already have pulled
2281 back locally is ineffective (someone else may already have pulled
2282 the changes). Furthermore, a race is possible with readers of the
2282 the changes). Furthermore, a race is possible with readers of the
2283 repository; for example an in-progress pull from the repository
2283 repository; for example an in-progress pull from the repository
2284 may fail if a rollback is performed.
2284 may fail if a rollback is performed.
2285 """
2285 """
2286 repo.rollback()
2286 repo.rollback()
2287
2287
2288 def root(ui, repo):
2288 def root(ui, repo):
2289 """print the root (top) of the current working dir
2289 """print the root (top) of the current working dir
2290
2290
2291 Print the root directory of the current repository.
2291 Print the root directory of the current repository.
2292 """
2292 """
2293 ui.write(repo.root + "\n")
2293 ui.write(repo.root + "\n")
2294
2294
2295 def serve(ui, repo, **opts):
2295 def serve(ui, repo, **opts):
2296 """export the repository via HTTP
2296 """export the repository via HTTP
2297
2297
2298 Start a local HTTP repository browser and pull server.
2298 Start a local HTTP repository browser and pull server.
2299
2299
2300 By default, the server logs accesses to stdout and errors to
2300 By default, the server logs accesses to stdout and errors to
2301 stderr. Use the "-A" and "-E" options to log to files.
2301 stderr. Use the "-A" and "-E" options to log to files.
2302 """
2302 """
2303
2303
2304 if opts["stdio"]:
2304 if opts["stdio"]:
2305 if repo is None:
2305 if repo is None:
2306 raise hg.RepoError(_("There is no Mercurial repository here"
2306 raise hg.RepoError(_("There is no Mercurial repository here"
2307 " (.hg not found)"))
2307 " (.hg not found)"))
2308 s = sshserver.sshserver(ui, repo)
2308 s = sshserver.sshserver(ui, repo)
2309 s.serve_forever()
2309 s.serve_forever()
2310
2310
2311 parentui = ui.parentui or ui
2311 parentui = ui.parentui or ui
2312 optlist = ("name templates style address port ipv6"
2312 optlist = ("name templates style address port ipv6"
2313 " accesslog errorlog webdir_conf certificate")
2313 " accesslog errorlog webdir_conf certificate")
2314 for o in optlist.split():
2314 for o in optlist.split():
2315 if opts[o]:
2315 if opts[o]:
2316 parentui.setconfig("web", o, str(opts[o]))
2316 parentui.setconfig("web", o, str(opts[o]))
2317 if (repo is not None) and (repo.ui != parentui):
2317 if (repo is not None) and (repo.ui != parentui):
2318 repo.ui.setconfig("web", o, str(opts[o]))
2318 repo.ui.setconfig("web", o, str(opts[o]))
2319
2319
2320 if repo is None and not ui.config("web", "webdir_conf"):
2320 if repo is None and not ui.config("web", "webdir_conf"):
2321 raise hg.RepoError(_("There is no Mercurial repository here"
2321 raise hg.RepoError(_("There is no Mercurial repository here"
2322 " (.hg not found)"))
2322 " (.hg not found)"))
2323
2323
2324 class service:
2324 class service:
2325 def init(self):
2325 def init(self):
2326 util.set_signal_handler()
2326 util.set_signal_handler()
2327 try:
2327 try:
2328 self.httpd = hgweb.server.create_server(parentui, repo)
2328 self.httpd = hgweb.server.create_server(parentui, repo)
2329 except socket.error, inst:
2329 except socket.error, inst:
2330 raise util.Abort(_('cannot start server: ') + inst.args[1])
2330 raise util.Abort(_('cannot start server: ') + inst.args[1])
2331
2331
2332 if not ui.verbose: return
2332 if not ui.verbose: return
2333
2333
2334 if self.httpd.port != 80:
2334 if self.httpd.port != 80:
2335 ui.status(_('listening at http://%s:%d/\n') %
2335 ui.status(_('listening at http://%s:%d/\n') %
2336 (self.httpd.addr, self.httpd.port))
2336 (self.httpd.addr, self.httpd.port))
2337 else:
2337 else:
2338 ui.status(_('listening at http://%s/\n') % self.httpd.addr)
2338 ui.status(_('listening at http://%s/\n') % self.httpd.addr)
2339
2339
2340 def run(self):
2340 def run(self):
2341 self.httpd.serve_forever()
2341 self.httpd.serve_forever()
2342
2342
2343 service = service()
2343 service = service()
2344
2344
2345 cmdutil.service(opts, initfn=service.init, runfn=service.run)
2345 cmdutil.service(opts, initfn=service.init, runfn=service.run)
2346
2346
2347 def status(ui, repo, *pats, **opts):
2347 def status(ui, repo, *pats, **opts):
2348 """show changed files in the working directory
2348 """show changed files in the working directory
2349
2349
2350 Show status of files in the repository. If names are given, only
2350 Show status of files in the repository. If names are given, only
2351 files that match are shown. Files that are clean or ignored, are
2351 files that match are shown. Files that are clean or ignored, are
2352 not listed unless -c (clean), -i (ignored) or -A is given.
2352 not listed unless -c (clean), -i (ignored) or -A is given.
2353
2353
2354 NOTE: status may appear to disagree with diff if permissions have
2354 NOTE: status may appear to disagree with diff if permissions have
2355 changed or a merge has occurred. The standard diff format does not
2355 changed or a merge has occurred. The standard diff format does not
2356 report permission changes and diff only reports changes relative
2356 report permission changes and diff only reports changes relative
2357 to one merge parent.
2357 to one merge parent.
2358
2358
2359 If one revision is given, it is used as the base revision.
2359 If one revision is given, it is used as the base revision.
2360 If two revisions are given, the difference between them is shown.
2360 If two revisions are given, the difference between them is shown.
2361
2361
2362 The codes used to show the status of files are:
2362 The codes used to show the status of files are:
2363 M = modified
2363 M = modified
2364 A = added
2364 A = added
2365 R = removed
2365 R = removed
2366 = = clean
2366 C = clean
2367 ! = deleted, but still tracked
2367 ! = deleted, but still tracked
2368 ? = not tracked
2368 ? = not tracked
2369 I = ignored (not shown by default)
2369 I = ignored (not shown by default)
2370 = the previous added file was copied from here
2370 = the previous added file was copied from here
2371 """
2371 """
2372
2372
2373 all = opts['all']
2373 all = opts['all']
2374 node1, node2 = cmdutil.revpair(repo, opts.get('rev'))
2374 node1, node2 = cmdutil.revpair(repo, opts.get('rev'))
2375
2375
2376 files, matchfn, anypats = cmdutil.matchpats(repo, pats, opts)
2376 files, matchfn, anypats = cmdutil.matchpats(repo, pats, opts)
2377 cwd = (pats and repo.getcwd()) or ''
2377 cwd = (pats and repo.getcwd()) or ''
2378 modified, added, removed, deleted, unknown, ignored, clean = [
2378 modified, added, removed, deleted, unknown, ignored, clean = [
2379 n for n in repo.status(node1=node1, node2=node2, files=files,
2379 n for n in repo.status(node1=node1, node2=node2, files=files,
2380 match=matchfn,
2380 match=matchfn,
2381 list_ignored=all or opts['ignored'],
2381 list_ignored=all or opts['ignored'],
2382 list_clean=all or opts['clean'])]
2382 list_clean=all or opts['clean'])]
2383
2383
2384 changetypes = (('modified', 'M', modified),
2384 changetypes = (('modified', 'M', modified),
2385 ('added', 'A', added),
2385 ('added', 'A', added),
2386 ('removed', 'R', removed),
2386 ('removed', 'R', removed),
2387 ('deleted', '!', deleted),
2387 ('deleted', '!', deleted),
2388 ('unknown', '?', unknown),
2388 ('unknown', '?', unknown),
2389 ('ignored', 'I', ignored))
2389 ('ignored', 'I', ignored))
2390
2390
2391 explicit_changetypes = changetypes + (('clean', '=', clean),)
2391 explicit_changetypes = changetypes + (('clean', 'C', clean),)
2392
2392
2393 end = opts['print0'] and '\0' or '\n'
2393 end = opts['print0'] and '\0' or '\n'
2394
2394
2395 for opt, char, changes in ([ct for ct in explicit_changetypes
2395 for opt, char, changes in ([ct for ct in explicit_changetypes
2396 if all or opts[ct[0]]]
2396 if all or opts[ct[0]]]
2397 or changetypes):
2397 or changetypes):
2398 if opts['no_status']:
2398 if opts['no_status']:
2399 format = "%%s%s" % end
2399 format = "%%s%s" % end
2400 else:
2400 else:
2401 format = "%s %%s%s" % (char, end)
2401 format = "%s %%s%s" % (char, end)
2402
2402
2403 for f in changes:
2403 for f in changes:
2404 ui.write(format % repo.pathto(f, cwd))
2404 ui.write(format % repo.pathto(f, cwd))
2405 if ((all or opts.get('copies')) and not opts.get('no_status')):
2405 if ((all or opts.get('copies')) and not opts.get('no_status')):
2406 copied = repo.dirstate.copied(f)
2406 copied = repo.dirstate.copied(f)
2407 if copied:
2407 if copied:
2408 ui.write(' %s%s' % (repo.pathto(copied, cwd), end))
2408 ui.write(' %s%s' % (repo.pathto(copied, cwd), end))
2409
2409
2410 def tag(ui, repo, name, rev_=None, **opts):
2410 def tag(ui, repo, name, rev_=None, **opts):
2411 """add a tag for the current or given revision
2411 """add a tag for the current or given revision
2412
2412
2413 Name a particular revision using <name>.
2413 Name a particular revision using <name>.
2414
2414
2415 Tags are used to name particular revisions of the repository and are
2415 Tags are used to name particular revisions of the repository and are
2416 very useful to compare different revision, to go back to significant
2416 very useful to compare different revision, to go back to significant
2417 earlier versions or to mark branch points as releases, etc.
2417 earlier versions or to mark branch points as releases, etc.
2418
2418
2419 If no revision is given, the parent of the working directory is used,
2419 If no revision is given, the parent of the working directory is used,
2420 or tip if no revision is checked out.
2420 or tip if no revision is checked out.
2421
2421
2422 To facilitate version control, distribution, and merging of tags,
2422 To facilitate version control, distribution, and merging of tags,
2423 they are stored as a file named ".hgtags" which is managed
2423 they are stored as a file named ".hgtags" which is managed
2424 similarly to other project files and can be hand-edited if
2424 similarly to other project files and can be hand-edited if
2425 necessary. The file '.hg/localtags' is used for local tags (not
2425 necessary. The file '.hg/localtags' is used for local tags (not
2426 shared among repositories).
2426 shared among repositories).
2427 """
2427 """
2428 if name in ['tip', '.', 'null']:
2428 if name in ['tip', '.', 'null']:
2429 raise util.Abort(_("the name '%s' is reserved") % name)
2429 raise util.Abort(_("the name '%s' is reserved") % name)
2430 if rev_ is not None:
2430 if rev_ is not None:
2431 ui.warn(_("use of 'hg tag NAME [REV]' is deprecated, "
2431 ui.warn(_("use of 'hg tag NAME [REV]' is deprecated, "
2432 "please use 'hg tag [-r REV] NAME' instead\n"))
2432 "please use 'hg tag [-r REV] NAME' instead\n"))
2433 if opts['rev']:
2433 if opts['rev']:
2434 raise util.Abort(_("use only one form to specify the revision"))
2434 raise util.Abort(_("use only one form to specify the revision"))
2435 if opts['rev'] and opts['remove']:
2435 if opts['rev'] and opts['remove']:
2436 raise util.Abort(_("--rev and --remove are incompatible"))
2436 raise util.Abort(_("--rev and --remove are incompatible"))
2437 if opts['rev']:
2437 if opts['rev']:
2438 rev_ = opts['rev']
2438 rev_ = opts['rev']
2439 message = opts['message']
2439 message = opts['message']
2440 if opts['remove']:
2440 if opts['remove']:
2441 tagtype = repo.tagtype(name)
2441 tagtype = repo.tagtype(name)
2442
2442
2443 if not tagtype:
2443 if not tagtype:
2444 raise util.Abort(_('tag %s does not exist') % name)
2444 raise util.Abort(_('tag %s does not exist') % name)
2445 if opts['local'] and tagtype == 'global':
2445 if opts['local'] and tagtype == 'global':
2446 raise util.Abort(_('%s tag is global') % name)
2446 raise util.Abort(_('%s tag is global') % name)
2447 if not opts['local'] and tagtype == 'local':
2447 if not opts['local'] and tagtype == 'local':
2448 raise util.Abort(_('%s tag is local') % name)
2448 raise util.Abort(_('%s tag is local') % name)
2449
2449
2450 rev_ = nullid
2450 rev_ = nullid
2451 if not message:
2451 if not message:
2452 message = _('Removed tag %s') % name
2452 message = _('Removed tag %s') % name
2453 elif name in repo.tags() and not opts['force']:
2453 elif name in repo.tags() and not opts['force']:
2454 raise util.Abort(_('a tag named %s already exists (use -f to force)')
2454 raise util.Abort(_('a tag named %s already exists (use -f to force)')
2455 % name)
2455 % name)
2456 if not rev_ and repo.dirstate.parents()[1] != nullid:
2456 if not rev_ and repo.dirstate.parents()[1] != nullid:
2457 raise util.Abort(_('uncommitted merge - please provide a '
2457 raise util.Abort(_('uncommitted merge - please provide a '
2458 'specific revision'))
2458 'specific revision'))
2459 r = repo.changectx(rev_).node()
2459 r = repo.changectx(rev_).node()
2460
2460
2461 if not message:
2461 if not message:
2462 message = _('Added tag %s for changeset %s') % (name, short(r))
2462 message = _('Added tag %s for changeset %s') % (name, short(r))
2463
2463
2464 repo.tag(name, r, message, opts['local'], opts['user'], opts['date'])
2464 repo.tag(name, r, message, opts['local'], opts['user'], opts['date'])
2465
2465
2466 def tags(ui, repo):
2466 def tags(ui, repo):
2467 """list repository tags
2467 """list repository tags
2468
2468
2469 List the repository tags.
2469 List the repository tags.
2470
2470
2471 This lists both regular and local tags. When the -v/--verbose switch
2471 This lists both regular and local tags. When the -v/--verbose switch
2472 is used, a third column "local" is printed for local tags.
2472 is used, a third column "local" is printed for local tags.
2473 """
2473 """
2474
2474
2475 l = repo.tagslist()
2475 l = repo.tagslist()
2476 l.reverse()
2476 l.reverse()
2477 hexfunc = ui.debugflag and hex or short
2477 hexfunc = ui.debugflag and hex or short
2478 tagtype = ""
2478 tagtype = ""
2479
2479
2480 for t, n in l:
2480 for t, n in l:
2481 if ui.quiet:
2481 if ui.quiet:
2482 ui.write("%s\n" % t)
2482 ui.write("%s\n" % t)
2483 continue
2483 continue
2484
2484
2485 try:
2485 try:
2486 hn = hexfunc(n)
2486 hn = hexfunc(n)
2487 r = "%5d:%s" % (repo.changelog.rev(n), hn)
2487 r = "%5d:%s" % (repo.changelog.rev(n), hn)
2488 except revlog.LookupError:
2488 except revlog.LookupError:
2489 r = " ?:%s" % hn
2489 r = " ?:%s" % hn
2490 else:
2490 else:
2491 spaces = " " * (30 - util.locallen(t))
2491 spaces = " " * (30 - util.locallen(t))
2492 if ui.verbose:
2492 if ui.verbose:
2493 if repo.tagtype(t) == 'local':
2493 if repo.tagtype(t) == 'local':
2494 tagtype = " local"
2494 tagtype = " local"
2495 else:
2495 else:
2496 tagtype = ""
2496 tagtype = ""
2497 ui.write("%s%s %s%s\n" % (t, spaces, r, tagtype))
2497 ui.write("%s%s %s%s\n" % (t, spaces, r, tagtype))
2498
2498
2499 def tip(ui, repo, **opts):
2499 def tip(ui, repo, **opts):
2500 """show the tip revision
2500 """show the tip revision
2501
2501
2502 Show the tip revision.
2502 Show the tip revision.
2503 """
2503 """
2504 cmdutil.show_changeset(ui, repo, opts).show(nullrev+repo.changelog.count())
2504 cmdutil.show_changeset(ui, repo, opts).show(nullrev+repo.changelog.count())
2505
2505
2506 def unbundle(ui, repo, fname1, *fnames, **opts):
2506 def unbundle(ui, repo, fname1, *fnames, **opts):
2507 """apply one or more changegroup files
2507 """apply one or more changegroup files
2508
2508
2509 Apply one or more compressed changegroup files generated by the
2509 Apply one or more compressed changegroup files generated by the
2510 bundle command.
2510 bundle command.
2511 """
2511 """
2512 fnames = (fname1,) + fnames
2512 fnames = (fname1,) + fnames
2513 for fname in fnames:
2513 for fname in fnames:
2514 if os.path.exists(fname):
2514 if os.path.exists(fname):
2515 f = open(fname, "rb")
2515 f = open(fname, "rb")
2516 else:
2516 else:
2517 f = urllib.urlopen(fname)
2517 f = urllib.urlopen(fname)
2518 gen = changegroup.readbundle(f, fname)
2518 gen = changegroup.readbundle(f, fname)
2519 modheads = repo.addchangegroup(gen, 'unbundle', 'bundle:' + fname)
2519 modheads = repo.addchangegroup(gen, 'unbundle', 'bundle:' + fname)
2520
2520
2521 return postincoming(ui, repo, modheads, opts['update'], None)
2521 return postincoming(ui, repo, modheads, opts['update'], None)
2522
2522
2523 def update(ui, repo, node=None, rev=None, clean=False, date=None):
2523 def update(ui, repo, node=None, rev=None, clean=False, date=None):
2524 """update working directory
2524 """update working directory
2525
2525
2526 Update the working directory to the specified revision, or the
2526 Update the working directory to the specified revision, or the
2527 tip of the current branch if none is specified.
2527 tip of the current branch if none is specified.
2528
2528
2529 If there are no outstanding changes in the working directory and
2529 If there are no outstanding changes in the working directory and
2530 there is a linear relationship between the current version and the
2530 there is a linear relationship between the current version and the
2531 requested version, the result is the requested version.
2531 requested version, the result is the requested version.
2532
2532
2533 To merge the working directory with another revision, use the
2533 To merge the working directory with another revision, use the
2534 merge command.
2534 merge command.
2535
2535
2536 By default, update will refuse to run if doing so would require
2536 By default, update will refuse to run if doing so would require
2537 discarding local changes.
2537 discarding local changes.
2538 """
2538 """
2539 if rev and node:
2539 if rev and node:
2540 raise util.Abort(_("please specify just one revision"))
2540 raise util.Abort(_("please specify just one revision"))
2541
2541
2542 if not rev:
2542 if not rev:
2543 rev = node
2543 rev = node
2544
2544
2545 if date:
2545 if date:
2546 if rev:
2546 if rev:
2547 raise util.Abort(_("you can't specify a revision and a date"))
2547 raise util.Abort(_("you can't specify a revision and a date"))
2548 rev = cmdutil.finddate(ui, repo, date)
2548 rev = cmdutil.finddate(ui, repo, date)
2549
2549
2550 if clean:
2550 if clean:
2551 return hg.clean(repo, rev)
2551 return hg.clean(repo, rev)
2552 else:
2552 else:
2553 return hg.update(repo, rev)
2553 return hg.update(repo, rev)
2554
2554
2555 def verify(ui, repo):
2555 def verify(ui, repo):
2556 """verify the integrity of the repository
2556 """verify the integrity of the repository
2557
2557
2558 Verify the integrity of the current repository.
2558 Verify the integrity of the current repository.
2559
2559
2560 This will perform an extensive check of the repository's
2560 This will perform an extensive check of the repository's
2561 integrity, validating the hashes and checksums of each entry in
2561 integrity, validating the hashes and checksums of each entry in
2562 the changelog, manifest, and tracked files, as well as the
2562 the changelog, manifest, and tracked files, as well as the
2563 integrity of their crosslinks and indices.
2563 integrity of their crosslinks and indices.
2564 """
2564 """
2565 return hg.verify(repo)
2565 return hg.verify(repo)
2566
2566
2567 def version_(ui):
2567 def version_(ui):
2568 """output version and copyright information"""
2568 """output version and copyright information"""
2569 ui.write(_("Mercurial Distributed SCM (version %s)\n")
2569 ui.write(_("Mercurial Distributed SCM (version %s)\n")
2570 % version.get_version())
2570 % version.get_version())
2571 ui.status(_(
2571 ui.status(_(
2572 "\nCopyright (C) 2005-2007 Matt Mackall <mpm@selenic.com> and others\n"
2572 "\nCopyright (C) 2005-2007 Matt Mackall <mpm@selenic.com> and others\n"
2573 "This is free software; see the source for copying conditions. "
2573 "This is free software; see the source for copying conditions. "
2574 "There is NO\nwarranty; "
2574 "There is NO\nwarranty; "
2575 "not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
2575 "not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
2576 ))
2576 ))
2577
2577
2578 # Command options and aliases are listed here, alphabetically
2578 # Command options and aliases are listed here, alphabetically
2579
2579
2580 globalopts = [
2580 globalopts = [
2581 ('R', 'repository', '',
2581 ('R', 'repository', '',
2582 _('repository root directory or symbolic path name')),
2582 _('repository root directory or symbolic path name')),
2583 ('', 'cwd', '', _('change working directory')),
2583 ('', 'cwd', '', _('change working directory')),
2584 ('y', 'noninteractive', None,
2584 ('y', 'noninteractive', None,
2585 _('do not prompt, assume \'yes\' for any required answers')),
2585 _('do not prompt, assume \'yes\' for any required answers')),
2586 ('q', 'quiet', None, _('suppress output')),
2586 ('q', 'quiet', None, _('suppress output')),
2587 ('v', 'verbose', None, _('enable additional output')),
2587 ('v', 'verbose', None, _('enable additional output')),
2588 ('', 'config', [], _('set/override config option')),
2588 ('', 'config', [], _('set/override config option')),
2589 ('', 'debug', None, _('enable debugging output')),
2589 ('', 'debug', None, _('enable debugging output')),
2590 ('', 'debugger', None, _('start debugger')),
2590 ('', 'debugger', None, _('start debugger')),
2591 ('', 'encoding', util._encoding, _('set the charset encoding')),
2591 ('', 'encoding', util._encoding, _('set the charset encoding')),
2592 ('', 'encodingmode', util._encodingmode, _('set the charset encoding mode')),
2592 ('', 'encodingmode', util._encodingmode, _('set the charset encoding mode')),
2593 ('', 'lsprof', None, _('print improved command execution profile')),
2593 ('', 'lsprof', None, _('print improved command execution profile')),
2594 ('', 'traceback', None, _('print traceback on exception')),
2594 ('', 'traceback', None, _('print traceback on exception')),
2595 ('', 'time', None, _('time how long the command takes')),
2595 ('', 'time', None, _('time how long the command takes')),
2596 ('', 'profile', None, _('print command execution profile')),
2596 ('', 'profile', None, _('print command execution profile')),
2597 ('', 'version', None, _('output version information and exit')),
2597 ('', 'version', None, _('output version information and exit')),
2598 ('h', 'help', None, _('display help and exit')),
2598 ('h', 'help', None, _('display help and exit')),
2599 ]
2599 ]
2600
2600
2601 dryrunopts = [('n', 'dry-run', None,
2601 dryrunopts = [('n', 'dry-run', None,
2602 _('do not perform actions, just print output'))]
2602 _('do not perform actions, just print output'))]
2603
2603
2604 remoteopts = [
2604 remoteopts = [
2605 ('e', 'ssh', '', _('specify ssh command to use')),
2605 ('e', 'ssh', '', _('specify ssh command to use')),
2606 ('', 'remotecmd', '', _('specify hg command to run on the remote side')),
2606 ('', 'remotecmd', '', _('specify hg command to run on the remote side')),
2607 ]
2607 ]
2608
2608
2609 walkopts = [
2609 walkopts = [
2610 ('I', 'include', [], _('include names matching the given patterns')),
2610 ('I', 'include', [], _('include names matching the given patterns')),
2611 ('X', 'exclude', [], _('exclude names matching the given patterns')),
2611 ('X', 'exclude', [], _('exclude names matching the given patterns')),
2612 ]
2612 ]
2613
2613
2614 commitopts = [
2614 commitopts = [
2615 ('m', 'message', '', _('use <text> as commit message')),
2615 ('m', 'message', '', _('use <text> as commit message')),
2616 ('l', 'logfile', '', _('read commit message from <file>')),
2616 ('l', 'logfile', '', _('read commit message from <file>')),
2617 ]
2617 ]
2618
2618
2619 commitopts2 = [
2619 commitopts2 = [
2620 ('d', 'date', '', _('record datecode as commit date')),
2620 ('d', 'date', '', _('record datecode as commit date')),
2621 ('u', 'user', '', _('record user as committer')),
2621 ('u', 'user', '', _('record user as committer')),
2622 ]
2622 ]
2623
2623
2624 table = {
2624 table = {
2625 "^add": (add, walkopts + dryrunopts, _('hg add [OPTION]... [FILE]...')),
2625 "^add": (add, walkopts + dryrunopts, _('hg add [OPTION]... [FILE]...')),
2626 "addremove":
2626 "addremove":
2627 (addremove,
2627 (addremove,
2628 [('s', 'similarity', '',
2628 [('s', 'similarity', '',
2629 _('guess renamed files by similarity (0<=s<=100)')),
2629 _('guess renamed files by similarity (0<=s<=100)')),
2630 ] + walkopts + dryrunopts,
2630 ] + walkopts + dryrunopts,
2631 _('hg addremove [OPTION]... [FILE]...')),
2631 _('hg addremove [OPTION]... [FILE]...')),
2632 "^annotate":
2632 "^annotate":
2633 (annotate,
2633 (annotate,
2634 [('r', 'rev', '', _('annotate the specified revision')),
2634 [('r', 'rev', '', _('annotate the specified revision')),
2635 ('f', 'follow', None, _('follow file copies and renames')),
2635 ('f', 'follow', None, _('follow file copies and renames')),
2636 ('a', 'text', None, _('treat all files as text')),
2636 ('a', 'text', None, _('treat all files as text')),
2637 ('u', 'user', None, _('list the author')),
2637 ('u', 'user', None, _('list the author')),
2638 ('d', 'date', None, _('list the date')),
2638 ('d', 'date', None, _('list the date')),
2639 ('n', 'number', None, _('list the revision number (default)')),
2639 ('n', 'number', None, _('list the revision number (default)')),
2640 ('c', 'changeset', None, _('list the changeset')),
2640 ('c', 'changeset', None, _('list the changeset')),
2641 ('l', 'line-number', None,
2641 ('l', 'line-number', None,
2642 _('show line number at the first appearance'))
2642 _('show line number at the first appearance'))
2643 ] + walkopts,
2643 ] + walkopts,
2644 _('hg annotate [-r REV] [-f] [-a] [-u] [-d] [-n] [-c] [-l] FILE...')),
2644 _('hg annotate [-r REV] [-f] [-a] [-u] [-d] [-n] [-c] [-l] FILE...')),
2645 "archive":
2645 "archive":
2646 (archive,
2646 (archive,
2647 [('', 'no-decode', None, _('do not pass files through decoders')),
2647 [('', 'no-decode', None, _('do not pass files through decoders')),
2648 ('p', 'prefix', '', _('directory prefix for files in archive')),
2648 ('p', 'prefix', '', _('directory prefix for files in archive')),
2649 ('r', 'rev', '', _('revision to distribute')),
2649 ('r', 'rev', '', _('revision to distribute')),
2650 ('t', 'type', '', _('type of distribution to create')),
2650 ('t', 'type', '', _('type of distribution to create')),
2651 ] + walkopts,
2651 ] + walkopts,
2652 _('hg archive [OPTION]... DEST')),
2652 _('hg archive [OPTION]... DEST')),
2653 "backout":
2653 "backout":
2654 (backout,
2654 (backout,
2655 [('', 'merge', None,
2655 [('', 'merge', None,
2656 _('merge with old dirstate parent after backout')),
2656 _('merge with old dirstate parent after backout')),
2657 ('', 'parent', '', _('parent to choose when backing out merge')),
2657 ('', 'parent', '', _('parent to choose when backing out merge')),
2658 ('r', 'rev', '', _('revision to backout')),
2658 ('r', 'rev', '', _('revision to backout')),
2659 ] + walkopts + commitopts + commitopts2,
2659 ] + walkopts + commitopts + commitopts2,
2660 _('hg backout [OPTION]... [-r] REV')),
2660 _('hg backout [OPTION]... [-r] REV')),
2661 "branch":
2661 "branch":
2662 (branch,
2662 (branch,
2663 [('f', 'force', None,
2663 [('f', 'force', None,
2664 _('set branch name even if it shadows an existing branch'))],
2664 _('set branch name even if it shadows an existing branch'))],
2665 _('hg branch [NAME]')),
2665 _('hg branch [NAME]')),
2666 "branches":
2666 "branches":
2667 (branches,
2667 (branches,
2668 [('a', 'active', False,
2668 [('a', 'active', False,
2669 _('show only branches that have unmerged heads'))],
2669 _('show only branches that have unmerged heads'))],
2670 _('hg branches [-a]')),
2670 _('hg branches [-a]')),
2671 "bundle":
2671 "bundle":
2672 (bundle,
2672 (bundle,
2673 [('f', 'force', None,
2673 [('f', 'force', None,
2674 _('run even when remote repository is unrelated')),
2674 _('run even when remote repository is unrelated')),
2675 ('r', 'rev', [],
2675 ('r', 'rev', [],
2676 _('a changeset you would like to bundle')),
2676 _('a changeset you would like to bundle')),
2677 ('', 'base', [],
2677 ('', 'base', [],
2678 _('a base changeset to specify instead of a destination')),
2678 _('a base changeset to specify instead of a destination')),
2679 ] + remoteopts,
2679 ] + remoteopts,
2680 _('hg bundle [-f] [-r REV]... [--base REV]... FILE [DEST]')),
2680 _('hg bundle [-f] [-r REV]... [--base REV]... FILE [DEST]')),
2681 "cat":
2681 "cat":
2682 (cat,
2682 (cat,
2683 [('o', 'output', '', _('print output to file with formatted name')),
2683 [('o', 'output', '', _('print output to file with formatted name')),
2684 ('r', 'rev', '', _('print the given revision')),
2684 ('r', 'rev', '', _('print the given revision')),
2685 ] + walkopts,
2685 ] + walkopts,
2686 _('hg cat [OPTION]... FILE...')),
2686 _('hg cat [OPTION]... FILE...')),
2687 "^clone":
2687 "^clone":
2688 (clone,
2688 (clone,
2689 [('U', 'noupdate', None, _('do not update the new working directory')),
2689 [('U', 'noupdate', None, _('do not update the new working directory')),
2690 ('r', 'rev', [],
2690 ('r', 'rev', [],
2691 _('a changeset you would like to have after cloning')),
2691 _('a changeset you would like to have after cloning')),
2692 ('', 'pull', None, _('use pull protocol to copy metadata')),
2692 ('', 'pull', None, _('use pull protocol to copy metadata')),
2693 ('', 'uncompressed', None,
2693 ('', 'uncompressed', None,
2694 _('use uncompressed transfer (fast over LAN)')),
2694 _('use uncompressed transfer (fast over LAN)')),
2695 ] + remoteopts,
2695 ] + remoteopts,
2696 _('hg clone [OPTION]... SOURCE [DEST]')),
2696 _('hg clone [OPTION]... SOURCE [DEST]')),
2697 "^commit|ci":
2697 "^commit|ci":
2698 (commit,
2698 (commit,
2699 [('A', 'addremove', None,
2699 [('A', 'addremove', None,
2700 _('mark new/missing files as added/removed before committing')),
2700 _('mark new/missing files as added/removed before committing')),
2701 ] + walkopts + commitopts + commitopts2,
2701 ] + walkopts + commitopts + commitopts2,
2702 _('hg commit [OPTION]... [FILE]...')),
2702 _('hg commit [OPTION]... [FILE]...')),
2703 "copy|cp":
2703 "copy|cp":
2704 (copy,
2704 (copy,
2705 [('A', 'after', None, _('record a copy that has already occurred')),
2705 [('A', 'after', None, _('record a copy that has already occurred')),
2706 ('f', 'force', None,
2706 ('f', 'force', None,
2707 _('forcibly copy over an existing managed file')),
2707 _('forcibly copy over an existing managed file')),
2708 ] + walkopts + dryrunopts,
2708 ] + walkopts + dryrunopts,
2709 _('hg copy [OPTION]... [SOURCE]... DEST')),
2709 _('hg copy [OPTION]... [SOURCE]... DEST')),
2710 "debugancestor": (debugancestor, [], _('debugancestor INDEX REV1 REV2')),
2710 "debugancestor": (debugancestor, [], _('debugancestor INDEX REV1 REV2')),
2711 "debugcomplete":
2711 "debugcomplete":
2712 (debugcomplete,
2712 (debugcomplete,
2713 [('o', 'options', None, _('show the command options'))],
2713 [('o', 'options', None, _('show the command options'))],
2714 _('debugcomplete [-o] CMD')),
2714 _('debugcomplete [-o] CMD')),
2715 "debuginstall": (debuginstall, [], _('debuginstall')),
2715 "debuginstall": (debuginstall, [], _('debuginstall')),
2716 "debugrebuildstate":
2716 "debugrebuildstate":
2717 (debugrebuildstate,
2717 (debugrebuildstate,
2718 [('r', 'rev', '', _('revision to rebuild to'))],
2718 [('r', 'rev', '', _('revision to rebuild to'))],
2719 _('debugrebuildstate [-r REV] [REV]')),
2719 _('debugrebuildstate [-r REV] [REV]')),
2720 "debugcheckstate": (debugcheckstate, [], _('debugcheckstate')),
2720 "debugcheckstate": (debugcheckstate, [], _('debugcheckstate')),
2721 "debugsetparents": (debugsetparents, [], _('debugsetparents REV1 [REV2]')),
2721 "debugsetparents": (debugsetparents, [], _('debugsetparents REV1 [REV2]')),
2722 "debugstate": (debugstate, [], _('debugstate')),
2722 "debugstate": (debugstate, [], _('debugstate')),
2723 "debugdate":
2723 "debugdate":
2724 (debugdate,
2724 (debugdate,
2725 [('e', 'extended', None, _('try extended date formats'))],
2725 [('e', 'extended', None, _('try extended date formats'))],
2726 _('debugdate [-e] DATE [RANGE]')),
2726 _('debugdate [-e] DATE [RANGE]')),
2727 "debugdata": (debugdata, [], _('debugdata FILE REV')),
2727 "debugdata": (debugdata, [], _('debugdata FILE REV')),
2728 "debugfsinfo": (debugfsinfo, [], _('debugfsinfo [PATH]')),
2728 "debugfsinfo": (debugfsinfo, [], _('debugfsinfo [PATH]')),
2729 "debugindex": (debugindex, [], _('debugindex FILE')),
2729 "debugindex": (debugindex, [], _('debugindex FILE')),
2730 "debugindexdot": (debugindexdot, [], _('debugindexdot FILE')),
2730 "debugindexdot": (debugindexdot, [], _('debugindexdot FILE')),
2731 "debugrename":
2731 "debugrename":
2732 (debugrename,
2732 (debugrename,
2733 [('r', 'rev', '', _('revision to debug'))],
2733 [('r', 'rev', '', _('revision to debug'))],
2734 _('debugrename [-r REV] FILE')),
2734 _('debugrename [-r REV] FILE')),
2735 "debugwalk": (debugwalk, walkopts, _('debugwalk [OPTION]... [FILE]...')),
2735 "debugwalk": (debugwalk, walkopts, _('debugwalk [OPTION]... [FILE]...')),
2736 "^diff":
2736 "^diff":
2737 (diff,
2737 (diff,
2738 [('r', 'rev', [], _('revision')),
2738 [('r', 'rev', [], _('revision')),
2739 ('a', 'text', None, _('treat all files as text')),
2739 ('a', 'text', None, _('treat all files as text')),
2740 ('p', 'show-function', None,
2740 ('p', 'show-function', None,
2741 _('show which function each change is in')),
2741 _('show which function each change is in')),
2742 ('g', 'git', None, _('use git extended diff format')),
2742 ('g', 'git', None, _('use git extended diff format')),
2743 ('', 'nodates', None, _("don't include dates in diff headers")),
2743 ('', 'nodates', None, _("don't include dates in diff headers")),
2744 ('w', 'ignore-all-space', None,
2744 ('w', 'ignore-all-space', None,
2745 _('ignore white space when comparing lines')),
2745 _('ignore white space when comparing lines')),
2746 ('b', 'ignore-space-change', None,
2746 ('b', 'ignore-space-change', None,
2747 _('ignore changes in the amount of white space')),
2747 _('ignore changes in the amount of white space')),
2748 ('B', 'ignore-blank-lines', None,
2748 ('B', 'ignore-blank-lines', None,
2749 _('ignore changes whose lines are all blank')),
2749 _('ignore changes whose lines are all blank')),
2750 ] + walkopts,
2750 ] + walkopts,
2751 _('hg diff [OPTION]... [-r REV1 [-r REV2]] [FILE]...')),
2751 _('hg diff [OPTION]... [-r REV1 [-r REV2]] [FILE]...')),
2752 "^export":
2752 "^export":
2753 (export,
2753 (export,
2754 [('o', 'output', '', _('print output to file with formatted name')),
2754 [('o', 'output', '', _('print output to file with formatted name')),
2755 ('a', 'text', None, _('treat all files as text')),
2755 ('a', 'text', None, _('treat all files as text')),
2756 ('g', 'git', None, _('use git extended diff format')),
2756 ('g', 'git', None, _('use git extended diff format')),
2757 ('', 'nodates', None, _("don't include dates in diff headers")),
2757 ('', 'nodates', None, _("don't include dates in diff headers")),
2758 ('', 'switch-parent', None, _('diff against the second parent'))],
2758 ('', 'switch-parent', None, _('diff against the second parent'))],
2759 _('hg export [OPTION]... [-o OUTFILESPEC] REV...')),
2759 _('hg export [OPTION]... [-o OUTFILESPEC] REV...')),
2760 "grep":
2760 "grep":
2761 (grep,
2761 (grep,
2762 [('0', 'print0', None, _('end fields with NUL')),
2762 [('0', 'print0', None, _('end fields with NUL')),
2763 ('', 'all', None, _('print all revisions that match')),
2763 ('', 'all', None, _('print all revisions that match')),
2764 ('f', 'follow', None,
2764 ('f', 'follow', None,
2765 _('follow changeset history, or file history across copies and renames')),
2765 _('follow changeset history, or file history across copies and renames')),
2766 ('i', 'ignore-case', None, _('ignore case when matching')),
2766 ('i', 'ignore-case', None, _('ignore case when matching')),
2767 ('l', 'files-with-matches', None,
2767 ('l', 'files-with-matches', None,
2768 _('print only filenames and revs that match')),
2768 _('print only filenames and revs that match')),
2769 ('n', 'line-number', None, _('print matching line numbers')),
2769 ('n', 'line-number', None, _('print matching line numbers')),
2770 ('r', 'rev', [], _('search in given revision range')),
2770 ('r', 'rev', [], _('search in given revision range')),
2771 ('u', 'user', None, _('print user who committed change')),
2771 ('u', 'user', None, _('print user who committed change')),
2772 ] + walkopts,
2772 ] + walkopts,
2773 _('hg grep [OPTION]... PATTERN [FILE]...')),
2773 _('hg grep [OPTION]... PATTERN [FILE]...')),
2774 "heads":
2774 "heads":
2775 (heads,
2775 (heads,
2776 [('', 'style', '', _('display using template map file')),
2776 [('', 'style', '', _('display using template map file')),
2777 ('r', 'rev', '', _('show only heads which are descendants of rev')),
2777 ('r', 'rev', '', _('show only heads which are descendants of rev')),
2778 ('', 'template', '', _('display with template'))],
2778 ('', 'template', '', _('display with template'))],
2779 _('hg heads [-r REV] [REV]...')),
2779 _('hg heads [-r REV] [REV]...')),
2780 "help": (help_, [], _('hg help [COMMAND]')),
2780 "help": (help_, [], _('hg help [COMMAND]')),
2781 "identify|id":
2781 "identify|id":
2782 (identify,
2782 (identify,
2783 [('r', 'rev', '', _('identify the specified rev')),
2783 [('r', 'rev', '', _('identify the specified rev')),
2784 ('n', 'num', None, _('show local revision number')),
2784 ('n', 'num', None, _('show local revision number')),
2785 ('i', 'id', None, _('show global revision id')),
2785 ('i', 'id', None, _('show global revision id')),
2786 ('b', 'branch', None, _('show branch')),
2786 ('b', 'branch', None, _('show branch')),
2787 ('t', 'tags', None, _('show tags'))],
2787 ('t', 'tags', None, _('show tags'))],
2788 _('hg identify [-nibt] [-r REV] [SOURCE]')),
2788 _('hg identify [-nibt] [-r REV] [SOURCE]')),
2789 "import|patch":
2789 "import|patch":
2790 (import_,
2790 (import_,
2791 [('p', 'strip', 1,
2791 [('p', 'strip', 1,
2792 _('directory strip option for patch. This has the same\n'
2792 _('directory strip option for patch. This has the same\n'
2793 'meaning as the corresponding patch option')),
2793 'meaning as the corresponding patch option')),
2794 ('b', 'base', '', _('base path')),
2794 ('b', 'base', '', _('base path')),
2795 ('f', 'force', None,
2795 ('f', 'force', None,
2796 _('skip check for outstanding uncommitted changes')),
2796 _('skip check for outstanding uncommitted changes')),
2797 ('', 'exact', None,
2797 ('', 'exact', None,
2798 _('apply patch to the nodes from which it was generated')),
2798 _('apply patch to the nodes from which it was generated')),
2799 ('', 'import-branch', None,
2799 ('', 'import-branch', None,
2800 _('Use any branch information in patch (implied by --exact)'))] + commitopts,
2800 _('Use any branch information in patch (implied by --exact)'))] + commitopts,
2801 _('hg import [-p NUM] [-m MESSAGE] [-f] PATCH...')),
2801 _('hg import [-p NUM] [-m MESSAGE] [-f] PATCH...')),
2802 "incoming|in": (incoming,
2802 "incoming|in": (incoming,
2803 [('M', 'no-merges', None, _('do not show merges')),
2803 [('M', 'no-merges', None, _('do not show merges')),
2804 ('f', 'force', None,
2804 ('f', 'force', None,
2805 _('run even when remote repository is unrelated')),
2805 _('run even when remote repository is unrelated')),
2806 ('', 'style', '', _('display using template map file')),
2806 ('', 'style', '', _('display using template map file')),
2807 ('n', 'newest-first', None, _('show newest record first')),
2807 ('n', 'newest-first', None, _('show newest record first')),
2808 ('', 'bundle', '', _('file to store the bundles into')),
2808 ('', 'bundle', '', _('file to store the bundles into')),
2809 ('p', 'patch', None, _('show patch')),
2809 ('p', 'patch', None, _('show patch')),
2810 ('r', 'rev', [], _('a specific revision up to which you would like to pull')),
2810 ('r', 'rev', [], _('a specific revision up to which you would like to pull')),
2811 ('', 'template', '', _('display with template')),
2811 ('', 'template', '', _('display with template')),
2812 ] + remoteopts,
2812 ] + remoteopts,
2813 _('hg incoming [-p] [-n] [-M] [-f] [-r REV]...'
2813 _('hg incoming [-p] [-n] [-M] [-f] [-r REV]...'
2814 ' [--bundle FILENAME] [SOURCE]')),
2814 ' [--bundle FILENAME] [SOURCE]')),
2815 "^init":
2815 "^init":
2816 (init,
2816 (init,
2817 remoteopts,
2817 remoteopts,
2818 _('hg init [-e CMD] [--remotecmd CMD] [DEST]')),
2818 _('hg init [-e CMD] [--remotecmd CMD] [DEST]')),
2819 "locate":
2819 "locate":
2820 (locate,
2820 (locate,
2821 [('r', 'rev', '', _('search the repository as it stood at rev')),
2821 [('r', 'rev', '', _('search the repository as it stood at rev')),
2822 ('0', 'print0', None,
2822 ('0', 'print0', None,
2823 _('end filenames with NUL, for use with xargs')),
2823 _('end filenames with NUL, for use with xargs')),
2824 ('f', 'fullpath', None,
2824 ('f', 'fullpath', None,
2825 _('print complete paths from the filesystem root')),
2825 _('print complete paths from the filesystem root')),
2826 ] + walkopts,
2826 ] + walkopts,
2827 _('hg locate [OPTION]... [PATTERN]...')),
2827 _('hg locate [OPTION]... [PATTERN]...')),
2828 "^log|history":
2828 "^log|history":
2829 (log,
2829 (log,
2830 [('f', 'follow', None,
2830 [('f', 'follow', None,
2831 _('follow changeset history, or file history across copies and renames')),
2831 _('follow changeset history, or file history across copies and renames')),
2832 ('', 'follow-first', None,
2832 ('', 'follow-first', None,
2833 _('only follow the first parent of merge changesets')),
2833 _('only follow the first parent of merge changesets')),
2834 ('d', 'date', '', _('show revs matching date spec')),
2834 ('d', 'date', '', _('show revs matching date spec')),
2835 ('C', 'copies', None, _('show copied files')),
2835 ('C', 'copies', None, _('show copied files')),
2836 ('k', 'keyword', [], _('do case-insensitive search for a keyword')),
2836 ('k', 'keyword', [], _('do case-insensitive search for a keyword')),
2837 ('l', 'limit', '', _('limit number of changes displayed')),
2837 ('l', 'limit', '', _('limit number of changes displayed')),
2838 ('r', 'rev', [], _('show the specified revision or range')),
2838 ('r', 'rev', [], _('show the specified revision or range')),
2839 ('', 'removed', None, _('include revs where files were removed')),
2839 ('', 'removed', None, _('include revs where files were removed')),
2840 ('M', 'no-merges', None, _('do not show merges')),
2840 ('M', 'no-merges', None, _('do not show merges')),
2841 ('', 'style', '', _('display using template map file')),
2841 ('', 'style', '', _('display using template map file')),
2842 ('m', 'only-merges', None, _('show only merges')),
2842 ('m', 'only-merges', None, _('show only merges')),
2843 ('p', 'patch', None, _('show patch')),
2843 ('p', 'patch', None, _('show patch')),
2844 ('P', 'prune', [], _('do not display revision or any of its ancestors')),
2844 ('P', 'prune', [], _('do not display revision or any of its ancestors')),
2845 ('', 'template', '', _('display with template')),
2845 ('', 'template', '', _('display with template')),
2846 ] + walkopts,
2846 ] + walkopts,
2847 _('hg log [OPTION]... [FILE]')),
2847 _('hg log [OPTION]... [FILE]')),
2848 "manifest": (manifest, [('r', 'rev', '', _('revision to display'))],
2848 "manifest": (manifest, [('r', 'rev', '', _('revision to display'))],
2849 _('hg manifest [-r REV]')),
2849 _('hg manifest [-r REV]')),
2850 "^merge":
2850 "^merge":
2851 (merge,
2851 (merge,
2852 [('f', 'force', None, _('force a merge with outstanding changes')),
2852 [('f', 'force', None, _('force a merge with outstanding changes')),
2853 ('r', 'rev', '', _('revision to merge')),
2853 ('r', 'rev', '', _('revision to merge')),
2854 ],
2854 ],
2855 _('hg merge [-f] [[-r] REV]')),
2855 _('hg merge [-f] [[-r] REV]')),
2856 "outgoing|out": (outgoing,
2856 "outgoing|out": (outgoing,
2857 [('M', 'no-merges', None, _('do not show merges')),
2857 [('M', 'no-merges', None, _('do not show merges')),
2858 ('f', 'force', None,
2858 ('f', 'force', None,
2859 _('run even when remote repository is unrelated')),
2859 _('run even when remote repository is unrelated')),
2860 ('p', 'patch', None, _('show patch')),
2860 ('p', 'patch', None, _('show patch')),
2861 ('', 'style', '', _('display using template map file')),
2861 ('', 'style', '', _('display using template map file')),
2862 ('r', 'rev', [], _('a specific revision you would like to push')),
2862 ('r', 'rev', [], _('a specific revision you would like to push')),
2863 ('n', 'newest-first', None, _('show newest record first')),
2863 ('n', 'newest-first', None, _('show newest record first')),
2864 ('', 'template', '', _('display with template')),
2864 ('', 'template', '', _('display with template')),
2865 ] + remoteopts,
2865 ] + remoteopts,
2866 _('hg outgoing [-M] [-p] [-n] [-f] [-r REV]... [DEST]')),
2866 _('hg outgoing [-M] [-p] [-n] [-f] [-r REV]... [DEST]')),
2867 "^parents":
2867 "^parents":
2868 (parents,
2868 (parents,
2869 [('r', 'rev', '', _('show parents from the specified rev')),
2869 [('r', 'rev', '', _('show parents from the specified rev')),
2870 ('', 'style', '', _('display using template map file')),
2870 ('', 'style', '', _('display using template map file')),
2871 ('', 'template', '', _('display with template'))],
2871 ('', 'template', '', _('display with template'))],
2872 _('hg parents [-r REV] [FILE]')),
2872 _('hg parents [-r REV] [FILE]')),
2873 "paths": (paths, [], _('hg paths [NAME]')),
2873 "paths": (paths, [], _('hg paths [NAME]')),
2874 "^pull":
2874 "^pull":
2875 (pull,
2875 (pull,
2876 [('u', 'update', None,
2876 [('u', 'update', None,
2877 _('update to new tip if changesets were pulled')),
2877 _('update to new tip if changesets were pulled')),
2878 ('f', 'force', None,
2878 ('f', 'force', None,
2879 _('run even when remote repository is unrelated')),
2879 _('run even when remote repository is unrelated')),
2880 ('r', 'rev', [],
2880 ('r', 'rev', [],
2881 _('a specific revision up to which you would like to pull')),
2881 _('a specific revision up to which you would like to pull')),
2882 ] + remoteopts,
2882 ] + remoteopts,
2883 _('hg pull [-u] [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [SOURCE]')),
2883 _('hg pull [-u] [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [SOURCE]')),
2884 "^push":
2884 "^push":
2885 (push,
2885 (push,
2886 [('f', 'force', None, _('force push')),
2886 [('f', 'force', None, _('force push')),
2887 ('r', 'rev', [], _('a specific revision you would like to push')),
2887 ('r', 'rev', [], _('a specific revision you would like to push')),
2888 ] + remoteopts,
2888 ] + remoteopts,
2889 _('hg push [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]')),
2889 _('hg push [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]')),
2890 "debugrawcommit|rawcommit":
2890 "debugrawcommit|rawcommit":
2891 (rawcommit,
2891 (rawcommit,
2892 [('p', 'parent', [], _('parent')),
2892 [('p', 'parent', [], _('parent')),
2893 ('F', 'files', '', _('file list'))
2893 ('F', 'files', '', _('file list'))
2894 ] + commitopts + commitopts2,
2894 ] + commitopts + commitopts2,
2895 _('hg debugrawcommit [OPTION]... [FILE]...')),
2895 _('hg debugrawcommit [OPTION]... [FILE]...')),
2896 "recover": (recover, [], _('hg recover')),
2896 "recover": (recover, [], _('hg recover')),
2897 "^remove|rm":
2897 "^remove|rm":
2898 (remove,
2898 (remove,
2899 [('A', 'after', None, _('record remove without deleting')),
2899 [('A', 'after', None, _('record remove without deleting')),
2900 ('f', 'force', None, _('remove file even if modified')),
2900 ('f', 'force', None, _('remove file even if modified')),
2901 ] + walkopts,
2901 ] + walkopts,
2902 _('hg remove [OPTION]... FILE...')),
2902 _('hg remove [OPTION]... FILE...')),
2903 "rename|mv":
2903 "rename|mv":
2904 (rename,
2904 (rename,
2905 [('A', 'after', None, _('record a rename that has already occurred')),
2905 [('A', 'after', None, _('record a rename that has already occurred')),
2906 ('f', 'force', None,
2906 ('f', 'force', None,
2907 _('forcibly copy over an existing managed file')),
2907 _('forcibly copy over an existing managed file')),
2908 ] + walkopts + dryrunopts,
2908 ] + walkopts + dryrunopts,
2909 _('hg rename [OPTION]... SOURCE... DEST')),
2909 _('hg rename [OPTION]... SOURCE... DEST')),
2910 "revert":
2910 "revert":
2911 (revert,
2911 (revert,
2912 [('a', 'all', None, _('revert all changes when no arguments given')),
2912 [('a', 'all', None, _('revert all changes when no arguments given')),
2913 ('d', 'date', '', _('tipmost revision matching date')),
2913 ('d', 'date', '', _('tipmost revision matching date')),
2914 ('r', 'rev', '', _('revision to revert to')),
2914 ('r', 'rev', '', _('revision to revert to')),
2915 ('', 'no-backup', None, _('do not save backup copies of files')),
2915 ('', 'no-backup', None, _('do not save backup copies of files')),
2916 ] + walkopts + dryrunopts,
2916 ] + walkopts + dryrunopts,
2917 _('hg revert [OPTION]... [-r REV] [NAME]...')),
2917 _('hg revert [OPTION]... [-r REV] [NAME]...')),
2918 "rollback": (rollback, [], _('hg rollback')),
2918 "rollback": (rollback, [], _('hg rollback')),
2919 "root": (root, [], _('hg root')),
2919 "root": (root, [], _('hg root')),
2920 "showconfig|debugconfig":
2920 "showconfig|debugconfig":
2921 (showconfig,
2921 (showconfig,
2922 [('u', 'untrusted', None, _('show untrusted configuration options'))],
2922 [('u', 'untrusted', None, _('show untrusted configuration options'))],
2923 _('showconfig [-u] [NAME]...')),
2923 _('showconfig [-u] [NAME]...')),
2924 "^serve":
2924 "^serve":
2925 (serve,
2925 (serve,
2926 [('A', 'accesslog', '', _('name of access log file to write to')),
2926 [('A', 'accesslog', '', _('name of access log file to write to')),
2927 ('d', 'daemon', None, _('run server in background')),
2927 ('d', 'daemon', None, _('run server in background')),
2928 ('', 'daemon-pipefds', '', _('used internally by daemon mode')),
2928 ('', 'daemon-pipefds', '', _('used internally by daemon mode')),
2929 ('E', 'errorlog', '', _('name of error log file to write to')),
2929 ('E', 'errorlog', '', _('name of error log file to write to')),
2930 ('p', 'port', 0, _('port to use (default: 8000)')),
2930 ('p', 'port', 0, _('port to use (default: 8000)')),
2931 ('a', 'address', '', _('address to use')),
2931 ('a', 'address', '', _('address to use')),
2932 ('n', 'name', '',
2932 ('n', 'name', '',
2933 _('name to show in web pages (default: working dir)')),
2933 _('name to show in web pages (default: working dir)')),
2934 ('', 'webdir-conf', '', _('name of the webdir config file'
2934 ('', 'webdir-conf', '', _('name of the webdir config file'
2935 ' (serve more than one repo)')),
2935 ' (serve more than one repo)')),
2936 ('', 'pid-file', '', _('name of file to write process ID to')),
2936 ('', 'pid-file', '', _('name of file to write process ID to')),
2937 ('', 'stdio', None, _('for remote clients')),
2937 ('', 'stdio', None, _('for remote clients')),
2938 ('t', 'templates', '', _('web templates to use')),
2938 ('t', 'templates', '', _('web templates to use')),
2939 ('', 'style', '', _('template style to use')),
2939 ('', 'style', '', _('template style to use')),
2940 ('6', 'ipv6', None, _('use IPv6 in addition to IPv4')),
2940 ('6', 'ipv6', None, _('use IPv6 in addition to IPv4')),
2941 ('', 'certificate', '', _('SSL certificate file'))],
2941 ('', 'certificate', '', _('SSL certificate file'))],
2942 _('hg serve [OPTION]...')),
2942 _('hg serve [OPTION]...')),
2943 "^status|st":
2943 "^status|st":
2944 (status,
2944 (status,
2945 [('A', 'all', None, _('show status of all files')),
2945 [('A', 'all', None, _('show status of all files')),
2946 ('m', 'modified', None, _('show only modified files')),
2946 ('m', 'modified', None, _('show only modified files')),
2947 ('a', 'added', None, _('show only added files')),
2947 ('a', 'added', None, _('show only added files')),
2948 ('r', 'removed', None, _('show only removed files')),
2948 ('r', 'removed', None, _('show only removed files')),
2949 ('d', 'deleted', None, _('show only deleted (but tracked) files')),
2949 ('d', 'deleted', None, _('show only deleted (but tracked) files')),
2950 ('c', 'clean', None, _('show only files without changes')),
2950 ('c', 'clean', None, _('show only files without changes')),
2951 ('u', 'unknown', None, _('show only unknown (not tracked) files')),
2951 ('u', 'unknown', None, _('show only unknown (not tracked) files')),
2952 ('i', 'ignored', None, _('show only ignored files')),
2952 ('i', 'ignored', None, _('show only ignored files')),
2953 ('n', 'no-status', None, _('hide status prefix')),
2953 ('n', 'no-status', None, _('hide status prefix')),
2954 ('C', 'copies', None, _('show source of copied files')),
2954 ('C', 'copies', None, _('show source of copied files')),
2955 ('0', 'print0', None,
2955 ('0', 'print0', None,
2956 _('end filenames with NUL, for use with xargs')),
2956 _('end filenames with NUL, for use with xargs')),
2957 ('', 'rev', [], _('show difference from revision')),
2957 ('', 'rev', [], _('show difference from revision')),
2958 ] + walkopts,
2958 ] + walkopts,
2959 _('hg status [OPTION]... [FILE]...')),
2959 _('hg status [OPTION]... [FILE]...')),
2960 "tag":
2960 "tag":
2961 (tag,
2961 (tag,
2962 [('f', 'force', None, _('replace existing tag')),
2962 [('f', 'force', None, _('replace existing tag')),
2963 ('l', 'local', None, _('make the tag local')),
2963 ('l', 'local', None, _('make the tag local')),
2964 ('r', 'rev', '', _('revision to tag')),
2964 ('r', 'rev', '', _('revision to tag')),
2965 ('', 'remove', None, _('remove a tag')),
2965 ('', 'remove', None, _('remove a tag')),
2966 # -l/--local is already there, commitopts cannot be used
2966 # -l/--local is already there, commitopts cannot be used
2967 ('m', 'message', '', _('use <text> as commit message')),
2967 ('m', 'message', '', _('use <text> as commit message')),
2968 ] + commitopts2,
2968 ] + commitopts2,
2969 _('hg tag [-l] [-m TEXT] [-d DATE] [-u USER] [-r REV] NAME')),
2969 _('hg tag [-l] [-m TEXT] [-d DATE] [-u USER] [-r REV] NAME')),
2970 "tags": (tags, [], _('hg tags')),
2970 "tags": (tags, [], _('hg tags')),
2971 "tip":
2971 "tip":
2972 (tip,
2972 (tip,
2973 [('', 'style', '', _('display using template map file')),
2973 [('', 'style', '', _('display using template map file')),
2974 ('p', 'patch', None, _('show patch')),
2974 ('p', 'patch', None, _('show patch')),
2975 ('', 'template', '', _('display with template'))],
2975 ('', 'template', '', _('display with template'))],
2976 _('hg tip [-p]')),
2976 _('hg tip [-p]')),
2977 "unbundle":
2977 "unbundle":
2978 (unbundle,
2978 (unbundle,
2979 [('u', 'update', None,
2979 [('u', 'update', None,
2980 _('update to new tip if changesets were unbundled'))],
2980 _('update to new tip if changesets were unbundled'))],
2981 _('hg unbundle [-u] FILE...')),
2981 _('hg unbundle [-u] FILE...')),
2982 "^update|up|checkout|co":
2982 "^update|up|checkout|co":
2983 (update,
2983 (update,
2984 [('C', 'clean', None, _('overwrite locally modified files')),
2984 [('C', 'clean', None, _('overwrite locally modified files')),
2985 ('d', 'date', '', _('tipmost revision matching date')),
2985 ('d', 'date', '', _('tipmost revision matching date')),
2986 ('r', 'rev', '', _('revision'))],
2986 ('r', 'rev', '', _('revision'))],
2987 _('hg update [-C] [-d DATE] [[-r] REV]')),
2987 _('hg update [-C] [-d DATE] [[-r] REV]')),
2988 "verify": (verify, [], _('hg verify')),
2988 "verify": (verify, [], _('hg verify')),
2989 "version": (version_, [], _('hg version')),
2989 "version": (version_, [], _('hg version')),
2990 }
2990 }
2991
2991
2992 norepo = ("clone init version help debugancestor debugcomplete debugdata"
2992 norepo = ("clone init version help debugancestor debugcomplete debugdata"
2993 " debugindex debugindexdot debugdate debuginstall debugfsinfo")
2993 " debugindex debugindexdot debugdate debuginstall debugfsinfo")
2994 optionalrepo = ("identify paths serve showconfig")
2994 optionalrepo = ("identify paths serve showconfig")
@@ -1,13 +1,13 b''
1 adding a
1 adding a
2 adding b
2 adding b
3 pulling from ../a
3 pulling from ../a
4 searching for changes
4 searching for changes
5 warning: repository is unrelated
5 warning: repository is unrelated
6 adding changesets
6 adding changesets
7 adding manifests
7 adding manifests
8 adding file changes
8 adding file changes
9 added 1 changesets with 1 changes to 1 files (+1 heads)
9 added 1 changesets with 1 changes to 1 files (+1 heads)
10 (run 'hg heads' to see heads, 'hg merge' to merge)
10 (run 'hg heads' to see heads, 'hg merge' to merge)
11 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
11 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
12 (branch merge, don't forget to commit)
12 (branch merge, don't forget to commit)
13 = b
13 C b
@@ -1,10 +1,10 b''
1 % basic
1 % basic
2 % unknown
2 % unknown
3 *** [alias] unknown: command bargle is unknown
3 *** [alias] unknown: command bargle is unknown
4 % ambiguous
4 % ambiguous
5 *** [alias] ambiguous: command s is ambiguous
5 *** [alias] ambiguous: command s is ambiguous
6 % recursive
6 % recursive
7 *** [alias] recursive: circular dependency on recursive
7 *** [alias] recursive: circular dependency on recursive
8 adding foo
8 adding foo
9 % with opts
9 % with opts
10 = foo
10 C foo
@@ -1,47 +1,47 b''
1 # should fail - foo is not managed
1 # should fail - foo is not managed
2 foo: not copying - file is not managed
2 foo: not copying - file is not managed
3 abort: no files to copy
3 abort: no files to copy
4 ? foo
4 ? foo
5 # dry-run; print a warning that this is not a real copy; foo is added
5 # dry-run; print a warning that this is not a real copy; foo is added
6 foo has not been committed yet, so no copy data will be stored for bar.
6 foo has not been committed yet, so no copy data will be stored for bar.
7 A foo
7 A foo
8 # should print a warning that this is not a real copy; bar is added
8 # should print a warning that this is not a real copy; bar is added
9 foo has not been committed yet, so no copy data will be stored for bar.
9 foo has not been committed yet, so no copy data will be stored for bar.
10 A bar
10 A bar
11 # should print a warning that this is not a real copy; foo is added
11 # should print a warning that this is not a real copy; foo is added
12 bar has not been committed yet, so no copy data will be stored for foo.
12 bar has not been committed yet, so no copy data will be stored for foo.
13 A foo
13 A foo
14 # dry-run; should show that foo is clean
14 # dry-run; should show that foo is clean
15 = foo
15 C foo
16 # should show copy
16 # should show copy
17 A bar
17 A bar
18 foo
18 foo
19 # shouldn't show copy
19 # shouldn't show copy
20 # should match
20 # should match
21 rev offset length base linkrev nodeid p1 p2
21 rev offset length base linkrev nodeid p1 p2
22 0 0 5 0 0 2ed2a3912a0b 000000000000 000000000000
22 0 0 5 0 0 2ed2a3912a0b 000000000000 000000000000
23 bar renamed from foo:2ed2a3912a0b24502043eae84ee4b279c18b90dd
23 bar renamed from foo:2ed2a3912a0b24502043eae84ee4b279c18b90dd
24 # should not be renamed
24 # should not be renamed
25 bar not renamed
25 bar not renamed
26 # should show copy
26 # should show copy
27 M bar
27 M bar
28 foo
28 foo
29 # should show no parents for tip
29 # should show no parents for tip
30 rev offset length base linkrev nodeid p1 p2
30 rev offset length base linkrev nodeid p1 p2
31 0 0 69 0 1 6ca237634e1f 000000000000 000000000000
31 0 0 69 0 1 6ca237634e1f 000000000000 000000000000
32 1 69 6 1 2 7a1ff8e75f5b 6ca237634e1f 000000000000
32 1 69 6 1 2 7a1ff8e75f5b 6ca237634e1f 000000000000
33 2 75 82 1 3 243dfe60f3d9 000000000000 000000000000
33 2 75 82 1 3 243dfe60f3d9 000000000000 000000000000
34 # should match
34 # should match
35 rev offset length base linkrev nodeid p1 p2
35 rev offset length base linkrev nodeid p1 p2
36 0 0 5 0 0 2ed2a3912a0b 000000000000 000000000000
36 0 0 5 0 0 2ed2a3912a0b 000000000000 000000000000
37 1 5 7 1 2 dd12c926cf16 2ed2a3912a0b 000000000000
37 1 5 7 1 2 dd12c926cf16 2ed2a3912a0b 000000000000
38 bar renamed from foo:dd12c926cf165e3eb4cf87b084955cb617221c17
38 bar renamed from foo:dd12c926cf165e3eb4cf87b084955cb617221c17
39 # should show no copies
39 # should show no copies
40 # copy --after on an added file
40 # copy --after on an added file
41 A baz
41 A baz
42 bar
42 bar
43 # foo was clean:
43 # foo was clean:
44 = foo
44 C foo
45 # but it's considered modified after a copy --after --force
45 # but it's considered modified after a copy --after --force
46 M foo
46 M foo
47 bar
47 bar
@@ -1,304 +1,304 b''
1 Mercurial Distributed SCM
1 Mercurial Distributed SCM
2
2
3 basic commands:
3 basic commands:
4
4
5 add add the specified files on the next commit
5 add add the specified files on the next commit
6 annotate show changeset information per file line
6 annotate show changeset information per file line
7 clone make a copy of an existing repository
7 clone make a copy of an existing repository
8 commit commit the specified files or all outstanding changes
8 commit commit the specified files or all outstanding changes
9 diff diff repository (or selected files)
9 diff diff repository (or selected files)
10 export dump the header and diffs for one or more changesets
10 export dump the header and diffs for one or more changesets
11 init create a new repository in the given directory
11 init create a new repository in the given directory
12 log show revision history of entire repository or files
12 log show revision history of entire repository or files
13 merge merge working directory with another revision
13 merge merge working directory with another revision
14 parents show the parents of the working dir or revision
14 parents show the parents of the working dir or revision
15 pull pull changes from the specified source
15 pull pull changes from the specified source
16 push push changes to the specified destination
16 push push changes to the specified destination
17 remove remove the specified files on the next commit
17 remove remove the specified files on the next commit
18 serve export the repository via HTTP
18 serve export the repository via HTTP
19 status show changed files in the working directory
19 status show changed files in the working directory
20 update update working directory
20 update update working directory
21
21
22 use "hg help" for the full list of commands or "hg -v" for details
22 use "hg help" for the full list of commands or "hg -v" for details
23 add add the specified files on the next commit
23 add add the specified files on the next commit
24 annotate show changeset information per file line
24 annotate show changeset information per file line
25 clone make a copy of an existing repository
25 clone make a copy of an existing repository
26 commit commit the specified files or all outstanding changes
26 commit commit the specified files or all outstanding changes
27 diff diff repository (or selected files)
27 diff diff repository (or selected files)
28 export dump the header and diffs for one or more changesets
28 export dump the header and diffs for one or more changesets
29 init create a new repository in the given directory
29 init create a new repository in the given directory
30 log show revision history of entire repository or files
30 log show revision history of entire repository or files
31 merge merge working directory with another revision
31 merge merge working directory with another revision
32 parents show the parents of the working dir or revision
32 parents show the parents of the working dir or revision
33 pull pull changes from the specified source
33 pull pull changes from the specified source
34 push push changes to the specified destination
34 push push changes to the specified destination
35 remove remove the specified files on the next commit
35 remove remove the specified files on the next commit
36 serve export the repository via HTTP
36 serve export the repository via HTTP
37 status show changed files in the working directory
37 status show changed files in the working directory
38 update update working directory
38 update update working directory
39 Mercurial Distributed SCM
39 Mercurial Distributed SCM
40
40
41 list of commands:
41 list of commands:
42
42
43 add add the specified files on the next commit
43 add add the specified files on the next commit
44 addremove add all new files, delete all missing files
44 addremove add all new files, delete all missing files
45 annotate show changeset information per file line
45 annotate show changeset information per file line
46 archive create unversioned archive of a repository revision
46 archive create unversioned archive of a repository revision
47 backout reverse effect of earlier changeset
47 backout reverse effect of earlier changeset
48 branch set or show the current branch name
48 branch set or show the current branch name
49 branches list repository named branches
49 branches list repository named branches
50 bundle create a changegroup file
50 bundle create a changegroup file
51 cat output the current or given revision of files
51 cat output the current or given revision of files
52 clone make a copy of an existing repository
52 clone make a copy of an existing repository
53 commit commit the specified files or all outstanding changes
53 commit commit the specified files or all outstanding changes
54 copy mark files as copied for the next commit
54 copy mark files as copied for the next commit
55 diff diff repository (or selected files)
55 diff diff repository (or selected files)
56 export dump the header and diffs for one or more changesets
56 export dump the header and diffs for one or more changesets
57 grep search for a pattern in specified files and revisions
57 grep search for a pattern in specified files and revisions
58 heads show current repository heads or show branch heads
58 heads show current repository heads or show branch heads
59 help show help for a command, extension, or list of commands
59 help show help for a command, extension, or list of commands
60 identify identify the working copy or specified revision
60 identify identify the working copy or specified revision
61 import import an ordered set of patches
61 import import an ordered set of patches
62 incoming show new changesets found in source
62 incoming show new changesets found in source
63 init create a new repository in the given directory
63 init create a new repository in the given directory
64 locate locate files matching specific patterns
64 locate locate files matching specific patterns
65 log show revision history of entire repository or files
65 log show revision history of entire repository or files
66 manifest output the current or given revision of the project manifest
66 manifest output the current or given revision of the project manifest
67 merge merge working directory with another revision
67 merge merge working directory with another revision
68 outgoing show changesets not found in destination
68 outgoing show changesets not found in destination
69 parents show the parents of the working dir or revision
69 parents show the parents of the working dir or revision
70 paths show definition of symbolic path names
70 paths show definition of symbolic path names
71 pull pull changes from the specified source
71 pull pull changes from the specified source
72 push push changes to the specified destination
72 push push changes to the specified destination
73 recover roll back an interrupted transaction
73 recover roll back an interrupted transaction
74 remove remove the specified files on the next commit
74 remove remove the specified files on the next commit
75 rename rename files; equivalent of copy + remove
75 rename rename files; equivalent of copy + remove
76 revert restore individual files or dirs to an earlier state
76 revert restore individual files or dirs to an earlier state
77 rollback roll back the last transaction
77 rollback roll back the last transaction
78 root print the root (top) of the current working dir
78 root print the root (top) of the current working dir
79 serve export the repository via HTTP
79 serve export the repository via HTTP
80 showconfig show combined config settings from all hgrc files
80 showconfig show combined config settings from all hgrc files
81 status show changed files in the working directory
81 status show changed files in the working directory
82 tag add a tag for the current or given revision
82 tag add a tag for the current or given revision
83 tags list repository tags
83 tags list repository tags
84 tip show the tip revision
84 tip show the tip revision
85 unbundle apply one or more changegroup files
85 unbundle apply one or more changegroup files
86 update update working directory
86 update update working directory
87 verify verify the integrity of the repository
87 verify verify the integrity of the repository
88 version output version and copyright information
88 version output version and copyright information
89
89
90 use "hg -v help" to show aliases and global options
90 use "hg -v help" to show aliases and global options
91 add add the specified files on the next commit
91 add add the specified files on the next commit
92 addremove add all new files, delete all missing files
92 addremove add all new files, delete all missing files
93 annotate show changeset information per file line
93 annotate show changeset information per file line
94 archive create unversioned archive of a repository revision
94 archive create unversioned archive of a repository revision
95 backout reverse effect of earlier changeset
95 backout reverse effect of earlier changeset
96 branch set or show the current branch name
96 branch set or show the current branch name
97 branches list repository named branches
97 branches list repository named branches
98 bundle create a changegroup file
98 bundle create a changegroup file
99 cat output the current or given revision of files
99 cat output the current or given revision of files
100 clone make a copy of an existing repository
100 clone make a copy of an existing repository
101 commit commit the specified files or all outstanding changes
101 commit commit the specified files or all outstanding changes
102 copy mark files as copied for the next commit
102 copy mark files as copied for the next commit
103 diff diff repository (or selected files)
103 diff diff repository (or selected files)
104 export dump the header and diffs for one or more changesets
104 export dump the header and diffs for one or more changesets
105 grep search for a pattern in specified files and revisions
105 grep search for a pattern in specified files and revisions
106 heads show current repository heads or show branch heads
106 heads show current repository heads or show branch heads
107 help show help for a command, extension, or list of commands
107 help show help for a command, extension, or list of commands
108 identify identify the working copy or specified revision
108 identify identify the working copy or specified revision
109 import import an ordered set of patches
109 import import an ordered set of patches
110 incoming show new changesets found in source
110 incoming show new changesets found in source
111 init create a new repository in the given directory
111 init create a new repository in the given directory
112 locate locate files matching specific patterns
112 locate locate files matching specific patterns
113 log show revision history of entire repository or files
113 log show revision history of entire repository or files
114 manifest output the current or given revision of the project manifest
114 manifest output the current or given revision of the project manifest
115 merge merge working directory with another revision
115 merge merge working directory with another revision
116 outgoing show changesets not found in destination
116 outgoing show changesets not found in destination
117 parents show the parents of the working dir or revision
117 parents show the parents of the working dir or revision
118 paths show definition of symbolic path names
118 paths show definition of symbolic path names
119 pull pull changes from the specified source
119 pull pull changes from the specified source
120 push push changes to the specified destination
120 push push changes to the specified destination
121 recover roll back an interrupted transaction
121 recover roll back an interrupted transaction
122 remove remove the specified files on the next commit
122 remove remove the specified files on the next commit
123 rename rename files; equivalent of copy + remove
123 rename rename files; equivalent of copy + remove
124 revert restore individual files or dirs to an earlier state
124 revert restore individual files or dirs to an earlier state
125 rollback roll back the last transaction
125 rollback roll back the last transaction
126 root print the root (top) of the current working dir
126 root print the root (top) of the current working dir
127 serve export the repository via HTTP
127 serve export the repository via HTTP
128 showconfig show combined config settings from all hgrc files
128 showconfig show combined config settings from all hgrc files
129 status show changed files in the working directory
129 status show changed files in the working directory
130 tag add a tag for the current or given revision
130 tag add a tag for the current or given revision
131 tags list repository tags
131 tags list repository tags
132 tip show the tip revision
132 tip show the tip revision
133 unbundle apply one or more changegroup files
133 unbundle apply one or more changegroup files
134 update update working directory
134 update update working directory
135 verify verify the integrity of the repository
135 verify verify the integrity of the repository
136 version output version and copyright information
136 version output version and copyright information
137 hg add [OPTION]... [FILE]...
137 hg add [OPTION]... [FILE]...
138
138
139 add the specified files on the next commit
139 add the specified files on the next commit
140
140
141 Schedule files to be version controlled and added to the repository.
141 Schedule files to be version controlled and added to the repository.
142
142
143 The files will be added to the repository at the next commit. To
143 The files will be added to the repository at the next commit. To
144 undo an add before that, see hg revert.
144 undo an add before that, see hg revert.
145
145
146 If no names are given, add all files in the repository.
146 If no names are given, add all files in the repository.
147
147
148 options:
148 options:
149
149
150 -I --include include names matching the given patterns
150 -I --include include names matching the given patterns
151 -X --exclude exclude names matching the given patterns
151 -X --exclude exclude names matching the given patterns
152 -n --dry-run do not perform actions, just print output
152 -n --dry-run do not perform actions, just print output
153
153
154 use "hg -v help add" to show global options
154 use "hg -v help add" to show global options
155 hg add: option --skjdfks not recognized
155 hg add: option --skjdfks not recognized
156 hg add [OPTION]... [FILE]...
156 hg add [OPTION]... [FILE]...
157
157
158 add the specified files on the next commit
158 add the specified files on the next commit
159
159
160 Schedule files to be version controlled and added to the repository.
160 Schedule files to be version controlled and added to the repository.
161
161
162 The files will be added to the repository at the next commit. To
162 The files will be added to the repository at the next commit. To
163 undo an add before that, see hg revert.
163 undo an add before that, see hg revert.
164
164
165 If no names are given, add all files in the repository.
165 If no names are given, add all files in the repository.
166
166
167 options:
167 options:
168
168
169 -I --include include names matching the given patterns
169 -I --include include names matching the given patterns
170 -X --exclude exclude names matching the given patterns
170 -X --exclude exclude names matching the given patterns
171 -n --dry-run do not perform actions, just print output
171 -n --dry-run do not perform actions, just print output
172
172
173 use "hg -v help add" to show global options
173 use "hg -v help add" to show global options
174 hg diff [OPTION]... [-r REV1 [-r REV2]] [FILE]...
174 hg diff [OPTION]... [-r REV1 [-r REV2]] [FILE]...
175
175
176 diff repository (or selected files)
176 diff repository (or selected files)
177
177
178 Show differences between revisions for the specified files.
178 Show differences between revisions for the specified files.
179
179
180 Differences between files are shown using the unified diff format.
180 Differences between files are shown using the unified diff format.
181
181
182 NOTE: diff may generate unexpected results for merges, as it will
182 NOTE: diff may generate unexpected results for merges, as it will
183 default to comparing against the working directory's first parent
183 default to comparing against the working directory's first parent
184 changeset if no revisions are specified.
184 changeset if no revisions are specified.
185
185
186 When two revision arguments are given, then changes are shown
186 When two revision arguments are given, then changes are shown
187 between those revisions. If only one revision is specified then
187 between those revisions. If only one revision is specified then
188 that revision is compared to the working directory, and, when no
188 that revision is compared to the working directory, and, when no
189 revisions are specified, the working directory files are compared
189 revisions are specified, the working directory files are compared
190 to its parent.
190 to its parent.
191
191
192 Without the -a option, diff will avoid generating diffs of files
192 Without the -a option, diff will avoid generating diffs of files
193 it detects as binary. With -a, diff will generate a diff anyway,
193 it detects as binary. With -a, diff will generate a diff anyway,
194 probably with undesirable results.
194 probably with undesirable results.
195
195
196 options:
196 options:
197
197
198 -r --rev revision
198 -r --rev revision
199 -a --text treat all files as text
199 -a --text treat all files as text
200 -p --show-function show which function each change is in
200 -p --show-function show which function each change is in
201 -g --git use git extended diff format
201 -g --git use git extended diff format
202 --nodates don't include dates in diff headers
202 --nodates don't include dates in diff headers
203 -w --ignore-all-space ignore white space when comparing lines
203 -w --ignore-all-space ignore white space when comparing lines
204 -b --ignore-space-change ignore changes in the amount of white space
204 -b --ignore-space-change ignore changes in the amount of white space
205 -B --ignore-blank-lines ignore changes whose lines are all blank
205 -B --ignore-blank-lines ignore changes whose lines are all blank
206 -I --include include names matching the given patterns
206 -I --include include names matching the given patterns
207 -X --exclude exclude names matching the given patterns
207 -X --exclude exclude names matching the given patterns
208
208
209 use "hg -v help diff" to show global options
209 use "hg -v help diff" to show global options
210 hg status [OPTION]... [FILE]...
210 hg status [OPTION]... [FILE]...
211
211
212 show changed files in the working directory
212 show changed files in the working directory
213
213
214 Show status of files in the repository. If names are given, only
214 Show status of files in the repository. If names are given, only
215 files that match are shown. Files that are clean or ignored, are
215 files that match are shown. Files that are clean or ignored, are
216 not listed unless -c (clean), -i (ignored) or -A is given.
216 not listed unless -c (clean), -i (ignored) or -A is given.
217
217
218 NOTE: status may appear to disagree with diff if permissions have
218 NOTE: status may appear to disagree with diff if permissions have
219 changed or a merge has occurred. The standard diff format does not
219 changed or a merge has occurred. The standard diff format does not
220 report permission changes and diff only reports changes relative
220 report permission changes and diff only reports changes relative
221 to one merge parent.
221 to one merge parent.
222
222
223 If one revision is given, it is used as the base revision.
223 If one revision is given, it is used as the base revision.
224 If two revisions are given, the difference between them is shown.
224 If two revisions are given, the difference between them is shown.
225
225
226 The codes used to show the status of files are:
226 The codes used to show the status of files are:
227 M = modified
227 M = modified
228 A = added
228 A = added
229 R = removed
229 R = removed
230 = = clean
230 C = clean
231 ! = deleted, but still tracked
231 ! = deleted, but still tracked
232 ? = not tracked
232 ? = not tracked
233 I = ignored (not shown by default)
233 I = ignored (not shown by default)
234 = the previous added file was copied from here
234 = the previous added file was copied from here
235
235
236 aliases: st
236 aliases: st
237
237
238 options:
238 options:
239
239
240 -A --all show status of all files
240 -A --all show status of all files
241 -m --modified show only modified files
241 -m --modified show only modified files
242 -a --added show only added files
242 -a --added show only added files
243 -r --removed show only removed files
243 -r --removed show only removed files
244 -d --deleted show only deleted (but tracked) files
244 -d --deleted show only deleted (but tracked) files
245 -c --clean show only files without changes
245 -c --clean show only files without changes
246 -u --unknown show only unknown (not tracked) files
246 -u --unknown show only unknown (not tracked) files
247 -i --ignored show only ignored files
247 -i --ignored show only ignored files
248 -n --no-status hide status prefix
248 -n --no-status hide status prefix
249 -C --copies show source of copied files
249 -C --copies show source of copied files
250 -0 --print0 end filenames with NUL, for use with xargs
250 -0 --print0 end filenames with NUL, for use with xargs
251 --rev show difference from revision
251 --rev show difference from revision
252 -I --include include names matching the given patterns
252 -I --include include names matching the given patterns
253 -X --exclude exclude names matching the given patterns
253 -X --exclude exclude names matching the given patterns
254
254
255 use "hg -v help status" to show global options
255 use "hg -v help status" to show global options
256 hg status [OPTION]... [FILE]...
256 hg status [OPTION]... [FILE]...
257
257
258 show changed files in the working directory
258 show changed files in the working directory
259 hg: unknown command 'foo'
259 hg: unknown command 'foo'
260 Mercurial Distributed SCM
260 Mercurial Distributed SCM
261
261
262 basic commands:
262 basic commands:
263
263
264 add add the specified files on the next commit
264 add add the specified files on the next commit
265 annotate show changeset information per file line
265 annotate show changeset information per file line
266 clone make a copy of an existing repository
266 clone make a copy of an existing repository
267 commit commit the specified files or all outstanding changes
267 commit commit the specified files or all outstanding changes
268 diff diff repository (or selected files)
268 diff diff repository (or selected files)
269 export dump the header and diffs for one or more changesets
269 export dump the header and diffs for one or more changesets
270 init create a new repository in the given directory
270 init create a new repository in the given directory
271 log show revision history of entire repository or files
271 log show revision history of entire repository or files
272 merge merge working directory with another revision
272 merge merge working directory with another revision
273 parents show the parents of the working dir or revision
273 parents show the parents of the working dir or revision
274 pull pull changes from the specified source
274 pull pull changes from the specified source
275 push push changes to the specified destination
275 push push changes to the specified destination
276 remove remove the specified files on the next commit
276 remove remove the specified files on the next commit
277 serve export the repository via HTTP
277 serve export the repository via HTTP
278 status show changed files in the working directory
278 status show changed files in the working directory
279 update update working directory
279 update update working directory
280
280
281 use "hg help" for the full list of commands or "hg -v" for details
281 use "hg help" for the full list of commands or "hg -v" for details
282 hg: unknown command 'skjdfks'
282 hg: unknown command 'skjdfks'
283 Mercurial Distributed SCM
283 Mercurial Distributed SCM
284
284
285 basic commands:
285 basic commands:
286
286
287 add add the specified files on the next commit
287 add add the specified files on the next commit
288 annotate show changeset information per file line
288 annotate show changeset information per file line
289 clone make a copy of an existing repository
289 clone make a copy of an existing repository
290 commit commit the specified files or all outstanding changes
290 commit commit the specified files or all outstanding changes
291 diff diff repository (or selected files)
291 diff diff repository (or selected files)
292 export dump the header and diffs for one or more changesets
292 export dump the header and diffs for one or more changesets
293 init create a new repository in the given directory
293 init create a new repository in the given directory
294 log show revision history of entire repository or files
294 log show revision history of entire repository or files
295 merge merge working directory with another revision
295 merge merge working directory with another revision
296 parents show the parents of the working dir or revision
296 parents show the parents of the working dir or revision
297 pull pull changes from the specified source
297 pull pull changes from the specified source
298 push push changes to the specified destination
298 push push changes to the specified destination
299 remove remove the specified files on the next commit
299 remove remove the specified files on the next commit
300 serve export the repository via HTTP
300 serve export the repository via HTTP
301 status show changed files in the working directory
301 status show changed files in the working directory
302 update update working directory
302 update update working directory
303
303
304 use "hg help" for the full list of commands or "hg -v" for details
304 use "hg help" for the full list of commands or "hg -v" for details
@@ -1,49 +1,49 b''
1 adding a
1 adding a
2 adding b/b
2 adding b/b
3 % file replaced with directory
3 % file replaced with directory
4 % should fail - would corrupt dirstate
4 % should fail - would corrupt dirstate
5 abort: file 'a' in dirstate clashes with 'a/a'
5 abort: file 'a' in dirstate clashes with 'a/a'
6 % removing shadow
6 % removing shadow
7 % should succeed - shadow removed
7 % should succeed - shadow removed
8 % directory replaced with file
8 % directory replaced with file
9 % should fail - would corrupt dirstate
9 % should fail - would corrupt dirstate
10 abort: directory 'b' already in dirstate
10 abort: directory 'b' already in dirstate
11 % removing shadow
11 % removing shadow
12 % should succeed - shadow removed
12 % should succeed - shadow removed
13 % look what we got
13 % look what we got
14 A a/a
14 A a/a
15 A b
15 A b
16 R a
16 R a
17 R b/b
17 R b/b
18 % revert reintroducing shadow - should fail
18 % revert reintroducing shadow - should fail
19 abort: file 'b' in dirstate clashes with 'b/b'
19 abort: file 'b' in dirstate clashes with 'b/b'
20 % revert all - should succeed
20 % revert all - should succeed
21 undeleting a
21 undeleting a
22 forgetting a/a
22 forgetting a/a
23 forgetting b
23 forgetting b
24 undeleting b/b
24 undeleting b/b
25 % addremove
25 % addremove
26 removing a
26 removing a
27 adding a/a
27 adding a/a
28 adding b
28 adding b
29 removing b/b
29 removing b/b
30 A a/a
30 A a/a
31 A b
31 A b
32 R a
32 R a
33 R b/b
33 R b/b
34 % commit
34 % commit
35 = a/a
35 C a/a
36 = b
36 C b
37 % long directory replaced with file
37 % long directory replaced with file
38 adding d/d/d
38 adding d/d/d
39 % should fail - would corrupt dirstate
39 % should fail - would corrupt dirstate
40 abort: directory 'd' already in dirstate
40 abort: directory 'd' already in dirstate
41 % removing shadow
41 % removing shadow
42 % should succeed - shadow removed
42 % should succeed - shadow removed
43 % update should work at least with clean workdir
43 % update should work at least with clean workdir
44 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
44 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
45 = a
45 C a
46 = b/b
46 C b/b
47 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
47 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
48 = a/a
48 C a/a
49 = b
49 C b
@@ -1,64 +1,64 b''
1 adding file1
1 adding file1
2 adding file2
2 adding file2
3 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
3 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
4
4
5 # non-interactive merge
5 # non-interactive merge
6 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
6 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
7 (branch merge, don't forget to commit)
7 (branch merge, don't forget to commit)
8 status:
8 status:
9 M file2
9 M file2
10 = file1
10 C file1
11 file1:
11 file1:
12 1
12 1
13 changed
13 changed
14 file2:
14 file2:
15 2
15 2
16 changed
16 changed
17
17
18 # interactive merge
18 # interactive merge
19 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
19 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
20 local changed file1 which remote deleted
20 local changed file1 which remote deleted
21 use (c)hanged version or (d)elete? remote changed file2 which local deleted
21 use (c)hanged version or (d)elete? remote changed file2 which local deleted
22 use (c)hanged version or leave (d)eleted? 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
22 use (c)hanged version or leave (d)eleted? 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
23 (branch merge, don't forget to commit)
23 (branch merge, don't forget to commit)
24 status:
24 status:
25 file2: No such file or directory
25 file2: No such file or directory
26 = file1
26 C file1
27 file1:
27 file1:
28 1
28 1
29 changed
29 changed
30 file2 does not exist
30 file2 does not exist
31
31
32 # interactive merge with bad input
32 # interactive merge with bad input
33 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
33 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
34 local changed file1 which remote deleted
34 local changed file1 which remote deleted
35 use (c)hanged version or (d)elete? unrecognized response
35 use (c)hanged version or (d)elete? unrecognized response
36 local changed file1 which remote deleted
36 local changed file1 which remote deleted
37 use (c)hanged version or (d)elete? unrecognized response
37 use (c)hanged version or (d)elete? unrecognized response
38 local changed file1 which remote deleted
38 local changed file1 which remote deleted
39 use (c)hanged version or (d)elete? remote changed file2 which local deleted
39 use (c)hanged version or (d)elete? remote changed file2 which local deleted
40 use (c)hanged version or leave (d)eleted? unrecognized response
40 use (c)hanged version or leave (d)eleted? unrecognized response
41 remote changed file2 which local deleted
41 remote changed file2 which local deleted
42 use (c)hanged version or leave (d)eleted? 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
42 use (c)hanged version or leave (d)eleted? 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
43 (branch merge, don't forget to commit)
43 (branch merge, don't forget to commit)
44 status:
44 status:
45 M file2
45 M file2
46 R file1
46 R file1
47 file1 does not exist
47 file1 does not exist
48 file2:
48 file2:
49 2
49 2
50 changed
50 changed
51
51
52 # interactive merge with not enough input
52 # interactive merge with not enough input
53 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
53 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
54 local changed file1 which remote deleted
54 local changed file1 which remote deleted
55 use (c)hanged version or (d)elete? remote changed file2 which local deleted
55 use (c)hanged version or (d)elete? remote changed file2 which local deleted
56 use (c)hanged version or leave (d)eleted? abort: response expected
56 use (c)hanged version or leave (d)eleted? abort: response expected
57 failed
57 failed
58 status:
58 status:
59 file2: No such file or directory
59 file2: No such file or directory
60 = file1
60 C file1
61 file1:
61 file1:
62 1
62 1
63 changed
63 changed
64 file2 does not exist
64 file2 does not exist
@@ -1,19 +1,19 b''
1 adding foo
1 adding foo
2 Patch queue now empty
2 Patch queue now empty
3 applying patch1
3 applying patch1
4 applying patch2
4 applying patch2
5 applying bad-patch
5 applying bad-patch
6 transaction abort!
6 transaction abort!
7 rollback completed
7 rollback completed
8 cleaning up working directory...done
8 cleaning up working directory...done
9 abort: decoding near 'οΏ½': 'ascii' codec can't decode byte 0xe9 in position 0: ordinal not in range(128)!
9 abort: decoding near 'οΏ½': 'ascii' codec can't decode byte 0xe9 in position 0: ordinal not in range(128)!
10 changeset: 0:bbd179dfa0a7
10 changeset: 0:bbd179dfa0a7
11 tag: tip
11 tag: tip
12 user: test
12 user: test
13 date: Thu Jan 01 00:00:00 1970 +0000
13 date: Thu Jan 01 00:00:00 1970 +0000
14 summary: add foo
14 summary: add foo
15
15
16 % bar should be gone; other unknown/ignored files should still be around
16 % bar should be gone; other unknown/ignored files should still be around
17 ? untracked-file
17 ? untracked-file
18 I .hgignore
18 I .hgignore
19 = foo
19 C foo
@@ -1,458 +1,458 b''
1 % help
1 % help
2 mq extension - patch management and development
2 mq extension - patch management and development
3
3
4 This extension lets you work with a stack of patches in a Mercurial
4 This extension lets you work with a stack of patches in a Mercurial
5 repository. It manages two stacks of patches - all known patches, and
5 repository. It manages two stacks of patches - all known patches, and
6 applied patches (subset of known patches).
6 applied patches (subset of known patches).
7
7
8 Known patches are represented as patch files in the .hg/patches
8 Known patches are represented as patch files in the .hg/patches
9 directory. Applied patches are both patch files and changesets.
9 directory. Applied patches are both patch files and changesets.
10
10
11 Common tasks (use "hg help command" for more details):
11 Common tasks (use "hg help command" for more details):
12
12
13 prepare repository to work with patches qinit
13 prepare repository to work with patches qinit
14 create new patch qnew
14 create new patch qnew
15 import existing patch qimport
15 import existing patch qimport
16
16
17 print patch series qseries
17 print patch series qseries
18 print applied patches qapplied
18 print applied patches qapplied
19 print name of top applied patch qtop
19 print name of top applied patch qtop
20
20
21 add known patch to applied stack qpush
21 add known patch to applied stack qpush
22 remove patch from applied stack qpop
22 remove patch from applied stack qpop
23 refresh contents of top applied patch qrefresh
23 refresh contents of top applied patch qrefresh
24
24
25 list of commands:
25 list of commands:
26
26
27 qapplied print the patches already applied
27 qapplied print the patches already applied
28 qclone clone main and patch repository at same time
28 qclone clone main and patch repository at same time
29 qcommit commit changes in the queue repository
29 qcommit commit changes in the queue repository
30 qdelete remove patches from queue
30 qdelete remove patches from queue
31 qdiff diff of the current patch
31 qdiff diff of the current patch
32 qfold fold the named patches into the current patch
32 qfold fold the named patches into the current patch
33 qgoto push or pop patches until named patch is at top of stack
33 qgoto push or pop patches until named patch is at top of stack
34 qguard set or print guards for a patch
34 qguard set or print guards for a patch
35 qheader Print the header of the topmost or specified patch
35 qheader Print the header of the topmost or specified patch
36 qimport import a patch
36 qimport import a patch
37 qinit init a new queue repository
37 qinit init a new queue repository
38 qnew create a new patch
38 qnew create a new patch
39 qnext print the name of the next patch
39 qnext print the name of the next patch
40 qpop pop the current patch off the stack
40 qpop pop the current patch off the stack
41 qprev print the name of the previous patch
41 qprev print the name of the previous patch
42 qpush push the next patch onto the stack
42 qpush push the next patch onto the stack
43 qrefresh update the current patch
43 qrefresh update the current patch
44 qrename rename a patch
44 qrename rename a patch
45 qrestore restore the queue state saved by a rev
45 qrestore restore the queue state saved by a rev
46 qsave save current queue state
46 qsave save current queue state
47 qselect set or print guarded patches to push
47 qselect set or print guarded patches to push
48 qseries print the entire series file
48 qseries print the entire series file
49 qtop print the name of the current patch
49 qtop print the name of the current patch
50 qunapplied print the patches not yet applied
50 qunapplied print the patches not yet applied
51 strip strip a revision and all later revs on the same branch
51 strip strip a revision and all later revs on the same branch
52
52
53 use "hg -v help mq" to show aliases and global options
53 use "hg -v help mq" to show aliases and global options
54 adding a
54 adding a
55 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
55 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
56 adding b/z
56 adding b/z
57 % qinit
57 % qinit
58 % -R qinit
58 % -R qinit
59 % qinit -c
59 % qinit -c
60 A .hgignore
60 A .hgignore
61 A series
61 A series
62 % qnew implies add
62 % qnew implies add
63 A .hgignore
63 A .hgignore
64 A series
64 A series
65 A test.patch
65 A test.patch
66 % qinit; qinit -c
66 % qinit; qinit -c
67 .hgignore:
67 .hgignore:
68 syntax: glob
68 syntax: glob
69 status
69 status
70 guards
70 guards
71 series:
71 series:
72 abort: repository already exists!
72 abort: repository already exists!
73 % qinit; <stuff>; qinit -c
73 % qinit; <stuff>; qinit -c
74 adding .hg/patches/A
74 adding .hg/patches/A
75 adding .hg/patches/B
75 adding .hg/patches/B
76 A .hgignore
76 A .hgignore
77 A A
77 A A
78 A B
78 A B
79 A series
79 A series
80 .hgignore:
80 .hgignore:
81 status
81 status
82 bleh
82 bleh
83 series:
83 series:
84 A
84 A
85 B
85 B
86 % qnew with uncommitted changes
86 % qnew with uncommitted changes
87 abort: local changes found, refresh first
87 abort: local changes found, refresh first
88 A somefile
88 A somefile
89 % qnew with uncommitted changes and missing file (issue 803)
89 % qnew with uncommitted changes and missing file (issue 803)
90 someotherfile: No such file or directory
90 someotherfile: No such file or directory
91 A somefile
91 A somefile
92 issue803.patch
92 issue803.patch
93 Patch queue now empty
93 Patch queue now empty
94 % qnew -m
94 % qnew -m
95 foo bar
95 foo bar
96 % qrefresh
96 % qrefresh
97 foo bar
97 foo bar
98
98
99 diff -r xa
99 diff -r xa
100 --- a/a
100 --- a/a
101 +++ b/a
101 +++ b/a
102 @@ -1,1 +1,2 @@ a
102 @@ -1,1 +1,2 @@ a
103 a
103 a
104 +a
104 +a
105 % empty qrefresh
105 % empty qrefresh
106 revision:
106 revision:
107 patch:
107 patch:
108 foo bar
108 foo bar
109
109
110 working dir diff:
110 working dir diff:
111 --- a/a
111 --- a/a
112 +++ b/a
112 +++ b/a
113 @@ -1,1 +1,2 @@ a
113 @@ -1,1 +1,2 @@ a
114 a
114 a
115 +a
115 +a
116 % qpop
116 % qpop
117 Patch queue now empty
117 Patch queue now empty
118 % qpush
118 % qpush
119 applying test.patch
119 applying test.patch
120 Now at: test.patch
120 Now at: test.patch
121 % pop/push outside repo
121 % pop/push outside repo
122 Patch queue now empty
122 Patch queue now empty
123 applying test.patch
123 applying test.patch
124 Now at: test.patch
124 Now at: test.patch
125 % qrefresh in subdir
125 % qrefresh in subdir
126 % pop/push -a in subdir
126 % pop/push -a in subdir
127 Patch queue now empty
127 Patch queue now empty
128 applying test.patch
128 applying test.patch
129 applying test2.patch
129 applying test2.patch
130 Now at: test2.patch
130 Now at: test2.patch
131 % qseries
131 % qseries
132 test.patch
132 test.patch
133 test2.patch
133 test2.patch
134 Now at: test.patch
134 Now at: test.patch
135 0 A test.patch: foo bar
135 0 A test.patch: foo bar
136 1 U test2.patch:
136 1 U test2.patch:
137 applying test2.patch
137 applying test2.patch
138 Now at: test2.patch
138 Now at: test2.patch
139 % qapplied
139 % qapplied
140 test.patch
140 test.patch
141 test2.patch
141 test2.patch
142 % qtop
142 % qtop
143 test2.patch
143 test2.patch
144 % qprev
144 % qprev
145 test.patch
145 test.patch
146 % qnext
146 % qnext
147 All patches applied
147 All patches applied
148 % pop, qnext, qprev, qapplied
148 % pop, qnext, qprev, qapplied
149 Now at: test.patch
149 Now at: test.patch
150 test2.patch
150 test2.patch
151 Only one patch applied
151 Only one patch applied
152 test.patch
152 test.patch
153 % commit should fail
153 % commit should fail
154 abort: cannot commit over an applied mq patch
154 abort: cannot commit over an applied mq patch
155 % push should fail
155 % push should fail
156 pushing to ../../k
156 pushing to ../../k
157 abort: source has mq patches applied
157 abort: source has mq patches applied
158 % qunapplied
158 % qunapplied
159 test2.patch
159 test2.patch
160 % qpush/qpop with index
160 % qpush/qpop with index
161 applying test2.patch
161 applying test2.patch
162 Now at: test2.patch
162 Now at: test2.patch
163 Now at: test.patch
163 Now at: test.patch
164 applying test1b.patch
164 applying test1b.patch
165 Now at: test1b.patch
165 Now at: test1b.patch
166 applying test2.patch
166 applying test2.patch
167 Now at: test2.patch
167 Now at: test2.patch
168 Now at: test1b.patch
168 Now at: test1b.patch
169 Now at: test.patch
169 Now at: test.patch
170 applying test1b.patch
170 applying test1b.patch
171 applying test2.patch
171 applying test2.patch
172 Now at: test2.patch
172 Now at: test2.patch
173 % push should succeed
173 % push should succeed
174 Patch queue now empty
174 Patch queue now empty
175 pushing to ../../k
175 pushing to ../../k
176 searching for changes
176 searching for changes
177 adding changesets
177 adding changesets
178 adding manifests
178 adding manifests
179 adding file changes
179 adding file changes
180 added 1 changesets with 1 changes to 1 files
180 added 1 changesets with 1 changes to 1 files
181 % qpush/qpop error codes
181 % qpush/qpop error codes
182 applying test.patch
182 applying test.patch
183 applying test1b.patch
183 applying test1b.patch
184 applying test2.patch
184 applying test2.patch
185 Now at: test2.patch
185 Now at: test2.patch
186 % pops all patches and succeeds
186 % pops all patches and succeeds
187 Patch queue now empty
187 Patch queue now empty
188 qpop -a succeeds
188 qpop -a succeeds
189 % does nothing and succeeds
189 % does nothing and succeeds
190 no patches applied
190 no patches applied
191 qpop -a succeeds
191 qpop -a succeeds
192 % fails - nothing else to pop
192 % fails - nothing else to pop
193 no patches applied
193 no patches applied
194 qpop fails
194 qpop fails
195 % pushes a patch and succeeds
195 % pushes a patch and succeeds
196 applying test.patch
196 applying test.patch
197 Now at: test.patch
197 Now at: test.patch
198 qpush succeeds
198 qpush succeeds
199 % pops a patch and succeeds
199 % pops a patch and succeeds
200 Patch queue now empty
200 Patch queue now empty
201 qpop succeeds
201 qpop succeeds
202 % pushes up to test1b.patch and succeeds
202 % pushes up to test1b.patch and succeeds
203 applying test.patch
203 applying test.patch
204 applying test1b.patch
204 applying test1b.patch
205 Now at: test1b.patch
205 Now at: test1b.patch
206 qpush test1b.patch succeeds
206 qpush test1b.patch succeeds
207 % does nothing and succeeds
207 % does nothing and succeeds
208 qpush: test1b.patch is already at the top
208 qpush: test1b.patch is already at the top
209 qpush test1b.patch succeeds
209 qpush test1b.patch succeeds
210 % does nothing and succeeds
210 % does nothing and succeeds
211 qpop: test1b.patch is already at the top
211 qpop: test1b.patch is already at the top
212 qpop test1b.patch succeeds
212 qpop test1b.patch succeeds
213 % fails - can't push to this patch
213 % fails - can't push to this patch
214 abort: cannot push to a previous patch: test.patch
214 abort: cannot push to a previous patch: test.patch
215 qpush test.patch fails
215 qpush test.patch fails
216 % fails - can't pop to this patch
216 % fails - can't pop to this patch
217 abort: patch test2.patch is not applied
217 abort: patch test2.patch is not applied
218 qpop test2.patch fails
218 qpop test2.patch fails
219 % pops up to test.patch and succeeds
219 % pops up to test.patch and succeeds
220 Now at: test.patch
220 Now at: test.patch
221 qpop test.patch succeeds
221 qpop test.patch succeeds
222 % pushes all patches and succeeds
222 % pushes all patches and succeeds
223 applying test1b.patch
223 applying test1b.patch
224 applying test2.patch
224 applying test2.patch
225 Now at: test2.patch
225 Now at: test2.patch
226 qpush -a succeeds
226 qpush -a succeeds
227 % does nothing and succeeds
227 % does nothing and succeeds
228 all patches are currently applied
228 all patches are currently applied
229 qpush -a succeeds
229 qpush -a succeeds
230 % fails - nothing else to push
230 % fails - nothing else to push
231 patch series already fully applied
231 patch series already fully applied
232 qpush fails
232 qpush fails
233 % does nothing and succeeds
233 % does nothing and succeeds
234 all patches are currently applied
234 all patches are currently applied
235 qpush test2.patch succeeds
235 qpush test2.patch succeeds
236 % strip
236 % strip
237 adding x
237 adding x
238 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
238 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
239 saving bundle to
239 saving bundle to
240 adding changesets
240 adding changesets
241 adding manifests
241 adding manifests
242 adding file changes
242 adding file changes
243 added 1 changesets with 1 changes to 1 files
243 added 1 changesets with 1 changes to 1 files
244 (run 'hg update' to get a working copy)
244 (run 'hg update' to get a working copy)
245 % cd b; hg qrefresh
245 % cd b; hg qrefresh
246 adding a
246 adding a
247 foo
247 foo
248
248
249 diff -r cb9a9f314b8b a
249 diff -r cb9a9f314b8b a
250 --- a/a
250 --- a/a
251 +++ b/a
251 +++ b/a
252 @@ -1,1 +1,2 @@ a
252 @@ -1,1 +1,2 @@ a
253 a
253 a
254 +a
254 +a
255 diff -r cb9a9f314b8b b/f
255 diff -r cb9a9f314b8b b/f
256 --- /dev/null
256 --- /dev/null
257 +++ b/b/f
257 +++ b/b/f
258 @@ -0,0 +1,1 @@
258 @@ -0,0 +1,1 @@
259 +f
259 +f
260 % hg qrefresh .
260 % hg qrefresh .
261 foo
261 foo
262
262
263 diff -r cb9a9f314b8b b/f
263 diff -r cb9a9f314b8b b/f
264 --- /dev/null
264 --- /dev/null
265 +++ b/b/f
265 +++ b/b/f
266 @@ -0,0 +1,1 @@
266 @@ -0,0 +1,1 @@
267 +f
267 +f
268 M a
268 M a
269 % qpush failure
269 % qpush failure
270 Patch queue now empty
270 Patch queue now empty
271 applying foo
271 applying foo
272 applying bar
272 applying bar
273 file foo already exists
273 file foo already exists
274 1 out of 1 hunk FAILED -- saving rejects to file foo.rej
274 1 out of 1 hunk FAILED -- saving rejects to file foo.rej
275 patch failed, unable to continue (try -v)
275 patch failed, unable to continue (try -v)
276 patch failed, rejects left in working dir
276 patch failed, rejects left in working dir
277 Errors during apply, please fix and refresh bar
277 Errors during apply, please fix and refresh bar
278 ? foo
278 ? foo
279 ? foo.rej
279 ? foo.rej
280 % mq tags
280 % mq tags
281 0 qparent
281 0 qparent
282 1 qbase foo
282 1 qbase foo
283 2 qtip bar tip
283 2 qtip bar tip
284 new file
284 new file
285
285
286 diff --git a/new b/new
286 diff --git a/new b/new
287 new file mode 100755
287 new file mode 100755
288 --- /dev/null
288 --- /dev/null
289 +++ b/new
289 +++ b/new
290 @@ -0,0 +1,1 @@
290 @@ -0,0 +1,1 @@
291 +foo
291 +foo
292 copy file
292 copy file
293
293
294 diff --git a/new b/copy
294 diff --git a/new b/copy
295 copy from new
295 copy from new
296 copy to copy
296 copy to copy
297 Now at: new
297 Now at: new
298 applying copy
298 applying copy
299 Now at: copy
299 Now at: copy
300 diff --git a/new b/copy
300 diff --git a/new b/copy
301 copy from new
301 copy from new
302 copy to copy
302 copy to copy
303 diff --git a/new b/copy
303 diff --git a/new b/copy
304 copy from new
304 copy from new
305 copy to copy
305 copy to copy
306 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
306 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
307 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
307 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
308 adding branch
308 adding branch
309 adding changesets
309 adding changesets
310 adding manifests
310 adding manifests
311 adding file changes
311 adding file changes
312 added 1 changesets with 1 changes to 1 files
312 added 1 changesets with 1 changes to 1 files
313 (run 'hg update' to get a working copy)
313 (run 'hg update' to get a working copy)
314 Patch queue now empty
314 Patch queue now empty
315 applying bar
315 applying bar
316 Now at: bar
316 Now at: bar
317 diff --git a/bar b/bar
317 diff --git a/bar b/bar
318 new file mode 100644
318 new file mode 100644
319 --- /dev/null
319 --- /dev/null
320 +++ b/bar
320 +++ b/bar
321 @@ -0,0 +1,1 @@
321 @@ -0,0 +1,1 @@
322 +bar
322 +bar
323 diff --git a/foo b/baz
323 diff --git a/foo b/baz
324 rename from foo
324 rename from foo
325 rename to baz
325 rename to baz
326 2 baz (foo)
326 2 baz (foo)
327 diff --git a/bar b/bar
327 diff --git a/bar b/bar
328 new file mode 100644
328 new file mode 100644
329 --- /dev/null
329 --- /dev/null
330 +++ b/bar
330 +++ b/bar
331 @@ -0,0 +1,1 @@
331 @@ -0,0 +1,1 @@
332 +bar
332 +bar
333 diff --git a/foo b/baz
333 diff --git a/foo b/baz
334 rename from foo
334 rename from foo
335 rename to baz
335 rename to baz
336 2 baz (foo)
336 2 baz (foo)
337 diff --git a/bar b/bar
337 diff --git a/bar b/bar
338 diff --git a/foo b/baz
338 diff --git a/foo b/baz
339
339
340 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
340 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
341 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
341 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
342 adding branch
342 adding branch
343 adding changesets
343 adding changesets
344 adding manifests
344 adding manifests
345 adding file changes
345 adding file changes
346 added 1 changesets with 1 changes to 1 files
346 added 1 changesets with 1 changes to 1 files
347 (run 'hg update' to get a working copy)
347 (run 'hg update' to get a working copy)
348 Patch queue now empty
348 Patch queue now empty
349 applying bar
349 applying bar
350 Now at: bar
350 Now at: bar
351 diff --git a/foo b/bleh
351 diff --git a/foo b/bleh
352 rename from foo
352 rename from foo
353 rename to bleh
353 rename to bleh
354 diff --git a/quux b/quux
354 diff --git a/quux b/quux
355 new file mode 100644
355 new file mode 100644
356 --- /dev/null
356 --- /dev/null
357 +++ b/quux
357 +++ b/quux
358 @@ -0,0 +1,1 @@
358 @@ -0,0 +1,1 @@
359 +bar
359 +bar
360 3 bleh (foo)
360 3 bleh (foo)
361 diff --git a/foo b/barney
361 diff --git a/foo b/barney
362 rename from foo
362 rename from foo
363 rename to barney
363 rename to barney
364 diff --git a/fred b/fred
364 diff --git a/fred b/fred
365 new file mode 100644
365 new file mode 100644
366 --- /dev/null
366 --- /dev/null
367 +++ b/fred
367 +++ b/fred
368 @@ -0,0 +1,1 @@
368 @@ -0,0 +1,1 @@
369 +bar
369 +bar
370 3 barney (foo)
370 3 barney (foo)
371 % refresh omitting an added file
371 % refresh omitting an added file
372 = newfile
372 C newfile
373 A newfile
373 A newfile
374 Now at: bar
374 Now at: bar
375 % create a git patch
375 % create a git patch
376 diff --git a/alexander b/alexander
376 diff --git a/alexander b/alexander
377 % create a git binary patch
377 % create a git binary patch
378 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
378 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
379 diff --git a/bucephalus b/bucephalus
379 diff --git a/bucephalus b/bucephalus
380 % check binary patches can be popped and pushed
380 % check binary patches can be popped and pushed
381 Now at: addalexander
381 Now at: addalexander
382 applying addbucephalus
382 applying addbucephalus
383 Now at: addbucephalus
383 Now at: addbucephalus
384 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
384 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
385 % strip again
385 % strip again
386 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
386 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
387 merging foo
387 merging foo
388 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
388 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
389 (branch merge, don't forget to commit)
389 (branch merge, don't forget to commit)
390 changeset: 3:99615015637b
390 changeset: 3:99615015637b
391 tag: tip
391 tag: tip
392 parent: 2:20cbbe65cff7
392 parent: 2:20cbbe65cff7
393 parent: 1:d2871fc282d4
393 parent: 1:d2871fc282d4
394 user: test
394 user: test
395 date: Thu Jan 01 00:00:00 1970 +0000
395 date: Thu Jan 01 00:00:00 1970 +0000
396 summary: merge
396 summary: merge
397
397
398 changeset: 2:20cbbe65cff7
398 changeset: 2:20cbbe65cff7
399 parent: 0:53245c60e682
399 parent: 0:53245c60e682
400 user: test
400 user: test
401 date: Thu Jan 01 00:00:00 1970 +0000
401 date: Thu Jan 01 00:00:00 1970 +0000
402 summary: change foo 2
402 summary: change foo 2
403
403
404 changeset: 1:d2871fc282d4
404 changeset: 1:d2871fc282d4
405 user: test
405 user: test
406 date: Thu Jan 01 00:00:00 1970 +0000
406 date: Thu Jan 01 00:00:00 1970 +0000
407 summary: change foo 1
407 summary: change foo 1
408
408
409 changeset: 0:53245c60e682
409 changeset: 0:53245c60e682
410 user: test
410 user: test
411 date: Thu Jan 01 00:00:00 1970 +0000
411 date: Thu Jan 01 00:00:00 1970 +0000
412 summary: add foo
412 summary: add foo
413
413
414 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
414 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
415 saving bundle to
415 saving bundle to
416 saving bundle to
416 saving bundle to
417 adding branch
417 adding branch
418 adding changesets
418 adding changesets
419 adding manifests
419 adding manifests
420 adding file changes
420 adding file changes
421 added 1 changesets with 1 changes to 1 files
421 added 1 changesets with 1 changes to 1 files
422 (run 'hg update' to get a working copy)
422 (run 'hg update' to get a working copy)
423 changeset: 1:20cbbe65cff7
423 changeset: 1:20cbbe65cff7
424 tag: tip
424 tag: tip
425 user: test
425 user: test
426 date: Thu Jan 01 00:00:00 1970 +0000
426 date: Thu Jan 01 00:00:00 1970 +0000
427 summary: change foo 2
427 summary: change foo 2
428
428
429 changeset: 0:53245c60e682
429 changeset: 0:53245c60e682
430 user: test
430 user: test
431 date: Thu Jan 01 00:00:00 1970 +0000
431 date: Thu Jan 01 00:00:00 1970 +0000
432 summary: add foo
432 summary: add foo
433
433
434 % qclone
434 % qclone
435 abort: versioned patch repository not found (see qinit -c)
435 abort: versioned patch repository not found (see qinit -c)
436 adding .hg/patches/patch1
436 adding .hg/patches/patch1
437 main repo:
437 main repo:
438 rev 1: change foo
438 rev 1: change foo
439 rev 0: add foo
439 rev 0: add foo
440 patch repo:
440 patch repo:
441 rev 0: checkpoint
441 rev 0: checkpoint
442 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
442 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
443 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
443 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
444 main repo:
444 main repo:
445 rev 0: add foo
445 rev 0: add foo
446 patch repo:
446 patch repo:
447 rev 0: checkpoint
447 rev 0: checkpoint
448 Patch queue now empty
448 Patch queue now empty
449 main repo:
449 main repo:
450 rev 0: add foo
450 rev 0: add foo
451 patch repo:
451 patch repo:
452 rev 0: checkpoint
452 rev 0: checkpoint
453 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
453 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
454 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
454 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
455 main repo:
455 main repo:
456 rev 0: add foo
456 rev 0: add foo
457 patch repo:
457 patch repo:
458 rev 0: checkpoint
458 rev 0: checkpoint
@@ -1,17 +1,17 b''
1 adding bar
1 adding bar
2 adding foo
2 adding foo
3 % state dump
3 % state dump
4 a 0 -1 baz
4 a 0 -1 baz
5 n 644 0 foo
5 n 644 0 foo
6 r 0 0 bar
6 r 0 0 bar
7 % status
7 % status
8 A baz
8 A baz
9 R bar
9 R bar
10 = foo
10 C foo
11 % state dump
11 % state dump
12 n 666 -1 bar
12 n 666 -1 bar
13 n 666 -1 foo
13 n 666 -1 foo
14 % status
14 % status
15 ! bar
15 ! bar
16 ? baz
16 ? baz
17 = foo
17 C foo
@@ -1,40 +1,40 b''
1 checkout
1 checkout
2 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
2 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
3 merge
3 merge
4 resolving manifests
4 resolving manifests
5 overwrite None partial False
5 overwrite None partial False
6 ancestor af1939970a1c local f26ec4fc3fa3+ remote 8e765a822af2
6 ancestor af1939970a1c local f26ec4fc3fa3+ remote 8e765a822af2
7 searching for copies back to rev 1
7 searching for copies back to rev 1
8 unmatched files in local:
8 unmatched files in local:
9 c2
9 c2
10 unmatched files in other:
10 unmatched files in other:
11 b
11 b
12 b2
12 b2
13 all copies found (* = to merge, ! = divergent):
13 all copies found (* = to merge, ! = divergent):
14 c2 -> a2
14 c2 -> a2
15 b -> a *
15 b -> a *
16 b2 -> a2
16 b2 -> a2
17 checking for directory renames
17 checking for directory renames
18 a2: divergent renames -> dr
18 a2: divergent renames -> dr
19 a: remote moved to b -> m
19 a: remote moved to b -> m
20 b2: remote created -> g
20 b2: remote created -> g
21 copying a to b
21 copying a to b
22 merging a and b
22 merging a and b
23 my a@f26ec4fc3fa3+ other b@8e765a822af2 ancestor a@af1939970a1c
23 my a@f26ec4fc3fa3+ other b@8e765a822af2 ancestor a@af1939970a1c
24 removing a
24 removing a
25 warning: detected divergent renames of a2 to:
25 warning: detected divergent renames of a2 to:
26 c2
26 c2
27 b2
27 b2
28 getting b2
28 getting b2
29 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
29 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
30 (branch merge, don't forget to commit)
30 (branch merge, don't forget to commit)
31 M b
31 M b
32 a
32 a
33 M b2
33 M b2
34 R a
34 R a
35 = c2
35 C c2
36 blahblah
36 blahblah
37 rev offset length base linkrev nodeid p1 p2
37 rev offset length base linkrev nodeid p1 p2
38 0 0 67 0 1 dc51707dfc98 000000000000 000000000000
38 0 0 67 0 1 dc51707dfc98 000000000000 000000000000
39 1 67 72 1 3 b2494a44f0a9 000000000000 dc51707dfc98
39 1 67 72 1 3 b2494a44f0a9 000000000000 dc51707dfc98
40 b renamed from a:dd03b83622e78778b403775d0d074b9ac7387a66
40 b renamed from a:dd03b83622e78778b403775d0d074b9ac7387a66
@@ -1,499 +1,499 b''
1 --------------
1 --------------
2 test L:up a R:nc a b W: - 1 get local a to b
2 test L:up a R:nc a b W: - 1 get local a to b
3 --------------
3 --------------
4 resolving manifests
4 resolving manifests
5 overwrite None partial False
5 overwrite None partial False
6 ancestor 924404dff337 local e300d1c794ec+ remote 735846fee2d7
6 ancestor 924404dff337 local e300d1c794ec+ remote 735846fee2d7
7 searching for copies back to rev 1
7 searching for copies back to rev 1
8 unmatched files in other:
8 unmatched files in other:
9 b
9 b
10 all copies found (* = to merge, ! = divergent):
10 all copies found (* = to merge, ! = divergent):
11 b -> a *
11 b -> a *
12 checking for directory renames
12 checking for directory renames
13 rev: versions differ -> m
13 rev: versions differ -> m
14 a: remote copied to b -> m
14 a: remote copied to b -> m
15 copying a to b
15 copying a to b
16 merging a and b
16 merging a and b
17 my a@e300d1c794ec+ other b@735846fee2d7 ancestor a@924404dff337
17 my a@e300d1c794ec+ other b@735846fee2d7 ancestor a@924404dff337
18 merging rev
18 merging rev
19 my rev@e300d1c794ec+ other rev@735846fee2d7 ancestor rev@924404dff337
19 my rev@e300d1c794ec+ other rev@735846fee2d7 ancestor rev@924404dff337
20 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
20 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
21 (branch merge, don't forget to commit)
21 (branch merge, don't forget to commit)
22 --------------
22 --------------
23 M b
23 M b
24 a
24 a
25 = a
25 C a
26 --------------
26 --------------
27
27
28 --------------
28 --------------
29 test L:nc a b R:up a W: - 2 get rem change to a and b
29 test L:nc a b R:up a W: - 2 get rem change to a and b
30 --------------
30 --------------
31 resolving manifests
31 resolving manifests
32 overwrite None partial False
32 overwrite None partial False
33 ancestor 924404dff337 local ac809aeed39a+ remote f4db7e329e71
33 ancestor 924404dff337 local ac809aeed39a+ remote f4db7e329e71
34 searching for copies back to rev 1
34 searching for copies back to rev 1
35 unmatched files in local:
35 unmatched files in local:
36 b
36 b
37 all copies found (* = to merge, ! = divergent):
37 all copies found (* = to merge, ! = divergent):
38 b -> a *
38 b -> a *
39 checking for directory renames
39 checking for directory renames
40 a: remote is newer -> g
40 a: remote is newer -> g
41 b: local copied to a -> m
41 b: local copied to a -> m
42 rev: versions differ -> m
42 rev: versions differ -> m
43 getting a
43 getting a
44 merging b and a
44 merging b and a
45 my b@ac809aeed39a+ other a@f4db7e329e71 ancestor a@924404dff337
45 my b@ac809aeed39a+ other a@f4db7e329e71 ancestor a@924404dff337
46 merging rev
46 merging rev
47 my rev@ac809aeed39a+ other rev@f4db7e329e71 ancestor rev@924404dff337
47 my rev@ac809aeed39a+ other rev@f4db7e329e71 ancestor rev@924404dff337
48 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
48 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
49 (branch merge, don't forget to commit)
49 (branch merge, don't forget to commit)
50 --------------
50 --------------
51 M a
51 M a
52 M b
52 M b
53 a
53 a
54 --------------
54 --------------
55
55
56 --------------
56 --------------
57 test L:up a R:nm a b W: - 3 get local a change to b, remove a
57 test L:up a R:nm a b W: - 3 get local a change to b, remove a
58 --------------
58 --------------
59 resolving manifests
59 resolving manifests
60 overwrite None partial False
60 overwrite None partial False
61 ancestor 924404dff337 local e300d1c794ec+ remote e03727d2d66b
61 ancestor 924404dff337 local e300d1c794ec+ remote e03727d2d66b
62 searching for copies back to rev 1
62 searching for copies back to rev 1
63 unmatched files in other:
63 unmatched files in other:
64 b
64 b
65 all copies found (* = to merge, ! = divergent):
65 all copies found (* = to merge, ! = divergent):
66 b -> a *
66 b -> a *
67 checking for directory renames
67 checking for directory renames
68 rev: versions differ -> m
68 rev: versions differ -> m
69 a: remote moved to b -> m
69 a: remote moved to b -> m
70 copying a to b
70 copying a to b
71 merging a and b
71 merging a and b
72 my a@e300d1c794ec+ other b@e03727d2d66b ancestor a@924404dff337
72 my a@e300d1c794ec+ other b@e03727d2d66b ancestor a@924404dff337
73 removing a
73 removing a
74 merging rev
74 merging rev
75 my rev@e300d1c794ec+ other rev@e03727d2d66b ancestor rev@924404dff337
75 my rev@e300d1c794ec+ other rev@e03727d2d66b ancestor rev@924404dff337
76 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
76 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
77 (branch merge, don't forget to commit)
77 (branch merge, don't forget to commit)
78 --------------
78 --------------
79 M b
79 M b
80 a
80 a
81 --------------
81 --------------
82
82
83 --------------
83 --------------
84 test L:nm a b R:up a W: - 4 get remote change to b
84 test L:nm a b R:up a W: - 4 get remote change to b
85 --------------
85 --------------
86 resolving manifests
86 resolving manifests
87 overwrite None partial False
87 overwrite None partial False
88 ancestor 924404dff337 local ecf3cb2a4219+ remote f4db7e329e71
88 ancestor 924404dff337 local ecf3cb2a4219+ remote f4db7e329e71
89 searching for copies back to rev 1
89 searching for copies back to rev 1
90 unmatched files in local:
90 unmatched files in local:
91 b
91 b
92 all copies found (* = to merge, ! = divergent):
92 all copies found (* = to merge, ! = divergent):
93 b -> a *
93 b -> a *
94 checking for directory renames
94 checking for directory renames
95 b: local moved to a -> m
95 b: local moved to a -> m
96 rev: versions differ -> m
96 rev: versions differ -> m
97 merging b and a
97 merging b and a
98 my b@ecf3cb2a4219+ other a@f4db7e329e71 ancestor a@924404dff337
98 my b@ecf3cb2a4219+ other a@f4db7e329e71 ancestor a@924404dff337
99 merging rev
99 merging rev
100 my rev@ecf3cb2a4219+ other rev@f4db7e329e71 ancestor rev@924404dff337
100 my rev@ecf3cb2a4219+ other rev@f4db7e329e71 ancestor rev@924404dff337
101 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
101 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
102 (branch merge, don't forget to commit)
102 (branch merge, don't forget to commit)
103 --------------
103 --------------
104 M b
104 M b
105 a
105 a
106 --------------
106 --------------
107
107
108 --------------
108 --------------
109 test L: R:nc a b W: - 5 get b
109 test L: R:nc a b W: - 5 get b
110 --------------
110 --------------
111 resolving manifests
111 resolving manifests
112 overwrite None partial False
112 overwrite None partial False
113 ancestor 924404dff337 local 94b33a1b7f2d+ remote 735846fee2d7
113 ancestor 924404dff337 local 94b33a1b7f2d+ remote 735846fee2d7
114 searching for copies back to rev 1
114 searching for copies back to rev 1
115 unmatched files in other:
115 unmatched files in other:
116 b
116 b
117 all copies found (* = to merge, ! = divergent):
117 all copies found (* = to merge, ! = divergent):
118 b -> a
118 b -> a
119 checking for directory renames
119 checking for directory renames
120 rev: versions differ -> m
120 rev: versions differ -> m
121 b: remote created -> g
121 b: remote created -> g
122 getting b
122 getting b
123 merging rev
123 merging rev
124 my rev@94b33a1b7f2d+ other rev@735846fee2d7 ancestor rev@924404dff337
124 my rev@94b33a1b7f2d+ other rev@735846fee2d7 ancestor rev@924404dff337
125 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
125 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
126 (branch merge, don't forget to commit)
126 (branch merge, don't forget to commit)
127 --------------
127 --------------
128 M b
128 M b
129 = a
129 C a
130 --------------
130 --------------
131
131
132 --------------
132 --------------
133 test L:nc a b R: W: - 6 nothing
133 test L:nc a b R: W: - 6 nothing
134 --------------
134 --------------
135 resolving manifests
135 resolving manifests
136 overwrite None partial False
136 overwrite None partial False
137 ancestor 924404dff337 local ac809aeed39a+ remote 97c705ade336
137 ancestor 924404dff337 local ac809aeed39a+ remote 97c705ade336
138 searching for copies back to rev 1
138 searching for copies back to rev 1
139 unmatched files in local:
139 unmatched files in local:
140 b
140 b
141 all copies found (* = to merge, ! = divergent):
141 all copies found (* = to merge, ! = divergent):
142 b -> a
142 b -> a
143 checking for directory renames
143 checking for directory renames
144 rev: versions differ -> m
144 rev: versions differ -> m
145 merging rev
145 merging rev
146 my rev@ac809aeed39a+ other rev@97c705ade336 ancestor rev@924404dff337
146 my rev@ac809aeed39a+ other rev@97c705ade336 ancestor rev@924404dff337
147 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
147 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
148 (branch merge, don't forget to commit)
148 (branch merge, don't forget to commit)
149 --------------
149 --------------
150 = a
150 C a
151 = b
151 C b
152 --------------
152 --------------
153
153
154 --------------
154 --------------
155 test L: R:nm a b W: - 7 get b
155 test L: R:nm a b W: - 7 get b
156 --------------
156 --------------
157 resolving manifests
157 resolving manifests
158 overwrite None partial False
158 overwrite None partial False
159 ancestor 924404dff337 local 94b33a1b7f2d+ remote e03727d2d66b
159 ancestor 924404dff337 local 94b33a1b7f2d+ remote e03727d2d66b
160 searching for copies back to rev 1
160 searching for copies back to rev 1
161 unmatched files in other:
161 unmatched files in other:
162 b
162 b
163 all copies found (* = to merge, ! = divergent):
163 all copies found (* = to merge, ! = divergent):
164 b -> a
164 b -> a
165 checking for directory renames
165 checking for directory renames
166 a: other deleted -> r
166 a: other deleted -> r
167 rev: versions differ -> m
167 rev: versions differ -> m
168 b: remote created -> g
168 b: remote created -> g
169 removing a
169 removing a
170 getting b
170 getting b
171 merging rev
171 merging rev
172 my rev@94b33a1b7f2d+ other rev@e03727d2d66b ancestor rev@924404dff337
172 my rev@94b33a1b7f2d+ other rev@e03727d2d66b ancestor rev@924404dff337
173 1 files updated, 1 files merged, 1 files removed, 0 files unresolved
173 1 files updated, 1 files merged, 1 files removed, 0 files unresolved
174 (branch merge, don't forget to commit)
174 (branch merge, don't forget to commit)
175 --------------
175 --------------
176 M b
176 M b
177 --------------
177 --------------
178
178
179 --------------
179 --------------
180 test L:nm a b R: W: - 8 nothing
180 test L:nm a b R: W: - 8 nothing
181 --------------
181 --------------
182 resolving manifests
182 resolving manifests
183 overwrite None partial False
183 overwrite None partial False
184 ancestor 924404dff337 local ecf3cb2a4219+ remote 97c705ade336
184 ancestor 924404dff337 local ecf3cb2a4219+ remote 97c705ade336
185 searching for copies back to rev 1
185 searching for copies back to rev 1
186 unmatched files in local:
186 unmatched files in local:
187 b
187 b
188 all copies found (* = to merge, ! = divergent):
188 all copies found (* = to merge, ! = divergent):
189 b -> a
189 b -> a
190 checking for directory renames
190 checking for directory renames
191 rev: versions differ -> m
191 rev: versions differ -> m
192 merging rev
192 merging rev
193 my rev@ecf3cb2a4219+ other rev@97c705ade336 ancestor rev@924404dff337
193 my rev@ecf3cb2a4219+ other rev@97c705ade336 ancestor rev@924404dff337
194 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
194 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
195 (branch merge, don't forget to commit)
195 (branch merge, don't forget to commit)
196 --------------
196 --------------
197 = b
197 C b
198 --------------
198 --------------
199
199
200 --------------
200 --------------
201 test L:um a b R:um a b W: - 9 do merge with ancestor in a
201 test L:um a b R:um a b W: - 9 do merge with ancestor in a
202 --------------
202 --------------
203 resolving manifests
203 resolving manifests
204 overwrite None partial False
204 overwrite None partial False
205 ancestor 924404dff337 local ec03c2ca8642+ remote 79cc6877a3b7
205 ancestor 924404dff337 local ec03c2ca8642+ remote 79cc6877a3b7
206 searching for copies back to rev 1
206 searching for copies back to rev 1
207 b: versions differ -> m
207 b: versions differ -> m
208 rev: versions differ -> m
208 rev: versions differ -> m
209 merging b
209 merging b
210 my b@ec03c2ca8642+ other b@79cc6877a3b7 ancestor a@924404dff337
210 my b@ec03c2ca8642+ other b@79cc6877a3b7 ancestor a@924404dff337
211 merging rev
211 merging rev
212 my rev@ec03c2ca8642+ other rev@79cc6877a3b7 ancestor rev@924404dff337
212 my rev@ec03c2ca8642+ other rev@79cc6877a3b7 ancestor rev@924404dff337
213 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
213 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
214 (branch merge, don't forget to commit)
214 (branch merge, don't forget to commit)
215 --------------
215 --------------
216 M b
216 M b
217 --------------
217 --------------
218
218
219 --------------
219 --------------
220 test L:nm a b R:nm a c W: - 11 get c, keep b
220 test L:nm a b R:nm a c W: - 11 get c, keep b
221 --------------
221 --------------
222 resolving manifests
222 resolving manifests
223 overwrite None partial False
223 overwrite None partial False
224 ancestor 924404dff337 local ecf3cb2a4219+ remote e6abcc1a30c2
224 ancestor 924404dff337 local ecf3cb2a4219+ remote e6abcc1a30c2
225 searching for copies back to rev 1
225 searching for copies back to rev 1
226 unmatched files in local:
226 unmatched files in local:
227 b
227 b
228 unmatched files in other:
228 unmatched files in other:
229 c
229 c
230 all copies found (* = to merge, ! = divergent):
230 all copies found (* = to merge, ! = divergent):
231 c -> a
231 c -> a
232 b -> a
232 b -> a
233 checking for directory renames
233 checking for directory renames
234 a: divergent renames -> dr
234 a: divergent renames -> dr
235 rev: versions differ -> m
235 rev: versions differ -> m
236 c: remote created -> g
236 c: remote created -> g
237 warning: detected divergent renames of a to:
237 warning: detected divergent renames of a to:
238 b
238 b
239 c
239 c
240 getting c
240 getting c
241 merging rev
241 merging rev
242 my rev@ecf3cb2a4219+ other rev@e6abcc1a30c2 ancestor rev@924404dff337
242 my rev@ecf3cb2a4219+ other rev@e6abcc1a30c2 ancestor rev@924404dff337
243 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
243 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
244 (branch merge, don't forget to commit)
244 (branch merge, don't forget to commit)
245 --------------
245 --------------
246 M c
246 M c
247 = b
247 C b
248 --------------
248 --------------
249
249
250 --------------
250 --------------
251 test L:nc a b R:up b W: - 12 merge b no ancestor
251 test L:nc a b R:up b W: - 12 merge b no ancestor
252 --------------
252 --------------
253 resolving manifests
253 resolving manifests
254 overwrite None partial False
254 overwrite None partial False
255 ancestor 924404dff337 local ac809aeed39a+ remote af30c7647fc7
255 ancestor 924404dff337 local ac809aeed39a+ remote af30c7647fc7
256 searching for copies back to rev 1
256 searching for copies back to rev 1
257 b: versions differ -> m
257 b: versions differ -> m
258 rev: versions differ -> m
258 rev: versions differ -> m
259 merging b
259 merging b
260 my b@ac809aeed39a+ other b@af30c7647fc7 ancestor b@000000000000
260 my b@ac809aeed39a+ other b@af30c7647fc7 ancestor b@000000000000
261 merging rev
261 merging rev
262 my rev@ac809aeed39a+ other rev@af30c7647fc7 ancestor rev@924404dff337
262 my rev@ac809aeed39a+ other rev@af30c7647fc7 ancestor rev@924404dff337
263 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
263 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
264 (branch merge, don't forget to commit)
264 (branch merge, don't forget to commit)
265 --------------
265 --------------
266 M b
266 M b
267 = a
267 C a
268 --------------
268 --------------
269
269
270 --------------
270 --------------
271 test L:up b R:nm a b W: - 13 merge b no ancestor
271 test L:up b R:nm a b W: - 13 merge b no ancestor
272 --------------
272 --------------
273 resolving manifests
273 resolving manifests
274 overwrite None partial False
274 overwrite None partial False
275 ancestor 924404dff337 local 59318016310c+ remote e03727d2d66b
275 ancestor 924404dff337 local 59318016310c+ remote e03727d2d66b
276 searching for copies back to rev 1
276 searching for copies back to rev 1
277 a: other deleted -> r
277 a: other deleted -> r
278 b: versions differ -> m
278 b: versions differ -> m
279 rev: versions differ -> m
279 rev: versions differ -> m
280 removing a
280 removing a
281 merging b
281 merging b
282 my b@59318016310c+ other b@e03727d2d66b ancestor b@000000000000
282 my b@59318016310c+ other b@e03727d2d66b ancestor b@000000000000
283 merging rev
283 merging rev
284 my rev@59318016310c+ other rev@e03727d2d66b ancestor rev@924404dff337
284 my rev@59318016310c+ other rev@e03727d2d66b ancestor rev@924404dff337
285 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
285 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
286 (branch merge, don't forget to commit)
286 (branch merge, don't forget to commit)
287 --------------
287 --------------
288 M b
288 M b
289 --------------
289 --------------
290
290
291 --------------
291 --------------
292 test L:nc a b R:up a b W: - 14 merge b no ancestor
292 test L:nc a b R:up a b W: - 14 merge b no ancestor
293 --------------
293 --------------
294 resolving manifests
294 resolving manifests
295 overwrite None partial False
295 overwrite None partial False
296 ancestor 924404dff337 local ac809aeed39a+ remote 8dbce441892a
296 ancestor 924404dff337 local ac809aeed39a+ remote 8dbce441892a
297 searching for copies back to rev 1
297 searching for copies back to rev 1
298 a: remote is newer -> g
298 a: remote is newer -> g
299 b: versions differ -> m
299 b: versions differ -> m
300 rev: versions differ -> m
300 rev: versions differ -> m
301 getting a
301 getting a
302 merging b
302 merging b
303 my b@ac809aeed39a+ other b@8dbce441892a ancestor b@000000000000
303 my b@ac809aeed39a+ other b@8dbce441892a ancestor b@000000000000
304 merging rev
304 merging rev
305 my rev@ac809aeed39a+ other rev@8dbce441892a ancestor rev@924404dff337
305 my rev@ac809aeed39a+ other rev@8dbce441892a ancestor rev@924404dff337
306 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
306 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
307 (branch merge, don't forget to commit)
307 (branch merge, don't forget to commit)
308 --------------
308 --------------
309 M a
309 M a
310 M b
310 M b
311 --------------
311 --------------
312
312
313 --------------
313 --------------
314 test L:up b R:nm a b W: - 15 merge b no ancestor, remove a
314 test L:up b R:nm a b W: - 15 merge b no ancestor, remove a
315 --------------
315 --------------
316 resolving manifests
316 resolving manifests
317 overwrite None partial False
317 overwrite None partial False
318 ancestor 924404dff337 local 59318016310c+ remote e03727d2d66b
318 ancestor 924404dff337 local 59318016310c+ remote e03727d2d66b
319 searching for copies back to rev 1
319 searching for copies back to rev 1
320 a: other deleted -> r
320 a: other deleted -> r
321 b: versions differ -> m
321 b: versions differ -> m
322 rev: versions differ -> m
322 rev: versions differ -> m
323 removing a
323 removing a
324 merging b
324 merging b
325 my b@59318016310c+ other b@e03727d2d66b ancestor b@000000000000
325 my b@59318016310c+ other b@e03727d2d66b ancestor b@000000000000
326 merging rev
326 merging rev
327 my rev@59318016310c+ other rev@e03727d2d66b ancestor rev@924404dff337
327 my rev@59318016310c+ other rev@e03727d2d66b ancestor rev@924404dff337
328 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
328 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
329 (branch merge, don't forget to commit)
329 (branch merge, don't forget to commit)
330 --------------
330 --------------
331 M b
331 M b
332 --------------
332 --------------
333
333
334 --------------
334 --------------
335 test L:nc a b R:up a b W: - 16 get a, merge b no ancestor
335 test L:nc a b R:up a b W: - 16 get a, merge b no ancestor
336 --------------
336 --------------
337 resolving manifests
337 resolving manifests
338 overwrite None partial False
338 overwrite None partial False
339 ancestor 924404dff337 local ac809aeed39a+ remote 8dbce441892a
339 ancestor 924404dff337 local ac809aeed39a+ remote 8dbce441892a
340 searching for copies back to rev 1
340 searching for copies back to rev 1
341 a: remote is newer -> g
341 a: remote is newer -> g
342 b: versions differ -> m
342 b: versions differ -> m
343 rev: versions differ -> m
343 rev: versions differ -> m
344 getting a
344 getting a
345 merging b
345 merging b
346 my b@ac809aeed39a+ other b@8dbce441892a ancestor b@000000000000
346 my b@ac809aeed39a+ other b@8dbce441892a ancestor b@000000000000
347 merging rev
347 merging rev
348 my rev@ac809aeed39a+ other rev@8dbce441892a ancestor rev@924404dff337
348 my rev@ac809aeed39a+ other rev@8dbce441892a ancestor rev@924404dff337
349 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
349 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
350 (branch merge, don't forget to commit)
350 (branch merge, don't forget to commit)
351 --------------
351 --------------
352 M a
352 M a
353 M b
353 M b
354 --------------
354 --------------
355
355
356 --------------
356 --------------
357 test L:up a b R:nc a b W: - 17 keep a, merge b no ancestor
357 test L:up a b R:nc a b W: - 17 keep a, merge b no ancestor
358 --------------
358 --------------
359 resolving manifests
359 resolving manifests
360 overwrite None partial False
360 overwrite None partial False
361 ancestor 924404dff337 local 0b76e65c8289+ remote 735846fee2d7
361 ancestor 924404dff337 local 0b76e65c8289+ remote 735846fee2d7
362 searching for copies back to rev 1
362 searching for copies back to rev 1
363 b: versions differ -> m
363 b: versions differ -> m
364 rev: versions differ -> m
364 rev: versions differ -> m
365 merging b
365 merging b
366 my b@0b76e65c8289+ other b@735846fee2d7 ancestor b@000000000000
366 my b@0b76e65c8289+ other b@735846fee2d7 ancestor b@000000000000
367 merging rev
367 merging rev
368 my rev@0b76e65c8289+ other rev@735846fee2d7 ancestor rev@924404dff337
368 my rev@0b76e65c8289+ other rev@735846fee2d7 ancestor rev@924404dff337
369 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
369 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
370 (branch merge, don't forget to commit)
370 (branch merge, don't forget to commit)
371 --------------
371 --------------
372 M b
372 M b
373 = a
373 C a
374 --------------
374 --------------
375
375
376 --------------
376 --------------
377 test L:nm a b R:up a b W: - 18 merge b no ancestor
377 test L:nm a b R:up a b W: - 18 merge b no ancestor
378 --------------
378 --------------
379 resolving manifests
379 resolving manifests
380 overwrite None partial False
380 overwrite None partial False
381 ancestor 924404dff337 local ecf3cb2a4219+ remote 8dbce441892a
381 ancestor 924404dff337 local ecf3cb2a4219+ remote 8dbce441892a
382 searching for copies back to rev 1
382 searching for copies back to rev 1
383 b: versions differ -> m
383 b: versions differ -> m
384 rev: versions differ -> m
384 rev: versions differ -> m
385 a: prompt recreating -> g
385 a: prompt recreating -> g
386 getting a
386 getting a
387 merging b
387 merging b
388 my b@ecf3cb2a4219+ other b@8dbce441892a ancestor b@000000000000
388 my b@ecf3cb2a4219+ other b@8dbce441892a ancestor b@000000000000
389 merging rev
389 merging rev
390 my rev@ecf3cb2a4219+ other rev@8dbce441892a ancestor rev@924404dff337
390 my rev@ecf3cb2a4219+ other rev@8dbce441892a ancestor rev@924404dff337
391 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
391 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
392 (branch merge, don't forget to commit)
392 (branch merge, don't forget to commit)
393 --------------
393 --------------
394 M a
394 M a
395 M b
395 M b
396 --------------
396 --------------
397
397
398 --------------
398 --------------
399 test L:up a b R:nm a b W: - 19 merge b no ancestor, prompt remove a
399 test L:up a b R:nm a b W: - 19 merge b no ancestor, prompt remove a
400 --------------
400 --------------
401 resolving manifests
401 resolving manifests
402 overwrite None partial False
402 overwrite None partial False
403 ancestor 924404dff337 local 0b76e65c8289+ remote e03727d2d66b
403 ancestor 924404dff337 local 0b76e65c8289+ remote e03727d2d66b
404 searching for copies back to rev 1
404 searching for copies back to rev 1
405 b: versions differ -> m
405 b: versions differ -> m
406 rev: versions differ -> m
406 rev: versions differ -> m
407 merging b
407 merging b
408 my b@0b76e65c8289+ other b@e03727d2d66b ancestor b@000000000000
408 my b@0b76e65c8289+ other b@e03727d2d66b ancestor b@000000000000
409 merging rev
409 merging rev
410 my rev@0b76e65c8289+ other rev@e03727d2d66b ancestor rev@924404dff337
410 my rev@0b76e65c8289+ other rev@e03727d2d66b ancestor rev@924404dff337
411 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
411 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
412 (branch merge, don't forget to commit)
412 (branch merge, don't forget to commit)
413 --------------
413 --------------
414 M b
414 M b
415 = a
415 C a
416 --------------
416 --------------
417
417
418 --------------
418 --------------
419 test L:up a R:um a b W: - 20 merge a and b to b, remove a
419 test L:up a R:um a b W: - 20 merge a and b to b, remove a
420 --------------
420 --------------
421 resolving manifests
421 resolving manifests
422 overwrite None partial False
422 overwrite None partial False
423 ancestor 924404dff337 local e300d1c794ec+ remote 79cc6877a3b7
423 ancestor 924404dff337 local e300d1c794ec+ remote 79cc6877a3b7
424 searching for copies back to rev 1
424 searching for copies back to rev 1
425 unmatched files in other:
425 unmatched files in other:
426 b
426 b
427 all copies found (* = to merge, ! = divergent):
427 all copies found (* = to merge, ! = divergent):
428 b -> a *
428 b -> a *
429 checking for directory renames
429 checking for directory renames
430 rev: versions differ -> m
430 rev: versions differ -> m
431 a: remote moved to b -> m
431 a: remote moved to b -> m
432 copying a to b
432 copying a to b
433 merging a and b
433 merging a and b
434 my a@e300d1c794ec+ other b@79cc6877a3b7 ancestor a@924404dff337
434 my a@e300d1c794ec+ other b@79cc6877a3b7 ancestor a@924404dff337
435 removing a
435 removing a
436 merging rev
436 merging rev
437 my rev@e300d1c794ec+ other rev@79cc6877a3b7 ancestor rev@924404dff337
437 my rev@e300d1c794ec+ other rev@79cc6877a3b7 ancestor rev@924404dff337
438 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
438 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
439 (branch merge, don't forget to commit)
439 (branch merge, don't forget to commit)
440 --------------
440 --------------
441 M b
441 M b
442 a
442 a
443 --------------
443 --------------
444
444
445 --------------
445 --------------
446 test L:um a b R:up a W: - 21 merge a and b to b
446 test L:um a b R:up a W: - 21 merge a and b to b
447 --------------
447 --------------
448 resolving manifests
448 resolving manifests
449 overwrite None partial False
449 overwrite None partial False
450 ancestor 924404dff337 local ec03c2ca8642+ remote f4db7e329e71
450 ancestor 924404dff337 local ec03c2ca8642+ remote f4db7e329e71
451 searching for copies back to rev 1
451 searching for copies back to rev 1
452 unmatched files in local:
452 unmatched files in local:
453 b
453 b
454 all copies found (* = to merge, ! = divergent):
454 all copies found (* = to merge, ! = divergent):
455 b -> a *
455 b -> a *
456 checking for directory renames
456 checking for directory renames
457 b: local moved to a -> m
457 b: local moved to a -> m
458 rev: versions differ -> m
458 rev: versions differ -> m
459 merging b and a
459 merging b and a
460 my b@ec03c2ca8642+ other a@f4db7e329e71 ancestor a@924404dff337
460 my b@ec03c2ca8642+ other a@f4db7e329e71 ancestor a@924404dff337
461 merging rev
461 merging rev
462 my rev@ec03c2ca8642+ other rev@f4db7e329e71 ancestor rev@924404dff337
462 my rev@ec03c2ca8642+ other rev@f4db7e329e71 ancestor rev@924404dff337
463 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
463 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
464 (branch merge, don't forget to commit)
464 (branch merge, don't forget to commit)
465 --------------
465 --------------
466 M b
466 M b
467 a
467 a
468 --------------
468 --------------
469
469
470 --------------
470 --------------
471 test L:nm a b R:up a c W: - 23 get c, keep b
471 test L:nm a b R:up a c W: - 23 get c, keep b
472 --------------
472 --------------
473 resolving manifests
473 resolving manifests
474 overwrite None partial False
474 overwrite None partial False
475 ancestor 924404dff337 local ecf3cb2a4219+ remote 2b958612230f
475 ancestor 924404dff337 local ecf3cb2a4219+ remote 2b958612230f
476 searching for copies back to rev 1
476 searching for copies back to rev 1
477 unmatched files in local:
477 unmatched files in local:
478 b
478 b
479 unmatched files in other:
479 unmatched files in other:
480 c
480 c
481 all copies found (* = to merge, ! = divergent):
481 all copies found (* = to merge, ! = divergent):
482 b -> a *
482 b -> a *
483 checking for directory renames
483 checking for directory renames
484 b: local moved to a -> m
484 b: local moved to a -> m
485 rev: versions differ -> m
485 rev: versions differ -> m
486 c: remote created -> g
486 c: remote created -> g
487 merging b and a
487 merging b and a
488 my b@ecf3cb2a4219+ other a@2b958612230f ancestor a@924404dff337
488 my b@ecf3cb2a4219+ other a@2b958612230f ancestor a@924404dff337
489 getting c
489 getting c
490 merging rev
490 merging rev
491 my rev@ecf3cb2a4219+ other rev@2b958612230f ancestor rev@924404dff337
491 my rev@ecf3cb2a4219+ other rev@2b958612230f ancestor rev@924404dff337
492 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
492 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
493 (branch merge, don't forget to commit)
493 (branch merge, don't forget to commit)
494 --------------
494 --------------
495 M b
495 M b
496 a
496 a
497 M c
497 M c
498 --------------
498 --------------
499
499
@@ -1,120 +1,120 b''
1 hg status in repo root:
1 hg status in repo root:
2 ? a/1/in_a_1
2 ? a/1/in_a_1
3 ? a/in_a
3 ? a/in_a
4 ? b/1/in_b_1
4 ? b/1/in_b_1
5 ? b/2/in_b_2
5 ? b/2/in_b_2
6 ? b/in_b
6 ? b/in_b
7 ? in_root
7 ? in_root
8 hg status . in repo root:
8 hg status . in repo root:
9 ? a/1/in_a_1
9 ? a/1/in_a_1
10 ? a/in_a
10 ? a/in_a
11 ? b/1/in_b_1
11 ? b/1/in_b_1
12 ? b/2/in_b_2
12 ? b/2/in_b_2
13 ? b/in_b
13 ? b/in_b
14 ? in_root
14 ? in_root
15 hg status in a:
15 hg status in a:
16 ? a/1/in_a_1
16 ? a/1/in_a_1
17 ? a/in_a
17 ? a/in_a
18 ? b/1/in_b_1
18 ? b/1/in_b_1
19 ? b/2/in_b_2
19 ? b/2/in_b_2
20 ? b/in_b
20 ? b/in_b
21 ? in_root
21 ? in_root
22 hg status . in a:
22 hg status . in a:
23 ? 1/in_a_1
23 ? 1/in_a_1
24 ? in_a
24 ? in_a
25 hg status .. in a:
25 hg status .. in a:
26 ? 1/in_a_1
26 ? 1/in_a_1
27 ? in_a
27 ? in_a
28 ? ../b/1/in_b_1
28 ? ../b/1/in_b_1
29 ? ../b/2/in_b_2
29 ? ../b/2/in_b_2
30 ? ../b/in_b
30 ? ../b/in_b
31 ? ../in_root
31 ? ../in_root
32 hg status in b:
32 hg status in b:
33 ? a/1/in_a_1
33 ? a/1/in_a_1
34 ? a/in_a
34 ? a/in_a
35 ? b/1/in_b_1
35 ? b/1/in_b_1
36 ? b/2/in_b_2
36 ? b/2/in_b_2
37 ? b/in_b
37 ? b/in_b
38 ? in_root
38 ? in_root
39 hg status . in b:
39 hg status . in b:
40 ? 1/in_b_1
40 ? 1/in_b_1
41 ? 2/in_b_2
41 ? 2/in_b_2
42 ? in_b
42 ? in_b
43 hg status .. in b:
43 hg status .. in b:
44 ? ../a/1/in_a_1
44 ? ../a/1/in_a_1
45 ? ../a/in_a
45 ? ../a/in_a
46 ? 1/in_b_1
46 ? 1/in_b_1
47 ? 2/in_b_2
47 ? 2/in_b_2
48 ? in_b
48 ? in_b
49 ? ../in_root
49 ? ../in_root
50 hg status in a/1:
50 hg status in a/1:
51 ? a/1/in_a_1
51 ? a/1/in_a_1
52 ? a/in_a
52 ? a/in_a
53 ? b/1/in_b_1
53 ? b/1/in_b_1
54 ? b/2/in_b_2
54 ? b/2/in_b_2
55 ? b/in_b
55 ? b/in_b
56 ? in_root
56 ? in_root
57 hg status . in a/1:
57 hg status . in a/1:
58 ? in_a_1
58 ? in_a_1
59 hg status .. in a/1:
59 hg status .. in a/1:
60 ? in_a_1
60 ? in_a_1
61 ? ../in_a
61 ? ../in_a
62 hg status in b/1:
62 hg status in b/1:
63 ? a/1/in_a_1
63 ? a/1/in_a_1
64 ? a/in_a
64 ? a/in_a
65 ? b/1/in_b_1
65 ? b/1/in_b_1
66 ? b/2/in_b_2
66 ? b/2/in_b_2
67 ? b/in_b
67 ? b/in_b
68 ? in_root
68 ? in_root
69 hg status . in b/1:
69 hg status . in b/1:
70 ? in_b_1
70 ? in_b_1
71 hg status .. in b/1:
71 hg status .. in b/1:
72 ? in_b_1
72 ? in_b_1
73 ? ../2/in_b_2
73 ? ../2/in_b_2
74 ? ../in_b
74 ? ../in_b
75 hg status in b/2:
75 hg status in b/2:
76 ? a/1/in_a_1
76 ? a/1/in_a_1
77 ? a/in_a
77 ? a/in_a
78 ? b/1/in_b_1
78 ? b/1/in_b_1
79 ? b/2/in_b_2
79 ? b/2/in_b_2
80 ? b/in_b
80 ? b/in_b
81 ? in_root
81 ? in_root
82 hg status . in b/2:
82 hg status . in b/2:
83 ? in_b_2
83 ? in_b_2
84 hg status .. in b/2:
84 hg status .. in b/2:
85 ? ../1/in_b_1
85 ? ../1/in_b_1
86 ? in_b_2
86 ? in_b_2
87 ? ../in_b
87 ? ../in_b
88 adding .hgignore
88 adding .hgignore
89 adding deleted
89 adding deleted
90 adding modified
90 adding modified
91 adding removed
91 adding removed
92 hg status:
92 hg status:
93 A added
93 A added
94 R removed
94 R removed
95 ! deleted
95 ! deleted
96 ? unknown
96 ? unknown
97 hg status modified added removed deleted unknown never-existed ignored:
97 hg status modified added removed deleted unknown never-existed ignored:
98 never-existed: No such file or directory
98 never-existed: No such file or directory
99 A added
99 A added
100 R removed
100 R removed
101 ! deleted
101 ! deleted
102 ? ignored
102 ? ignored
103 ? unknown
103 ? unknown
104 hg status -C:
104 hg status -C:
105 A added
105 A added
106 A copied
106 A copied
107 modified
107 modified
108 R removed
108 R removed
109 ! deleted
109 ! deleted
110 ? unknown
110 ? unknown
111 hg status -A:
111 hg status -A:
112 A added
112 A added
113 A copied
113 A copied
114 modified
114 modified
115 R removed
115 R removed
116 ! deleted
116 ! deleted
117 ? unknown
117 ? unknown
118 I ignored
118 I ignored
119 = .hgignore
119 C .hgignore
120 = modified
120 C modified
General Comments 0
You need to be logged in to leave comments. Login now