##// END OF EJS Templates
filemerge: add internal merge tool to dump files forcibly...
FUJIWARA Katsunori -
r32255:7e35d31b default
parent child Browse files
Show More
@@ -1,724 +1,737 b''
1 # filemerge.py - file-level merge handling for Mercurial
1 # filemerge.py - file-level merge handling for Mercurial
2 #
2 #
3 # Copyright 2006, 2007, 2008 Matt Mackall <mpm@selenic.com>
3 # Copyright 2006, 2007, 2008 Matt Mackall <mpm@selenic.com>
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 from __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 import filecmp
10 import filecmp
11 import os
11 import os
12 import re
12 import re
13 import tempfile
13 import tempfile
14
14
15 from .i18n import _
15 from .i18n import _
16 from .node import nullid, short
16 from .node import nullid, short
17
17
18 from . import (
18 from . import (
19 encoding,
19 encoding,
20 error,
20 error,
21 formatter,
21 formatter,
22 match,
22 match,
23 pycompat,
23 pycompat,
24 scmutil,
24 scmutil,
25 simplemerge,
25 simplemerge,
26 tagmerge,
26 tagmerge,
27 templatekw,
27 templatekw,
28 templater,
28 templater,
29 util,
29 util,
30 )
30 )
31
31
32 def _toolstr(ui, tool, part, default=""):
32 def _toolstr(ui, tool, part, default=""):
33 return ui.config("merge-tools", tool + "." + part, default)
33 return ui.config("merge-tools", tool + "." + part, default)
34
34
35 def _toolbool(ui, tool, part, default=False):
35 def _toolbool(ui, tool, part, default=False):
36 return ui.configbool("merge-tools", tool + "." + part, default)
36 return ui.configbool("merge-tools", tool + "." + part, default)
37
37
38 def _toollist(ui, tool, part, default=None):
38 def _toollist(ui, tool, part, default=None):
39 if default is None:
39 if default is None:
40 default = []
40 default = []
41 return ui.configlist("merge-tools", tool + "." + part, default)
41 return ui.configlist("merge-tools", tool + "." + part, default)
42
42
43 internals = {}
43 internals = {}
44 # Merge tools to document.
44 # Merge tools to document.
45 internalsdoc = {}
45 internalsdoc = {}
46
46
47 # internal tool merge types
47 # internal tool merge types
48 nomerge = None
48 nomerge = None
49 mergeonly = 'mergeonly' # just the full merge, no premerge
49 mergeonly = 'mergeonly' # just the full merge, no premerge
50 fullmerge = 'fullmerge' # both premerge and merge
50 fullmerge = 'fullmerge' # both premerge and merge
51
51
52 class absentfilectx(object):
52 class absentfilectx(object):
53 """Represents a file that's ostensibly in a context but is actually not
53 """Represents a file that's ostensibly in a context but is actually not
54 present in it.
54 present in it.
55
55
56 This is here because it's very specific to the filemerge code for now --
56 This is here because it's very specific to the filemerge code for now --
57 other code is likely going to break with the values this returns."""
57 other code is likely going to break with the values this returns."""
58 def __init__(self, ctx, f):
58 def __init__(self, ctx, f):
59 self._ctx = ctx
59 self._ctx = ctx
60 self._f = f
60 self._f = f
61
61
62 def path(self):
62 def path(self):
63 return self._f
63 return self._f
64
64
65 def size(self):
65 def size(self):
66 return None
66 return None
67
67
68 def data(self):
68 def data(self):
69 return None
69 return None
70
70
71 def filenode(self):
71 def filenode(self):
72 return nullid
72 return nullid
73
73
74 _customcmp = True
74 _customcmp = True
75 def cmp(self, fctx):
75 def cmp(self, fctx):
76 """compare with other file context
76 """compare with other file context
77
77
78 returns True if different from fctx.
78 returns True if different from fctx.
79 """
79 """
80 return not (fctx.isabsent() and
80 return not (fctx.isabsent() and
81 fctx.ctx() == self.ctx() and
81 fctx.ctx() == self.ctx() and
82 fctx.path() == self.path())
82 fctx.path() == self.path())
83
83
84 def flags(self):
84 def flags(self):
85 return ''
85 return ''
86
86
87 def changectx(self):
87 def changectx(self):
88 return self._ctx
88 return self._ctx
89
89
90 def isbinary(self):
90 def isbinary(self):
91 return False
91 return False
92
92
93 def isabsent(self):
93 def isabsent(self):
94 return True
94 return True
95
95
96 def internaltool(name, mergetype, onfailure=None, precheck=None):
96 def internaltool(name, mergetype, onfailure=None, precheck=None):
97 '''return a decorator for populating internal merge tool table'''
97 '''return a decorator for populating internal merge tool table'''
98 def decorator(func):
98 def decorator(func):
99 fullname = ':' + name
99 fullname = ':' + name
100 func.__doc__ = (pycompat.sysstr("``%s``\n" % fullname)
100 func.__doc__ = (pycompat.sysstr("``%s``\n" % fullname)
101 + func.__doc__.strip())
101 + func.__doc__.strip())
102 internals[fullname] = func
102 internals[fullname] = func
103 internals['internal:' + name] = func
103 internals['internal:' + name] = func
104 internalsdoc[fullname] = func
104 internalsdoc[fullname] = func
105 func.mergetype = mergetype
105 func.mergetype = mergetype
106 func.onfailure = onfailure
106 func.onfailure = onfailure
107 func.precheck = precheck
107 func.precheck = precheck
108 return func
108 return func
109 return decorator
109 return decorator
110
110
111 def _findtool(ui, tool):
111 def _findtool(ui, tool):
112 if tool in internals:
112 if tool in internals:
113 return tool
113 return tool
114 return findexternaltool(ui, tool)
114 return findexternaltool(ui, tool)
115
115
116 def findexternaltool(ui, tool):
116 def findexternaltool(ui, tool):
117 for kn in ("regkey", "regkeyalt"):
117 for kn in ("regkey", "regkeyalt"):
118 k = _toolstr(ui, tool, kn)
118 k = _toolstr(ui, tool, kn)
119 if not k:
119 if not k:
120 continue
120 continue
121 p = util.lookupreg(k, _toolstr(ui, tool, "regname"))
121 p = util.lookupreg(k, _toolstr(ui, tool, "regname"))
122 if p:
122 if p:
123 p = util.findexe(p + _toolstr(ui, tool, "regappend"))
123 p = util.findexe(p + _toolstr(ui, tool, "regappend"))
124 if p:
124 if p:
125 return p
125 return p
126 exe = _toolstr(ui, tool, "executable", tool)
126 exe = _toolstr(ui, tool, "executable", tool)
127 return util.findexe(util.expandpath(exe))
127 return util.findexe(util.expandpath(exe))
128
128
129 def _picktool(repo, ui, path, binary, symlink, changedelete):
129 def _picktool(repo, ui, path, binary, symlink, changedelete):
130 def supportscd(tool):
130 def supportscd(tool):
131 return tool in internals and internals[tool].mergetype == nomerge
131 return tool in internals and internals[tool].mergetype == nomerge
132
132
133 def check(tool, pat, symlink, binary, changedelete):
133 def check(tool, pat, symlink, binary, changedelete):
134 tmsg = tool
134 tmsg = tool
135 if pat:
135 if pat:
136 tmsg = _("%s (for pattern %s)") % (tool, pat)
136 tmsg = _("%s (for pattern %s)") % (tool, pat)
137 if not _findtool(ui, tool):
137 if not _findtool(ui, tool):
138 if pat: # explicitly requested tool deserves a warning
138 if pat: # explicitly requested tool deserves a warning
139 ui.warn(_("couldn't find merge tool %s\n") % tmsg)
139 ui.warn(_("couldn't find merge tool %s\n") % tmsg)
140 else: # configured but non-existing tools are more silent
140 else: # configured but non-existing tools are more silent
141 ui.note(_("couldn't find merge tool %s\n") % tmsg)
141 ui.note(_("couldn't find merge tool %s\n") % tmsg)
142 elif symlink and not _toolbool(ui, tool, "symlink"):
142 elif symlink and not _toolbool(ui, tool, "symlink"):
143 ui.warn(_("tool %s can't handle symlinks\n") % tmsg)
143 ui.warn(_("tool %s can't handle symlinks\n") % tmsg)
144 elif binary and not _toolbool(ui, tool, "binary"):
144 elif binary and not _toolbool(ui, tool, "binary"):
145 ui.warn(_("tool %s can't handle binary\n") % tmsg)
145 ui.warn(_("tool %s can't handle binary\n") % tmsg)
146 elif changedelete and not supportscd(tool):
146 elif changedelete and not supportscd(tool):
147 # the nomerge tools are the only tools that support change/delete
147 # the nomerge tools are the only tools that support change/delete
148 # conflicts
148 # conflicts
149 pass
149 pass
150 elif not util.gui() and _toolbool(ui, tool, "gui"):
150 elif not util.gui() and _toolbool(ui, tool, "gui"):
151 ui.warn(_("tool %s requires a GUI\n") % tmsg)
151 ui.warn(_("tool %s requires a GUI\n") % tmsg)
152 else:
152 else:
153 return True
153 return True
154 return False
154 return False
155
155
156 # internal config: ui.forcemerge
156 # internal config: ui.forcemerge
157 # forcemerge comes from command line arguments, highest priority
157 # forcemerge comes from command line arguments, highest priority
158 force = ui.config('ui', 'forcemerge')
158 force = ui.config('ui', 'forcemerge')
159 if force:
159 if force:
160 toolpath = _findtool(ui, force)
160 toolpath = _findtool(ui, force)
161 if changedelete and not supportscd(toolpath):
161 if changedelete and not supportscd(toolpath):
162 return ":prompt", None
162 return ":prompt", None
163 else:
163 else:
164 if toolpath:
164 if toolpath:
165 return (force, util.shellquote(toolpath))
165 return (force, util.shellquote(toolpath))
166 else:
166 else:
167 # mimic HGMERGE if given tool not found
167 # mimic HGMERGE if given tool not found
168 return (force, force)
168 return (force, force)
169
169
170 # HGMERGE takes next precedence
170 # HGMERGE takes next precedence
171 hgmerge = encoding.environ.get("HGMERGE")
171 hgmerge = encoding.environ.get("HGMERGE")
172 if hgmerge:
172 if hgmerge:
173 if changedelete and not supportscd(hgmerge):
173 if changedelete and not supportscd(hgmerge):
174 return ":prompt", None
174 return ":prompt", None
175 else:
175 else:
176 return (hgmerge, hgmerge)
176 return (hgmerge, hgmerge)
177
177
178 # then patterns
178 # then patterns
179 for pat, tool in ui.configitems("merge-patterns"):
179 for pat, tool in ui.configitems("merge-patterns"):
180 mf = match.match(repo.root, '', [pat])
180 mf = match.match(repo.root, '', [pat])
181 if mf(path) and check(tool, pat, symlink, False, changedelete):
181 if mf(path) and check(tool, pat, symlink, False, changedelete):
182 toolpath = _findtool(ui, tool)
182 toolpath = _findtool(ui, tool)
183 return (tool, util.shellquote(toolpath))
183 return (tool, util.shellquote(toolpath))
184
184
185 # then merge tools
185 # then merge tools
186 tools = {}
186 tools = {}
187 disabled = set()
187 disabled = set()
188 for k, v in ui.configitems("merge-tools"):
188 for k, v in ui.configitems("merge-tools"):
189 t = k.split('.')[0]
189 t = k.split('.')[0]
190 if t not in tools:
190 if t not in tools:
191 tools[t] = int(_toolstr(ui, t, "priority", "0"))
191 tools[t] = int(_toolstr(ui, t, "priority", "0"))
192 if _toolbool(ui, t, "disabled", False):
192 if _toolbool(ui, t, "disabled", False):
193 disabled.add(t)
193 disabled.add(t)
194 names = tools.keys()
194 names = tools.keys()
195 tools = sorted([(-p, tool) for tool, p in tools.items()
195 tools = sorted([(-p, tool) for tool, p in tools.items()
196 if tool not in disabled])
196 if tool not in disabled])
197 uimerge = ui.config("ui", "merge")
197 uimerge = ui.config("ui", "merge")
198 if uimerge:
198 if uimerge:
199 # external tools defined in uimerge won't be able to handle
199 # external tools defined in uimerge won't be able to handle
200 # change/delete conflicts
200 # change/delete conflicts
201 if uimerge not in names and not changedelete:
201 if uimerge not in names and not changedelete:
202 return (uimerge, uimerge)
202 return (uimerge, uimerge)
203 tools.insert(0, (None, uimerge)) # highest priority
203 tools.insert(0, (None, uimerge)) # highest priority
204 tools.append((None, "hgmerge")) # the old default, if found
204 tools.append((None, "hgmerge")) # the old default, if found
205 for p, t in tools:
205 for p, t in tools:
206 if check(t, None, symlink, binary, changedelete):
206 if check(t, None, symlink, binary, changedelete):
207 toolpath = _findtool(ui, t)
207 toolpath = _findtool(ui, t)
208 return (t, util.shellquote(toolpath))
208 return (t, util.shellquote(toolpath))
209
209
210 # internal merge or prompt as last resort
210 # internal merge or prompt as last resort
211 if symlink or binary or changedelete:
211 if symlink or binary or changedelete:
212 if not changedelete and len(tools):
212 if not changedelete and len(tools):
213 # any tool is rejected by capability for symlink or binary
213 # any tool is rejected by capability for symlink or binary
214 ui.warn(_("no tool found to merge %s\n") % path)
214 ui.warn(_("no tool found to merge %s\n") % path)
215 return ":prompt", None
215 return ":prompt", None
216 return ":merge", None
216 return ":merge", None
217
217
218 def _eoltype(data):
218 def _eoltype(data):
219 "Guess the EOL type of a file"
219 "Guess the EOL type of a file"
220 if '\0' in data: # binary
220 if '\0' in data: # binary
221 return None
221 return None
222 if '\r\n' in data: # Windows
222 if '\r\n' in data: # Windows
223 return '\r\n'
223 return '\r\n'
224 if '\r' in data: # Old Mac
224 if '\r' in data: # Old Mac
225 return '\r'
225 return '\r'
226 if '\n' in data: # UNIX
226 if '\n' in data: # UNIX
227 return '\n'
227 return '\n'
228 return None # unknown
228 return None # unknown
229
229
230 def _matcheol(file, origfile):
230 def _matcheol(file, origfile):
231 "Convert EOL markers in a file to match origfile"
231 "Convert EOL markers in a file to match origfile"
232 tostyle = _eoltype(util.readfile(origfile))
232 tostyle = _eoltype(util.readfile(origfile))
233 if tostyle:
233 if tostyle:
234 data = util.readfile(file)
234 data = util.readfile(file)
235 style = _eoltype(data)
235 style = _eoltype(data)
236 if style:
236 if style:
237 newdata = data.replace(style, tostyle)
237 newdata = data.replace(style, tostyle)
238 if newdata != data:
238 if newdata != data:
239 util.writefile(file, newdata)
239 util.writefile(file, newdata)
240
240
241 @internaltool('prompt', nomerge)
241 @internaltool('prompt', nomerge)
242 def _iprompt(repo, mynode, orig, fcd, fco, fca, toolconf, labels=None):
242 def _iprompt(repo, mynode, orig, fcd, fco, fca, toolconf, labels=None):
243 """Asks the user which of the local `p1()` or the other `p2()` version to
243 """Asks the user which of the local `p1()` or the other `p2()` version to
244 keep as the merged version."""
244 keep as the merged version."""
245 ui = repo.ui
245 ui = repo.ui
246 fd = fcd.path()
246 fd = fcd.path()
247
247
248 prompts = partextras(labels)
248 prompts = partextras(labels)
249 prompts['fd'] = fd
249 prompts['fd'] = fd
250 try:
250 try:
251 if fco.isabsent():
251 if fco.isabsent():
252 index = ui.promptchoice(
252 index = ui.promptchoice(
253 _("local%(l)s changed %(fd)s which other%(o)s deleted\n"
253 _("local%(l)s changed %(fd)s which other%(o)s deleted\n"
254 "use (c)hanged version, (d)elete, or leave (u)nresolved?"
254 "use (c)hanged version, (d)elete, or leave (u)nresolved?"
255 "$$ &Changed $$ &Delete $$ &Unresolved") % prompts, 2)
255 "$$ &Changed $$ &Delete $$ &Unresolved") % prompts, 2)
256 choice = ['local', 'other', 'unresolved'][index]
256 choice = ['local', 'other', 'unresolved'][index]
257 elif fcd.isabsent():
257 elif fcd.isabsent():
258 index = ui.promptchoice(
258 index = ui.promptchoice(
259 _("other%(o)s changed %(fd)s which local%(l)s deleted\n"
259 _("other%(o)s changed %(fd)s which local%(l)s deleted\n"
260 "use (c)hanged version, leave (d)eleted, or "
260 "use (c)hanged version, leave (d)eleted, or "
261 "leave (u)nresolved?"
261 "leave (u)nresolved?"
262 "$$ &Changed $$ &Deleted $$ &Unresolved") % prompts, 2)
262 "$$ &Changed $$ &Deleted $$ &Unresolved") % prompts, 2)
263 choice = ['other', 'local', 'unresolved'][index]
263 choice = ['other', 'local', 'unresolved'][index]
264 else:
264 else:
265 index = ui.promptchoice(
265 index = ui.promptchoice(
266 _("keep (l)ocal%(l)s, take (o)ther%(o)s, or leave (u)nresolved"
266 _("keep (l)ocal%(l)s, take (o)ther%(o)s, or leave (u)nresolved"
267 " for %(fd)s?"
267 " for %(fd)s?"
268 "$$ &Local $$ &Other $$ &Unresolved") % prompts, 2)
268 "$$ &Local $$ &Other $$ &Unresolved") % prompts, 2)
269 choice = ['local', 'other', 'unresolved'][index]
269 choice = ['local', 'other', 'unresolved'][index]
270
270
271 if choice == 'other':
271 if choice == 'other':
272 return _iother(repo, mynode, orig, fcd, fco, fca, toolconf,
272 return _iother(repo, mynode, orig, fcd, fco, fca, toolconf,
273 labels)
273 labels)
274 elif choice == 'local':
274 elif choice == 'local':
275 return _ilocal(repo, mynode, orig, fcd, fco, fca, toolconf,
275 return _ilocal(repo, mynode, orig, fcd, fco, fca, toolconf,
276 labels)
276 labels)
277 elif choice == 'unresolved':
277 elif choice == 'unresolved':
278 return _ifail(repo, mynode, orig, fcd, fco, fca, toolconf,
278 return _ifail(repo, mynode, orig, fcd, fco, fca, toolconf,
279 labels)
279 labels)
280 except error.ResponseExpected:
280 except error.ResponseExpected:
281 ui.write("\n")
281 ui.write("\n")
282 return _ifail(repo, mynode, orig, fcd, fco, fca, toolconf,
282 return _ifail(repo, mynode, orig, fcd, fco, fca, toolconf,
283 labels)
283 labels)
284
284
285 @internaltool('local', nomerge)
285 @internaltool('local', nomerge)
286 def _ilocal(repo, mynode, orig, fcd, fco, fca, toolconf, labels=None):
286 def _ilocal(repo, mynode, orig, fcd, fco, fca, toolconf, labels=None):
287 """Uses the local `p1()` version of files as the merged version."""
287 """Uses the local `p1()` version of files as the merged version."""
288 return 0, fcd.isabsent()
288 return 0, fcd.isabsent()
289
289
290 @internaltool('other', nomerge)
290 @internaltool('other', nomerge)
291 def _iother(repo, mynode, orig, fcd, fco, fca, toolconf, labels=None):
291 def _iother(repo, mynode, orig, fcd, fco, fca, toolconf, labels=None):
292 """Uses the other `p2()` version of files as the merged version."""
292 """Uses the other `p2()` version of files as the merged version."""
293 if fco.isabsent():
293 if fco.isabsent():
294 # local changed, remote deleted -- 'deleted' picked
294 # local changed, remote deleted -- 'deleted' picked
295 repo.wvfs.unlinkpath(fcd.path())
295 repo.wvfs.unlinkpath(fcd.path())
296 deleted = True
296 deleted = True
297 else:
297 else:
298 repo.wwrite(fcd.path(), fco.data(), fco.flags())
298 repo.wwrite(fcd.path(), fco.data(), fco.flags())
299 deleted = False
299 deleted = False
300 return 0, deleted
300 return 0, deleted
301
301
302 @internaltool('fail', nomerge)
302 @internaltool('fail', nomerge)
303 def _ifail(repo, mynode, orig, fcd, fco, fca, toolconf, labels=None):
303 def _ifail(repo, mynode, orig, fcd, fco, fca, toolconf, labels=None):
304 """
304 """
305 Rather than attempting to merge files that were modified on both
305 Rather than attempting to merge files that were modified on both
306 branches, it marks them as unresolved. The resolve command must be
306 branches, it marks them as unresolved. The resolve command must be
307 used to resolve these conflicts."""
307 used to resolve these conflicts."""
308 # for change/delete conflicts write out the changed version, then fail
308 # for change/delete conflicts write out the changed version, then fail
309 if fcd.isabsent():
309 if fcd.isabsent():
310 repo.wwrite(fcd.path(), fco.data(), fco.flags())
310 repo.wwrite(fcd.path(), fco.data(), fco.flags())
311 return 1, False
311 return 1, False
312
312
313 def _premerge(repo, fcd, fco, fca, toolconf, files, labels=None):
313 def _premerge(repo, fcd, fco, fca, toolconf, files, labels=None):
314 tool, toolpath, binary, symlink = toolconf
314 tool, toolpath, binary, symlink = toolconf
315 if symlink or fcd.isabsent() or fco.isabsent():
315 if symlink or fcd.isabsent() or fco.isabsent():
316 return 1
316 return 1
317 a, b, c, back = files
317 a, b, c, back = files
318
318
319 ui = repo.ui
319 ui = repo.ui
320
320
321 validkeep = ['keep', 'keep-merge3']
321 validkeep = ['keep', 'keep-merge3']
322
322
323 # do we attempt to simplemerge first?
323 # do we attempt to simplemerge first?
324 try:
324 try:
325 premerge = _toolbool(ui, tool, "premerge", not binary)
325 premerge = _toolbool(ui, tool, "premerge", not binary)
326 except error.ConfigError:
326 except error.ConfigError:
327 premerge = _toolstr(ui, tool, "premerge").lower()
327 premerge = _toolstr(ui, tool, "premerge").lower()
328 if premerge not in validkeep:
328 if premerge not in validkeep:
329 _valid = ', '.join(["'" + v + "'" for v in validkeep])
329 _valid = ', '.join(["'" + v + "'" for v in validkeep])
330 raise error.ConfigError(_("%s.premerge not valid "
330 raise error.ConfigError(_("%s.premerge not valid "
331 "('%s' is neither boolean nor %s)") %
331 "('%s' is neither boolean nor %s)") %
332 (tool, premerge, _valid))
332 (tool, premerge, _valid))
333
333
334 if premerge:
334 if premerge:
335 if premerge == 'keep-merge3':
335 if premerge == 'keep-merge3':
336 if not labels:
336 if not labels:
337 labels = _defaultconflictlabels
337 labels = _defaultconflictlabels
338 if len(labels) < 3:
338 if len(labels) < 3:
339 labels.append('base')
339 labels.append('base')
340 r = simplemerge.simplemerge(ui, a, b, c, quiet=True, label=labels)
340 r = simplemerge.simplemerge(ui, a, b, c, quiet=True, label=labels)
341 if not r:
341 if not r:
342 ui.debug(" premerge successful\n")
342 ui.debug(" premerge successful\n")
343 return 0
343 return 0
344 if premerge not in validkeep:
344 if premerge not in validkeep:
345 util.copyfile(back, a) # restore from backup and try again
345 util.copyfile(back, a) # restore from backup and try again
346 return 1 # continue merging
346 return 1 # continue merging
347
347
348 def _mergecheck(repo, mynode, orig, fcd, fco, fca, toolconf):
348 def _mergecheck(repo, mynode, orig, fcd, fco, fca, toolconf):
349 tool, toolpath, binary, symlink = toolconf
349 tool, toolpath, binary, symlink = toolconf
350 if symlink:
350 if symlink:
351 repo.ui.warn(_('warning: internal %s cannot merge symlinks '
351 repo.ui.warn(_('warning: internal %s cannot merge symlinks '
352 'for %s\n') % (tool, fcd.path()))
352 'for %s\n') % (tool, fcd.path()))
353 return False
353 return False
354 if fcd.isabsent() or fco.isabsent():
354 if fcd.isabsent() or fco.isabsent():
355 repo.ui.warn(_('warning: internal %s cannot merge change/delete '
355 repo.ui.warn(_('warning: internal %s cannot merge change/delete '
356 'conflict for %s\n') % (tool, fcd.path()))
356 'conflict for %s\n') % (tool, fcd.path()))
357 return False
357 return False
358 return True
358 return True
359
359
360 def _merge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels, mode):
360 def _merge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels, mode):
361 """
361 """
362 Uses the internal non-interactive simple merge algorithm for merging
362 Uses the internal non-interactive simple merge algorithm for merging
363 files. It will fail if there are any conflicts and leave markers in
363 files. It will fail if there are any conflicts and leave markers in
364 the partially merged file. Markers will have two sections, one for each side
364 the partially merged file. Markers will have two sections, one for each side
365 of merge, unless mode equals 'union' which suppresses the markers."""
365 of merge, unless mode equals 'union' which suppresses the markers."""
366 a, b, c, back = files
366 a, b, c, back = files
367
367
368 ui = repo.ui
368 ui = repo.ui
369
369
370 r = simplemerge.simplemerge(ui, a, b, c, label=labels, mode=mode)
370 r = simplemerge.simplemerge(ui, a, b, c, label=labels, mode=mode)
371 return True, r, False
371 return True, r, False
372
372
373 @internaltool('union', fullmerge,
373 @internaltool('union', fullmerge,
374 _("warning: conflicts while merging %s! "
374 _("warning: conflicts while merging %s! "
375 "(edit, then use 'hg resolve --mark')\n"),
375 "(edit, then use 'hg resolve --mark')\n"),
376 precheck=_mergecheck)
376 precheck=_mergecheck)
377 def _iunion(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
377 def _iunion(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
378 """
378 """
379 Uses the internal non-interactive simple merge algorithm for merging
379 Uses the internal non-interactive simple merge algorithm for merging
380 files. It will use both left and right sides for conflict regions.
380 files. It will use both left and right sides for conflict regions.
381 No markers are inserted."""
381 No markers are inserted."""
382 return _merge(repo, mynode, orig, fcd, fco, fca, toolconf,
382 return _merge(repo, mynode, orig, fcd, fco, fca, toolconf,
383 files, labels, 'union')
383 files, labels, 'union')
384
384
385 @internaltool('merge', fullmerge,
385 @internaltool('merge', fullmerge,
386 _("warning: conflicts while merging %s! "
386 _("warning: conflicts while merging %s! "
387 "(edit, then use 'hg resolve --mark')\n"),
387 "(edit, then use 'hg resolve --mark')\n"),
388 precheck=_mergecheck)
388 precheck=_mergecheck)
389 def _imerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
389 def _imerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
390 """
390 """
391 Uses the internal non-interactive simple merge algorithm for merging
391 Uses the internal non-interactive simple merge algorithm for merging
392 files. It will fail if there are any conflicts and leave markers in
392 files. It will fail if there are any conflicts and leave markers in
393 the partially merged file. Markers will have two sections, one for each side
393 the partially merged file. Markers will have two sections, one for each side
394 of merge."""
394 of merge."""
395 return _merge(repo, mynode, orig, fcd, fco, fca, toolconf,
395 return _merge(repo, mynode, orig, fcd, fco, fca, toolconf,
396 files, labels, 'merge')
396 files, labels, 'merge')
397
397
398 @internaltool('merge3', fullmerge,
398 @internaltool('merge3', fullmerge,
399 _("warning: conflicts while merging %s! "
399 _("warning: conflicts while merging %s! "
400 "(edit, then use 'hg resolve --mark')\n"),
400 "(edit, then use 'hg resolve --mark')\n"),
401 precheck=_mergecheck)
401 precheck=_mergecheck)
402 def _imerge3(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
402 def _imerge3(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
403 """
403 """
404 Uses the internal non-interactive simple merge algorithm for merging
404 Uses the internal non-interactive simple merge algorithm for merging
405 files. It will fail if there are any conflicts and leave markers in
405 files. It will fail if there are any conflicts and leave markers in
406 the partially merged file. Marker will have three sections, one from each
406 the partially merged file. Marker will have three sections, one from each
407 side of the merge and one for the base content."""
407 side of the merge and one for the base content."""
408 if not labels:
408 if not labels:
409 labels = _defaultconflictlabels
409 labels = _defaultconflictlabels
410 if len(labels) < 3:
410 if len(labels) < 3:
411 labels.append('base')
411 labels.append('base')
412 return _imerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels)
412 return _imerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels)
413
413
414 def _imergeauto(repo, mynode, orig, fcd, fco, fca, toolconf, files,
414 def _imergeauto(repo, mynode, orig, fcd, fco, fca, toolconf, files,
415 labels=None, localorother=None):
415 labels=None, localorother=None):
416 """
416 """
417 Generic driver for _imergelocal and _imergeother
417 Generic driver for _imergelocal and _imergeother
418 """
418 """
419 assert localorother is not None
419 assert localorother is not None
420 tool, toolpath, binary, symlink = toolconf
420 tool, toolpath, binary, symlink = toolconf
421 a, b, c, back = files
421 a, b, c, back = files
422 r = simplemerge.simplemerge(repo.ui, a, b, c, label=labels,
422 r = simplemerge.simplemerge(repo.ui, a, b, c, label=labels,
423 localorother=localorother)
423 localorother=localorother)
424 return True, r
424 return True, r
425
425
426 @internaltool('merge-local', mergeonly, precheck=_mergecheck)
426 @internaltool('merge-local', mergeonly, precheck=_mergecheck)
427 def _imergelocal(*args, **kwargs):
427 def _imergelocal(*args, **kwargs):
428 """
428 """
429 Like :merge, but resolve all conflicts non-interactively in favor
429 Like :merge, but resolve all conflicts non-interactively in favor
430 of the local `p1()` changes."""
430 of the local `p1()` changes."""
431 success, status = _imergeauto(localorother='local', *args, **kwargs)
431 success, status = _imergeauto(localorother='local', *args, **kwargs)
432 return success, status, False
432 return success, status, False
433
433
434 @internaltool('merge-other', mergeonly, precheck=_mergecheck)
434 @internaltool('merge-other', mergeonly, precheck=_mergecheck)
435 def _imergeother(*args, **kwargs):
435 def _imergeother(*args, **kwargs):
436 """
436 """
437 Like :merge, but resolve all conflicts non-interactively in favor
437 Like :merge, but resolve all conflicts non-interactively in favor
438 of the other `p2()` changes."""
438 of the other `p2()` changes."""
439 success, status = _imergeauto(localorother='other', *args, **kwargs)
439 success, status = _imergeauto(localorother='other', *args, **kwargs)
440 return success, status, False
440 return success, status, False
441
441
442 @internaltool('tagmerge', mergeonly,
442 @internaltool('tagmerge', mergeonly,
443 _("automatic tag merging of %s failed! "
443 _("automatic tag merging of %s failed! "
444 "(use 'hg resolve --tool :merge' or another merge "
444 "(use 'hg resolve --tool :merge' or another merge "
445 "tool of your choice)\n"))
445 "tool of your choice)\n"))
446 def _itagmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
446 def _itagmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
447 """
447 """
448 Uses the internal tag merge algorithm (experimental).
448 Uses the internal tag merge algorithm (experimental).
449 """
449 """
450 success, status = tagmerge.merge(repo, fcd, fco, fca)
450 success, status = tagmerge.merge(repo, fcd, fco, fca)
451 return success, status, False
451 return success, status, False
452
452
453 @internaltool('dump', fullmerge)
453 @internaltool('dump', fullmerge)
454 def _idump(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
454 def _idump(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
455 """
455 """
456 Creates three versions of the files to merge, containing the
456 Creates three versions of the files to merge, containing the
457 contents of local, other and base. These files can then be used to
457 contents of local, other and base. These files can then be used to
458 perform a merge manually. If the file to be merged is named
458 perform a merge manually. If the file to be merged is named
459 ``a.txt``, these files will accordingly be named ``a.txt.local``,
459 ``a.txt``, these files will accordingly be named ``a.txt.local``,
460 ``a.txt.other`` and ``a.txt.base`` and they will be placed in the
460 ``a.txt.other`` and ``a.txt.base`` and they will be placed in the
461 same directory as ``a.txt``."""
461 same directory as ``a.txt``.
462
463 This implies permerge. Therefore, files aren't dumped, if premerge
464 runs successfully. Use :forcedump to forcibly write files out.
465 """
462 a, b, c, back = files
466 a, b, c, back = files
463
467
464 fd = fcd.path()
468 fd = fcd.path()
465
469
466 util.copyfile(a, a + ".local")
470 util.copyfile(a, a + ".local")
467 repo.wwrite(fd + ".other", fco.data(), fco.flags())
471 repo.wwrite(fd + ".other", fco.data(), fco.flags())
468 repo.wwrite(fd + ".base", fca.data(), fca.flags())
472 repo.wwrite(fd + ".base", fca.data(), fca.flags())
469 return False, 1, False
473 return False, 1, False
470
474
475 @internaltool('forcedump', mergeonly)
476 def _forcedump(repo, mynode, orig, fcd, fco, fca, toolconf, files,
477 labels=None):
478 """
479 Creates three versions of the files as same as :dump, but omits premerge.
480 """
481 return _idump(repo, mynode, orig, fcd, fco, fca, toolconf, files,
482 labels=labels)
483
471 def _xmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
484 def _xmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
472 tool, toolpath, binary, symlink = toolconf
485 tool, toolpath, binary, symlink = toolconf
473 if fcd.isabsent() or fco.isabsent():
486 if fcd.isabsent() or fco.isabsent():
474 repo.ui.warn(_('warning: %s cannot merge change/delete conflict '
487 repo.ui.warn(_('warning: %s cannot merge change/delete conflict '
475 'for %s\n') % (tool, fcd.path()))
488 'for %s\n') % (tool, fcd.path()))
476 return False, 1, None
489 return False, 1, None
477 a, b, c, back = files
490 a, b, c, back = files
478 out = ""
491 out = ""
479 env = {'HG_FILE': fcd.path(),
492 env = {'HG_FILE': fcd.path(),
480 'HG_MY_NODE': short(mynode),
493 'HG_MY_NODE': short(mynode),
481 'HG_OTHER_NODE': str(fco.changectx()),
494 'HG_OTHER_NODE': str(fco.changectx()),
482 'HG_BASE_NODE': str(fca.changectx()),
495 'HG_BASE_NODE': str(fca.changectx()),
483 'HG_MY_ISLINK': 'l' in fcd.flags(),
496 'HG_MY_ISLINK': 'l' in fcd.flags(),
484 'HG_OTHER_ISLINK': 'l' in fco.flags(),
497 'HG_OTHER_ISLINK': 'l' in fco.flags(),
485 'HG_BASE_ISLINK': 'l' in fca.flags(),
498 'HG_BASE_ISLINK': 'l' in fca.flags(),
486 }
499 }
487
500
488 ui = repo.ui
501 ui = repo.ui
489
502
490 args = _toolstr(ui, tool, "args", '$local $base $other')
503 args = _toolstr(ui, tool, "args", '$local $base $other')
491 if "$output" in args:
504 if "$output" in args:
492 out, a = a, back # read input from backup, write to original
505 out, a = a, back # read input from backup, write to original
493 replace = {'local': a, 'base': b, 'other': c, 'output': out}
506 replace = {'local': a, 'base': b, 'other': c, 'output': out}
494 args = util.interpolate(r'\$', replace, args,
507 args = util.interpolate(r'\$', replace, args,
495 lambda s: util.shellquote(util.localpath(s)))
508 lambda s: util.shellquote(util.localpath(s)))
496 cmd = toolpath + ' ' + args
509 cmd = toolpath + ' ' + args
497 if _toolbool(ui, tool, "gui"):
510 if _toolbool(ui, tool, "gui"):
498 repo.ui.status(_('running merge tool %s for file %s\n') %
511 repo.ui.status(_('running merge tool %s for file %s\n') %
499 (tool, fcd.path()))
512 (tool, fcd.path()))
500 repo.ui.debug('launching merge tool: %s\n' % cmd)
513 repo.ui.debug('launching merge tool: %s\n' % cmd)
501 r = ui.system(cmd, cwd=repo.root, environ=env, blockedtag='mergetool')
514 r = ui.system(cmd, cwd=repo.root, environ=env, blockedtag='mergetool')
502 repo.ui.debug('merge tool returned: %s\n' % r)
515 repo.ui.debug('merge tool returned: %s\n' % r)
503 return True, r, False
516 return True, r, False
504
517
505 def _formatconflictmarker(repo, ctx, template, label, pad):
518 def _formatconflictmarker(repo, ctx, template, label, pad):
506 """Applies the given template to the ctx, prefixed by the label.
519 """Applies the given template to the ctx, prefixed by the label.
507
520
508 Pad is the minimum width of the label prefix, so that multiple markers
521 Pad is the minimum width of the label prefix, so that multiple markers
509 can have aligned templated parts.
522 can have aligned templated parts.
510 """
523 """
511 if ctx.node() is None:
524 if ctx.node() is None:
512 ctx = ctx.p1()
525 ctx = ctx.p1()
513
526
514 props = templatekw.keywords.copy()
527 props = templatekw.keywords.copy()
515 props['templ'] = template
528 props['templ'] = template
516 props['ctx'] = ctx
529 props['ctx'] = ctx
517 props['repo'] = repo
530 props['repo'] = repo
518 templateresult = template('conflictmarker', **props)
531 templateresult = template('conflictmarker', **props)
519
532
520 label = ('%s:' % label).ljust(pad + 1)
533 label = ('%s:' % label).ljust(pad + 1)
521 mark = '%s %s' % (label, templater.stringify(templateresult))
534 mark = '%s %s' % (label, templater.stringify(templateresult))
522
535
523 if mark:
536 if mark:
524 mark = mark.splitlines()[0] # split for safety
537 mark = mark.splitlines()[0] # split for safety
525
538
526 # 8 for the prefix of conflict marker lines (e.g. '<<<<<<< ')
539 # 8 for the prefix of conflict marker lines (e.g. '<<<<<<< ')
527 return util.ellipsis(mark, 80 - 8)
540 return util.ellipsis(mark, 80 - 8)
528
541
529 _defaultconflictmarker = ('{node|short} '
542 _defaultconflictmarker = ('{node|short} '
530 '{ifeq(tags, "tip", "", '
543 '{ifeq(tags, "tip", "", '
531 'ifeq(tags, "", "", "{tags} "))}'
544 'ifeq(tags, "", "", "{tags} "))}'
532 '{if(bookmarks, "{bookmarks} ")}'
545 '{if(bookmarks, "{bookmarks} ")}'
533 '{ifeq(branch, "default", "", "{branch} ")}'
546 '{ifeq(branch, "default", "", "{branch} ")}'
534 '- {author|user}: {desc|firstline}')
547 '- {author|user}: {desc|firstline}')
535
548
536 _defaultconflictlabels = ['local', 'other']
549 _defaultconflictlabels = ['local', 'other']
537
550
538 def _formatlabels(repo, fcd, fco, fca, labels):
551 def _formatlabels(repo, fcd, fco, fca, labels):
539 """Formats the given labels using the conflict marker template.
552 """Formats the given labels using the conflict marker template.
540
553
541 Returns a list of formatted labels.
554 Returns a list of formatted labels.
542 """
555 """
543 cd = fcd.changectx()
556 cd = fcd.changectx()
544 co = fco.changectx()
557 co = fco.changectx()
545 ca = fca.changectx()
558 ca = fca.changectx()
546
559
547 ui = repo.ui
560 ui = repo.ui
548 template = ui.config('ui', 'mergemarkertemplate', _defaultconflictmarker)
561 template = ui.config('ui', 'mergemarkertemplate', _defaultconflictmarker)
549 template = templater.unquotestring(template)
562 template = templater.unquotestring(template)
550 tmpl = formatter.maketemplater(ui, 'conflictmarker', template)
563 tmpl = formatter.maketemplater(ui, 'conflictmarker', template)
551
564
552 pad = max(len(l) for l in labels)
565 pad = max(len(l) for l in labels)
553
566
554 newlabels = [_formatconflictmarker(repo, cd, tmpl, labels[0], pad),
567 newlabels = [_formatconflictmarker(repo, cd, tmpl, labels[0], pad),
555 _formatconflictmarker(repo, co, tmpl, labels[1], pad)]
568 _formatconflictmarker(repo, co, tmpl, labels[1], pad)]
556 if len(labels) > 2:
569 if len(labels) > 2:
557 newlabels.append(_formatconflictmarker(repo, ca, tmpl, labels[2], pad))
570 newlabels.append(_formatconflictmarker(repo, ca, tmpl, labels[2], pad))
558 return newlabels
571 return newlabels
559
572
560 def partextras(labels):
573 def partextras(labels):
561 """Return a dictionary of extra labels for use in prompts to the user
574 """Return a dictionary of extra labels for use in prompts to the user
562
575
563 Intended use is in strings of the form "(l)ocal%(l)s".
576 Intended use is in strings of the form "(l)ocal%(l)s".
564 """
577 """
565 if labels is None:
578 if labels is None:
566 return {
579 return {
567 "l": "",
580 "l": "",
568 "o": "",
581 "o": "",
569 }
582 }
570
583
571 return {
584 return {
572 "l": " [%s]" % labels[0],
585 "l": " [%s]" % labels[0],
573 "o": " [%s]" % labels[1],
586 "o": " [%s]" % labels[1],
574 }
587 }
575
588
576 def _filemerge(premerge, repo, mynode, orig, fcd, fco, fca, labels=None):
589 def _filemerge(premerge, repo, mynode, orig, fcd, fco, fca, labels=None):
577 """perform a 3-way merge in the working directory
590 """perform a 3-way merge in the working directory
578
591
579 premerge = whether this is a premerge
592 premerge = whether this is a premerge
580 mynode = parent node before merge
593 mynode = parent node before merge
581 orig = original local filename before merge
594 orig = original local filename before merge
582 fco = other file context
595 fco = other file context
583 fca = ancestor file context
596 fca = ancestor file context
584 fcd = local file context for current/destination file
597 fcd = local file context for current/destination file
585
598
586 Returns whether the merge is complete, the return value of the merge, and
599 Returns whether the merge is complete, the return value of the merge, and
587 a boolean indicating whether the file was deleted from disk."""
600 a boolean indicating whether the file was deleted from disk."""
588
601
589 def temp(prefix, ctx):
602 def temp(prefix, ctx):
590 fullbase, ext = os.path.splitext(ctx.path())
603 fullbase, ext = os.path.splitext(ctx.path())
591 pre = "%s~%s." % (os.path.basename(fullbase), prefix)
604 pre = "%s~%s." % (os.path.basename(fullbase), prefix)
592 (fd, name) = tempfile.mkstemp(prefix=pre, suffix=ext)
605 (fd, name) = tempfile.mkstemp(prefix=pre, suffix=ext)
593 data = repo.wwritedata(ctx.path(), ctx.data())
606 data = repo.wwritedata(ctx.path(), ctx.data())
594 f = os.fdopen(fd, pycompat.sysstr("wb"))
607 f = os.fdopen(fd, pycompat.sysstr("wb"))
595 f.write(data)
608 f.write(data)
596 f.close()
609 f.close()
597 return name
610 return name
598
611
599 if not fco.cmp(fcd): # files identical?
612 if not fco.cmp(fcd): # files identical?
600 return True, None, False
613 return True, None, False
601
614
602 ui = repo.ui
615 ui = repo.ui
603 fd = fcd.path()
616 fd = fcd.path()
604 binary = fcd.isbinary() or fco.isbinary() or fca.isbinary()
617 binary = fcd.isbinary() or fco.isbinary() or fca.isbinary()
605 symlink = 'l' in fcd.flags() + fco.flags()
618 symlink = 'l' in fcd.flags() + fco.flags()
606 changedelete = fcd.isabsent() or fco.isabsent()
619 changedelete = fcd.isabsent() or fco.isabsent()
607 tool, toolpath = _picktool(repo, ui, fd, binary, symlink, changedelete)
620 tool, toolpath = _picktool(repo, ui, fd, binary, symlink, changedelete)
608 if tool in internals and tool.startswith('internal:'):
621 if tool in internals and tool.startswith('internal:'):
609 # normalize to new-style names (':merge' etc)
622 # normalize to new-style names (':merge' etc)
610 tool = tool[len('internal'):]
623 tool = tool[len('internal'):]
611 ui.debug("picked tool '%s' for %s (binary %s symlink %s changedelete %s)\n"
624 ui.debug("picked tool '%s' for %s (binary %s symlink %s changedelete %s)\n"
612 % (tool, fd, binary, symlink, changedelete))
625 % (tool, fd, binary, symlink, changedelete))
613
626
614 if tool in internals:
627 if tool in internals:
615 func = internals[tool]
628 func = internals[tool]
616 mergetype = func.mergetype
629 mergetype = func.mergetype
617 onfailure = func.onfailure
630 onfailure = func.onfailure
618 precheck = func.precheck
631 precheck = func.precheck
619 else:
632 else:
620 func = _xmerge
633 func = _xmerge
621 mergetype = fullmerge
634 mergetype = fullmerge
622 onfailure = _("merging %s failed!\n")
635 onfailure = _("merging %s failed!\n")
623 precheck = None
636 precheck = None
624
637
625 toolconf = tool, toolpath, binary, symlink
638 toolconf = tool, toolpath, binary, symlink
626
639
627 if mergetype == nomerge:
640 if mergetype == nomerge:
628 r, deleted = func(repo, mynode, orig, fcd, fco, fca, toolconf, labels)
641 r, deleted = func(repo, mynode, orig, fcd, fco, fca, toolconf, labels)
629 return True, r, deleted
642 return True, r, deleted
630
643
631 if premerge:
644 if premerge:
632 if orig != fco.path():
645 if orig != fco.path():
633 ui.status(_("merging %s and %s to %s\n") % (orig, fco.path(), fd))
646 ui.status(_("merging %s and %s to %s\n") % (orig, fco.path(), fd))
634 else:
647 else:
635 ui.status(_("merging %s\n") % fd)
648 ui.status(_("merging %s\n") % fd)
636
649
637 ui.debug("my %s other %s ancestor %s\n" % (fcd, fco, fca))
650 ui.debug("my %s other %s ancestor %s\n" % (fcd, fco, fca))
638
651
639 if precheck and not precheck(repo, mynode, orig, fcd, fco, fca,
652 if precheck and not precheck(repo, mynode, orig, fcd, fco, fca,
640 toolconf):
653 toolconf):
641 if onfailure:
654 if onfailure:
642 ui.warn(onfailure % fd)
655 ui.warn(onfailure % fd)
643 return True, 1, False
656 return True, 1, False
644
657
645 a = repo.wjoin(fd)
658 a = repo.wjoin(fd)
646 b = temp("base", fca)
659 b = temp("base", fca)
647 c = temp("other", fco)
660 c = temp("other", fco)
648 if not fcd.isabsent():
661 if not fcd.isabsent():
649 back = scmutil.origpath(ui, repo, a)
662 back = scmutil.origpath(ui, repo, a)
650 if premerge:
663 if premerge:
651 util.copyfile(a, back)
664 util.copyfile(a, back)
652 else:
665 else:
653 back = None
666 back = None
654 files = (a, b, c, back)
667 files = (a, b, c, back)
655
668
656 r = 1
669 r = 1
657 try:
670 try:
658 markerstyle = ui.config('ui', 'mergemarkers', 'basic')
671 markerstyle = ui.config('ui', 'mergemarkers', 'basic')
659 if not labels:
672 if not labels:
660 labels = _defaultconflictlabels
673 labels = _defaultconflictlabels
661 if markerstyle != 'basic':
674 if markerstyle != 'basic':
662 labels = _formatlabels(repo, fcd, fco, fca, labels)
675 labels = _formatlabels(repo, fcd, fco, fca, labels)
663
676
664 if premerge and mergetype == fullmerge:
677 if premerge and mergetype == fullmerge:
665 r = _premerge(repo, fcd, fco, fca, toolconf, files, labels=labels)
678 r = _premerge(repo, fcd, fco, fca, toolconf, files, labels=labels)
666 # complete if premerge successful (r is 0)
679 # complete if premerge successful (r is 0)
667 return not r, r, False
680 return not r, r, False
668
681
669 needcheck, r, deleted = func(repo, mynode, orig, fcd, fco, fca,
682 needcheck, r, deleted = func(repo, mynode, orig, fcd, fco, fca,
670 toolconf, files, labels=labels)
683 toolconf, files, labels=labels)
671
684
672 if needcheck:
685 if needcheck:
673 r = _check(r, ui, tool, fcd, files)
686 r = _check(r, ui, tool, fcd, files)
674
687
675 if r:
688 if r:
676 if onfailure:
689 if onfailure:
677 ui.warn(onfailure % fd)
690 ui.warn(onfailure % fd)
678
691
679 return True, r, deleted
692 return True, r, deleted
680 finally:
693 finally:
681 if not r and back is not None:
694 if not r and back is not None:
682 util.unlink(back)
695 util.unlink(back)
683 util.unlink(b)
696 util.unlink(b)
684 util.unlink(c)
697 util.unlink(c)
685
698
686 def _check(r, ui, tool, fcd, files):
699 def _check(r, ui, tool, fcd, files):
687 fd = fcd.path()
700 fd = fcd.path()
688 a, b, c, back = files
701 a, b, c, back = files
689
702
690 if not r and (_toolbool(ui, tool, "checkconflicts") or
703 if not r and (_toolbool(ui, tool, "checkconflicts") or
691 'conflicts' in _toollist(ui, tool, "check")):
704 'conflicts' in _toollist(ui, tool, "check")):
692 if re.search("^(<<<<<<< .*|=======|>>>>>>> .*)$", fcd.data(),
705 if re.search("^(<<<<<<< .*|=======|>>>>>>> .*)$", fcd.data(),
693 re.MULTILINE):
706 re.MULTILINE):
694 r = 1
707 r = 1
695
708
696 checked = False
709 checked = False
697 if 'prompt' in _toollist(ui, tool, "check"):
710 if 'prompt' in _toollist(ui, tool, "check"):
698 checked = True
711 checked = True
699 if ui.promptchoice(_("was merge of '%s' successful (yn)?"
712 if ui.promptchoice(_("was merge of '%s' successful (yn)?"
700 "$$ &Yes $$ &No") % fd, 1):
713 "$$ &Yes $$ &No") % fd, 1):
701 r = 1
714 r = 1
702
715
703 if not r and not checked and (_toolbool(ui, tool, "checkchanged") or
716 if not r and not checked and (_toolbool(ui, tool, "checkchanged") or
704 'changed' in
717 'changed' in
705 _toollist(ui, tool, "check")):
718 _toollist(ui, tool, "check")):
706 if back is not None and filecmp.cmp(a, back):
719 if back is not None and filecmp.cmp(a, back):
707 if ui.promptchoice(_(" output file %s appears unchanged\n"
720 if ui.promptchoice(_(" output file %s appears unchanged\n"
708 "was merge successful (yn)?"
721 "was merge successful (yn)?"
709 "$$ &Yes $$ &No") % fd, 1):
722 "$$ &Yes $$ &No") % fd, 1):
710 r = 1
723 r = 1
711
724
712 if back is not None and _toolbool(ui, tool, "fixeol"):
725 if back is not None and _toolbool(ui, tool, "fixeol"):
713 _matcheol(a, back)
726 _matcheol(a, back)
714
727
715 return r
728 return r
716
729
717 def premerge(repo, mynode, orig, fcd, fco, fca, labels=None):
730 def premerge(repo, mynode, orig, fcd, fco, fca, labels=None):
718 return _filemerge(True, repo, mynode, orig, fcd, fco, fca, labels=labels)
731 return _filemerge(True, repo, mynode, orig, fcd, fco, fca, labels=labels)
719
732
720 def filemerge(repo, mynode, orig, fcd, fco, fca, labels=None):
733 def filemerge(repo, mynode, orig, fcd, fco, fca, labels=None):
721 return _filemerge(False, repo, mynode, orig, fcd, fco, fca, labels=labels)
734 return _filemerge(False, repo, mynode, orig, fcd, fco, fca, labels=labels)
722
735
723 # tell hggettext to extract docstrings from these functions:
736 # tell hggettext to extract docstrings from these functions:
724 i18nfunctions = internals.values()
737 i18nfunctions = internals.values()
@@ -1,3327 +1,3334 b''
1 Short help:
1 Short help:
2
2
3 $ hg
3 $ hg
4 Mercurial Distributed SCM
4 Mercurial Distributed SCM
5
5
6 basic commands:
6 basic commands:
7
7
8 add add the specified files on the next commit
8 add add the specified files on the next commit
9 annotate show changeset information by line for each file
9 annotate show changeset information by line for each file
10 clone make a copy of an existing repository
10 clone make a copy of an existing repository
11 commit commit the specified files or all outstanding changes
11 commit commit the specified files or all outstanding changes
12 diff diff repository (or selected files)
12 diff diff repository (or selected files)
13 export dump the header and diffs for one or more changesets
13 export dump the header and diffs for one or more changesets
14 forget forget the specified files on the next commit
14 forget forget the specified files on the next commit
15 init create a new repository in the given directory
15 init create a new repository in the given directory
16 log show revision history of entire repository or files
16 log show revision history of entire repository or files
17 merge merge another revision into working directory
17 merge merge another revision into working directory
18 pull pull changes from the specified source
18 pull pull changes from the specified source
19 push push changes to the specified destination
19 push push changes to the specified destination
20 remove remove the specified files on the next commit
20 remove remove the specified files on the next commit
21 serve start stand-alone webserver
21 serve start stand-alone webserver
22 status show changed files in the working directory
22 status show changed files in the working directory
23 summary summarize working directory state
23 summary summarize working directory state
24 update update working directory (or switch revisions)
24 update update working directory (or switch revisions)
25
25
26 (use 'hg help' for the full list of commands or 'hg -v' for details)
26 (use 'hg help' for the full list of commands or 'hg -v' for details)
27
27
28 $ hg -q
28 $ hg -q
29 add add the specified files on the next commit
29 add add the specified files on the next commit
30 annotate show changeset information by line for each file
30 annotate show changeset information by line for each file
31 clone make a copy of an existing repository
31 clone make a copy of an existing repository
32 commit commit the specified files or all outstanding changes
32 commit commit the specified files or all outstanding changes
33 diff diff repository (or selected files)
33 diff diff repository (or selected files)
34 export dump the header and diffs for one or more changesets
34 export dump the header and diffs for one or more changesets
35 forget forget the specified files on the next commit
35 forget forget the specified files on the next commit
36 init create a new repository in the given directory
36 init create a new repository in the given directory
37 log show revision history of entire repository or files
37 log show revision history of entire repository or files
38 merge merge another revision into working directory
38 merge merge another revision into working directory
39 pull pull changes from the specified source
39 pull pull changes from the specified source
40 push push changes to the specified destination
40 push push changes to the specified destination
41 remove remove the specified files on the next commit
41 remove remove the specified files on the next commit
42 serve start stand-alone webserver
42 serve start stand-alone webserver
43 status show changed files in the working directory
43 status show changed files in the working directory
44 summary summarize working directory state
44 summary summarize working directory state
45 update update working directory (or switch revisions)
45 update update working directory (or switch revisions)
46
46
47 $ hg help
47 $ hg help
48 Mercurial Distributed SCM
48 Mercurial Distributed SCM
49
49
50 list of commands:
50 list of commands:
51
51
52 add add the specified files on the next commit
52 add add the specified files on the next commit
53 addremove add all new files, delete all missing files
53 addremove add all new files, delete all missing files
54 annotate show changeset information by line for each file
54 annotate show changeset information by line for each file
55 archive create an unversioned archive of a repository revision
55 archive create an unversioned archive of a repository revision
56 backout reverse effect of earlier changeset
56 backout reverse effect of earlier changeset
57 bisect subdivision search of changesets
57 bisect subdivision search of changesets
58 bookmarks create a new bookmark or list existing bookmarks
58 bookmarks create a new bookmark or list existing bookmarks
59 branch set or show the current branch name
59 branch set or show the current branch name
60 branches list repository named branches
60 branches list repository named branches
61 bundle create a bundle file
61 bundle create a bundle file
62 cat output the current or given revision of files
62 cat output the current or given revision of files
63 clone make a copy of an existing repository
63 clone make a copy of an existing repository
64 commit commit the specified files or all outstanding changes
64 commit commit the specified files or all outstanding changes
65 config show combined config settings from all hgrc files
65 config show combined config settings from all hgrc files
66 copy mark files as copied for the next commit
66 copy mark files as copied for the next commit
67 diff diff repository (or selected files)
67 diff diff repository (or selected files)
68 export dump the header and diffs for one or more changesets
68 export dump the header and diffs for one or more changesets
69 files list tracked files
69 files list tracked files
70 forget forget the specified files on the next commit
70 forget forget the specified files on the next commit
71 graft copy changes from other branches onto the current branch
71 graft copy changes from other branches onto the current branch
72 grep search revision history for a pattern in specified files
72 grep search revision history for a pattern in specified files
73 heads show branch heads
73 heads show branch heads
74 help show help for a given topic or a help overview
74 help show help for a given topic or a help overview
75 identify identify the working directory or specified revision
75 identify identify the working directory or specified revision
76 import import an ordered set of patches
76 import import an ordered set of patches
77 incoming show new changesets found in source
77 incoming show new changesets found in source
78 init create a new repository in the given directory
78 init create a new repository in the given directory
79 log show revision history of entire repository or files
79 log show revision history of entire repository or files
80 manifest output the current or given revision of the project manifest
80 manifest output the current or given revision of the project manifest
81 merge merge another revision into working directory
81 merge merge another revision into working directory
82 outgoing show changesets not found in the destination
82 outgoing show changesets not found in the destination
83 paths show aliases for remote repositories
83 paths show aliases for remote repositories
84 phase set or show the current phase name
84 phase set or show the current phase name
85 pull pull changes from the specified source
85 pull pull changes from the specified source
86 push push changes to the specified destination
86 push push changes to the specified destination
87 recover roll back an interrupted transaction
87 recover roll back an interrupted transaction
88 remove remove the specified files on the next commit
88 remove remove the specified files on the next commit
89 rename rename files; equivalent of copy + remove
89 rename rename files; equivalent of copy + remove
90 resolve redo merges or set/view the merge status of files
90 resolve redo merges or set/view the merge status of files
91 revert restore files to their checkout state
91 revert restore files to their checkout state
92 root print the root (top) of the current working directory
92 root print the root (top) of the current working directory
93 serve start stand-alone webserver
93 serve start stand-alone webserver
94 status show changed files in the working directory
94 status show changed files in the working directory
95 summary summarize working directory state
95 summary summarize working directory state
96 tag add one or more tags for the current or given revision
96 tag add one or more tags for the current or given revision
97 tags list repository tags
97 tags list repository tags
98 unbundle apply one or more bundle files
98 unbundle apply one or more bundle files
99 update update working directory (or switch revisions)
99 update update working directory (or switch revisions)
100 verify verify the integrity of the repository
100 verify verify the integrity of the repository
101 version output version and copyright information
101 version output version and copyright information
102
102
103 additional help topics:
103 additional help topics:
104
104
105 bundlespec Bundle File Formats
105 bundlespec Bundle File Formats
106 color Colorizing Outputs
106 color Colorizing Outputs
107 config Configuration Files
107 config Configuration Files
108 dates Date Formats
108 dates Date Formats
109 diffs Diff Formats
109 diffs Diff Formats
110 environment Environment Variables
110 environment Environment Variables
111 extensions Using Additional Features
111 extensions Using Additional Features
112 filesets Specifying File Sets
112 filesets Specifying File Sets
113 glossary Glossary
113 glossary Glossary
114 hgignore Syntax for Mercurial Ignore Files
114 hgignore Syntax for Mercurial Ignore Files
115 hgweb Configuring hgweb
115 hgweb Configuring hgweb
116 internals Technical implementation topics
116 internals Technical implementation topics
117 merge-tools Merge Tools
117 merge-tools Merge Tools
118 pager Pager Support
118 pager Pager Support
119 patterns File Name Patterns
119 patterns File Name Patterns
120 phases Working with Phases
120 phases Working with Phases
121 revisions Specifying Revisions
121 revisions Specifying Revisions
122 scripting Using Mercurial from scripts and automation
122 scripting Using Mercurial from scripts and automation
123 subrepos Subrepositories
123 subrepos Subrepositories
124 templating Template Usage
124 templating Template Usage
125 urls URL Paths
125 urls URL Paths
126
126
127 (use 'hg help -v' to show built-in aliases and global options)
127 (use 'hg help -v' to show built-in aliases and global options)
128
128
129 $ hg -q help
129 $ hg -q help
130 add add the specified files on the next commit
130 add add the specified files on the next commit
131 addremove add all new files, delete all missing files
131 addremove add all new files, delete all missing files
132 annotate show changeset information by line for each file
132 annotate show changeset information by line for each file
133 archive create an unversioned archive of a repository revision
133 archive create an unversioned archive of a repository revision
134 backout reverse effect of earlier changeset
134 backout reverse effect of earlier changeset
135 bisect subdivision search of changesets
135 bisect subdivision search of changesets
136 bookmarks create a new bookmark or list existing bookmarks
136 bookmarks create a new bookmark or list existing bookmarks
137 branch set or show the current branch name
137 branch set or show the current branch name
138 branches list repository named branches
138 branches list repository named branches
139 bundle create a bundle file
139 bundle create a bundle file
140 cat output the current or given revision of files
140 cat output the current or given revision of files
141 clone make a copy of an existing repository
141 clone make a copy of an existing repository
142 commit commit the specified files or all outstanding changes
142 commit commit the specified files or all outstanding changes
143 config show combined config settings from all hgrc files
143 config show combined config settings from all hgrc files
144 copy mark files as copied for the next commit
144 copy mark files as copied for the next commit
145 diff diff repository (or selected files)
145 diff diff repository (or selected files)
146 export dump the header and diffs for one or more changesets
146 export dump the header and diffs for one or more changesets
147 files list tracked files
147 files list tracked files
148 forget forget the specified files on the next commit
148 forget forget the specified files on the next commit
149 graft copy changes from other branches onto the current branch
149 graft copy changes from other branches onto the current branch
150 grep search revision history for a pattern in specified files
150 grep search revision history for a pattern in specified files
151 heads show branch heads
151 heads show branch heads
152 help show help for a given topic or a help overview
152 help show help for a given topic or a help overview
153 identify identify the working directory or specified revision
153 identify identify the working directory or specified revision
154 import import an ordered set of patches
154 import import an ordered set of patches
155 incoming show new changesets found in source
155 incoming show new changesets found in source
156 init create a new repository in the given directory
156 init create a new repository in the given directory
157 log show revision history of entire repository or files
157 log show revision history of entire repository or files
158 manifest output the current or given revision of the project manifest
158 manifest output the current or given revision of the project manifest
159 merge merge another revision into working directory
159 merge merge another revision into working directory
160 outgoing show changesets not found in the destination
160 outgoing show changesets not found in the destination
161 paths show aliases for remote repositories
161 paths show aliases for remote repositories
162 phase set or show the current phase name
162 phase set or show the current phase name
163 pull pull changes from the specified source
163 pull pull changes from the specified source
164 push push changes to the specified destination
164 push push changes to the specified destination
165 recover roll back an interrupted transaction
165 recover roll back an interrupted transaction
166 remove remove the specified files on the next commit
166 remove remove the specified files on the next commit
167 rename rename files; equivalent of copy + remove
167 rename rename files; equivalent of copy + remove
168 resolve redo merges or set/view the merge status of files
168 resolve redo merges or set/view the merge status of files
169 revert restore files to their checkout state
169 revert restore files to their checkout state
170 root print the root (top) of the current working directory
170 root print the root (top) of the current working directory
171 serve start stand-alone webserver
171 serve start stand-alone webserver
172 status show changed files in the working directory
172 status show changed files in the working directory
173 summary summarize working directory state
173 summary summarize working directory state
174 tag add one or more tags for the current or given revision
174 tag add one or more tags for the current or given revision
175 tags list repository tags
175 tags list repository tags
176 unbundle apply one or more bundle files
176 unbundle apply one or more bundle files
177 update update working directory (or switch revisions)
177 update update working directory (or switch revisions)
178 verify verify the integrity of the repository
178 verify verify the integrity of the repository
179 version output version and copyright information
179 version output version and copyright information
180
180
181 additional help topics:
181 additional help topics:
182
182
183 bundlespec Bundle File Formats
183 bundlespec Bundle File Formats
184 color Colorizing Outputs
184 color Colorizing Outputs
185 config Configuration Files
185 config Configuration Files
186 dates Date Formats
186 dates Date Formats
187 diffs Diff Formats
187 diffs Diff Formats
188 environment Environment Variables
188 environment Environment Variables
189 extensions Using Additional Features
189 extensions Using Additional Features
190 filesets Specifying File Sets
190 filesets Specifying File Sets
191 glossary Glossary
191 glossary Glossary
192 hgignore Syntax for Mercurial Ignore Files
192 hgignore Syntax for Mercurial Ignore Files
193 hgweb Configuring hgweb
193 hgweb Configuring hgweb
194 internals Technical implementation topics
194 internals Technical implementation topics
195 merge-tools Merge Tools
195 merge-tools Merge Tools
196 pager Pager Support
196 pager Pager Support
197 patterns File Name Patterns
197 patterns File Name Patterns
198 phases Working with Phases
198 phases Working with Phases
199 revisions Specifying Revisions
199 revisions Specifying Revisions
200 scripting Using Mercurial from scripts and automation
200 scripting Using Mercurial from scripts and automation
201 subrepos Subrepositories
201 subrepos Subrepositories
202 templating Template Usage
202 templating Template Usage
203 urls URL Paths
203 urls URL Paths
204
204
205 Test extension help:
205 Test extension help:
206 $ hg help extensions --config extensions.rebase= --config extensions.children=
206 $ hg help extensions --config extensions.rebase= --config extensions.children=
207 Using Additional Features
207 Using Additional Features
208 """""""""""""""""""""""""
208 """""""""""""""""""""""""
209
209
210 Mercurial has the ability to add new features through the use of
210 Mercurial has the ability to add new features through the use of
211 extensions. Extensions may add new commands, add options to existing
211 extensions. Extensions may add new commands, add options to existing
212 commands, change the default behavior of commands, or implement hooks.
212 commands, change the default behavior of commands, or implement hooks.
213
213
214 To enable the "foo" extension, either shipped with Mercurial or in the
214 To enable the "foo" extension, either shipped with Mercurial or in the
215 Python search path, create an entry for it in your configuration file,
215 Python search path, create an entry for it in your configuration file,
216 like this:
216 like this:
217
217
218 [extensions]
218 [extensions]
219 foo =
219 foo =
220
220
221 You may also specify the full path to an extension:
221 You may also specify the full path to an extension:
222
222
223 [extensions]
223 [extensions]
224 myfeature = ~/.hgext/myfeature.py
224 myfeature = ~/.hgext/myfeature.py
225
225
226 See 'hg help config' for more information on configuration files.
226 See 'hg help config' for more information on configuration files.
227
227
228 Extensions are not loaded by default for a variety of reasons: they can
228 Extensions are not loaded by default for a variety of reasons: they can
229 increase startup overhead; they may be meant for advanced usage only; they
229 increase startup overhead; they may be meant for advanced usage only; they
230 may provide potentially dangerous abilities (such as letting you destroy
230 may provide potentially dangerous abilities (such as letting you destroy
231 or modify history); they might not be ready for prime time; or they may
231 or modify history); they might not be ready for prime time; or they may
232 alter some usual behaviors of stock Mercurial. It is thus up to the user
232 alter some usual behaviors of stock Mercurial. It is thus up to the user
233 to activate extensions as needed.
233 to activate extensions as needed.
234
234
235 To explicitly disable an extension enabled in a configuration file of
235 To explicitly disable an extension enabled in a configuration file of
236 broader scope, prepend its path with !:
236 broader scope, prepend its path with !:
237
237
238 [extensions]
238 [extensions]
239 # disabling extension bar residing in /path/to/extension/bar.py
239 # disabling extension bar residing in /path/to/extension/bar.py
240 bar = !/path/to/extension/bar.py
240 bar = !/path/to/extension/bar.py
241 # ditto, but no path was supplied for extension baz
241 # ditto, but no path was supplied for extension baz
242 baz = !
242 baz = !
243
243
244 enabled extensions:
244 enabled extensions:
245
245
246 children command to display child changesets (DEPRECATED)
246 children command to display child changesets (DEPRECATED)
247 rebase command to move sets of revisions to a different ancestor
247 rebase command to move sets of revisions to a different ancestor
248
248
249 disabled extensions:
249 disabled extensions:
250
250
251 acl hooks for controlling repository access
251 acl hooks for controlling repository access
252 blackbox log repository events to a blackbox for debugging
252 blackbox log repository events to a blackbox for debugging
253 bugzilla hooks for integrating with the Bugzilla bug tracker
253 bugzilla hooks for integrating with the Bugzilla bug tracker
254 censor erase file content at a given revision
254 censor erase file content at a given revision
255 churn command to display statistics about repository history
255 churn command to display statistics about repository history
256 clonebundles advertise pre-generated bundles to seed clones
256 clonebundles advertise pre-generated bundles to seed clones
257 convert import revisions from foreign VCS repositories into
257 convert import revisions from foreign VCS repositories into
258 Mercurial
258 Mercurial
259 eol automatically manage newlines in repository files
259 eol automatically manage newlines in repository files
260 extdiff command to allow external programs to compare revisions
260 extdiff command to allow external programs to compare revisions
261 factotum http authentication with factotum
261 factotum http authentication with factotum
262 gpg commands to sign and verify changesets
262 gpg commands to sign and verify changesets
263 hgk browse the repository in a graphical way
263 hgk browse the repository in a graphical way
264 highlight syntax highlighting for hgweb (requires Pygments)
264 highlight syntax highlighting for hgweb (requires Pygments)
265 histedit interactive history editing
265 histedit interactive history editing
266 keyword expand keywords in tracked files
266 keyword expand keywords in tracked files
267 largefiles track large binary files
267 largefiles track large binary files
268 mq manage a stack of patches
268 mq manage a stack of patches
269 notify hooks for sending email push notifications
269 notify hooks for sending email push notifications
270 patchbomb command to send changesets as (a series of) patch emails
270 patchbomb command to send changesets as (a series of) patch emails
271 purge command to delete untracked files from the working
271 purge command to delete untracked files from the working
272 directory
272 directory
273 relink recreates hardlinks between repository clones
273 relink recreates hardlinks between repository clones
274 schemes extend schemes with shortcuts to repository swarms
274 schemes extend schemes with shortcuts to repository swarms
275 share share a common history between several working directories
275 share share a common history between several working directories
276 shelve save and restore changes to the working directory
276 shelve save and restore changes to the working directory
277 strip strip changesets and their descendants from history
277 strip strip changesets and their descendants from history
278 transplant command to transplant changesets from another branch
278 transplant command to transplant changesets from another branch
279 win32mbcs allow the use of MBCS paths with problematic encodings
279 win32mbcs allow the use of MBCS paths with problematic encodings
280 zeroconf discover and advertise repositories on the local network
280 zeroconf discover and advertise repositories on the local network
281
281
282 Verify that extension keywords appear in help templates
282 Verify that extension keywords appear in help templates
283
283
284 $ hg help --config extensions.transplant= templating|grep transplant > /dev/null
284 $ hg help --config extensions.transplant= templating|grep transplant > /dev/null
285
285
286 Test short command list with verbose option
286 Test short command list with verbose option
287
287
288 $ hg -v help shortlist
288 $ hg -v help shortlist
289 Mercurial Distributed SCM
289 Mercurial Distributed SCM
290
290
291 basic commands:
291 basic commands:
292
292
293 add add the specified files on the next commit
293 add add the specified files on the next commit
294 annotate, blame
294 annotate, blame
295 show changeset information by line for each file
295 show changeset information by line for each file
296 clone make a copy of an existing repository
296 clone make a copy of an existing repository
297 commit, ci commit the specified files or all outstanding changes
297 commit, ci commit the specified files or all outstanding changes
298 diff diff repository (or selected files)
298 diff diff repository (or selected files)
299 export dump the header and diffs for one or more changesets
299 export dump the header and diffs for one or more changesets
300 forget forget the specified files on the next commit
300 forget forget the specified files on the next commit
301 init create a new repository in the given directory
301 init create a new repository in the given directory
302 log, history show revision history of entire repository or files
302 log, history show revision history of entire repository or files
303 merge merge another revision into working directory
303 merge merge another revision into working directory
304 pull pull changes from the specified source
304 pull pull changes from the specified source
305 push push changes to the specified destination
305 push push changes to the specified destination
306 remove, rm remove the specified files on the next commit
306 remove, rm remove the specified files on the next commit
307 serve start stand-alone webserver
307 serve start stand-alone webserver
308 status, st show changed files in the working directory
308 status, st show changed files in the working directory
309 summary, sum summarize working directory state
309 summary, sum summarize working directory state
310 update, up, checkout, co
310 update, up, checkout, co
311 update working directory (or switch revisions)
311 update working directory (or switch revisions)
312
312
313 global options ([+] can be repeated):
313 global options ([+] can be repeated):
314
314
315 -R --repository REPO repository root directory or name of overlay bundle
315 -R --repository REPO repository root directory or name of overlay bundle
316 file
316 file
317 --cwd DIR change working directory
317 --cwd DIR change working directory
318 -y --noninteractive do not prompt, automatically pick the first choice for
318 -y --noninteractive do not prompt, automatically pick the first choice for
319 all prompts
319 all prompts
320 -q --quiet suppress output
320 -q --quiet suppress output
321 -v --verbose enable additional output
321 -v --verbose enable additional output
322 --color TYPE when to colorize (boolean, always, auto, never, or
322 --color TYPE when to colorize (boolean, always, auto, never, or
323 debug)
323 debug)
324 --config CONFIG [+] set/override config option (use 'section.name=value')
324 --config CONFIG [+] set/override config option (use 'section.name=value')
325 --debug enable debugging output
325 --debug enable debugging output
326 --debugger start debugger
326 --debugger start debugger
327 --encoding ENCODE set the charset encoding (default: ascii)
327 --encoding ENCODE set the charset encoding (default: ascii)
328 --encodingmode MODE set the charset encoding mode (default: strict)
328 --encodingmode MODE set the charset encoding mode (default: strict)
329 --traceback always print a traceback on exception
329 --traceback always print a traceback on exception
330 --time time how long the command takes
330 --time time how long the command takes
331 --profile print command execution profile
331 --profile print command execution profile
332 --version output version information and exit
332 --version output version information and exit
333 -h --help display help and exit
333 -h --help display help and exit
334 --hidden consider hidden changesets
334 --hidden consider hidden changesets
335 --pager TYPE when to paginate (boolean, always, auto, or never)
335 --pager TYPE when to paginate (boolean, always, auto, or never)
336 (default: auto)
336 (default: auto)
337
337
338 (use 'hg help' for the full list of commands)
338 (use 'hg help' for the full list of commands)
339
339
340 $ hg add -h
340 $ hg add -h
341 hg add [OPTION]... [FILE]...
341 hg add [OPTION]... [FILE]...
342
342
343 add the specified files on the next commit
343 add the specified files on the next commit
344
344
345 Schedule files to be version controlled and added to the repository.
345 Schedule files to be version controlled and added to the repository.
346
346
347 The files will be added to the repository at the next commit. To undo an
347 The files will be added to the repository at the next commit. To undo an
348 add before that, see 'hg forget'.
348 add before that, see 'hg forget'.
349
349
350 If no names are given, add all files to the repository (except files
350 If no names are given, add all files to the repository (except files
351 matching ".hgignore").
351 matching ".hgignore").
352
352
353 Returns 0 if all files are successfully added.
353 Returns 0 if all files are successfully added.
354
354
355 options ([+] can be repeated):
355 options ([+] can be repeated):
356
356
357 -I --include PATTERN [+] include names matching the given patterns
357 -I --include PATTERN [+] include names matching the given patterns
358 -X --exclude PATTERN [+] exclude names matching the given patterns
358 -X --exclude PATTERN [+] exclude names matching the given patterns
359 -S --subrepos recurse into subrepositories
359 -S --subrepos recurse into subrepositories
360 -n --dry-run do not perform actions, just print output
360 -n --dry-run do not perform actions, just print output
361
361
362 (some details hidden, use --verbose to show complete help)
362 (some details hidden, use --verbose to show complete help)
363
363
364 Verbose help for add
364 Verbose help for add
365
365
366 $ hg add -hv
366 $ hg add -hv
367 hg add [OPTION]... [FILE]...
367 hg add [OPTION]... [FILE]...
368
368
369 add the specified files on the next commit
369 add the specified files on the next commit
370
370
371 Schedule files to be version controlled and added to the repository.
371 Schedule files to be version controlled and added to the repository.
372
372
373 The files will be added to the repository at the next commit. To undo an
373 The files will be added to the repository at the next commit. To undo an
374 add before that, see 'hg forget'.
374 add before that, see 'hg forget'.
375
375
376 If no names are given, add all files to the repository (except files
376 If no names are given, add all files to the repository (except files
377 matching ".hgignore").
377 matching ".hgignore").
378
378
379 Examples:
379 Examples:
380
380
381 - New (unknown) files are added automatically by 'hg add':
381 - New (unknown) files are added automatically by 'hg add':
382
382
383 $ ls
383 $ ls
384 foo.c
384 foo.c
385 $ hg status
385 $ hg status
386 ? foo.c
386 ? foo.c
387 $ hg add
387 $ hg add
388 adding foo.c
388 adding foo.c
389 $ hg status
389 $ hg status
390 A foo.c
390 A foo.c
391
391
392 - Specific files to be added can be specified:
392 - Specific files to be added can be specified:
393
393
394 $ ls
394 $ ls
395 bar.c foo.c
395 bar.c foo.c
396 $ hg status
396 $ hg status
397 ? bar.c
397 ? bar.c
398 ? foo.c
398 ? foo.c
399 $ hg add bar.c
399 $ hg add bar.c
400 $ hg status
400 $ hg status
401 A bar.c
401 A bar.c
402 ? foo.c
402 ? foo.c
403
403
404 Returns 0 if all files are successfully added.
404 Returns 0 if all files are successfully added.
405
405
406 options ([+] can be repeated):
406 options ([+] can be repeated):
407
407
408 -I --include PATTERN [+] include names matching the given patterns
408 -I --include PATTERN [+] include names matching the given patterns
409 -X --exclude PATTERN [+] exclude names matching the given patterns
409 -X --exclude PATTERN [+] exclude names matching the given patterns
410 -S --subrepos recurse into subrepositories
410 -S --subrepos recurse into subrepositories
411 -n --dry-run do not perform actions, just print output
411 -n --dry-run do not perform actions, just print output
412
412
413 global options ([+] can be repeated):
413 global options ([+] can be repeated):
414
414
415 -R --repository REPO repository root directory or name of overlay bundle
415 -R --repository REPO repository root directory or name of overlay bundle
416 file
416 file
417 --cwd DIR change working directory
417 --cwd DIR change working directory
418 -y --noninteractive do not prompt, automatically pick the first choice for
418 -y --noninteractive do not prompt, automatically pick the first choice for
419 all prompts
419 all prompts
420 -q --quiet suppress output
420 -q --quiet suppress output
421 -v --verbose enable additional output
421 -v --verbose enable additional output
422 --color TYPE when to colorize (boolean, always, auto, never, or
422 --color TYPE when to colorize (boolean, always, auto, never, or
423 debug)
423 debug)
424 --config CONFIG [+] set/override config option (use 'section.name=value')
424 --config CONFIG [+] set/override config option (use 'section.name=value')
425 --debug enable debugging output
425 --debug enable debugging output
426 --debugger start debugger
426 --debugger start debugger
427 --encoding ENCODE set the charset encoding (default: ascii)
427 --encoding ENCODE set the charset encoding (default: ascii)
428 --encodingmode MODE set the charset encoding mode (default: strict)
428 --encodingmode MODE set the charset encoding mode (default: strict)
429 --traceback always print a traceback on exception
429 --traceback always print a traceback on exception
430 --time time how long the command takes
430 --time time how long the command takes
431 --profile print command execution profile
431 --profile print command execution profile
432 --version output version information and exit
432 --version output version information and exit
433 -h --help display help and exit
433 -h --help display help and exit
434 --hidden consider hidden changesets
434 --hidden consider hidden changesets
435 --pager TYPE when to paginate (boolean, always, auto, or never)
435 --pager TYPE when to paginate (boolean, always, auto, or never)
436 (default: auto)
436 (default: auto)
437
437
438 Test the textwidth config option
438 Test the textwidth config option
439
439
440 $ hg root -h --config ui.textwidth=50
440 $ hg root -h --config ui.textwidth=50
441 hg root
441 hg root
442
442
443 print the root (top) of the current working
443 print the root (top) of the current working
444 directory
444 directory
445
445
446 Print the root directory of the current
446 Print the root directory of the current
447 repository.
447 repository.
448
448
449 Returns 0 on success.
449 Returns 0 on success.
450
450
451 (some details hidden, use --verbose to show
451 (some details hidden, use --verbose to show
452 complete help)
452 complete help)
453
453
454 Test help option with version option
454 Test help option with version option
455
455
456 $ hg add -h --version
456 $ hg add -h --version
457 Mercurial Distributed SCM (version *) (glob)
457 Mercurial Distributed SCM (version *) (glob)
458 (see https://mercurial-scm.org for more information)
458 (see https://mercurial-scm.org for more information)
459
459
460 Copyright (C) 2005-* Matt Mackall and others (glob)
460 Copyright (C) 2005-* Matt Mackall and others (glob)
461 This is free software; see the source for copying conditions. There is NO
461 This is free software; see the source for copying conditions. There is NO
462 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
462 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
463
463
464 $ hg add --skjdfks
464 $ hg add --skjdfks
465 hg add: option --skjdfks not recognized
465 hg add: option --skjdfks not recognized
466 hg add [OPTION]... [FILE]...
466 hg add [OPTION]... [FILE]...
467
467
468 add the specified files on the next commit
468 add the specified files on the next commit
469
469
470 options ([+] can be repeated):
470 options ([+] can be repeated):
471
471
472 -I --include PATTERN [+] include names matching the given patterns
472 -I --include PATTERN [+] include names matching the given patterns
473 -X --exclude PATTERN [+] exclude names matching the given patterns
473 -X --exclude PATTERN [+] exclude names matching the given patterns
474 -S --subrepos recurse into subrepositories
474 -S --subrepos recurse into subrepositories
475 -n --dry-run do not perform actions, just print output
475 -n --dry-run do not perform actions, just print output
476
476
477 (use 'hg add -h' to show more help)
477 (use 'hg add -h' to show more help)
478 [255]
478 [255]
479
479
480 Test ambiguous command help
480 Test ambiguous command help
481
481
482 $ hg help ad
482 $ hg help ad
483 list of commands:
483 list of commands:
484
484
485 add add the specified files on the next commit
485 add add the specified files on the next commit
486 addremove add all new files, delete all missing files
486 addremove add all new files, delete all missing files
487
487
488 (use 'hg help -v ad' to show built-in aliases and global options)
488 (use 'hg help -v ad' to show built-in aliases and global options)
489
489
490 Test command without options
490 Test command without options
491
491
492 $ hg help verify
492 $ hg help verify
493 hg verify
493 hg verify
494
494
495 verify the integrity of the repository
495 verify the integrity of the repository
496
496
497 Verify the integrity of the current repository.
497 Verify the integrity of the current repository.
498
498
499 This will perform an extensive check of the repository's integrity,
499 This will perform an extensive check of the repository's integrity,
500 validating the hashes and checksums of each entry in the changelog,
500 validating the hashes and checksums of each entry in the changelog,
501 manifest, and tracked files, as well as the integrity of their crosslinks
501 manifest, and tracked files, as well as the integrity of their crosslinks
502 and indices.
502 and indices.
503
503
504 Please see https://mercurial-scm.org/wiki/RepositoryCorruption for more
504 Please see https://mercurial-scm.org/wiki/RepositoryCorruption for more
505 information about recovery from corruption of the repository.
505 information about recovery from corruption of the repository.
506
506
507 Returns 0 on success, 1 if errors are encountered.
507 Returns 0 on success, 1 if errors are encountered.
508
508
509 (some details hidden, use --verbose to show complete help)
509 (some details hidden, use --verbose to show complete help)
510
510
511 $ hg help diff
511 $ hg help diff
512 hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
512 hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
513
513
514 diff repository (or selected files)
514 diff repository (or selected files)
515
515
516 Show differences between revisions for the specified files.
516 Show differences between revisions for the specified files.
517
517
518 Differences between files are shown using the unified diff format.
518 Differences between files are shown using the unified diff format.
519
519
520 Note:
520 Note:
521 'hg diff' may generate unexpected results for merges, as it will
521 'hg diff' may generate unexpected results for merges, as it will
522 default to comparing against the working directory's first parent
522 default to comparing against the working directory's first parent
523 changeset if no revisions are specified.
523 changeset if no revisions are specified.
524
524
525 When two revision arguments are given, then changes are shown between
525 When two revision arguments are given, then changes are shown between
526 those revisions. If only one revision is specified then that revision is
526 those revisions. If only one revision is specified then that revision is
527 compared to the working directory, and, when no revisions are specified,
527 compared to the working directory, and, when no revisions are specified,
528 the working directory files are compared to its first parent.
528 the working directory files are compared to its first parent.
529
529
530 Alternatively you can specify -c/--change with a revision to see the
530 Alternatively you can specify -c/--change with a revision to see the
531 changes in that changeset relative to its first parent.
531 changes in that changeset relative to its first parent.
532
532
533 Without the -a/--text option, diff will avoid generating diffs of files it
533 Without the -a/--text option, diff will avoid generating diffs of files it
534 detects as binary. With -a, diff will generate a diff anyway, probably
534 detects as binary. With -a, diff will generate a diff anyway, probably
535 with undesirable results.
535 with undesirable results.
536
536
537 Use the -g/--git option to generate diffs in the git extended diff format.
537 Use the -g/--git option to generate diffs in the git extended diff format.
538 For more information, read 'hg help diffs'.
538 For more information, read 'hg help diffs'.
539
539
540 Returns 0 on success.
540 Returns 0 on success.
541
541
542 options ([+] can be repeated):
542 options ([+] can be repeated):
543
543
544 -r --rev REV [+] revision
544 -r --rev REV [+] revision
545 -c --change REV change made by revision
545 -c --change REV change made by revision
546 -a --text treat all files as text
546 -a --text treat all files as text
547 -g --git use git extended diff format
547 -g --git use git extended diff format
548 --binary generate binary diffs in git mode (default)
548 --binary generate binary diffs in git mode (default)
549 --nodates omit dates from diff headers
549 --nodates omit dates from diff headers
550 --noprefix omit a/ and b/ prefixes from filenames
550 --noprefix omit a/ and b/ prefixes from filenames
551 -p --show-function show which function each change is in
551 -p --show-function show which function each change is in
552 --reverse produce a diff that undoes the changes
552 --reverse produce a diff that undoes the changes
553 -w --ignore-all-space ignore white space when comparing lines
553 -w --ignore-all-space ignore white space when comparing lines
554 -b --ignore-space-change ignore changes in the amount of white space
554 -b --ignore-space-change ignore changes in the amount of white space
555 -B --ignore-blank-lines ignore changes whose lines are all blank
555 -B --ignore-blank-lines ignore changes whose lines are all blank
556 -U --unified NUM number of lines of context to show
556 -U --unified NUM number of lines of context to show
557 --stat output diffstat-style summary of changes
557 --stat output diffstat-style summary of changes
558 --root DIR produce diffs relative to subdirectory
558 --root DIR produce diffs relative to subdirectory
559 -I --include PATTERN [+] include names matching the given patterns
559 -I --include PATTERN [+] include names matching the given patterns
560 -X --exclude PATTERN [+] exclude names matching the given patterns
560 -X --exclude PATTERN [+] exclude names matching the given patterns
561 -S --subrepos recurse into subrepositories
561 -S --subrepos recurse into subrepositories
562
562
563 (some details hidden, use --verbose to show complete help)
563 (some details hidden, use --verbose to show complete help)
564
564
565 $ hg help status
565 $ hg help status
566 hg status [OPTION]... [FILE]...
566 hg status [OPTION]... [FILE]...
567
567
568 aliases: st
568 aliases: st
569
569
570 show changed files in the working directory
570 show changed files in the working directory
571
571
572 Show status of files in the repository. If names are given, only files
572 Show status of files in the repository. If names are given, only files
573 that match are shown. Files that are clean or ignored or the source of a
573 that match are shown. Files that are clean or ignored or the source of a
574 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
574 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
575 -C/--copies or -A/--all are given. Unless options described with "show
575 -C/--copies or -A/--all are given. Unless options described with "show
576 only ..." are given, the options -mardu are used.
576 only ..." are given, the options -mardu are used.
577
577
578 Option -q/--quiet hides untracked (unknown and ignored) files unless
578 Option -q/--quiet hides untracked (unknown and ignored) files unless
579 explicitly requested with -u/--unknown or -i/--ignored.
579 explicitly requested with -u/--unknown or -i/--ignored.
580
580
581 Note:
581 Note:
582 'hg status' may appear to disagree with diff if permissions have
582 'hg status' may appear to disagree with diff if permissions have
583 changed or a merge has occurred. The standard diff format does not
583 changed or a merge has occurred. The standard diff format does not
584 report permission changes and diff only reports changes relative to one
584 report permission changes and diff only reports changes relative to one
585 merge parent.
585 merge parent.
586
586
587 If one revision is given, it is used as the base revision. If two
587 If one revision is given, it is used as the base revision. If two
588 revisions are given, the differences between them are shown. The --change
588 revisions are given, the differences between them are shown. The --change
589 option can also be used as a shortcut to list the changed files of a
589 option can also be used as a shortcut to list the changed files of a
590 revision from its first parent.
590 revision from its first parent.
591
591
592 The codes used to show the status of files are:
592 The codes used to show the status of files are:
593
593
594 M = modified
594 M = modified
595 A = added
595 A = added
596 R = removed
596 R = removed
597 C = clean
597 C = clean
598 ! = missing (deleted by non-hg command, but still tracked)
598 ! = missing (deleted by non-hg command, but still tracked)
599 ? = not tracked
599 ? = not tracked
600 I = ignored
600 I = ignored
601 = origin of the previous file (with --copies)
601 = origin of the previous file (with --copies)
602
602
603 Returns 0 on success.
603 Returns 0 on success.
604
604
605 options ([+] can be repeated):
605 options ([+] can be repeated):
606
606
607 -A --all show status of all files
607 -A --all show status of all files
608 -m --modified show only modified files
608 -m --modified show only modified files
609 -a --added show only added files
609 -a --added show only added files
610 -r --removed show only removed files
610 -r --removed show only removed files
611 -d --deleted show only deleted (but tracked) files
611 -d --deleted show only deleted (but tracked) files
612 -c --clean show only files without changes
612 -c --clean show only files without changes
613 -u --unknown show only unknown (not tracked) files
613 -u --unknown show only unknown (not tracked) files
614 -i --ignored show only ignored files
614 -i --ignored show only ignored files
615 -n --no-status hide status prefix
615 -n --no-status hide status prefix
616 -C --copies show source of copied files
616 -C --copies show source of copied files
617 -0 --print0 end filenames with NUL, for use with xargs
617 -0 --print0 end filenames with NUL, for use with xargs
618 --rev REV [+] show difference from revision
618 --rev REV [+] show difference from revision
619 --change REV list the changed files of a revision
619 --change REV list the changed files of a revision
620 -I --include PATTERN [+] include names matching the given patterns
620 -I --include PATTERN [+] include names matching the given patterns
621 -X --exclude PATTERN [+] exclude names matching the given patterns
621 -X --exclude PATTERN [+] exclude names matching the given patterns
622 -S --subrepos recurse into subrepositories
622 -S --subrepos recurse into subrepositories
623
623
624 (some details hidden, use --verbose to show complete help)
624 (some details hidden, use --verbose to show complete help)
625
625
626 $ hg -q help status
626 $ hg -q help status
627 hg status [OPTION]... [FILE]...
627 hg status [OPTION]... [FILE]...
628
628
629 show changed files in the working directory
629 show changed files in the working directory
630
630
631 $ hg help foo
631 $ hg help foo
632 abort: no such help topic: foo
632 abort: no such help topic: foo
633 (try 'hg help --keyword foo')
633 (try 'hg help --keyword foo')
634 [255]
634 [255]
635
635
636 $ hg skjdfks
636 $ hg skjdfks
637 hg: unknown command 'skjdfks'
637 hg: unknown command 'skjdfks'
638 Mercurial Distributed SCM
638 Mercurial Distributed SCM
639
639
640 basic commands:
640 basic commands:
641
641
642 add add the specified files on the next commit
642 add add the specified files on the next commit
643 annotate show changeset information by line for each file
643 annotate show changeset information by line for each file
644 clone make a copy of an existing repository
644 clone make a copy of an existing repository
645 commit commit the specified files or all outstanding changes
645 commit commit the specified files or all outstanding changes
646 diff diff repository (or selected files)
646 diff diff repository (or selected files)
647 export dump the header and diffs for one or more changesets
647 export dump the header and diffs for one or more changesets
648 forget forget the specified files on the next commit
648 forget forget the specified files on the next commit
649 init create a new repository in the given directory
649 init create a new repository in the given directory
650 log show revision history of entire repository or files
650 log show revision history of entire repository or files
651 merge merge another revision into working directory
651 merge merge another revision into working directory
652 pull pull changes from the specified source
652 pull pull changes from the specified source
653 push push changes to the specified destination
653 push push changes to the specified destination
654 remove remove the specified files on the next commit
654 remove remove the specified files on the next commit
655 serve start stand-alone webserver
655 serve start stand-alone webserver
656 status show changed files in the working directory
656 status show changed files in the working directory
657 summary summarize working directory state
657 summary summarize working directory state
658 update update working directory (or switch revisions)
658 update update working directory (or switch revisions)
659
659
660 (use 'hg help' for the full list of commands or 'hg -v' for details)
660 (use 'hg help' for the full list of commands or 'hg -v' for details)
661 [255]
661 [255]
662
662
663
663
664 Make sure that we don't run afoul of the help system thinking that
664 Make sure that we don't run afoul of the help system thinking that
665 this is a section and erroring out weirdly.
665 this is a section and erroring out weirdly.
666
666
667 $ hg .log
667 $ hg .log
668 hg: unknown command '.log'
668 hg: unknown command '.log'
669 (did you mean log?)
669 (did you mean log?)
670 [255]
670 [255]
671
671
672 $ hg log.
672 $ hg log.
673 hg: unknown command 'log.'
673 hg: unknown command 'log.'
674 (did you mean log?)
674 (did you mean log?)
675 [255]
675 [255]
676 $ hg pu.lh
676 $ hg pu.lh
677 hg: unknown command 'pu.lh'
677 hg: unknown command 'pu.lh'
678 (did you mean one of pull, push?)
678 (did you mean one of pull, push?)
679 [255]
679 [255]
680
680
681 $ cat > helpext.py <<EOF
681 $ cat > helpext.py <<EOF
682 > import os
682 > import os
683 > from mercurial import cmdutil, commands
683 > from mercurial import cmdutil, commands
684 >
684 >
685 > cmdtable = {}
685 > cmdtable = {}
686 > command = cmdutil.command(cmdtable)
686 > command = cmdutil.command(cmdtable)
687 >
687 >
688 > @command('nohelp',
688 > @command('nohelp',
689 > [('', 'longdesc', 3, 'x'*90),
689 > [('', 'longdesc', 3, 'x'*90),
690 > ('n', '', None, 'normal desc'),
690 > ('n', '', None, 'normal desc'),
691 > ('', 'newline', '', 'line1\nline2')],
691 > ('', 'newline', '', 'line1\nline2')],
692 > 'hg nohelp',
692 > 'hg nohelp',
693 > norepo=True)
693 > norepo=True)
694 > @command('debugoptADV', [('', 'aopt', None, 'option is (ADVANCED)')])
694 > @command('debugoptADV', [('', 'aopt', None, 'option is (ADVANCED)')])
695 > @command('debugoptDEP', [('', 'dopt', None, 'option is (DEPRECATED)')])
695 > @command('debugoptDEP', [('', 'dopt', None, 'option is (DEPRECATED)')])
696 > @command('debugoptEXP', [('', 'eopt', None, 'option is (EXPERIMENTAL)')])
696 > @command('debugoptEXP', [('', 'eopt', None, 'option is (EXPERIMENTAL)')])
697 > def nohelp(ui, *args, **kwargs):
697 > def nohelp(ui, *args, **kwargs):
698 > pass
698 > pass
699 >
699 >
700 > def uisetup(ui):
700 > def uisetup(ui):
701 > ui.setconfig('alias', 'shellalias', '!echo hi', 'helpext')
701 > ui.setconfig('alias', 'shellalias', '!echo hi', 'helpext')
702 > ui.setconfig('alias', 'hgalias', 'summary', 'helpext')
702 > ui.setconfig('alias', 'hgalias', 'summary', 'helpext')
703 >
703 >
704 > EOF
704 > EOF
705 $ echo '[extensions]' >> $HGRCPATH
705 $ echo '[extensions]' >> $HGRCPATH
706 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
706 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
707
707
708 Test for aliases
708 Test for aliases
709
709
710 $ hg help hgalias
710 $ hg help hgalias
711 hg hgalias [--remote]
711 hg hgalias [--remote]
712
712
713 alias for: hg summary
713 alias for: hg summary
714
714
715 summarize working directory state
715 summarize working directory state
716
716
717 This generates a brief summary of the working directory state, including
717 This generates a brief summary of the working directory state, including
718 parents, branch, commit status, phase and available updates.
718 parents, branch, commit status, phase and available updates.
719
719
720 With the --remote option, this will check the default paths for incoming
720 With the --remote option, this will check the default paths for incoming
721 and outgoing changes. This can be time-consuming.
721 and outgoing changes. This can be time-consuming.
722
722
723 Returns 0 on success.
723 Returns 0 on success.
724
724
725 defined by: helpext
725 defined by: helpext
726
726
727 options:
727 options:
728
728
729 --remote check for push and pull
729 --remote check for push and pull
730
730
731 (some details hidden, use --verbose to show complete help)
731 (some details hidden, use --verbose to show complete help)
732
732
733 $ hg help shellalias
733 $ hg help shellalias
734 hg shellalias
734 hg shellalias
735
735
736 shell alias for:
736 shell alias for:
737
737
738 echo hi
738 echo hi
739
739
740 defined by: helpext
740 defined by: helpext
741
741
742 (some details hidden, use --verbose to show complete help)
742 (some details hidden, use --verbose to show complete help)
743
743
744 Test command with no help text
744 Test command with no help text
745
745
746 $ hg help nohelp
746 $ hg help nohelp
747 hg nohelp
747 hg nohelp
748
748
749 (no help text available)
749 (no help text available)
750
750
751 options:
751 options:
752
752
753 --longdesc VALUE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
753 --longdesc VALUE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
754 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (default: 3)
754 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (default: 3)
755 -n -- normal desc
755 -n -- normal desc
756 --newline VALUE line1 line2
756 --newline VALUE line1 line2
757
757
758 (some details hidden, use --verbose to show complete help)
758 (some details hidden, use --verbose to show complete help)
759
759
760 $ hg help -k nohelp
760 $ hg help -k nohelp
761 Commands:
761 Commands:
762
762
763 nohelp hg nohelp
763 nohelp hg nohelp
764
764
765 Extension Commands:
765 Extension Commands:
766
766
767 nohelp (no help text available)
767 nohelp (no help text available)
768
768
769 Test that default list of commands omits extension commands
769 Test that default list of commands omits extension commands
770
770
771 $ hg help
771 $ hg help
772 Mercurial Distributed SCM
772 Mercurial Distributed SCM
773
773
774 list of commands:
774 list of commands:
775
775
776 add add the specified files on the next commit
776 add add the specified files on the next commit
777 addremove add all new files, delete all missing files
777 addremove add all new files, delete all missing files
778 annotate show changeset information by line for each file
778 annotate show changeset information by line for each file
779 archive create an unversioned archive of a repository revision
779 archive create an unversioned archive of a repository revision
780 backout reverse effect of earlier changeset
780 backout reverse effect of earlier changeset
781 bisect subdivision search of changesets
781 bisect subdivision search of changesets
782 bookmarks create a new bookmark or list existing bookmarks
782 bookmarks create a new bookmark or list existing bookmarks
783 branch set or show the current branch name
783 branch set or show the current branch name
784 branches list repository named branches
784 branches list repository named branches
785 bundle create a bundle file
785 bundle create a bundle file
786 cat output the current or given revision of files
786 cat output the current or given revision of files
787 clone make a copy of an existing repository
787 clone make a copy of an existing repository
788 commit commit the specified files or all outstanding changes
788 commit commit the specified files or all outstanding changes
789 config show combined config settings from all hgrc files
789 config show combined config settings from all hgrc files
790 copy mark files as copied for the next commit
790 copy mark files as copied for the next commit
791 diff diff repository (or selected files)
791 diff diff repository (or selected files)
792 export dump the header and diffs for one or more changesets
792 export dump the header and diffs for one or more changesets
793 files list tracked files
793 files list tracked files
794 forget forget the specified files on the next commit
794 forget forget the specified files on the next commit
795 graft copy changes from other branches onto the current branch
795 graft copy changes from other branches onto the current branch
796 grep search revision history for a pattern in specified files
796 grep search revision history for a pattern in specified files
797 heads show branch heads
797 heads show branch heads
798 help show help for a given topic or a help overview
798 help show help for a given topic or a help overview
799 identify identify the working directory or specified revision
799 identify identify the working directory or specified revision
800 import import an ordered set of patches
800 import import an ordered set of patches
801 incoming show new changesets found in source
801 incoming show new changesets found in source
802 init create a new repository in the given directory
802 init create a new repository in the given directory
803 log show revision history of entire repository or files
803 log show revision history of entire repository or files
804 manifest output the current or given revision of the project manifest
804 manifest output the current or given revision of the project manifest
805 merge merge another revision into working directory
805 merge merge another revision into working directory
806 outgoing show changesets not found in the destination
806 outgoing show changesets not found in the destination
807 paths show aliases for remote repositories
807 paths show aliases for remote repositories
808 phase set or show the current phase name
808 phase set or show the current phase name
809 pull pull changes from the specified source
809 pull pull changes from the specified source
810 push push changes to the specified destination
810 push push changes to the specified destination
811 recover roll back an interrupted transaction
811 recover roll back an interrupted transaction
812 remove remove the specified files on the next commit
812 remove remove the specified files on the next commit
813 rename rename files; equivalent of copy + remove
813 rename rename files; equivalent of copy + remove
814 resolve redo merges or set/view the merge status of files
814 resolve redo merges or set/view the merge status of files
815 revert restore files to their checkout state
815 revert restore files to their checkout state
816 root print the root (top) of the current working directory
816 root print the root (top) of the current working directory
817 serve start stand-alone webserver
817 serve start stand-alone webserver
818 status show changed files in the working directory
818 status show changed files in the working directory
819 summary summarize working directory state
819 summary summarize working directory state
820 tag add one or more tags for the current or given revision
820 tag add one or more tags for the current or given revision
821 tags list repository tags
821 tags list repository tags
822 unbundle apply one or more bundle files
822 unbundle apply one or more bundle files
823 update update working directory (or switch revisions)
823 update update working directory (or switch revisions)
824 verify verify the integrity of the repository
824 verify verify the integrity of the repository
825 version output version and copyright information
825 version output version and copyright information
826
826
827 enabled extensions:
827 enabled extensions:
828
828
829 helpext (no help text available)
829 helpext (no help text available)
830
830
831 additional help topics:
831 additional help topics:
832
832
833 bundlespec Bundle File Formats
833 bundlespec Bundle File Formats
834 color Colorizing Outputs
834 color Colorizing Outputs
835 config Configuration Files
835 config Configuration Files
836 dates Date Formats
836 dates Date Formats
837 diffs Diff Formats
837 diffs Diff Formats
838 environment Environment Variables
838 environment Environment Variables
839 extensions Using Additional Features
839 extensions Using Additional Features
840 filesets Specifying File Sets
840 filesets Specifying File Sets
841 glossary Glossary
841 glossary Glossary
842 hgignore Syntax for Mercurial Ignore Files
842 hgignore Syntax for Mercurial Ignore Files
843 hgweb Configuring hgweb
843 hgweb Configuring hgweb
844 internals Technical implementation topics
844 internals Technical implementation topics
845 merge-tools Merge Tools
845 merge-tools Merge Tools
846 pager Pager Support
846 pager Pager Support
847 patterns File Name Patterns
847 patterns File Name Patterns
848 phases Working with Phases
848 phases Working with Phases
849 revisions Specifying Revisions
849 revisions Specifying Revisions
850 scripting Using Mercurial from scripts and automation
850 scripting Using Mercurial from scripts and automation
851 subrepos Subrepositories
851 subrepos Subrepositories
852 templating Template Usage
852 templating Template Usage
853 urls URL Paths
853 urls URL Paths
854
854
855 (use 'hg help -v' to show built-in aliases and global options)
855 (use 'hg help -v' to show built-in aliases and global options)
856
856
857
857
858 Test list of internal help commands
858 Test list of internal help commands
859
859
860 $ hg help debug
860 $ hg help debug
861 debug commands (internal and unsupported):
861 debug commands (internal and unsupported):
862
862
863 debugancestor
863 debugancestor
864 find the ancestor revision of two revisions in a given index
864 find the ancestor revision of two revisions in a given index
865 debugapplystreamclonebundle
865 debugapplystreamclonebundle
866 apply a stream clone bundle file
866 apply a stream clone bundle file
867 debugbuilddag
867 debugbuilddag
868 builds a repo with a given DAG from scratch in the current
868 builds a repo with a given DAG from scratch in the current
869 empty repo
869 empty repo
870 debugbundle lists the contents of a bundle
870 debugbundle lists the contents of a bundle
871 debugcheckstate
871 debugcheckstate
872 validate the correctness of the current dirstate
872 validate the correctness of the current dirstate
873 debugcolor show available color, effects or style
873 debugcolor show available color, effects or style
874 debugcommands
874 debugcommands
875 list all available commands and options
875 list all available commands and options
876 debugcomplete
876 debugcomplete
877 returns the completion list associated with the given command
877 returns the completion list associated with the given command
878 debugcreatestreamclonebundle
878 debugcreatestreamclonebundle
879 create a stream clone bundle file
879 create a stream clone bundle file
880 debugdag format the changelog or an index DAG as a concise textual
880 debugdag format the changelog or an index DAG as a concise textual
881 description
881 description
882 debugdata dump the contents of a data file revision
882 debugdata dump the contents of a data file revision
883 debugdate parse and display a date
883 debugdate parse and display a date
884 debugdeltachain
884 debugdeltachain
885 dump information about delta chains in a revlog
885 dump information about delta chains in a revlog
886 debugdirstate
886 debugdirstate
887 show the contents of the current dirstate
887 show the contents of the current dirstate
888 debugdiscovery
888 debugdiscovery
889 runs the changeset discovery protocol in isolation
889 runs the changeset discovery protocol in isolation
890 debugextensions
890 debugextensions
891 show information about active extensions
891 show information about active extensions
892 debugfileset parse and apply a fileset specification
892 debugfileset parse and apply a fileset specification
893 debugfsinfo show information detected about current filesystem
893 debugfsinfo show information detected about current filesystem
894 debuggetbundle
894 debuggetbundle
895 retrieves a bundle from a repo
895 retrieves a bundle from a repo
896 debugignore display the combined ignore pattern and information about
896 debugignore display the combined ignore pattern and information about
897 ignored files
897 ignored files
898 debugindex dump the contents of an index file
898 debugindex dump the contents of an index file
899 debugindexdot
899 debugindexdot
900 dump an index DAG as a graphviz dot file
900 dump an index DAG as a graphviz dot file
901 debuginstall test Mercurial installation
901 debuginstall test Mercurial installation
902 debugknown test whether node ids are known to a repo
902 debugknown test whether node ids are known to a repo
903 debuglocks show or modify state of locks
903 debuglocks show or modify state of locks
904 debugmergestate
904 debugmergestate
905 print merge state
905 print merge state
906 debugnamecomplete
906 debugnamecomplete
907 complete "names" - tags, open branch names, bookmark names
907 complete "names" - tags, open branch names, bookmark names
908 debugobsolete
908 debugobsolete
909 create arbitrary obsolete marker
909 create arbitrary obsolete marker
910 debugoptADV (no help text available)
910 debugoptADV (no help text available)
911 debugoptDEP (no help text available)
911 debugoptDEP (no help text available)
912 debugoptEXP (no help text available)
912 debugoptEXP (no help text available)
913 debugpathcomplete
913 debugpathcomplete
914 complete part or all of a tracked path
914 complete part or all of a tracked path
915 debugpushkey access the pushkey key/value protocol
915 debugpushkey access the pushkey key/value protocol
916 debugpvec (no help text available)
916 debugpvec (no help text available)
917 debugrebuilddirstate
917 debugrebuilddirstate
918 rebuild the dirstate as it would look like for the given
918 rebuild the dirstate as it would look like for the given
919 revision
919 revision
920 debugrebuildfncache
920 debugrebuildfncache
921 rebuild the fncache file
921 rebuild the fncache file
922 debugrename dump rename information
922 debugrename dump rename information
923 debugrevlog show data and statistics about a revlog
923 debugrevlog show data and statistics about a revlog
924 debugrevspec parse and apply a revision specification
924 debugrevspec parse and apply a revision specification
925 debugsetparents
925 debugsetparents
926 manually set the parents of the current working directory
926 manually set the parents of the current working directory
927 debugsub (no help text available)
927 debugsub (no help text available)
928 debugsuccessorssets
928 debugsuccessorssets
929 show set of successors for revision
929 show set of successors for revision
930 debugtemplate
930 debugtemplate
931 parse and apply a template
931 parse and apply a template
932 debugupgraderepo
932 debugupgraderepo
933 upgrade a repository to use different features
933 upgrade a repository to use different features
934 debugwalk show how files match on given patterns
934 debugwalk show how files match on given patterns
935 debugwireargs
935 debugwireargs
936 (no help text available)
936 (no help text available)
937
937
938 (use 'hg help -v debug' to show built-in aliases and global options)
938 (use 'hg help -v debug' to show built-in aliases and global options)
939
939
940 internals topic renders index of available sub-topics
940 internals topic renders index of available sub-topics
941
941
942 $ hg help internals
942 $ hg help internals
943 Technical implementation topics
943 Technical implementation topics
944 """""""""""""""""""""""""""""""
944 """""""""""""""""""""""""""""""
945
945
946 To access a subtopic, use "hg help internals.{subtopic-name}"
946 To access a subtopic, use "hg help internals.{subtopic-name}"
947
947
948 bundles Bundles
948 bundles Bundles
949 censor Censor
949 censor Censor
950 changegroups Changegroups
950 changegroups Changegroups
951 requirements Repository Requirements
951 requirements Repository Requirements
952 revlogs Revision Logs
952 revlogs Revision Logs
953 wireprotocol Wire Protocol
953 wireprotocol Wire Protocol
954
954
955 sub-topics can be accessed
955 sub-topics can be accessed
956
956
957 $ hg help internals.changegroups
957 $ hg help internals.changegroups
958 Changegroups
958 Changegroups
959 """"""""""""
959 """"""""""""
960
960
961 Changegroups are representations of repository revlog data, specifically
961 Changegroups are representations of repository revlog data, specifically
962 the changelog data, root/flat manifest data, treemanifest data, and
962 the changelog data, root/flat manifest data, treemanifest data, and
963 filelogs.
963 filelogs.
964
964
965 There are 3 versions of changegroups: "1", "2", and "3". From a high-
965 There are 3 versions of changegroups: "1", "2", and "3". From a high-
966 level, versions "1" and "2" are almost exactly the same, with the only
966 level, versions "1" and "2" are almost exactly the same, with the only
967 difference being an additional item in the *delta header*. Version "3"
967 difference being an additional item in the *delta header*. Version "3"
968 adds support for revlog flags in the *delta header* and optionally
968 adds support for revlog flags in the *delta header* and optionally
969 exchanging treemanifests (enabled by setting an option on the
969 exchanging treemanifests (enabled by setting an option on the
970 "changegroup" part in the bundle2).
970 "changegroup" part in the bundle2).
971
971
972 Changegroups when not exchanging treemanifests consist of 3 logical
972 Changegroups when not exchanging treemanifests consist of 3 logical
973 segments:
973 segments:
974
974
975 +---------------------------------+
975 +---------------------------------+
976 | | | |
976 | | | |
977 | changeset | manifest | filelogs |
977 | changeset | manifest | filelogs |
978 | | | |
978 | | | |
979 | | | |
979 | | | |
980 +---------------------------------+
980 +---------------------------------+
981
981
982 When exchanging treemanifests, there are 4 logical segments:
982 When exchanging treemanifests, there are 4 logical segments:
983
983
984 +-------------------------------------------------+
984 +-------------------------------------------------+
985 | | | | |
985 | | | | |
986 | changeset | root | treemanifests | filelogs |
986 | changeset | root | treemanifests | filelogs |
987 | | manifest | | |
987 | | manifest | | |
988 | | | | |
988 | | | | |
989 +-------------------------------------------------+
989 +-------------------------------------------------+
990
990
991 The principle building block of each segment is a *chunk*. A *chunk* is a
991 The principle building block of each segment is a *chunk*. A *chunk* is a
992 framed piece of data:
992 framed piece of data:
993
993
994 +---------------------------------------+
994 +---------------------------------------+
995 | | |
995 | | |
996 | length | data |
996 | length | data |
997 | (4 bytes) | (<length - 4> bytes) |
997 | (4 bytes) | (<length - 4> bytes) |
998 | | |
998 | | |
999 +---------------------------------------+
999 +---------------------------------------+
1000
1000
1001 All integers are big-endian signed integers. Each chunk starts with a
1001 All integers are big-endian signed integers. Each chunk starts with a
1002 32-bit integer indicating the length of the entire chunk (including the
1002 32-bit integer indicating the length of the entire chunk (including the
1003 length field itself).
1003 length field itself).
1004
1004
1005 There is a special case chunk that has a value of 0 for the length
1005 There is a special case chunk that has a value of 0 for the length
1006 ("0x00000000"). We call this an *empty chunk*.
1006 ("0x00000000"). We call this an *empty chunk*.
1007
1007
1008 Delta Groups
1008 Delta Groups
1009 ============
1009 ============
1010
1010
1011 A *delta group* expresses the content of a revlog as a series of deltas,
1011 A *delta group* expresses the content of a revlog as a series of deltas,
1012 or patches against previous revisions.
1012 or patches against previous revisions.
1013
1013
1014 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
1014 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
1015 to signal the end of the delta group:
1015 to signal the end of the delta group:
1016
1016
1017 +------------------------------------------------------------------------+
1017 +------------------------------------------------------------------------+
1018 | | | | | |
1018 | | | | | |
1019 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
1019 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
1020 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
1020 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
1021 | | | | | |
1021 | | | | | |
1022 +------------------------------------------------------------------------+
1022 +------------------------------------------------------------------------+
1023
1023
1024 Each *chunk*'s data consists of the following:
1024 Each *chunk*'s data consists of the following:
1025
1025
1026 +---------------------------------------+
1026 +---------------------------------------+
1027 | | |
1027 | | |
1028 | delta header | delta data |
1028 | delta header | delta data |
1029 | (various by version) | (various) |
1029 | (various by version) | (various) |
1030 | | |
1030 | | |
1031 +---------------------------------------+
1031 +---------------------------------------+
1032
1032
1033 The *delta data* is a series of *delta*s that describe a diff from an
1033 The *delta data* is a series of *delta*s that describe a diff from an
1034 existing entry (either that the recipient already has, or previously
1034 existing entry (either that the recipient already has, or previously
1035 specified in the bundle/changegroup).
1035 specified in the bundle/changegroup).
1036
1036
1037 The *delta header* is different between versions "1", "2", and "3" of the
1037 The *delta header* is different between versions "1", "2", and "3" of the
1038 changegroup format.
1038 changegroup format.
1039
1039
1040 Version 1 (headerlen=80):
1040 Version 1 (headerlen=80):
1041
1041
1042 +------------------------------------------------------+
1042 +------------------------------------------------------+
1043 | | | | |
1043 | | | | |
1044 | node | p1 node | p2 node | link node |
1044 | node | p1 node | p2 node | link node |
1045 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1045 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1046 | | | | |
1046 | | | | |
1047 +------------------------------------------------------+
1047 +------------------------------------------------------+
1048
1048
1049 Version 2 (headerlen=100):
1049 Version 2 (headerlen=100):
1050
1050
1051 +------------------------------------------------------------------+
1051 +------------------------------------------------------------------+
1052 | | | | | |
1052 | | | | | |
1053 | node | p1 node | p2 node | base node | link node |
1053 | node | p1 node | p2 node | base node | link node |
1054 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1054 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1055 | | | | | |
1055 | | | | | |
1056 +------------------------------------------------------------------+
1056 +------------------------------------------------------------------+
1057
1057
1058 Version 3 (headerlen=102):
1058 Version 3 (headerlen=102):
1059
1059
1060 +------------------------------------------------------------------------------+
1060 +------------------------------------------------------------------------------+
1061 | | | | | | |
1061 | | | | | | |
1062 | node | p1 node | p2 node | base node | link node | flags |
1062 | node | p1 node | p2 node | base node | link node | flags |
1063 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
1063 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
1064 | | | | | | |
1064 | | | | | | |
1065 +------------------------------------------------------------------------------+
1065 +------------------------------------------------------------------------------+
1066
1066
1067 The *delta data* consists of "chunklen - 4 - headerlen" bytes, which
1067 The *delta data* consists of "chunklen - 4 - headerlen" bytes, which
1068 contain a series of *delta*s, densely packed (no separators). These deltas
1068 contain a series of *delta*s, densely packed (no separators). These deltas
1069 describe a diff from an existing entry (either that the recipient already
1069 describe a diff from an existing entry (either that the recipient already
1070 has, or previously specified in the bundle/changegroup). The format is
1070 has, or previously specified in the bundle/changegroup). The format is
1071 described more fully in "hg help internals.bdiff", but briefly:
1071 described more fully in "hg help internals.bdiff", but briefly:
1072
1072
1073 +---------------------------------------------------------------+
1073 +---------------------------------------------------------------+
1074 | | | | |
1074 | | | | |
1075 | start offset | end offset | new length | content |
1075 | start offset | end offset | new length | content |
1076 | (4 bytes) | (4 bytes) | (4 bytes) | (<new length> bytes) |
1076 | (4 bytes) | (4 bytes) | (4 bytes) | (<new length> bytes) |
1077 | | | | |
1077 | | | | |
1078 +---------------------------------------------------------------+
1078 +---------------------------------------------------------------+
1079
1079
1080 Please note that the length field in the delta data does *not* include
1080 Please note that the length field in the delta data does *not* include
1081 itself.
1081 itself.
1082
1082
1083 In version 1, the delta is always applied against the previous node from
1083 In version 1, the delta is always applied against the previous node from
1084 the changegroup or the first parent if this is the first entry in the
1084 the changegroup or the first parent if this is the first entry in the
1085 changegroup.
1085 changegroup.
1086
1086
1087 In version 2 and up, the delta base node is encoded in the entry in the
1087 In version 2 and up, the delta base node is encoded in the entry in the
1088 changegroup. This allows the delta to be expressed against any parent,
1088 changegroup. This allows the delta to be expressed against any parent,
1089 which can result in smaller deltas and more efficient encoding of data.
1089 which can result in smaller deltas and more efficient encoding of data.
1090
1090
1091 Changeset Segment
1091 Changeset Segment
1092 =================
1092 =================
1093
1093
1094 The *changeset segment* consists of a single *delta group* holding
1094 The *changeset segment* consists of a single *delta group* holding
1095 changelog data. The *empty chunk* at the end of the *delta group* denotes
1095 changelog data. The *empty chunk* at the end of the *delta group* denotes
1096 the boundary to the *manifest segment*.
1096 the boundary to the *manifest segment*.
1097
1097
1098 Manifest Segment
1098 Manifest Segment
1099 ================
1099 ================
1100
1100
1101 The *manifest segment* consists of a single *delta group* holding manifest
1101 The *manifest segment* consists of a single *delta group* holding manifest
1102 data. If treemanifests are in use, it contains only the manifest for the
1102 data. If treemanifests are in use, it contains only the manifest for the
1103 root directory of the repository. Otherwise, it contains the entire
1103 root directory of the repository. Otherwise, it contains the entire
1104 manifest data. The *empty chunk* at the end of the *delta group* denotes
1104 manifest data. The *empty chunk* at the end of the *delta group* denotes
1105 the boundary to the next segment (either the *treemanifests segment* or
1105 the boundary to the next segment (either the *treemanifests segment* or
1106 the *filelogs segment*, depending on version and the request options).
1106 the *filelogs segment*, depending on version and the request options).
1107
1107
1108 Treemanifests Segment
1108 Treemanifests Segment
1109 ---------------------
1109 ---------------------
1110
1110
1111 The *treemanifests segment* only exists in changegroup version "3", and
1111 The *treemanifests segment* only exists in changegroup version "3", and
1112 only if the 'treemanifest' param is part of the bundle2 changegroup part
1112 only if the 'treemanifest' param is part of the bundle2 changegroup part
1113 (it is not possible to use changegroup version 3 outside of bundle2).
1113 (it is not possible to use changegroup version 3 outside of bundle2).
1114 Aside from the filenames in the *treemanifests segment* containing a
1114 Aside from the filenames in the *treemanifests segment* containing a
1115 trailing "/" character, it behaves identically to the *filelogs segment*
1115 trailing "/" character, it behaves identically to the *filelogs segment*
1116 (see below). The final sub-segment is followed by an *empty chunk*
1116 (see below). The final sub-segment is followed by an *empty chunk*
1117 (logically, a sub-segment with filename size 0). This denotes the boundary
1117 (logically, a sub-segment with filename size 0). This denotes the boundary
1118 to the *filelogs segment*.
1118 to the *filelogs segment*.
1119
1119
1120 Filelogs Segment
1120 Filelogs Segment
1121 ================
1121 ================
1122
1122
1123 The *filelogs segment* consists of multiple sub-segments, each
1123 The *filelogs segment* consists of multiple sub-segments, each
1124 corresponding to an individual file whose data is being described:
1124 corresponding to an individual file whose data is being described:
1125
1125
1126 +--------------------------------------------------+
1126 +--------------------------------------------------+
1127 | | | | | |
1127 | | | | | |
1128 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
1128 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
1129 | | | | | (4 bytes) |
1129 | | | | | (4 bytes) |
1130 | | | | | |
1130 | | | | | |
1131 +--------------------------------------------------+
1131 +--------------------------------------------------+
1132
1132
1133 The final filelog sub-segment is followed by an *empty chunk* (logically,
1133 The final filelog sub-segment is followed by an *empty chunk* (logically,
1134 a sub-segment with filename size 0). This denotes the end of the segment
1134 a sub-segment with filename size 0). This denotes the end of the segment
1135 and of the overall changegroup.
1135 and of the overall changegroup.
1136
1136
1137 Each filelog sub-segment consists of the following:
1137 Each filelog sub-segment consists of the following:
1138
1138
1139 +------------------------------------------------------+
1139 +------------------------------------------------------+
1140 | | | |
1140 | | | |
1141 | filename length | filename | delta group |
1141 | filename length | filename | delta group |
1142 | (4 bytes) | (<length - 4> bytes) | (various) |
1142 | (4 bytes) | (<length - 4> bytes) | (various) |
1143 | | | |
1143 | | | |
1144 +------------------------------------------------------+
1144 +------------------------------------------------------+
1145
1145
1146 That is, a *chunk* consisting of the filename (not terminated or padded)
1146 That is, a *chunk* consisting of the filename (not terminated or padded)
1147 followed by N chunks constituting the *delta group* for this file. The
1147 followed by N chunks constituting the *delta group* for this file. The
1148 *empty chunk* at the end of each *delta group* denotes the boundary to the
1148 *empty chunk* at the end of each *delta group* denotes the boundary to the
1149 next filelog sub-segment.
1149 next filelog sub-segment.
1150
1150
1151 Test list of commands with command with no help text
1151 Test list of commands with command with no help text
1152
1152
1153 $ hg help helpext
1153 $ hg help helpext
1154 helpext extension - no help text available
1154 helpext extension - no help text available
1155
1155
1156 list of commands:
1156 list of commands:
1157
1157
1158 nohelp (no help text available)
1158 nohelp (no help text available)
1159
1159
1160 (use 'hg help -v helpext' to show built-in aliases and global options)
1160 (use 'hg help -v helpext' to show built-in aliases and global options)
1161
1161
1162
1162
1163 test advanced, deprecated and experimental options are hidden in command help
1163 test advanced, deprecated and experimental options are hidden in command help
1164 $ hg help debugoptADV
1164 $ hg help debugoptADV
1165 hg debugoptADV
1165 hg debugoptADV
1166
1166
1167 (no help text available)
1167 (no help text available)
1168
1168
1169 options:
1169 options:
1170
1170
1171 (some details hidden, use --verbose to show complete help)
1171 (some details hidden, use --verbose to show complete help)
1172 $ hg help debugoptDEP
1172 $ hg help debugoptDEP
1173 hg debugoptDEP
1173 hg debugoptDEP
1174
1174
1175 (no help text available)
1175 (no help text available)
1176
1176
1177 options:
1177 options:
1178
1178
1179 (some details hidden, use --verbose to show complete help)
1179 (some details hidden, use --verbose to show complete help)
1180
1180
1181 $ hg help debugoptEXP
1181 $ hg help debugoptEXP
1182 hg debugoptEXP
1182 hg debugoptEXP
1183
1183
1184 (no help text available)
1184 (no help text available)
1185
1185
1186 options:
1186 options:
1187
1187
1188 (some details hidden, use --verbose to show complete help)
1188 (some details hidden, use --verbose to show complete help)
1189
1189
1190 test advanced, deprecated and experimental options are shown with -v
1190 test advanced, deprecated and experimental options are shown with -v
1191 $ hg help -v debugoptADV | grep aopt
1191 $ hg help -v debugoptADV | grep aopt
1192 --aopt option is (ADVANCED)
1192 --aopt option is (ADVANCED)
1193 $ hg help -v debugoptDEP | grep dopt
1193 $ hg help -v debugoptDEP | grep dopt
1194 --dopt option is (DEPRECATED)
1194 --dopt option is (DEPRECATED)
1195 $ hg help -v debugoptEXP | grep eopt
1195 $ hg help -v debugoptEXP | grep eopt
1196 --eopt option is (EXPERIMENTAL)
1196 --eopt option is (EXPERIMENTAL)
1197
1197
1198 #if gettext
1198 #if gettext
1199 test deprecated option is hidden with translation with untranslated description
1199 test deprecated option is hidden with translation with untranslated description
1200 (use many globy for not failing on changed transaction)
1200 (use many globy for not failing on changed transaction)
1201 $ LANGUAGE=sv hg help debugoptDEP
1201 $ LANGUAGE=sv hg help debugoptDEP
1202 hg debugoptDEP
1202 hg debugoptDEP
1203
1203
1204 (*) (glob)
1204 (*) (glob)
1205
1205
1206 options:
1206 options:
1207
1207
1208 (some details hidden, use --verbose to show complete help)
1208 (some details hidden, use --verbose to show complete help)
1209 #endif
1209 #endif
1210
1210
1211 Test commands that collide with topics (issue4240)
1211 Test commands that collide with topics (issue4240)
1212
1212
1213 $ hg config -hq
1213 $ hg config -hq
1214 hg config [-u] [NAME]...
1214 hg config [-u] [NAME]...
1215
1215
1216 show combined config settings from all hgrc files
1216 show combined config settings from all hgrc files
1217 $ hg showconfig -hq
1217 $ hg showconfig -hq
1218 hg config [-u] [NAME]...
1218 hg config [-u] [NAME]...
1219
1219
1220 show combined config settings from all hgrc files
1220 show combined config settings from all hgrc files
1221
1221
1222 Test a help topic
1222 Test a help topic
1223
1223
1224 $ hg help dates
1224 $ hg help dates
1225 Date Formats
1225 Date Formats
1226 """"""""""""
1226 """"""""""""
1227
1227
1228 Some commands allow the user to specify a date, e.g.:
1228 Some commands allow the user to specify a date, e.g.:
1229
1229
1230 - backout, commit, import, tag: Specify the commit date.
1230 - backout, commit, import, tag: Specify the commit date.
1231 - log, revert, update: Select revision(s) by date.
1231 - log, revert, update: Select revision(s) by date.
1232
1232
1233 Many date formats are valid. Here are some examples:
1233 Many date formats are valid. Here are some examples:
1234
1234
1235 - "Wed Dec 6 13:18:29 2006" (local timezone assumed)
1235 - "Wed Dec 6 13:18:29 2006" (local timezone assumed)
1236 - "Dec 6 13:18 -0600" (year assumed, time offset provided)
1236 - "Dec 6 13:18 -0600" (year assumed, time offset provided)
1237 - "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000)
1237 - "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000)
1238 - "Dec 6" (midnight)
1238 - "Dec 6" (midnight)
1239 - "13:18" (today assumed)
1239 - "13:18" (today assumed)
1240 - "3:39" (3:39AM assumed)
1240 - "3:39" (3:39AM assumed)
1241 - "3:39pm" (15:39)
1241 - "3:39pm" (15:39)
1242 - "2006-12-06 13:18:29" (ISO 8601 format)
1242 - "2006-12-06 13:18:29" (ISO 8601 format)
1243 - "2006-12-6 13:18"
1243 - "2006-12-6 13:18"
1244 - "2006-12-6"
1244 - "2006-12-6"
1245 - "12-6"
1245 - "12-6"
1246 - "12/6"
1246 - "12/6"
1247 - "12/6/6" (Dec 6 2006)
1247 - "12/6/6" (Dec 6 2006)
1248 - "today" (midnight)
1248 - "today" (midnight)
1249 - "yesterday" (midnight)
1249 - "yesterday" (midnight)
1250 - "now" - right now
1250 - "now" - right now
1251
1251
1252 Lastly, there is Mercurial's internal format:
1252 Lastly, there is Mercurial's internal format:
1253
1253
1254 - "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC)
1254 - "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC)
1255
1255
1256 This is the internal representation format for dates. The first number is
1256 This is the internal representation format for dates. The first number is
1257 the number of seconds since the epoch (1970-01-01 00:00 UTC). The second
1257 the number of seconds since the epoch (1970-01-01 00:00 UTC). The second
1258 is the offset of the local timezone, in seconds west of UTC (negative if
1258 is the offset of the local timezone, in seconds west of UTC (negative if
1259 the timezone is east of UTC).
1259 the timezone is east of UTC).
1260
1260
1261 The log command also accepts date ranges:
1261 The log command also accepts date ranges:
1262
1262
1263 - "<DATE" - at or before a given date/time
1263 - "<DATE" - at or before a given date/time
1264 - ">DATE" - on or after a given date/time
1264 - ">DATE" - on or after a given date/time
1265 - "DATE to DATE" - a date range, inclusive
1265 - "DATE to DATE" - a date range, inclusive
1266 - "-DAYS" - within a given number of days of today
1266 - "-DAYS" - within a given number of days of today
1267
1267
1268 Test repeated config section name
1268 Test repeated config section name
1269
1269
1270 $ hg help config.host
1270 $ hg help config.host
1271 "http_proxy.host"
1271 "http_proxy.host"
1272 Host name and (optional) port of the proxy server, for example
1272 Host name and (optional) port of the proxy server, for example
1273 "myproxy:8000".
1273 "myproxy:8000".
1274
1274
1275 "smtp.host"
1275 "smtp.host"
1276 Host name of mail server, e.g. "mail.example.com".
1276 Host name of mail server, e.g. "mail.example.com".
1277
1277
1278 Unrelated trailing paragraphs shouldn't be included
1278 Unrelated trailing paragraphs shouldn't be included
1279
1279
1280 $ hg help config.extramsg | grep '^$'
1280 $ hg help config.extramsg | grep '^$'
1281
1281
1282
1282
1283 Test capitalized section name
1283 Test capitalized section name
1284
1284
1285 $ hg help scripting.HGPLAIN > /dev/null
1285 $ hg help scripting.HGPLAIN > /dev/null
1286
1286
1287 Help subsection:
1287 Help subsection:
1288
1288
1289 $ hg help config.charsets |grep "Email example:" > /dev/null
1289 $ hg help config.charsets |grep "Email example:" > /dev/null
1290 [1]
1290 [1]
1291
1291
1292 Show nested definitions
1292 Show nested definitions
1293 ("profiling.type"[break]"ls"[break]"stat"[break])
1293 ("profiling.type"[break]"ls"[break]"stat"[break])
1294
1294
1295 $ hg help config.type | egrep '^$'|wc -l
1295 $ hg help config.type | egrep '^$'|wc -l
1296 \s*3 (re)
1296 \s*3 (re)
1297
1297
1298 Separate sections from subsections
1298 Separate sections from subsections
1299
1299
1300 $ hg help config.format | egrep '^ ("|-)|^\s*$' | uniq
1300 $ hg help config.format | egrep '^ ("|-)|^\s*$' | uniq
1301 "format"
1301 "format"
1302 --------
1302 --------
1303
1303
1304 "usegeneraldelta"
1304 "usegeneraldelta"
1305
1305
1306 "dotencode"
1306 "dotencode"
1307
1307
1308 "usefncache"
1308 "usefncache"
1309
1309
1310 "usestore"
1310 "usestore"
1311
1311
1312 "profiling"
1312 "profiling"
1313 -----------
1313 -----------
1314
1314
1315 "format"
1315 "format"
1316
1316
1317 "progress"
1317 "progress"
1318 ----------
1318 ----------
1319
1319
1320 "format"
1320 "format"
1321
1321
1322
1322
1323 Last item in help config.*:
1323 Last item in help config.*:
1324
1324
1325 $ hg help config.`hg help config|grep '^ "'| \
1325 $ hg help config.`hg help config|grep '^ "'| \
1326 > tail -1|sed 's![ "]*!!g'`| \
1326 > tail -1|sed 's![ "]*!!g'`| \
1327 > grep 'hg help -c config' > /dev/null
1327 > grep 'hg help -c config' > /dev/null
1328 [1]
1328 [1]
1329
1329
1330 note to use help -c for general hg help config:
1330 note to use help -c for general hg help config:
1331
1331
1332 $ hg help config |grep 'hg help -c config' > /dev/null
1332 $ hg help config |grep 'hg help -c config' > /dev/null
1333
1333
1334 Test templating help
1334 Test templating help
1335
1335
1336 $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
1336 $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
1337 desc String. The text of the changeset description.
1337 desc String. The text of the changeset description.
1338 diffstat String. Statistics of changes with the following format:
1338 diffstat String. Statistics of changes with the following format:
1339 firstline Any text. Returns the first line of text.
1339 firstline Any text. Returns the first line of text.
1340 nonempty Any text. Returns '(none)' if the string is empty.
1340 nonempty Any text. Returns '(none)' if the string is empty.
1341
1341
1342 Test deprecated items
1342 Test deprecated items
1343
1343
1344 $ hg help -v templating | grep currentbookmark
1344 $ hg help -v templating | grep currentbookmark
1345 currentbookmark
1345 currentbookmark
1346 $ hg help templating | (grep currentbookmark || true)
1346 $ hg help templating | (grep currentbookmark || true)
1347
1347
1348 Test help hooks
1348 Test help hooks
1349
1349
1350 $ cat > helphook1.py <<EOF
1350 $ cat > helphook1.py <<EOF
1351 > from mercurial import help
1351 > from mercurial import help
1352 >
1352 >
1353 > def rewrite(ui, topic, doc):
1353 > def rewrite(ui, topic, doc):
1354 > return doc + '\nhelphook1\n'
1354 > return doc + '\nhelphook1\n'
1355 >
1355 >
1356 > def extsetup(ui):
1356 > def extsetup(ui):
1357 > help.addtopichook('revisions', rewrite)
1357 > help.addtopichook('revisions', rewrite)
1358 > EOF
1358 > EOF
1359 $ cat > helphook2.py <<EOF
1359 $ cat > helphook2.py <<EOF
1360 > from mercurial import help
1360 > from mercurial import help
1361 >
1361 >
1362 > def rewrite(ui, topic, doc):
1362 > def rewrite(ui, topic, doc):
1363 > return doc + '\nhelphook2\n'
1363 > return doc + '\nhelphook2\n'
1364 >
1364 >
1365 > def extsetup(ui):
1365 > def extsetup(ui):
1366 > help.addtopichook('revisions', rewrite)
1366 > help.addtopichook('revisions', rewrite)
1367 > EOF
1367 > EOF
1368 $ echo '[extensions]' >> $HGRCPATH
1368 $ echo '[extensions]' >> $HGRCPATH
1369 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
1369 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
1370 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
1370 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
1371 $ hg help revsets | grep helphook
1371 $ hg help revsets | grep helphook
1372 helphook1
1372 helphook1
1373 helphook2
1373 helphook2
1374
1374
1375 help -c should only show debug --debug
1375 help -c should only show debug --debug
1376
1376
1377 $ hg help -c --debug|egrep debug|wc -l|egrep '^\s*0\s*$'
1377 $ hg help -c --debug|egrep debug|wc -l|egrep '^\s*0\s*$'
1378 [1]
1378 [1]
1379
1379
1380 help -c should only show deprecated for -v
1380 help -c should only show deprecated for -v
1381
1381
1382 $ hg help -c -v|egrep DEPRECATED|wc -l|egrep '^\s*0\s*$'
1382 $ hg help -c -v|egrep DEPRECATED|wc -l|egrep '^\s*0\s*$'
1383 [1]
1383 [1]
1384
1384
1385 Test -s / --system
1385 Test -s / --system
1386
1386
1387 $ hg help config.files -s windows |grep 'etc/mercurial' | \
1387 $ hg help config.files -s windows |grep 'etc/mercurial' | \
1388 > wc -l | sed -e 's/ //g'
1388 > wc -l | sed -e 's/ //g'
1389 0
1389 0
1390 $ hg help config.files --system unix | grep 'USER' | \
1390 $ hg help config.files --system unix | grep 'USER' | \
1391 > wc -l | sed -e 's/ //g'
1391 > wc -l | sed -e 's/ //g'
1392 0
1392 0
1393
1393
1394 Test -e / -c / -k combinations
1394 Test -e / -c / -k combinations
1395
1395
1396 $ hg help -c|egrep '^[A-Z].*:|^ debug'
1396 $ hg help -c|egrep '^[A-Z].*:|^ debug'
1397 Commands:
1397 Commands:
1398 $ hg help -e|egrep '^[A-Z].*:|^ debug'
1398 $ hg help -e|egrep '^[A-Z].*:|^ debug'
1399 Extensions:
1399 Extensions:
1400 $ hg help -k|egrep '^[A-Z].*:|^ debug'
1400 $ hg help -k|egrep '^[A-Z].*:|^ debug'
1401 Topics:
1401 Topics:
1402 Commands:
1402 Commands:
1403 Extensions:
1403 Extensions:
1404 Extension Commands:
1404 Extension Commands:
1405 $ hg help -c schemes
1405 $ hg help -c schemes
1406 abort: no such help topic: schemes
1406 abort: no such help topic: schemes
1407 (try 'hg help --keyword schemes')
1407 (try 'hg help --keyword schemes')
1408 [255]
1408 [255]
1409 $ hg help -e schemes |head -1
1409 $ hg help -e schemes |head -1
1410 schemes extension - extend schemes with shortcuts to repository swarms
1410 schemes extension - extend schemes with shortcuts to repository swarms
1411 $ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):'
1411 $ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):'
1412 Commands:
1412 Commands:
1413 $ hg help -e -k a |egrep '^(Topics|Extensions|Commands):'
1413 $ hg help -e -k a |egrep '^(Topics|Extensions|Commands):'
1414 Extensions:
1414 Extensions:
1415 $ hg help -e -c -k date |egrep '^(Topics|Extensions|Commands):'
1415 $ hg help -e -c -k date |egrep '^(Topics|Extensions|Commands):'
1416 Extensions:
1416 Extensions:
1417 Commands:
1417 Commands:
1418 $ hg help -c commit > /dev/null
1418 $ hg help -c commit > /dev/null
1419 $ hg help -e -c commit > /dev/null
1419 $ hg help -e -c commit > /dev/null
1420 $ hg help -e commit > /dev/null
1420 $ hg help -e commit > /dev/null
1421 abort: no such help topic: commit
1421 abort: no such help topic: commit
1422 (try 'hg help --keyword commit')
1422 (try 'hg help --keyword commit')
1423 [255]
1423 [255]
1424
1424
1425 Test keyword search help
1425 Test keyword search help
1426
1426
1427 $ cat > prefixedname.py <<EOF
1427 $ cat > prefixedname.py <<EOF
1428 > '''matched against word "clone"
1428 > '''matched against word "clone"
1429 > '''
1429 > '''
1430 > EOF
1430 > EOF
1431 $ echo '[extensions]' >> $HGRCPATH
1431 $ echo '[extensions]' >> $HGRCPATH
1432 $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH
1432 $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH
1433 $ hg help -k clone
1433 $ hg help -k clone
1434 Topics:
1434 Topics:
1435
1435
1436 config Configuration Files
1436 config Configuration Files
1437 extensions Using Additional Features
1437 extensions Using Additional Features
1438 glossary Glossary
1438 glossary Glossary
1439 phases Working with Phases
1439 phases Working with Phases
1440 subrepos Subrepositories
1440 subrepos Subrepositories
1441 urls URL Paths
1441 urls URL Paths
1442
1442
1443 Commands:
1443 Commands:
1444
1444
1445 bookmarks create a new bookmark or list existing bookmarks
1445 bookmarks create a new bookmark or list existing bookmarks
1446 clone make a copy of an existing repository
1446 clone make a copy of an existing repository
1447 paths show aliases for remote repositories
1447 paths show aliases for remote repositories
1448 update update working directory (or switch revisions)
1448 update update working directory (or switch revisions)
1449
1449
1450 Extensions:
1450 Extensions:
1451
1451
1452 clonebundles advertise pre-generated bundles to seed clones
1452 clonebundles advertise pre-generated bundles to seed clones
1453 prefixedname matched against word "clone"
1453 prefixedname matched against word "clone"
1454 relink recreates hardlinks between repository clones
1454 relink recreates hardlinks between repository clones
1455
1455
1456 Extension Commands:
1456 Extension Commands:
1457
1457
1458 qclone clone main and patch repository at same time
1458 qclone clone main and patch repository at same time
1459
1459
1460 Test unfound topic
1460 Test unfound topic
1461
1461
1462 $ hg help nonexistingtopicthatwillneverexisteverever
1462 $ hg help nonexistingtopicthatwillneverexisteverever
1463 abort: no such help topic: nonexistingtopicthatwillneverexisteverever
1463 abort: no such help topic: nonexistingtopicthatwillneverexisteverever
1464 (try 'hg help --keyword nonexistingtopicthatwillneverexisteverever')
1464 (try 'hg help --keyword nonexistingtopicthatwillneverexisteverever')
1465 [255]
1465 [255]
1466
1466
1467 Test unfound keyword
1467 Test unfound keyword
1468
1468
1469 $ hg help --keyword nonexistingwordthatwillneverexisteverever
1469 $ hg help --keyword nonexistingwordthatwillneverexisteverever
1470 abort: no matches
1470 abort: no matches
1471 (try 'hg help' for a list of topics)
1471 (try 'hg help' for a list of topics)
1472 [255]
1472 [255]
1473
1473
1474 Test omit indicating for help
1474 Test omit indicating for help
1475
1475
1476 $ cat > addverboseitems.py <<EOF
1476 $ cat > addverboseitems.py <<EOF
1477 > '''extension to test omit indicating.
1477 > '''extension to test omit indicating.
1478 >
1478 >
1479 > This paragraph is never omitted (for extension)
1479 > This paragraph is never omitted (for extension)
1480 >
1480 >
1481 > .. container:: verbose
1481 > .. container:: verbose
1482 >
1482 >
1483 > This paragraph is omitted,
1483 > This paragraph is omitted,
1484 > if :hg:\`help\` is invoked without \`\`-v\`\` (for extension)
1484 > if :hg:\`help\` is invoked without \`\`-v\`\` (for extension)
1485 >
1485 >
1486 > This paragraph is never omitted, too (for extension)
1486 > This paragraph is never omitted, too (for extension)
1487 > '''
1487 > '''
1488 >
1488 >
1489 > from mercurial import help, commands
1489 > from mercurial import help, commands
1490 > testtopic = """This paragraph is never omitted (for topic).
1490 > testtopic = """This paragraph is never omitted (for topic).
1491 >
1491 >
1492 > .. container:: verbose
1492 > .. container:: verbose
1493 >
1493 >
1494 > This paragraph is omitted,
1494 > This paragraph is omitted,
1495 > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic)
1495 > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic)
1496 >
1496 >
1497 > This paragraph is never omitted, too (for topic)
1497 > This paragraph is never omitted, too (for topic)
1498 > """
1498 > """
1499 > def extsetup(ui):
1499 > def extsetup(ui):
1500 > help.helptable.append((["topic-containing-verbose"],
1500 > help.helptable.append((["topic-containing-verbose"],
1501 > "This is the topic to test omit indicating.",
1501 > "This is the topic to test omit indicating.",
1502 > lambda ui: testtopic))
1502 > lambda ui: testtopic))
1503 > EOF
1503 > EOF
1504 $ echo '[extensions]' >> $HGRCPATH
1504 $ echo '[extensions]' >> $HGRCPATH
1505 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
1505 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
1506 $ hg help addverboseitems
1506 $ hg help addverboseitems
1507 addverboseitems extension - extension to test omit indicating.
1507 addverboseitems extension - extension to test omit indicating.
1508
1508
1509 This paragraph is never omitted (for extension)
1509 This paragraph is never omitted (for extension)
1510
1510
1511 This paragraph is never omitted, too (for extension)
1511 This paragraph is never omitted, too (for extension)
1512
1512
1513 (some details hidden, use --verbose to show complete help)
1513 (some details hidden, use --verbose to show complete help)
1514
1514
1515 no commands defined
1515 no commands defined
1516 $ hg help -v addverboseitems
1516 $ hg help -v addverboseitems
1517 addverboseitems extension - extension to test omit indicating.
1517 addverboseitems extension - extension to test omit indicating.
1518
1518
1519 This paragraph is never omitted (for extension)
1519 This paragraph is never omitted (for extension)
1520
1520
1521 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1521 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1522 extension)
1522 extension)
1523
1523
1524 This paragraph is never omitted, too (for extension)
1524 This paragraph is never omitted, too (for extension)
1525
1525
1526 no commands defined
1526 no commands defined
1527 $ hg help topic-containing-verbose
1527 $ hg help topic-containing-verbose
1528 This is the topic to test omit indicating.
1528 This is the topic to test omit indicating.
1529 """"""""""""""""""""""""""""""""""""""""""
1529 """"""""""""""""""""""""""""""""""""""""""
1530
1530
1531 This paragraph is never omitted (for topic).
1531 This paragraph is never omitted (for topic).
1532
1532
1533 This paragraph is never omitted, too (for topic)
1533 This paragraph is never omitted, too (for topic)
1534
1534
1535 (some details hidden, use --verbose to show complete help)
1535 (some details hidden, use --verbose to show complete help)
1536 $ hg help -v topic-containing-verbose
1536 $ hg help -v topic-containing-verbose
1537 This is the topic to test omit indicating.
1537 This is the topic to test omit indicating.
1538 """"""""""""""""""""""""""""""""""""""""""
1538 """"""""""""""""""""""""""""""""""""""""""
1539
1539
1540 This paragraph is never omitted (for topic).
1540 This paragraph is never omitted (for topic).
1541
1541
1542 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1542 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1543 topic)
1543 topic)
1544
1544
1545 This paragraph is never omitted, too (for topic)
1545 This paragraph is never omitted, too (for topic)
1546
1546
1547 Test section lookup
1547 Test section lookup
1548
1548
1549 $ hg help revset.merge
1549 $ hg help revset.merge
1550 "merge()"
1550 "merge()"
1551 Changeset is a merge changeset.
1551 Changeset is a merge changeset.
1552
1552
1553 $ hg help glossary.dag
1553 $ hg help glossary.dag
1554 DAG
1554 DAG
1555 The repository of changesets of a distributed version control system
1555 The repository of changesets of a distributed version control system
1556 (DVCS) can be described as a directed acyclic graph (DAG), consisting
1556 (DVCS) can be described as a directed acyclic graph (DAG), consisting
1557 of nodes and edges, where nodes correspond to changesets and edges
1557 of nodes and edges, where nodes correspond to changesets and edges
1558 imply a parent -> child relation. This graph can be visualized by
1558 imply a parent -> child relation. This graph can be visualized by
1559 graphical tools such as 'hg log --graph'. In Mercurial, the DAG is
1559 graphical tools such as 'hg log --graph'. In Mercurial, the DAG is
1560 limited by the requirement for children to have at most two parents.
1560 limited by the requirement for children to have at most two parents.
1561
1561
1562
1562
1563 $ hg help hgrc.paths
1563 $ hg help hgrc.paths
1564 "paths"
1564 "paths"
1565 -------
1565 -------
1566
1566
1567 Assigns symbolic names and behavior to repositories.
1567 Assigns symbolic names and behavior to repositories.
1568
1568
1569 Options are symbolic names defining the URL or directory that is the
1569 Options are symbolic names defining the URL or directory that is the
1570 location of the repository. Example:
1570 location of the repository. Example:
1571
1571
1572 [paths]
1572 [paths]
1573 my_server = https://example.com/my_repo
1573 my_server = https://example.com/my_repo
1574 local_path = /home/me/repo
1574 local_path = /home/me/repo
1575
1575
1576 These symbolic names can be used from the command line. To pull from
1576 These symbolic names can be used from the command line. To pull from
1577 "my_server": 'hg pull my_server'. To push to "local_path": 'hg push
1577 "my_server": 'hg pull my_server'. To push to "local_path": 'hg push
1578 local_path'.
1578 local_path'.
1579
1579
1580 Options containing colons (":") denote sub-options that can influence
1580 Options containing colons (":") denote sub-options that can influence
1581 behavior for that specific path. Example:
1581 behavior for that specific path. Example:
1582
1582
1583 [paths]
1583 [paths]
1584 my_server = https://example.com/my_path
1584 my_server = https://example.com/my_path
1585 my_server:pushurl = ssh://example.com/my_path
1585 my_server:pushurl = ssh://example.com/my_path
1586
1586
1587 The following sub-options can be defined:
1587 The following sub-options can be defined:
1588
1588
1589 "pushurl"
1589 "pushurl"
1590 The URL to use for push operations. If not defined, the location
1590 The URL to use for push operations. If not defined, the location
1591 defined by the path's main entry is used.
1591 defined by the path's main entry is used.
1592
1592
1593 "pushrev"
1593 "pushrev"
1594 A revset defining which revisions to push by default.
1594 A revset defining which revisions to push by default.
1595
1595
1596 When 'hg push' is executed without a "-r" argument, the revset defined
1596 When 'hg push' is executed without a "-r" argument, the revset defined
1597 by this sub-option is evaluated to determine what to push.
1597 by this sub-option is evaluated to determine what to push.
1598
1598
1599 For example, a value of "." will push the working directory's revision
1599 For example, a value of "." will push the working directory's revision
1600 by default.
1600 by default.
1601
1601
1602 Revsets specifying bookmarks will not result in the bookmark being
1602 Revsets specifying bookmarks will not result in the bookmark being
1603 pushed.
1603 pushed.
1604
1604
1605 The following special named paths exist:
1605 The following special named paths exist:
1606
1606
1607 "default"
1607 "default"
1608 The URL or directory to use when no source or remote is specified.
1608 The URL or directory to use when no source or remote is specified.
1609
1609
1610 'hg clone' will automatically define this path to the location the
1610 'hg clone' will automatically define this path to the location the
1611 repository was cloned from.
1611 repository was cloned from.
1612
1612
1613 "default-push"
1613 "default-push"
1614 (deprecated) The URL or directory for the default 'hg push' location.
1614 (deprecated) The URL or directory for the default 'hg push' location.
1615 "default:pushurl" should be used instead.
1615 "default:pushurl" should be used instead.
1616
1616
1617 $ hg help glossary.mcguffin
1617 $ hg help glossary.mcguffin
1618 abort: help section not found: glossary.mcguffin
1618 abort: help section not found: glossary.mcguffin
1619 [255]
1619 [255]
1620
1620
1621 $ hg help glossary.mc.guffin
1621 $ hg help glossary.mc.guffin
1622 abort: help section not found: glossary.mc.guffin
1622 abort: help section not found: glossary.mc.guffin
1623 [255]
1623 [255]
1624
1624
1625 $ hg help template.files
1625 $ hg help template.files
1626 files List of strings. All files modified, added, or removed by
1626 files List of strings. All files modified, added, or removed by
1627 this changeset.
1627 this changeset.
1628 files(pattern)
1628 files(pattern)
1629 All files of the current changeset matching the pattern. See
1629 All files of the current changeset matching the pattern. See
1630 'hg help patterns'.
1630 'hg help patterns'.
1631
1631
1632 Test section lookup by translated message
1632 Test section lookup by translated message
1633
1633
1634 str.lower() instead of encoding.lower(str) on translated message might
1634 str.lower() instead of encoding.lower(str) on translated message might
1635 make message meaningless, because some encoding uses 0x41(A) - 0x5a(Z)
1635 make message meaningless, because some encoding uses 0x41(A) - 0x5a(Z)
1636 as the second or later byte of multi-byte character.
1636 as the second or later byte of multi-byte character.
1637
1637
1638 For example, "\x8bL\x98^" (translation of "record" in ja_JP.cp932)
1638 For example, "\x8bL\x98^" (translation of "record" in ja_JP.cp932)
1639 contains 0x4c (L). str.lower() replaces 0x4c(L) by 0x6c(l) and this
1639 contains 0x4c (L). str.lower() replaces 0x4c(L) by 0x6c(l) and this
1640 replacement makes message meaningless.
1640 replacement makes message meaningless.
1641
1641
1642 This tests that section lookup by translated string isn't broken by
1642 This tests that section lookup by translated string isn't broken by
1643 such str.lower().
1643 such str.lower().
1644
1644
1645 $ python <<EOF
1645 $ python <<EOF
1646 > def escape(s):
1646 > def escape(s):
1647 > return ''.join('\u%x' % ord(uc) for uc in s.decode('cp932'))
1647 > return ''.join('\u%x' % ord(uc) for uc in s.decode('cp932'))
1648 > # translation of "record" in ja_JP.cp932
1648 > # translation of "record" in ja_JP.cp932
1649 > upper = "\x8bL\x98^"
1649 > upper = "\x8bL\x98^"
1650 > # str.lower()-ed section name should be treated as different one
1650 > # str.lower()-ed section name should be treated as different one
1651 > lower = "\x8bl\x98^"
1651 > lower = "\x8bl\x98^"
1652 > with open('ambiguous.py', 'w') as fp:
1652 > with open('ambiguous.py', 'w') as fp:
1653 > fp.write("""# ambiguous section names in ja_JP.cp932
1653 > fp.write("""# ambiguous section names in ja_JP.cp932
1654 > u'''summary of extension
1654 > u'''summary of extension
1655 >
1655 >
1656 > %s
1656 > %s
1657 > ----
1657 > ----
1658 >
1658 >
1659 > Upper name should show only this message
1659 > Upper name should show only this message
1660 >
1660 >
1661 > %s
1661 > %s
1662 > ----
1662 > ----
1663 >
1663 >
1664 > Lower name should show only this message
1664 > Lower name should show only this message
1665 >
1665 >
1666 > subsequent section
1666 > subsequent section
1667 > ------------------
1667 > ------------------
1668 >
1668 >
1669 > This should be hidden at 'hg help ambiguous' with section name.
1669 > This should be hidden at 'hg help ambiguous' with section name.
1670 > '''
1670 > '''
1671 > """ % (escape(upper), escape(lower)))
1671 > """ % (escape(upper), escape(lower)))
1672 > EOF
1672 > EOF
1673
1673
1674 $ cat >> $HGRCPATH <<EOF
1674 $ cat >> $HGRCPATH <<EOF
1675 > [extensions]
1675 > [extensions]
1676 > ambiguous = ./ambiguous.py
1676 > ambiguous = ./ambiguous.py
1677 > EOF
1677 > EOF
1678
1678
1679 $ python <<EOF | sh
1679 $ python <<EOF | sh
1680 > upper = "\x8bL\x98^"
1680 > upper = "\x8bL\x98^"
1681 > print "hg --encoding cp932 help -e ambiguous.%s" % upper
1681 > print "hg --encoding cp932 help -e ambiguous.%s" % upper
1682 > EOF
1682 > EOF
1683 \x8bL\x98^ (esc)
1683 \x8bL\x98^ (esc)
1684 ----
1684 ----
1685
1685
1686 Upper name should show only this message
1686 Upper name should show only this message
1687
1687
1688
1688
1689 $ python <<EOF | sh
1689 $ python <<EOF | sh
1690 > lower = "\x8bl\x98^"
1690 > lower = "\x8bl\x98^"
1691 > print "hg --encoding cp932 help -e ambiguous.%s" % lower
1691 > print "hg --encoding cp932 help -e ambiguous.%s" % lower
1692 > EOF
1692 > EOF
1693 \x8bl\x98^ (esc)
1693 \x8bl\x98^ (esc)
1694 ----
1694 ----
1695
1695
1696 Lower name should show only this message
1696 Lower name should show only this message
1697
1697
1698
1698
1699 $ cat >> $HGRCPATH <<EOF
1699 $ cat >> $HGRCPATH <<EOF
1700 > [extensions]
1700 > [extensions]
1701 > ambiguous = !
1701 > ambiguous = !
1702 > EOF
1702 > EOF
1703
1703
1704 Show help content of disabled extensions
1704 Show help content of disabled extensions
1705
1705
1706 $ cat >> $HGRCPATH <<EOF
1706 $ cat >> $HGRCPATH <<EOF
1707 > [extensions]
1707 > [extensions]
1708 > ambiguous = !./ambiguous.py
1708 > ambiguous = !./ambiguous.py
1709 > EOF
1709 > EOF
1710 $ hg help -e ambiguous
1710 $ hg help -e ambiguous
1711 ambiguous extension - (no help text available)
1711 ambiguous extension - (no help text available)
1712
1712
1713 (use 'hg help extensions' for information on enabling extensions)
1713 (use 'hg help extensions' for information on enabling extensions)
1714
1714
1715 Test dynamic list of merge tools only shows up once
1715 Test dynamic list of merge tools only shows up once
1716 $ hg help merge-tools
1716 $ hg help merge-tools
1717 Merge Tools
1717 Merge Tools
1718 """""""""""
1718 """""""""""
1719
1719
1720 To merge files Mercurial uses merge tools.
1720 To merge files Mercurial uses merge tools.
1721
1721
1722 A merge tool combines two different versions of a file into a merged file.
1722 A merge tool combines two different versions of a file into a merged file.
1723 Merge tools are given the two files and the greatest common ancestor of
1723 Merge tools are given the two files and the greatest common ancestor of
1724 the two file versions, so they can determine the changes made on both
1724 the two file versions, so they can determine the changes made on both
1725 branches.
1725 branches.
1726
1726
1727 Merge tools are used both for 'hg resolve', 'hg merge', 'hg update', 'hg
1727 Merge tools are used both for 'hg resolve', 'hg merge', 'hg update', 'hg
1728 backout' and in several extensions.
1728 backout' and in several extensions.
1729
1729
1730 Usually, the merge tool tries to automatically reconcile the files by
1730 Usually, the merge tool tries to automatically reconcile the files by
1731 combining all non-overlapping changes that occurred separately in the two
1731 combining all non-overlapping changes that occurred separately in the two
1732 different evolutions of the same initial base file. Furthermore, some
1732 different evolutions of the same initial base file. Furthermore, some
1733 interactive merge programs make it easier to manually resolve conflicting
1733 interactive merge programs make it easier to manually resolve conflicting
1734 merges, either in a graphical way, or by inserting some conflict markers.
1734 merges, either in a graphical way, or by inserting some conflict markers.
1735 Mercurial does not include any interactive merge programs but relies on
1735 Mercurial does not include any interactive merge programs but relies on
1736 external tools for that.
1736 external tools for that.
1737
1737
1738 Available merge tools
1738 Available merge tools
1739 =====================
1739 =====================
1740
1740
1741 External merge tools and their properties are configured in the merge-
1741 External merge tools and their properties are configured in the merge-
1742 tools configuration section - see hgrc(5) - but they can often just be
1742 tools configuration section - see hgrc(5) - but they can often just be
1743 named by their executable.
1743 named by their executable.
1744
1744
1745 A merge tool is generally usable if its executable can be found on the
1745 A merge tool is generally usable if its executable can be found on the
1746 system and if it can handle the merge. The executable is found if it is an
1746 system and if it can handle the merge. The executable is found if it is an
1747 absolute or relative executable path or the name of an application in the
1747 absolute or relative executable path or the name of an application in the
1748 executable search path. The tool is assumed to be able to handle the merge
1748 executable search path. The tool is assumed to be able to handle the merge
1749 if it can handle symlinks if the file is a symlink, if it can handle
1749 if it can handle symlinks if the file is a symlink, if it can handle
1750 binary files if the file is binary, and if a GUI is available if the tool
1750 binary files if the file is binary, and if a GUI is available if the tool
1751 requires a GUI.
1751 requires a GUI.
1752
1752
1753 There are some internal merge tools which can be used. The internal merge
1753 There are some internal merge tools which can be used. The internal merge
1754 tools are:
1754 tools are:
1755
1755
1756 ":dump"
1756 ":dump"
1757 Creates three versions of the files to merge, containing the contents of
1757 Creates three versions of the files to merge, containing the contents of
1758 local, other and base. These files can then be used to perform a merge
1758 local, other and base. These files can then be used to perform a merge
1759 manually. If the file to be merged is named "a.txt", these files will
1759 manually. If the file to be merged is named "a.txt", these files will
1760 accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and
1760 accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and
1761 they will be placed in the same directory as "a.txt".
1761 they will be placed in the same directory as "a.txt".
1762
1762
1763 This implies permerge. Therefore, files aren't dumped, if premerge runs
1764 successfully. Use :forcedump to forcibly write files out.
1765
1763 ":fail"
1766 ":fail"
1764 Rather than attempting to merge files that were modified on both
1767 Rather than attempting to merge files that were modified on both
1765 branches, it marks them as unresolved. The resolve command must be used
1768 branches, it marks them as unresolved. The resolve command must be used
1766 to resolve these conflicts.
1769 to resolve these conflicts.
1767
1770
1771 ":forcedump"
1772 Creates three versions of the files as same as :dump, but omits
1773 premerge.
1774
1768 ":local"
1775 ":local"
1769 Uses the local 'p1()' version of files as the merged version.
1776 Uses the local 'p1()' version of files as the merged version.
1770
1777
1771 ":merge"
1778 ":merge"
1772 Uses the internal non-interactive simple merge algorithm for merging
1779 Uses the internal non-interactive simple merge algorithm for merging
1773 files. It will fail if there are any conflicts and leave markers in the
1780 files. It will fail if there are any conflicts and leave markers in the
1774 partially merged file. Markers will have two sections, one for each side
1781 partially merged file. Markers will have two sections, one for each side
1775 of merge.
1782 of merge.
1776
1783
1777 ":merge-local"
1784 ":merge-local"
1778 Like :merge, but resolve all conflicts non-interactively in favor of the
1785 Like :merge, but resolve all conflicts non-interactively in favor of the
1779 local 'p1()' changes.
1786 local 'p1()' changes.
1780
1787
1781 ":merge-other"
1788 ":merge-other"
1782 Like :merge, but resolve all conflicts non-interactively in favor of the
1789 Like :merge, but resolve all conflicts non-interactively in favor of the
1783 other 'p2()' changes.
1790 other 'p2()' changes.
1784
1791
1785 ":merge3"
1792 ":merge3"
1786 Uses the internal non-interactive simple merge algorithm for merging
1793 Uses the internal non-interactive simple merge algorithm for merging
1787 files. It will fail if there are any conflicts and leave markers in the
1794 files. It will fail if there are any conflicts and leave markers in the
1788 partially merged file. Marker will have three sections, one from each
1795 partially merged file. Marker will have three sections, one from each
1789 side of the merge and one for the base content.
1796 side of the merge and one for the base content.
1790
1797
1791 ":other"
1798 ":other"
1792 Uses the other 'p2()' version of files as the merged version.
1799 Uses the other 'p2()' version of files as the merged version.
1793
1800
1794 ":prompt"
1801 ":prompt"
1795 Asks the user which of the local 'p1()' or the other 'p2()' version to
1802 Asks the user which of the local 'p1()' or the other 'p2()' version to
1796 keep as the merged version.
1803 keep as the merged version.
1797
1804
1798 ":tagmerge"
1805 ":tagmerge"
1799 Uses the internal tag merge algorithm (experimental).
1806 Uses the internal tag merge algorithm (experimental).
1800
1807
1801 ":union"
1808 ":union"
1802 Uses the internal non-interactive simple merge algorithm for merging
1809 Uses the internal non-interactive simple merge algorithm for merging
1803 files. It will use both left and right sides for conflict regions. No
1810 files. It will use both left and right sides for conflict regions. No
1804 markers are inserted.
1811 markers are inserted.
1805
1812
1806 Internal tools are always available and do not require a GUI but will by
1813 Internal tools are always available and do not require a GUI but will by
1807 default not handle symlinks or binary files.
1814 default not handle symlinks or binary files.
1808
1815
1809 Choosing a merge tool
1816 Choosing a merge tool
1810 =====================
1817 =====================
1811
1818
1812 Mercurial uses these rules when deciding which merge tool to use:
1819 Mercurial uses these rules when deciding which merge tool to use:
1813
1820
1814 1. If a tool has been specified with the --tool option to merge or
1821 1. If a tool has been specified with the --tool option to merge or
1815 resolve, it is used. If it is the name of a tool in the merge-tools
1822 resolve, it is used. If it is the name of a tool in the merge-tools
1816 configuration, its configuration is used. Otherwise the specified tool
1823 configuration, its configuration is used. Otherwise the specified tool
1817 must be executable by the shell.
1824 must be executable by the shell.
1818 2. If the "HGMERGE" environment variable is present, its value is used and
1825 2. If the "HGMERGE" environment variable is present, its value is used and
1819 must be executable by the shell.
1826 must be executable by the shell.
1820 3. If the filename of the file to be merged matches any of the patterns in
1827 3. If the filename of the file to be merged matches any of the patterns in
1821 the merge-patterns configuration section, the first usable merge tool
1828 the merge-patterns configuration section, the first usable merge tool
1822 corresponding to a matching pattern is used. Here, binary capabilities
1829 corresponding to a matching pattern is used. Here, binary capabilities
1823 of the merge tool are not considered.
1830 of the merge tool are not considered.
1824 4. If ui.merge is set it will be considered next. If the value is not the
1831 4. If ui.merge is set it will be considered next. If the value is not the
1825 name of a configured tool, the specified value is used and must be
1832 name of a configured tool, the specified value is used and must be
1826 executable by the shell. Otherwise the named tool is used if it is
1833 executable by the shell. Otherwise the named tool is used if it is
1827 usable.
1834 usable.
1828 5. If any usable merge tools are present in the merge-tools configuration
1835 5. If any usable merge tools are present in the merge-tools configuration
1829 section, the one with the highest priority is used.
1836 section, the one with the highest priority is used.
1830 6. If a program named "hgmerge" can be found on the system, it is used -
1837 6. If a program named "hgmerge" can be found on the system, it is used -
1831 but it will by default not be used for symlinks and binary files.
1838 but it will by default not be used for symlinks and binary files.
1832 7. If the file to be merged is not binary and is not a symlink, then
1839 7. If the file to be merged is not binary and is not a symlink, then
1833 internal ":merge" is used.
1840 internal ":merge" is used.
1834 8. Otherwise, ":prompt" is used.
1841 8. Otherwise, ":prompt" is used.
1835
1842
1836 Note:
1843 Note:
1837 After selecting a merge program, Mercurial will by default attempt to
1844 After selecting a merge program, Mercurial will by default attempt to
1838 merge the files using a simple merge algorithm first. Only if it
1845 merge the files using a simple merge algorithm first. Only if it
1839 doesn't succeed because of conflicting changes Mercurial will actually
1846 doesn't succeed because of conflicting changes Mercurial will actually
1840 execute the merge program. Whether to use the simple merge algorithm
1847 execute the merge program. Whether to use the simple merge algorithm
1841 first can be controlled by the premerge setting of the merge tool.
1848 first can be controlled by the premerge setting of the merge tool.
1842 Premerge is enabled by default unless the file is binary or a symlink.
1849 Premerge is enabled by default unless the file is binary or a symlink.
1843
1850
1844 See the merge-tools and ui sections of hgrc(5) for details on the
1851 See the merge-tools and ui sections of hgrc(5) for details on the
1845 configuration of merge tools.
1852 configuration of merge tools.
1846
1853
1847 Compression engines listed in `hg help bundlespec`
1854 Compression engines listed in `hg help bundlespec`
1848
1855
1849 $ hg help bundlespec | grep gzip
1856 $ hg help bundlespec | grep gzip
1850 "v1" bundles can only use the "gzip", "bzip2", and "none" compression
1857 "v1" bundles can only use the "gzip", "bzip2", and "none" compression
1851 An algorithm that produces smaller bundles than "gzip".
1858 An algorithm that produces smaller bundles than "gzip".
1852 This engine will likely produce smaller bundles than "gzip" but will be
1859 This engine will likely produce smaller bundles than "gzip" but will be
1853 "gzip"
1860 "gzip"
1854 better compression than "gzip". It also frequently yields better (?)
1861 better compression than "gzip". It also frequently yields better (?)
1855
1862
1856 Test usage of section marks in help documents
1863 Test usage of section marks in help documents
1857
1864
1858 $ cd "$TESTDIR"/../doc
1865 $ cd "$TESTDIR"/../doc
1859 $ python check-seclevel.py
1866 $ python check-seclevel.py
1860 $ cd $TESTTMP
1867 $ cd $TESTTMP
1861
1868
1862 #if serve
1869 #if serve
1863
1870
1864 Test the help pages in hgweb.
1871 Test the help pages in hgweb.
1865
1872
1866 Dish up an empty repo; serve it cold.
1873 Dish up an empty repo; serve it cold.
1867
1874
1868 $ hg init "$TESTTMP/test"
1875 $ hg init "$TESTTMP/test"
1869 $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
1876 $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
1870 $ cat hg.pid >> $DAEMON_PIDS
1877 $ cat hg.pid >> $DAEMON_PIDS
1871
1878
1872 $ get-with-headers.py $LOCALIP:$HGPORT "help"
1879 $ get-with-headers.py $LOCALIP:$HGPORT "help"
1873 200 Script output follows
1880 200 Script output follows
1874
1881
1875 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1882 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1876 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1883 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1877 <head>
1884 <head>
1878 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1885 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1879 <meta name="robots" content="index, nofollow" />
1886 <meta name="robots" content="index, nofollow" />
1880 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1887 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1881 <script type="text/javascript" src="/static/mercurial.js"></script>
1888 <script type="text/javascript" src="/static/mercurial.js"></script>
1882
1889
1883 <title>Help: Index</title>
1890 <title>Help: Index</title>
1884 </head>
1891 </head>
1885 <body>
1892 <body>
1886
1893
1887 <div class="container">
1894 <div class="container">
1888 <div class="menu">
1895 <div class="menu">
1889 <div class="logo">
1896 <div class="logo">
1890 <a href="https://mercurial-scm.org/">
1897 <a href="https://mercurial-scm.org/">
1891 <img src="/static/hglogo.png" alt="mercurial" /></a>
1898 <img src="/static/hglogo.png" alt="mercurial" /></a>
1892 </div>
1899 </div>
1893 <ul>
1900 <ul>
1894 <li><a href="/shortlog">log</a></li>
1901 <li><a href="/shortlog">log</a></li>
1895 <li><a href="/graph">graph</a></li>
1902 <li><a href="/graph">graph</a></li>
1896 <li><a href="/tags">tags</a></li>
1903 <li><a href="/tags">tags</a></li>
1897 <li><a href="/bookmarks">bookmarks</a></li>
1904 <li><a href="/bookmarks">bookmarks</a></li>
1898 <li><a href="/branches">branches</a></li>
1905 <li><a href="/branches">branches</a></li>
1899 </ul>
1906 </ul>
1900 <ul>
1907 <ul>
1901 <li class="active">help</li>
1908 <li class="active">help</li>
1902 </ul>
1909 </ul>
1903 </div>
1910 </div>
1904
1911
1905 <div class="main">
1912 <div class="main">
1906 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1913 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1907 <form class="search" action="/log">
1914 <form class="search" action="/log">
1908
1915
1909 <p><input name="rev" id="search1" type="text" size="30" /></p>
1916 <p><input name="rev" id="search1" type="text" size="30" /></p>
1910 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1917 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1911 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1918 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1912 </form>
1919 </form>
1913 <table class="bigtable">
1920 <table class="bigtable">
1914 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
1921 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
1915
1922
1916 <tr><td>
1923 <tr><td>
1917 <a href="/help/bundlespec">
1924 <a href="/help/bundlespec">
1918 bundlespec
1925 bundlespec
1919 </a>
1926 </a>
1920 </td><td>
1927 </td><td>
1921 Bundle File Formats
1928 Bundle File Formats
1922 </td></tr>
1929 </td></tr>
1923 <tr><td>
1930 <tr><td>
1924 <a href="/help/color">
1931 <a href="/help/color">
1925 color
1932 color
1926 </a>
1933 </a>
1927 </td><td>
1934 </td><td>
1928 Colorizing Outputs
1935 Colorizing Outputs
1929 </td></tr>
1936 </td></tr>
1930 <tr><td>
1937 <tr><td>
1931 <a href="/help/config">
1938 <a href="/help/config">
1932 config
1939 config
1933 </a>
1940 </a>
1934 </td><td>
1941 </td><td>
1935 Configuration Files
1942 Configuration Files
1936 </td></tr>
1943 </td></tr>
1937 <tr><td>
1944 <tr><td>
1938 <a href="/help/dates">
1945 <a href="/help/dates">
1939 dates
1946 dates
1940 </a>
1947 </a>
1941 </td><td>
1948 </td><td>
1942 Date Formats
1949 Date Formats
1943 </td></tr>
1950 </td></tr>
1944 <tr><td>
1951 <tr><td>
1945 <a href="/help/diffs">
1952 <a href="/help/diffs">
1946 diffs
1953 diffs
1947 </a>
1954 </a>
1948 </td><td>
1955 </td><td>
1949 Diff Formats
1956 Diff Formats
1950 </td></tr>
1957 </td></tr>
1951 <tr><td>
1958 <tr><td>
1952 <a href="/help/environment">
1959 <a href="/help/environment">
1953 environment
1960 environment
1954 </a>
1961 </a>
1955 </td><td>
1962 </td><td>
1956 Environment Variables
1963 Environment Variables
1957 </td></tr>
1964 </td></tr>
1958 <tr><td>
1965 <tr><td>
1959 <a href="/help/extensions">
1966 <a href="/help/extensions">
1960 extensions
1967 extensions
1961 </a>
1968 </a>
1962 </td><td>
1969 </td><td>
1963 Using Additional Features
1970 Using Additional Features
1964 </td></tr>
1971 </td></tr>
1965 <tr><td>
1972 <tr><td>
1966 <a href="/help/filesets">
1973 <a href="/help/filesets">
1967 filesets
1974 filesets
1968 </a>
1975 </a>
1969 </td><td>
1976 </td><td>
1970 Specifying File Sets
1977 Specifying File Sets
1971 </td></tr>
1978 </td></tr>
1972 <tr><td>
1979 <tr><td>
1973 <a href="/help/glossary">
1980 <a href="/help/glossary">
1974 glossary
1981 glossary
1975 </a>
1982 </a>
1976 </td><td>
1983 </td><td>
1977 Glossary
1984 Glossary
1978 </td></tr>
1985 </td></tr>
1979 <tr><td>
1986 <tr><td>
1980 <a href="/help/hgignore">
1987 <a href="/help/hgignore">
1981 hgignore
1988 hgignore
1982 </a>
1989 </a>
1983 </td><td>
1990 </td><td>
1984 Syntax for Mercurial Ignore Files
1991 Syntax for Mercurial Ignore Files
1985 </td></tr>
1992 </td></tr>
1986 <tr><td>
1993 <tr><td>
1987 <a href="/help/hgweb">
1994 <a href="/help/hgweb">
1988 hgweb
1995 hgweb
1989 </a>
1996 </a>
1990 </td><td>
1997 </td><td>
1991 Configuring hgweb
1998 Configuring hgweb
1992 </td></tr>
1999 </td></tr>
1993 <tr><td>
2000 <tr><td>
1994 <a href="/help/internals">
2001 <a href="/help/internals">
1995 internals
2002 internals
1996 </a>
2003 </a>
1997 </td><td>
2004 </td><td>
1998 Technical implementation topics
2005 Technical implementation topics
1999 </td></tr>
2006 </td></tr>
2000 <tr><td>
2007 <tr><td>
2001 <a href="/help/merge-tools">
2008 <a href="/help/merge-tools">
2002 merge-tools
2009 merge-tools
2003 </a>
2010 </a>
2004 </td><td>
2011 </td><td>
2005 Merge Tools
2012 Merge Tools
2006 </td></tr>
2013 </td></tr>
2007 <tr><td>
2014 <tr><td>
2008 <a href="/help/pager">
2015 <a href="/help/pager">
2009 pager
2016 pager
2010 </a>
2017 </a>
2011 </td><td>
2018 </td><td>
2012 Pager Support
2019 Pager Support
2013 </td></tr>
2020 </td></tr>
2014 <tr><td>
2021 <tr><td>
2015 <a href="/help/patterns">
2022 <a href="/help/patterns">
2016 patterns
2023 patterns
2017 </a>
2024 </a>
2018 </td><td>
2025 </td><td>
2019 File Name Patterns
2026 File Name Patterns
2020 </td></tr>
2027 </td></tr>
2021 <tr><td>
2028 <tr><td>
2022 <a href="/help/phases">
2029 <a href="/help/phases">
2023 phases
2030 phases
2024 </a>
2031 </a>
2025 </td><td>
2032 </td><td>
2026 Working with Phases
2033 Working with Phases
2027 </td></tr>
2034 </td></tr>
2028 <tr><td>
2035 <tr><td>
2029 <a href="/help/revisions">
2036 <a href="/help/revisions">
2030 revisions
2037 revisions
2031 </a>
2038 </a>
2032 </td><td>
2039 </td><td>
2033 Specifying Revisions
2040 Specifying Revisions
2034 </td></tr>
2041 </td></tr>
2035 <tr><td>
2042 <tr><td>
2036 <a href="/help/scripting">
2043 <a href="/help/scripting">
2037 scripting
2044 scripting
2038 </a>
2045 </a>
2039 </td><td>
2046 </td><td>
2040 Using Mercurial from scripts and automation
2047 Using Mercurial from scripts and automation
2041 </td></tr>
2048 </td></tr>
2042 <tr><td>
2049 <tr><td>
2043 <a href="/help/subrepos">
2050 <a href="/help/subrepos">
2044 subrepos
2051 subrepos
2045 </a>
2052 </a>
2046 </td><td>
2053 </td><td>
2047 Subrepositories
2054 Subrepositories
2048 </td></tr>
2055 </td></tr>
2049 <tr><td>
2056 <tr><td>
2050 <a href="/help/templating">
2057 <a href="/help/templating">
2051 templating
2058 templating
2052 </a>
2059 </a>
2053 </td><td>
2060 </td><td>
2054 Template Usage
2061 Template Usage
2055 </td></tr>
2062 </td></tr>
2056 <tr><td>
2063 <tr><td>
2057 <a href="/help/urls">
2064 <a href="/help/urls">
2058 urls
2065 urls
2059 </a>
2066 </a>
2060 </td><td>
2067 </td><td>
2061 URL Paths
2068 URL Paths
2062 </td></tr>
2069 </td></tr>
2063 <tr><td>
2070 <tr><td>
2064 <a href="/help/topic-containing-verbose">
2071 <a href="/help/topic-containing-verbose">
2065 topic-containing-verbose
2072 topic-containing-verbose
2066 </a>
2073 </a>
2067 </td><td>
2074 </td><td>
2068 This is the topic to test omit indicating.
2075 This is the topic to test omit indicating.
2069 </td></tr>
2076 </td></tr>
2070
2077
2071
2078
2072 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
2079 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
2073
2080
2074 <tr><td>
2081 <tr><td>
2075 <a href="/help/add">
2082 <a href="/help/add">
2076 add
2083 add
2077 </a>
2084 </a>
2078 </td><td>
2085 </td><td>
2079 add the specified files on the next commit
2086 add the specified files on the next commit
2080 </td></tr>
2087 </td></tr>
2081 <tr><td>
2088 <tr><td>
2082 <a href="/help/annotate">
2089 <a href="/help/annotate">
2083 annotate
2090 annotate
2084 </a>
2091 </a>
2085 </td><td>
2092 </td><td>
2086 show changeset information by line for each file
2093 show changeset information by line for each file
2087 </td></tr>
2094 </td></tr>
2088 <tr><td>
2095 <tr><td>
2089 <a href="/help/clone">
2096 <a href="/help/clone">
2090 clone
2097 clone
2091 </a>
2098 </a>
2092 </td><td>
2099 </td><td>
2093 make a copy of an existing repository
2100 make a copy of an existing repository
2094 </td></tr>
2101 </td></tr>
2095 <tr><td>
2102 <tr><td>
2096 <a href="/help/commit">
2103 <a href="/help/commit">
2097 commit
2104 commit
2098 </a>
2105 </a>
2099 </td><td>
2106 </td><td>
2100 commit the specified files or all outstanding changes
2107 commit the specified files or all outstanding changes
2101 </td></tr>
2108 </td></tr>
2102 <tr><td>
2109 <tr><td>
2103 <a href="/help/diff">
2110 <a href="/help/diff">
2104 diff
2111 diff
2105 </a>
2112 </a>
2106 </td><td>
2113 </td><td>
2107 diff repository (or selected files)
2114 diff repository (or selected files)
2108 </td></tr>
2115 </td></tr>
2109 <tr><td>
2116 <tr><td>
2110 <a href="/help/export">
2117 <a href="/help/export">
2111 export
2118 export
2112 </a>
2119 </a>
2113 </td><td>
2120 </td><td>
2114 dump the header and diffs for one or more changesets
2121 dump the header and diffs for one or more changesets
2115 </td></tr>
2122 </td></tr>
2116 <tr><td>
2123 <tr><td>
2117 <a href="/help/forget">
2124 <a href="/help/forget">
2118 forget
2125 forget
2119 </a>
2126 </a>
2120 </td><td>
2127 </td><td>
2121 forget the specified files on the next commit
2128 forget the specified files on the next commit
2122 </td></tr>
2129 </td></tr>
2123 <tr><td>
2130 <tr><td>
2124 <a href="/help/init">
2131 <a href="/help/init">
2125 init
2132 init
2126 </a>
2133 </a>
2127 </td><td>
2134 </td><td>
2128 create a new repository in the given directory
2135 create a new repository in the given directory
2129 </td></tr>
2136 </td></tr>
2130 <tr><td>
2137 <tr><td>
2131 <a href="/help/log">
2138 <a href="/help/log">
2132 log
2139 log
2133 </a>
2140 </a>
2134 </td><td>
2141 </td><td>
2135 show revision history of entire repository or files
2142 show revision history of entire repository or files
2136 </td></tr>
2143 </td></tr>
2137 <tr><td>
2144 <tr><td>
2138 <a href="/help/merge">
2145 <a href="/help/merge">
2139 merge
2146 merge
2140 </a>
2147 </a>
2141 </td><td>
2148 </td><td>
2142 merge another revision into working directory
2149 merge another revision into working directory
2143 </td></tr>
2150 </td></tr>
2144 <tr><td>
2151 <tr><td>
2145 <a href="/help/pull">
2152 <a href="/help/pull">
2146 pull
2153 pull
2147 </a>
2154 </a>
2148 </td><td>
2155 </td><td>
2149 pull changes from the specified source
2156 pull changes from the specified source
2150 </td></tr>
2157 </td></tr>
2151 <tr><td>
2158 <tr><td>
2152 <a href="/help/push">
2159 <a href="/help/push">
2153 push
2160 push
2154 </a>
2161 </a>
2155 </td><td>
2162 </td><td>
2156 push changes to the specified destination
2163 push changes to the specified destination
2157 </td></tr>
2164 </td></tr>
2158 <tr><td>
2165 <tr><td>
2159 <a href="/help/remove">
2166 <a href="/help/remove">
2160 remove
2167 remove
2161 </a>
2168 </a>
2162 </td><td>
2169 </td><td>
2163 remove the specified files on the next commit
2170 remove the specified files on the next commit
2164 </td></tr>
2171 </td></tr>
2165 <tr><td>
2172 <tr><td>
2166 <a href="/help/serve">
2173 <a href="/help/serve">
2167 serve
2174 serve
2168 </a>
2175 </a>
2169 </td><td>
2176 </td><td>
2170 start stand-alone webserver
2177 start stand-alone webserver
2171 </td></tr>
2178 </td></tr>
2172 <tr><td>
2179 <tr><td>
2173 <a href="/help/status">
2180 <a href="/help/status">
2174 status
2181 status
2175 </a>
2182 </a>
2176 </td><td>
2183 </td><td>
2177 show changed files in the working directory
2184 show changed files in the working directory
2178 </td></tr>
2185 </td></tr>
2179 <tr><td>
2186 <tr><td>
2180 <a href="/help/summary">
2187 <a href="/help/summary">
2181 summary
2188 summary
2182 </a>
2189 </a>
2183 </td><td>
2190 </td><td>
2184 summarize working directory state
2191 summarize working directory state
2185 </td></tr>
2192 </td></tr>
2186 <tr><td>
2193 <tr><td>
2187 <a href="/help/update">
2194 <a href="/help/update">
2188 update
2195 update
2189 </a>
2196 </a>
2190 </td><td>
2197 </td><td>
2191 update working directory (or switch revisions)
2198 update working directory (or switch revisions)
2192 </td></tr>
2199 </td></tr>
2193
2200
2194
2201
2195
2202
2196 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
2203 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
2197
2204
2198 <tr><td>
2205 <tr><td>
2199 <a href="/help/addremove">
2206 <a href="/help/addremove">
2200 addremove
2207 addremove
2201 </a>
2208 </a>
2202 </td><td>
2209 </td><td>
2203 add all new files, delete all missing files
2210 add all new files, delete all missing files
2204 </td></tr>
2211 </td></tr>
2205 <tr><td>
2212 <tr><td>
2206 <a href="/help/archive">
2213 <a href="/help/archive">
2207 archive
2214 archive
2208 </a>
2215 </a>
2209 </td><td>
2216 </td><td>
2210 create an unversioned archive of a repository revision
2217 create an unversioned archive of a repository revision
2211 </td></tr>
2218 </td></tr>
2212 <tr><td>
2219 <tr><td>
2213 <a href="/help/backout">
2220 <a href="/help/backout">
2214 backout
2221 backout
2215 </a>
2222 </a>
2216 </td><td>
2223 </td><td>
2217 reverse effect of earlier changeset
2224 reverse effect of earlier changeset
2218 </td></tr>
2225 </td></tr>
2219 <tr><td>
2226 <tr><td>
2220 <a href="/help/bisect">
2227 <a href="/help/bisect">
2221 bisect
2228 bisect
2222 </a>
2229 </a>
2223 </td><td>
2230 </td><td>
2224 subdivision search of changesets
2231 subdivision search of changesets
2225 </td></tr>
2232 </td></tr>
2226 <tr><td>
2233 <tr><td>
2227 <a href="/help/bookmarks">
2234 <a href="/help/bookmarks">
2228 bookmarks
2235 bookmarks
2229 </a>
2236 </a>
2230 </td><td>
2237 </td><td>
2231 create a new bookmark or list existing bookmarks
2238 create a new bookmark or list existing bookmarks
2232 </td></tr>
2239 </td></tr>
2233 <tr><td>
2240 <tr><td>
2234 <a href="/help/branch">
2241 <a href="/help/branch">
2235 branch
2242 branch
2236 </a>
2243 </a>
2237 </td><td>
2244 </td><td>
2238 set or show the current branch name
2245 set or show the current branch name
2239 </td></tr>
2246 </td></tr>
2240 <tr><td>
2247 <tr><td>
2241 <a href="/help/branches">
2248 <a href="/help/branches">
2242 branches
2249 branches
2243 </a>
2250 </a>
2244 </td><td>
2251 </td><td>
2245 list repository named branches
2252 list repository named branches
2246 </td></tr>
2253 </td></tr>
2247 <tr><td>
2254 <tr><td>
2248 <a href="/help/bundle">
2255 <a href="/help/bundle">
2249 bundle
2256 bundle
2250 </a>
2257 </a>
2251 </td><td>
2258 </td><td>
2252 create a bundle file
2259 create a bundle file
2253 </td></tr>
2260 </td></tr>
2254 <tr><td>
2261 <tr><td>
2255 <a href="/help/cat">
2262 <a href="/help/cat">
2256 cat
2263 cat
2257 </a>
2264 </a>
2258 </td><td>
2265 </td><td>
2259 output the current or given revision of files
2266 output the current or given revision of files
2260 </td></tr>
2267 </td></tr>
2261 <tr><td>
2268 <tr><td>
2262 <a href="/help/config">
2269 <a href="/help/config">
2263 config
2270 config
2264 </a>
2271 </a>
2265 </td><td>
2272 </td><td>
2266 show combined config settings from all hgrc files
2273 show combined config settings from all hgrc files
2267 </td></tr>
2274 </td></tr>
2268 <tr><td>
2275 <tr><td>
2269 <a href="/help/copy">
2276 <a href="/help/copy">
2270 copy
2277 copy
2271 </a>
2278 </a>
2272 </td><td>
2279 </td><td>
2273 mark files as copied for the next commit
2280 mark files as copied for the next commit
2274 </td></tr>
2281 </td></tr>
2275 <tr><td>
2282 <tr><td>
2276 <a href="/help/files">
2283 <a href="/help/files">
2277 files
2284 files
2278 </a>
2285 </a>
2279 </td><td>
2286 </td><td>
2280 list tracked files
2287 list tracked files
2281 </td></tr>
2288 </td></tr>
2282 <tr><td>
2289 <tr><td>
2283 <a href="/help/graft">
2290 <a href="/help/graft">
2284 graft
2291 graft
2285 </a>
2292 </a>
2286 </td><td>
2293 </td><td>
2287 copy changes from other branches onto the current branch
2294 copy changes from other branches onto the current branch
2288 </td></tr>
2295 </td></tr>
2289 <tr><td>
2296 <tr><td>
2290 <a href="/help/grep">
2297 <a href="/help/grep">
2291 grep
2298 grep
2292 </a>
2299 </a>
2293 </td><td>
2300 </td><td>
2294 search revision history for a pattern in specified files
2301 search revision history for a pattern in specified files
2295 </td></tr>
2302 </td></tr>
2296 <tr><td>
2303 <tr><td>
2297 <a href="/help/heads">
2304 <a href="/help/heads">
2298 heads
2305 heads
2299 </a>
2306 </a>
2300 </td><td>
2307 </td><td>
2301 show branch heads
2308 show branch heads
2302 </td></tr>
2309 </td></tr>
2303 <tr><td>
2310 <tr><td>
2304 <a href="/help/help">
2311 <a href="/help/help">
2305 help
2312 help
2306 </a>
2313 </a>
2307 </td><td>
2314 </td><td>
2308 show help for a given topic or a help overview
2315 show help for a given topic or a help overview
2309 </td></tr>
2316 </td></tr>
2310 <tr><td>
2317 <tr><td>
2311 <a href="/help/hgalias">
2318 <a href="/help/hgalias">
2312 hgalias
2319 hgalias
2313 </a>
2320 </a>
2314 </td><td>
2321 </td><td>
2315 summarize working directory state
2322 summarize working directory state
2316 </td></tr>
2323 </td></tr>
2317 <tr><td>
2324 <tr><td>
2318 <a href="/help/identify">
2325 <a href="/help/identify">
2319 identify
2326 identify
2320 </a>
2327 </a>
2321 </td><td>
2328 </td><td>
2322 identify the working directory or specified revision
2329 identify the working directory or specified revision
2323 </td></tr>
2330 </td></tr>
2324 <tr><td>
2331 <tr><td>
2325 <a href="/help/import">
2332 <a href="/help/import">
2326 import
2333 import
2327 </a>
2334 </a>
2328 </td><td>
2335 </td><td>
2329 import an ordered set of patches
2336 import an ordered set of patches
2330 </td></tr>
2337 </td></tr>
2331 <tr><td>
2338 <tr><td>
2332 <a href="/help/incoming">
2339 <a href="/help/incoming">
2333 incoming
2340 incoming
2334 </a>
2341 </a>
2335 </td><td>
2342 </td><td>
2336 show new changesets found in source
2343 show new changesets found in source
2337 </td></tr>
2344 </td></tr>
2338 <tr><td>
2345 <tr><td>
2339 <a href="/help/manifest">
2346 <a href="/help/manifest">
2340 manifest
2347 manifest
2341 </a>
2348 </a>
2342 </td><td>
2349 </td><td>
2343 output the current or given revision of the project manifest
2350 output the current or given revision of the project manifest
2344 </td></tr>
2351 </td></tr>
2345 <tr><td>
2352 <tr><td>
2346 <a href="/help/nohelp">
2353 <a href="/help/nohelp">
2347 nohelp
2354 nohelp
2348 </a>
2355 </a>
2349 </td><td>
2356 </td><td>
2350 (no help text available)
2357 (no help text available)
2351 </td></tr>
2358 </td></tr>
2352 <tr><td>
2359 <tr><td>
2353 <a href="/help/outgoing">
2360 <a href="/help/outgoing">
2354 outgoing
2361 outgoing
2355 </a>
2362 </a>
2356 </td><td>
2363 </td><td>
2357 show changesets not found in the destination
2364 show changesets not found in the destination
2358 </td></tr>
2365 </td></tr>
2359 <tr><td>
2366 <tr><td>
2360 <a href="/help/paths">
2367 <a href="/help/paths">
2361 paths
2368 paths
2362 </a>
2369 </a>
2363 </td><td>
2370 </td><td>
2364 show aliases for remote repositories
2371 show aliases for remote repositories
2365 </td></tr>
2372 </td></tr>
2366 <tr><td>
2373 <tr><td>
2367 <a href="/help/phase">
2374 <a href="/help/phase">
2368 phase
2375 phase
2369 </a>
2376 </a>
2370 </td><td>
2377 </td><td>
2371 set or show the current phase name
2378 set or show the current phase name
2372 </td></tr>
2379 </td></tr>
2373 <tr><td>
2380 <tr><td>
2374 <a href="/help/recover">
2381 <a href="/help/recover">
2375 recover
2382 recover
2376 </a>
2383 </a>
2377 </td><td>
2384 </td><td>
2378 roll back an interrupted transaction
2385 roll back an interrupted transaction
2379 </td></tr>
2386 </td></tr>
2380 <tr><td>
2387 <tr><td>
2381 <a href="/help/rename">
2388 <a href="/help/rename">
2382 rename
2389 rename
2383 </a>
2390 </a>
2384 </td><td>
2391 </td><td>
2385 rename files; equivalent of copy + remove
2392 rename files; equivalent of copy + remove
2386 </td></tr>
2393 </td></tr>
2387 <tr><td>
2394 <tr><td>
2388 <a href="/help/resolve">
2395 <a href="/help/resolve">
2389 resolve
2396 resolve
2390 </a>
2397 </a>
2391 </td><td>
2398 </td><td>
2392 redo merges or set/view the merge status of files
2399 redo merges or set/view the merge status of files
2393 </td></tr>
2400 </td></tr>
2394 <tr><td>
2401 <tr><td>
2395 <a href="/help/revert">
2402 <a href="/help/revert">
2396 revert
2403 revert
2397 </a>
2404 </a>
2398 </td><td>
2405 </td><td>
2399 restore files to their checkout state
2406 restore files to their checkout state
2400 </td></tr>
2407 </td></tr>
2401 <tr><td>
2408 <tr><td>
2402 <a href="/help/root">
2409 <a href="/help/root">
2403 root
2410 root
2404 </a>
2411 </a>
2405 </td><td>
2412 </td><td>
2406 print the root (top) of the current working directory
2413 print the root (top) of the current working directory
2407 </td></tr>
2414 </td></tr>
2408 <tr><td>
2415 <tr><td>
2409 <a href="/help/shellalias">
2416 <a href="/help/shellalias">
2410 shellalias
2417 shellalias
2411 </a>
2418 </a>
2412 </td><td>
2419 </td><td>
2413 (no help text available)
2420 (no help text available)
2414 </td></tr>
2421 </td></tr>
2415 <tr><td>
2422 <tr><td>
2416 <a href="/help/tag">
2423 <a href="/help/tag">
2417 tag
2424 tag
2418 </a>
2425 </a>
2419 </td><td>
2426 </td><td>
2420 add one or more tags for the current or given revision
2427 add one or more tags for the current or given revision
2421 </td></tr>
2428 </td></tr>
2422 <tr><td>
2429 <tr><td>
2423 <a href="/help/tags">
2430 <a href="/help/tags">
2424 tags
2431 tags
2425 </a>
2432 </a>
2426 </td><td>
2433 </td><td>
2427 list repository tags
2434 list repository tags
2428 </td></tr>
2435 </td></tr>
2429 <tr><td>
2436 <tr><td>
2430 <a href="/help/unbundle">
2437 <a href="/help/unbundle">
2431 unbundle
2438 unbundle
2432 </a>
2439 </a>
2433 </td><td>
2440 </td><td>
2434 apply one or more bundle files
2441 apply one or more bundle files
2435 </td></tr>
2442 </td></tr>
2436 <tr><td>
2443 <tr><td>
2437 <a href="/help/verify">
2444 <a href="/help/verify">
2438 verify
2445 verify
2439 </a>
2446 </a>
2440 </td><td>
2447 </td><td>
2441 verify the integrity of the repository
2448 verify the integrity of the repository
2442 </td></tr>
2449 </td></tr>
2443 <tr><td>
2450 <tr><td>
2444 <a href="/help/version">
2451 <a href="/help/version">
2445 version
2452 version
2446 </a>
2453 </a>
2447 </td><td>
2454 </td><td>
2448 output version and copyright information
2455 output version and copyright information
2449 </td></tr>
2456 </td></tr>
2450
2457
2451
2458
2452 </table>
2459 </table>
2453 </div>
2460 </div>
2454 </div>
2461 </div>
2455
2462
2456
2463
2457
2464
2458 </body>
2465 </body>
2459 </html>
2466 </html>
2460
2467
2461
2468
2462 $ get-with-headers.py $LOCALIP:$HGPORT "help/add"
2469 $ get-with-headers.py $LOCALIP:$HGPORT "help/add"
2463 200 Script output follows
2470 200 Script output follows
2464
2471
2465 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2472 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2466 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2473 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2467 <head>
2474 <head>
2468 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2475 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2469 <meta name="robots" content="index, nofollow" />
2476 <meta name="robots" content="index, nofollow" />
2470 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2477 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2471 <script type="text/javascript" src="/static/mercurial.js"></script>
2478 <script type="text/javascript" src="/static/mercurial.js"></script>
2472
2479
2473 <title>Help: add</title>
2480 <title>Help: add</title>
2474 </head>
2481 </head>
2475 <body>
2482 <body>
2476
2483
2477 <div class="container">
2484 <div class="container">
2478 <div class="menu">
2485 <div class="menu">
2479 <div class="logo">
2486 <div class="logo">
2480 <a href="https://mercurial-scm.org/">
2487 <a href="https://mercurial-scm.org/">
2481 <img src="/static/hglogo.png" alt="mercurial" /></a>
2488 <img src="/static/hglogo.png" alt="mercurial" /></a>
2482 </div>
2489 </div>
2483 <ul>
2490 <ul>
2484 <li><a href="/shortlog">log</a></li>
2491 <li><a href="/shortlog">log</a></li>
2485 <li><a href="/graph">graph</a></li>
2492 <li><a href="/graph">graph</a></li>
2486 <li><a href="/tags">tags</a></li>
2493 <li><a href="/tags">tags</a></li>
2487 <li><a href="/bookmarks">bookmarks</a></li>
2494 <li><a href="/bookmarks">bookmarks</a></li>
2488 <li><a href="/branches">branches</a></li>
2495 <li><a href="/branches">branches</a></li>
2489 </ul>
2496 </ul>
2490 <ul>
2497 <ul>
2491 <li class="active"><a href="/help">help</a></li>
2498 <li class="active"><a href="/help">help</a></li>
2492 </ul>
2499 </ul>
2493 </div>
2500 </div>
2494
2501
2495 <div class="main">
2502 <div class="main">
2496 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2503 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2497 <h3>Help: add</h3>
2504 <h3>Help: add</h3>
2498
2505
2499 <form class="search" action="/log">
2506 <form class="search" action="/log">
2500
2507
2501 <p><input name="rev" id="search1" type="text" size="30" /></p>
2508 <p><input name="rev" id="search1" type="text" size="30" /></p>
2502 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2509 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2503 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2510 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2504 </form>
2511 </form>
2505 <div id="doc">
2512 <div id="doc">
2506 <p>
2513 <p>
2507 hg add [OPTION]... [FILE]...
2514 hg add [OPTION]... [FILE]...
2508 </p>
2515 </p>
2509 <p>
2516 <p>
2510 add the specified files on the next commit
2517 add the specified files on the next commit
2511 </p>
2518 </p>
2512 <p>
2519 <p>
2513 Schedule files to be version controlled and added to the
2520 Schedule files to be version controlled and added to the
2514 repository.
2521 repository.
2515 </p>
2522 </p>
2516 <p>
2523 <p>
2517 The files will be added to the repository at the next commit. To
2524 The files will be added to the repository at the next commit. To
2518 undo an add before that, see 'hg forget'.
2525 undo an add before that, see 'hg forget'.
2519 </p>
2526 </p>
2520 <p>
2527 <p>
2521 If no names are given, add all files to the repository (except
2528 If no names are given, add all files to the repository (except
2522 files matching &quot;.hgignore&quot;).
2529 files matching &quot;.hgignore&quot;).
2523 </p>
2530 </p>
2524 <p>
2531 <p>
2525 Examples:
2532 Examples:
2526 </p>
2533 </p>
2527 <ul>
2534 <ul>
2528 <li> New (unknown) files are added automatically by 'hg add':
2535 <li> New (unknown) files are added automatically by 'hg add':
2529 <pre>
2536 <pre>
2530 \$ ls (re)
2537 \$ ls (re)
2531 foo.c
2538 foo.c
2532 \$ hg status (re)
2539 \$ hg status (re)
2533 ? foo.c
2540 ? foo.c
2534 \$ hg add (re)
2541 \$ hg add (re)
2535 adding foo.c
2542 adding foo.c
2536 \$ hg status (re)
2543 \$ hg status (re)
2537 A foo.c
2544 A foo.c
2538 </pre>
2545 </pre>
2539 <li> Specific files to be added can be specified:
2546 <li> Specific files to be added can be specified:
2540 <pre>
2547 <pre>
2541 \$ ls (re)
2548 \$ ls (re)
2542 bar.c foo.c
2549 bar.c foo.c
2543 \$ hg status (re)
2550 \$ hg status (re)
2544 ? bar.c
2551 ? bar.c
2545 ? foo.c
2552 ? foo.c
2546 \$ hg add bar.c (re)
2553 \$ hg add bar.c (re)
2547 \$ hg status (re)
2554 \$ hg status (re)
2548 A bar.c
2555 A bar.c
2549 ? foo.c
2556 ? foo.c
2550 </pre>
2557 </pre>
2551 </ul>
2558 </ul>
2552 <p>
2559 <p>
2553 Returns 0 if all files are successfully added.
2560 Returns 0 if all files are successfully added.
2554 </p>
2561 </p>
2555 <p>
2562 <p>
2556 options ([+] can be repeated):
2563 options ([+] can be repeated):
2557 </p>
2564 </p>
2558 <table>
2565 <table>
2559 <tr><td>-I</td>
2566 <tr><td>-I</td>
2560 <td>--include PATTERN [+]</td>
2567 <td>--include PATTERN [+]</td>
2561 <td>include names matching the given patterns</td></tr>
2568 <td>include names matching the given patterns</td></tr>
2562 <tr><td>-X</td>
2569 <tr><td>-X</td>
2563 <td>--exclude PATTERN [+]</td>
2570 <td>--exclude PATTERN [+]</td>
2564 <td>exclude names matching the given patterns</td></tr>
2571 <td>exclude names matching the given patterns</td></tr>
2565 <tr><td>-S</td>
2572 <tr><td>-S</td>
2566 <td>--subrepos</td>
2573 <td>--subrepos</td>
2567 <td>recurse into subrepositories</td></tr>
2574 <td>recurse into subrepositories</td></tr>
2568 <tr><td>-n</td>
2575 <tr><td>-n</td>
2569 <td>--dry-run</td>
2576 <td>--dry-run</td>
2570 <td>do not perform actions, just print output</td></tr>
2577 <td>do not perform actions, just print output</td></tr>
2571 </table>
2578 </table>
2572 <p>
2579 <p>
2573 global options ([+] can be repeated):
2580 global options ([+] can be repeated):
2574 </p>
2581 </p>
2575 <table>
2582 <table>
2576 <tr><td>-R</td>
2583 <tr><td>-R</td>
2577 <td>--repository REPO</td>
2584 <td>--repository REPO</td>
2578 <td>repository root directory or name of overlay bundle file</td></tr>
2585 <td>repository root directory or name of overlay bundle file</td></tr>
2579 <tr><td></td>
2586 <tr><td></td>
2580 <td>--cwd DIR</td>
2587 <td>--cwd DIR</td>
2581 <td>change working directory</td></tr>
2588 <td>change working directory</td></tr>
2582 <tr><td>-y</td>
2589 <tr><td>-y</td>
2583 <td>--noninteractive</td>
2590 <td>--noninteractive</td>
2584 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2591 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2585 <tr><td>-q</td>
2592 <tr><td>-q</td>
2586 <td>--quiet</td>
2593 <td>--quiet</td>
2587 <td>suppress output</td></tr>
2594 <td>suppress output</td></tr>
2588 <tr><td>-v</td>
2595 <tr><td>-v</td>
2589 <td>--verbose</td>
2596 <td>--verbose</td>
2590 <td>enable additional output</td></tr>
2597 <td>enable additional output</td></tr>
2591 <tr><td></td>
2598 <tr><td></td>
2592 <td>--color TYPE</td>
2599 <td>--color TYPE</td>
2593 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
2600 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
2594 <tr><td></td>
2601 <tr><td></td>
2595 <td>--config CONFIG [+]</td>
2602 <td>--config CONFIG [+]</td>
2596 <td>set/override config option (use 'section.name=value')</td></tr>
2603 <td>set/override config option (use 'section.name=value')</td></tr>
2597 <tr><td></td>
2604 <tr><td></td>
2598 <td>--debug</td>
2605 <td>--debug</td>
2599 <td>enable debugging output</td></tr>
2606 <td>enable debugging output</td></tr>
2600 <tr><td></td>
2607 <tr><td></td>
2601 <td>--debugger</td>
2608 <td>--debugger</td>
2602 <td>start debugger</td></tr>
2609 <td>start debugger</td></tr>
2603 <tr><td></td>
2610 <tr><td></td>
2604 <td>--encoding ENCODE</td>
2611 <td>--encoding ENCODE</td>
2605 <td>set the charset encoding (default: ascii)</td></tr>
2612 <td>set the charset encoding (default: ascii)</td></tr>
2606 <tr><td></td>
2613 <tr><td></td>
2607 <td>--encodingmode MODE</td>
2614 <td>--encodingmode MODE</td>
2608 <td>set the charset encoding mode (default: strict)</td></tr>
2615 <td>set the charset encoding mode (default: strict)</td></tr>
2609 <tr><td></td>
2616 <tr><td></td>
2610 <td>--traceback</td>
2617 <td>--traceback</td>
2611 <td>always print a traceback on exception</td></tr>
2618 <td>always print a traceback on exception</td></tr>
2612 <tr><td></td>
2619 <tr><td></td>
2613 <td>--time</td>
2620 <td>--time</td>
2614 <td>time how long the command takes</td></tr>
2621 <td>time how long the command takes</td></tr>
2615 <tr><td></td>
2622 <tr><td></td>
2616 <td>--profile</td>
2623 <td>--profile</td>
2617 <td>print command execution profile</td></tr>
2624 <td>print command execution profile</td></tr>
2618 <tr><td></td>
2625 <tr><td></td>
2619 <td>--version</td>
2626 <td>--version</td>
2620 <td>output version information and exit</td></tr>
2627 <td>output version information and exit</td></tr>
2621 <tr><td>-h</td>
2628 <tr><td>-h</td>
2622 <td>--help</td>
2629 <td>--help</td>
2623 <td>display help and exit</td></tr>
2630 <td>display help and exit</td></tr>
2624 <tr><td></td>
2631 <tr><td></td>
2625 <td>--hidden</td>
2632 <td>--hidden</td>
2626 <td>consider hidden changesets</td></tr>
2633 <td>consider hidden changesets</td></tr>
2627 <tr><td></td>
2634 <tr><td></td>
2628 <td>--pager TYPE</td>
2635 <td>--pager TYPE</td>
2629 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
2636 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
2630 </table>
2637 </table>
2631
2638
2632 </div>
2639 </div>
2633 </div>
2640 </div>
2634 </div>
2641 </div>
2635
2642
2636
2643
2637
2644
2638 </body>
2645 </body>
2639 </html>
2646 </html>
2640
2647
2641
2648
2642 $ get-with-headers.py $LOCALIP:$HGPORT "help/remove"
2649 $ get-with-headers.py $LOCALIP:$HGPORT "help/remove"
2643 200 Script output follows
2650 200 Script output follows
2644
2651
2645 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2652 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2646 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2653 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2647 <head>
2654 <head>
2648 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2655 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2649 <meta name="robots" content="index, nofollow" />
2656 <meta name="robots" content="index, nofollow" />
2650 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2657 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2651 <script type="text/javascript" src="/static/mercurial.js"></script>
2658 <script type="text/javascript" src="/static/mercurial.js"></script>
2652
2659
2653 <title>Help: remove</title>
2660 <title>Help: remove</title>
2654 </head>
2661 </head>
2655 <body>
2662 <body>
2656
2663
2657 <div class="container">
2664 <div class="container">
2658 <div class="menu">
2665 <div class="menu">
2659 <div class="logo">
2666 <div class="logo">
2660 <a href="https://mercurial-scm.org/">
2667 <a href="https://mercurial-scm.org/">
2661 <img src="/static/hglogo.png" alt="mercurial" /></a>
2668 <img src="/static/hglogo.png" alt="mercurial" /></a>
2662 </div>
2669 </div>
2663 <ul>
2670 <ul>
2664 <li><a href="/shortlog">log</a></li>
2671 <li><a href="/shortlog">log</a></li>
2665 <li><a href="/graph">graph</a></li>
2672 <li><a href="/graph">graph</a></li>
2666 <li><a href="/tags">tags</a></li>
2673 <li><a href="/tags">tags</a></li>
2667 <li><a href="/bookmarks">bookmarks</a></li>
2674 <li><a href="/bookmarks">bookmarks</a></li>
2668 <li><a href="/branches">branches</a></li>
2675 <li><a href="/branches">branches</a></li>
2669 </ul>
2676 </ul>
2670 <ul>
2677 <ul>
2671 <li class="active"><a href="/help">help</a></li>
2678 <li class="active"><a href="/help">help</a></li>
2672 </ul>
2679 </ul>
2673 </div>
2680 </div>
2674
2681
2675 <div class="main">
2682 <div class="main">
2676 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2683 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2677 <h3>Help: remove</h3>
2684 <h3>Help: remove</h3>
2678
2685
2679 <form class="search" action="/log">
2686 <form class="search" action="/log">
2680
2687
2681 <p><input name="rev" id="search1" type="text" size="30" /></p>
2688 <p><input name="rev" id="search1" type="text" size="30" /></p>
2682 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2689 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2683 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2690 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2684 </form>
2691 </form>
2685 <div id="doc">
2692 <div id="doc">
2686 <p>
2693 <p>
2687 hg remove [OPTION]... FILE...
2694 hg remove [OPTION]... FILE...
2688 </p>
2695 </p>
2689 <p>
2696 <p>
2690 aliases: rm
2697 aliases: rm
2691 </p>
2698 </p>
2692 <p>
2699 <p>
2693 remove the specified files on the next commit
2700 remove the specified files on the next commit
2694 </p>
2701 </p>
2695 <p>
2702 <p>
2696 Schedule the indicated files for removal from the current branch.
2703 Schedule the indicated files for removal from the current branch.
2697 </p>
2704 </p>
2698 <p>
2705 <p>
2699 This command schedules the files to be removed at the next commit.
2706 This command schedules the files to be removed at the next commit.
2700 To undo a remove before that, see 'hg revert'. To undo added
2707 To undo a remove before that, see 'hg revert'. To undo added
2701 files, see 'hg forget'.
2708 files, see 'hg forget'.
2702 </p>
2709 </p>
2703 <p>
2710 <p>
2704 -A/--after can be used to remove only files that have already
2711 -A/--after can be used to remove only files that have already
2705 been deleted, -f/--force can be used to force deletion, and -Af
2712 been deleted, -f/--force can be used to force deletion, and -Af
2706 can be used to remove files from the next revision without
2713 can be used to remove files from the next revision without
2707 deleting them from the working directory.
2714 deleting them from the working directory.
2708 </p>
2715 </p>
2709 <p>
2716 <p>
2710 The following table details the behavior of remove for different
2717 The following table details the behavior of remove for different
2711 file states (columns) and option combinations (rows). The file
2718 file states (columns) and option combinations (rows). The file
2712 states are Added [A], Clean [C], Modified [M] and Missing [!]
2719 states are Added [A], Clean [C], Modified [M] and Missing [!]
2713 (as reported by 'hg status'). The actions are Warn, Remove
2720 (as reported by 'hg status'). The actions are Warn, Remove
2714 (from branch) and Delete (from disk):
2721 (from branch) and Delete (from disk):
2715 </p>
2722 </p>
2716 <table>
2723 <table>
2717 <tr><td>opt/state</td>
2724 <tr><td>opt/state</td>
2718 <td>A</td>
2725 <td>A</td>
2719 <td>C</td>
2726 <td>C</td>
2720 <td>M</td>
2727 <td>M</td>
2721 <td>!</td></tr>
2728 <td>!</td></tr>
2722 <tr><td>none</td>
2729 <tr><td>none</td>
2723 <td>W</td>
2730 <td>W</td>
2724 <td>RD</td>
2731 <td>RD</td>
2725 <td>W</td>
2732 <td>W</td>
2726 <td>R</td></tr>
2733 <td>R</td></tr>
2727 <tr><td>-f</td>
2734 <tr><td>-f</td>
2728 <td>R</td>
2735 <td>R</td>
2729 <td>RD</td>
2736 <td>RD</td>
2730 <td>RD</td>
2737 <td>RD</td>
2731 <td>R</td></tr>
2738 <td>R</td></tr>
2732 <tr><td>-A</td>
2739 <tr><td>-A</td>
2733 <td>W</td>
2740 <td>W</td>
2734 <td>W</td>
2741 <td>W</td>
2735 <td>W</td>
2742 <td>W</td>
2736 <td>R</td></tr>
2743 <td>R</td></tr>
2737 <tr><td>-Af</td>
2744 <tr><td>-Af</td>
2738 <td>R</td>
2745 <td>R</td>
2739 <td>R</td>
2746 <td>R</td>
2740 <td>R</td>
2747 <td>R</td>
2741 <td>R</td></tr>
2748 <td>R</td></tr>
2742 </table>
2749 </table>
2743 <p>
2750 <p>
2744 <b>Note:</b>
2751 <b>Note:</b>
2745 </p>
2752 </p>
2746 <p>
2753 <p>
2747 'hg remove' never deletes files in Added [A] state from the
2754 'hg remove' never deletes files in Added [A] state from the
2748 working directory, not even if &quot;--force&quot; is specified.
2755 working directory, not even if &quot;--force&quot; is specified.
2749 </p>
2756 </p>
2750 <p>
2757 <p>
2751 Returns 0 on success, 1 if any warnings encountered.
2758 Returns 0 on success, 1 if any warnings encountered.
2752 </p>
2759 </p>
2753 <p>
2760 <p>
2754 options ([+] can be repeated):
2761 options ([+] can be repeated):
2755 </p>
2762 </p>
2756 <table>
2763 <table>
2757 <tr><td>-A</td>
2764 <tr><td>-A</td>
2758 <td>--after</td>
2765 <td>--after</td>
2759 <td>record delete for missing files</td></tr>
2766 <td>record delete for missing files</td></tr>
2760 <tr><td>-f</td>
2767 <tr><td>-f</td>
2761 <td>--force</td>
2768 <td>--force</td>
2762 <td>forget added files, delete modified files</td></tr>
2769 <td>forget added files, delete modified files</td></tr>
2763 <tr><td>-S</td>
2770 <tr><td>-S</td>
2764 <td>--subrepos</td>
2771 <td>--subrepos</td>
2765 <td>recurse into subrepositories</td></tr>
2772 <td>recurse into subrepositories</td></tr>
2766 <tr><td>-I</td>
2773 <tr><td>-I</td>
2767 <td>--include PATTERN [+]</td>
2774 <td>--include PATTERN [+]</td>
2768 <td>include names matching the given patterns</td></tr>
2775 <td>include names matching the given patterns</td></tr>
2769 <tr><td>-X</td>
2776 <tr><td>-X</td>
2770 <td>--exclude PATTERN [+]</td>
2777 <td>--exclude PATTERN [+]</td>
2771 <td>exclude names matching the given patterns</td></tr>
2778 <td>exclude names matching the given patterns</td></tr>
2772 </table>
2779 </table>
2773 <p>
2780 <p>
2774 global options ([+] can be repeated):
2781 global options ([+] can be repeated):
2775 </p>
2782 </p>
2776 <table>
2783 <table>
2777 <tr><td>-R</td>
2784 <tr><td>-R</td>
2778 <td>--repository REPO</td>
2785 <td>--repository REPO</td>
2779 <td>repository root directory or name of overlay bundle file</td></tr>
2786 <td>repository root directory or name of overlay bundle file</td></tr>
2780 <tr><td></td>
2787 <tr><td></td>
2781 <td>--cwd DIR</td>
2788 <td>--cwd DIR</td>
2782 <td>change working directory</td></tr>
2789 <td>change working directory</td></tr>
2783 <tr><td>-y</td>
2790 <tr><td>-y</td>
2784 <td>--noninteractive</td>
2791 <td>--noninteractive</td>
2785 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2792 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2786 <tr><td>-q</td>
2793 <tr><td>-q</td>
2787 <td>--quiet</td>
2794 <td>--quiet</td>
2788 <td>suppress output</td></tr>
2795 <td>suppress output</td></tr>
2789 <tr><td>-v</td>
2796 <tr><td>-v</td>
2790 <td>--verbose</td>
2797 <td>--verbose</td>
2791 <td>enable additional output</td></tr>
2798 <td>enable additional output</td></tr>
2792 <tr><td></td>
2799 <tr><td></td>
2793 <td>--color TYPE</td>
2800 <td>--color TYPE</td>
2794 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
2801 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
2795 <tr><td></td>
2802 <tr><td></td>
2796 <td>--config CONFIG [+]</td>
2803 <td>--config CONFIG [+]</td>
2797 <td>set/override config option (use 'section.name=value')</td></tr>
2804 <td>set/override config option (use 'section.name=value')</td></tr>
2798 <tr><td></td>
2805 <tr><td></td>
2799 <td>--debug</td>
2806 <td>--debug</td>
2800 <td>enable debugging output</td></tr>
2807 <td>enable debugging output</td></tr>
2801 <tr><td></td>
2808 <tr><td></td>
2802 <td>--debugger</td>
2809 <td>--debugger</td>
2803 <td>start debugger</td></tr>
2810 <td>start debugger</td></tr>
2804 <tr><td></td>
2811 <tr><td></td>
2805 <td>--encoding ENCODE</td>
2812 <td>--encoding ENCODE</td>
2806 <td>set the charset encoding (default: ascii)</td></tr>
2813 <td>set the charset encoding (default: ascii)</td></tr>
2807 <tr><td></td>
2814 <tr><td></td>
2808 <td>--encodingmode MODE</td>
2815 <td>--encodingmode MODE</td>
2809 <td>set the charset encoding mode (default: strict)</td></tr>
2816 <td>set the charset encoding mode (default: strict)</td></tr>
2810 <tr><td></td>
2817 <tr><td></td>
2811 <td>--traceback</td>
2818 <td>--traceback</td>
2812 <td>always print a traceback on exception</td></tr>
2819 <td>always print a traceback on exception</td></tr>
2813 <tr><td></td>
2820 <tr><td></td>
2814 <td>--time</td>
2821 <td>--time</td>
2815 <td>time how long the command takes</td></tr>
2822 <td>time how long the command takes</td></tr>
2816 <tr><td></td>
2823 <tr><td></td>
2817 <td>--profile</td>
2824 <td>--profile</td>
2818 <td>print command execution profile</td></tr>
2825 <td>print command execution profile</td></tr>
2819 <tr><td></td>
2826 <tr><td></td>
2820 <td>--version</td>
2827 <td>--version</td>
2821 <td>output version information and exit</td></tr>
2828 <td>output version information and exit</td></tr>
2822 <tr><td>-h</td>
2829 <tr><td>-h</td>
2823 <td>--help</td>
2830 <td>--help</td>
2824 <td>display help and exit</td></tr>
2831 <td>display help and exit</td></tr>
2825 <tr><td></td>
2832 <tr><td></td>
2826 <td>--hidden</td>
2833 <td>--hidden</td>
2827 <td>consider hidden changesets</td></tr>
2834 <td>consider hidden changesets</td></tr>
2828 <tr><td></td>
2835 <tr><td></td>
2829 <td>--pager TYPE</td>
2836 <td>--pager TYPE</td>
2830 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
2837 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
2831 </table>
2838 </table>
2832
2839
2833 </div>
2840 </div>
2834 </div>
2841 </div>
2835 </div>
2842 </div>
2836
2843
2837
2844
2838
2845
2839 </body>
2846 </body>
2840 </html>
2847 </html>
2841
2848
2842
2849
2843 $ get-with-headers.py $LOCALIP:$HGPORT "help/dates"
2850 $ get-with-headers.py $LOCALIP:$HGPORT "help/dates"
2844 200 Script output follows
2851 200 Script output follows
2845
2852
2846 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2853 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2847 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2854 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2848 <head>
2855 <head>
2849 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2856 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2850 <meta name="robots" content="index, nofollow" />
2857 <meta name="robots" content="index, nofollow" />
2851 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2858 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2852 <script type="text/javascript" src="/static/mercurial.js"></script>
2859 <script type="text/javascript" src="/static/mercurial.js"></script>
2853
2860
2854 <title>Help: dates</title>
2861 <title>Help: dates</title>
2855 </head>
2862 </head>
2856 <body>
2863 <body>
2857
2864
2858 <div class="container">
2865 <div class="container">
2859 <div class="menu">
2866 <div class="menu">
2860 <div class="logo">
2867 <div class="logo">
2861 <a href="https://mercurial-scm.org/">
2868 <a href="https://mercurial-scm.org/">
2862 <img src="/static/hglogo.png" alt="mercurial" /></a>
2869 <img src="/static/hglogo.png" alt="mercurial" /></a>
2863 </div>
2870 </div>
2864 <ul>
2871 <ul>
2865 <li><a href="/shortlog">log</a></li>
2872 <li><a href="/shortlog">log</a></li>
2866 <li><a href="/graph">graph</a></li>
2873 <li><a href="/graph">graph</a></li>
2867 <li><a href="/tags">tags</a></li>
2874 <li><a href="/tags">tags</a></li>
2868 <li><a href="/bookmarks">bookmarks</a></li>
2875 <li><a href="/bookmarks">bookmarks</a></li>
2869 <li><a href="/branches">branches</a></li>
2876 <li><a href="/branches">branches</a></li>
2870 </ul>
2877 </ul>
2871 <ul>
2878 <ul>
2872 <li class="active"><a href="/help">help</a></li>
2879 <li class="active"><a href="/help">help</a></li>
2873 </ul>
2880 </ul>
2874 </div>
2881 </div>
2875
2882
2876 <div class="main">
2883 <div class="main">
2877 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2884 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2878 <h3>Help: dates</h3>
2885 <h3>Help: dates</h3>
2879
2886
2880 <form class="search" action="/log">
2887 <form class="search" action="/log">
2881
2888
2882 <p><input name="rev" id="search1" type="text" size="30" /></p>
2889 <p><input name="rev" id="search1" type="text" size="30" /></p>
2883 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2890 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2884 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2891 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2885 </form>
2892 </form>
2886 <div id="doc">
2893 <div id="doc">
2887 <h1>Date Formats</h1>
2894 <h1>Date Formats</h1>
2888 <p>
2895 <p>
2889 Some commands allow the user to specify a date, e.g.:
2896 Some commands allow the user to specify a date, e.g.:
2890 </p>
2897 </p>
2891 <ul>
2898 <ul>
2892 <li> backout, commit, import, tag: Specify the commit date.
2899 <li> backout, commit, import, tag: Specify the commit date.
2893 <li> log, revert, update: Select revision(s) by date.
2900 <li> log, revert, update: Select revision(s) by date.
2894 </ul>
2901 </ul>
2895 <p>
2902 <p>
2896 Many date formats are valid. Here are some examples:
2903 Many date formats are valid. Here are some examples:
2897 </p>
2904 </p>
2898 <ul>
2905 <ul>
2899 <li> &quot;Wed Dec 6 13:18:29 2006&quot; (local timezone assumed)
2906 <li> &quot;Wed Dec 6 13:18:29 2006&quot; (local timezone assumed)
2900 <li> &quot;Dec 6 13:18 -0600&quot; (year assumed, time offset provided)
2907 <li> &quot;Dec 6 13:18 -0600&quot; (year assumed, time offset provided)
2901 <li> &quot;Dec 6 13:18 UTC&quot; (UTC and GMT are aliases for +0000)
2908 <li> &quot;Dec 6 13:18 UTC&quot; (UTC and GMT are aliases for +0000)
2902 <li> &quot;Dec 6&quot; (midnight)
2909 <li> &quot;Dec 6&quot; (midnight)
2903 <li> &quot;13:18&quot; (today assumed)
2910 <li> &quot;13:18&quot; (today assumed)
2904 <li> &quot;3:39&quot; (3:39AM assumed)
2911 <li> &quot;3:39&quot; (3:39AM assumed)
2905 <li> &quot;3:39pm&quot; (15:39)
2912 <li> &quot;3:39pm&quot; (15:39)
2906 <li> &quot;2006-12-06 13:18:29&quot; (ISO 8601 format)
2913 <li> &quot;2006-12-06 13:18:29&quot; (ISO 8601 format)
2907 <li> &quot;2006-12-6 13:18&quot;
2914 <li> &quot;2006-12-6 13:18&quot;
2908 <li> &quot;2006-12-6&quot;
2915 <li> &quot;2006-12-6&quot;
2909 <li> &quot;12-6&quot;
2916 <li> &quot;12-6&quot;
2910 <li> &quot;12/6&quot;
2917 <li> &quot;12/6&quot;
2911 <li> &quot;12/6/6&quot; (Dec 6 2006)
2918 <li> &quot;12/6/6&quot; (Dec 6 2006)
2912 <li> &quot;today&quot; (midnight)
2919 <li> &quot;today&quot; (midnight)
2913 <li> &quot;yesterday&quot; (midnight)
2920 <li> &quot;yesterday&quot; (midnight)
2914 <li> &quot;now&quot; - right now
2921 <li> &quot;now&quot; - right now
2915 </ul>
2922 </ul>
2916 <p>
2923 <p>
2917 Lastly, there is Mercurial's internal format:
2924 Lastly, there is Mercurial's internal format:
2918 </p>
2925 </p>
2919 <ul>
2926 <ul>
2920 <li> &quot;1165411109 0&quot; (Wed Dec 6 13:18:29 2006 UTC)
2927 <li> &quot;1165411109 0&quot; (Wed Dec 6 13:18:29 2006 UTC)
2921 </ul>
2928 </ul>
2922 <p>
2929 <p>
2923 This is the internal representation format for dates. The first number
2930 This is the internal representation format for dates. The first number
2924 is the number of seconds since the epoch (1970-01-01 00:00 UTC). The
2931 is the number of seconds since the epoch (1970-01-01 00:00 UTC). The
2925 second is the offset of the local timezone, in seconds west of UTC
2932 second is the offset of the local timezone, in seconds west of UTC
2926 (negative if the timezone is east of UTC).
2933 (negative if the timezone is east of UTC).
2927 </p>
2934 </p>
2928 <p>
2935 <p>
2929 The log command also accepts date ranges:
2936 The log command also accepts date ranges:
2930 </p>
2937 </p>
2931 <ul>
2938 <ul>
2932 <li> &quot;&lt;DATE&quot; - at or before a given date/time
2939 <li> &quot;&lt;DATE&quot; - at or before a given date/time
2933 <li> &quot;&gt;DATE&quot; - on or after a given date/time
2940 <li> &quot;&gt;DATE&quot; - on or after a given date/time
2934 <li> &quot;DATE to DATE&quot; - a date range, inclusive
2941 <li> &quot;DATE to DATE&quot; - a date range, inclusive
2935 <li> &quot;-DAYS&quot; - within a given number of days of today
2942 <li> &quot;-DAYS&quot; - within a given number of days of today
2936 </ul>
2943 </ul>
2937
2944
2938 </div>
2945 </div>
2939 </div>
2946 </div>
2940 </div>
2947 </div>
2941
2948
2942
2949
2943
2950
2944 </body>
2951 </body>
2945 </html>
2952 </html>
2946
2953
2947
2954
2948 Sub-topic indexes rendered properly
2955 Sub-topic indexes rendered properly
2949
2956
2950 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals"
2957 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals"
2951 200 Script output follows
2958 200 Script output follows
2952
2959
2953 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2960 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2954 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2961 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2955 <head>
2962 <head>
2956 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2963 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2957 <meta name="robots" content="index, nofollow" />
2964 <meta name="robots" content="index, nofollow" />
2958 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2965 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2959 <script type="text/javascript" src="/static/mercurial.js"></script>
2966 <script type="text/javascript" src="/static/mercurial.js"></script>
2960
2967
2961 <title>Help: internals</title>
2968 <title>Help: internals</title>
2962 </head>
2969 </head>
2963 <body>
2970 <body>
2964
2971
2965 <div class="container">
2972 <div class="container">
2966 <div class="menu">
2973 <div class="menu">
2967 <div class="logo">
2974 <div class="logo">
2968 <a href="https://mercurial-scm.org/">
2975 <a href="https://mercurial-scm.org/">
2969 <img src="/static/hglogo.png" alt="mercurial" /></a>
2976 <img src="/static/hglogo.png" alt="mercurial" /></a>
2970 </div>
2977 </div>
2971 <ul>
2978 <ul>
2972 <li><a href="/shortlog">log</a></li>
2979 <li><a href="/shortlog">log</a></li>
2973 <li><a href="/graph">graph</a></li>
2980 <li><a href="/graph">graph</a></li>
2974 <li><a href="/tags">tags</a></li>
2981 <li><a href="/tags">tags</a></li>
2975 <li><a href="/bookmarks">bookmarks</a></li>
2982 <li><a href="/bookmarks">bookmarks</a></li>
2976 <li><a href="/branches">branches</a></li>
2983 <li><a href="/branches">branches</a></li>
2977 </ul>
2984 </ul>
2978 <ul>
2985 <ul>
2979 <li><a href="/help">help</a></li>
2986 <li><a href="/help">help</a></li>
2980 </ul>
2987 </ul>
2981 </div>
2988 </div>
2982
2989
2983 <div class="main">
2990 <div class="main">
2984 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2991 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2985 <form class="search" action="/log">
2992 <form class="search" action="/log">
2986
2993
2987 <p><input name="rev" id="search1" type="text" size="30" /></p>
2994 <p><input name="rev" id="search1" type="text" size="30" /></p>
2988 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2995 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2989 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2996 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2990 </form>
2997 </form>
2991 <table class="bigtable">
2998 <table class="bigtable">
2992 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
2999 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
2993
3000
2994 <tr><td>
3001 <tr><td>
2995 <a href="/help/internals.bundles">
3002 <a href="/help/internals.bundles">
2996 bundles
3003 bundles
2997 </a>
3004 </a>
2998 </td><td>
3005 </td><td>
2999 Bundles
3006 Bundles
3000 </td></tr>
3007 </td></tr>
3001 <tr><td>
3008 <tr><td>
3002 <a href="/help/internals.censor">
3009 <a href="/help/internals.censor">
3003 censor
3010 censor
3004 </a>
3011 </a>
3005 </td><td>
3012 </td><td>
3006 Censor
3013 Censor
3007 </td></tr>
3014 </td></tr>
3008 <tr><td>
3015 <tr><td>
3009 <a href="/help/internals.changegroups">
3016 <a href="/help/internals.changegroups">
3010 changegroups
3017 changegroups
3011 </a>
3018 </a>
3012 </td><td>
3019 </td><td>
3013 Changegroups
3020 Changegroups
3014 </td></tr>
3021 </td></tr>
3015 <tr><td>
3022 <tr><td>
3016 <a href="/help/internals.requirements">
3023 <a href="/help/internals.requirements">
3017 requirements
3024 requirements
3018 </a>
3025 </a>
3019 </td><td>
3026 </td><td>
3020 Repository Requirements
3027 Repository Requirements
3021 </td></tr>
3028 </td></tr>
3022 <tr><td>
3029 <tr><td>
3023 <a href="/help/internals.revlogs">
3030 <a href="/help/internals.revlogs">
3024 revlogs
3031 revlogs
3025 </a>
3032 </a>
3026 </td><td>
3033 </td><td>
3027 Revision Logs
3034 Revision Logs
3028 </td></tr>
3035 </td></tr>
3029 <tr><td>
3036 <tr><td>
3030 <a href="/help/internals.wireprotocol">
3037 <a href="/help/internals.wireprotocol">
3031 wireprotocol
3038 wireprotocol
3032 </a>
3039 </a>
3033 </td><td>
3040 </td><td>
3034 Wire Protocol
3041 Wire Protocol
3035 </td></tr>
3042 </td></tr>
3036
3043
3037
3044
3038
3045
3039
3046
3040
3047
3041 </table>
3048 </table>
3042 </div>
3049 </div>
3043 </div>
3050 </div>
3044
3051
3045
3052
3046
3053
3047 </body>
3054 </body>
3048 </html>
3055 </html>
3049
3056
3050
3057
3051 Sub-topic topics rendered properly
3058 Sub-topic topics rendered properly
3052
3059
3053 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals.changegroups"
3060 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals.changegroups"
3054 200 Script output follows
3061 200 Script output follows
3055
3062
3056 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3063 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3057 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3064 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3058 <head>
3065 <head>
3059 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3066 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3060 <meta name="robots" content="index, nofollow" />
3067 <meta name="robots" content="index, nofollow" />
3061 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3068 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3062 <script type="text/javascript" src="/static/mercurial.js"></script>
3069 <script type="text/javascript" src="/static/mercurial.js"></script>
3063
3070
3064 <title>Help: internals.changegroups</title>
3071 <title>Help: internals.changegroups</title>
3065 </head>
3072 </head>
3066 <body>
3073 <body>
3067
3074
3068 <div class="container">
3075 <div class="container">
3069 <div class="menu">
3076 <div class="menu">
3070 <div class="logo">
3077 <div class="logo">
3071 <a href="https://mercurial-scm.org/">
3078 <a href="https://mercurial-scm.org/">
3072 <img src="/static/hglogo.png" alt="mercurial" /></a>
3079 <img src="/static/hglogo.png" alt="mercurial" /></a>
3073 </div>
3080 </div>
3074 <ul>
3081 <ul>
3075 <li><a href="/shortlog">log</a></li>
3082 <li><a href="/shortlog">log</a></li>
3076 <li><a href="/graph">graph</a></li>
3083 <li><a href="/graph">graph</a></li>
3077 <li><a href="/tags">tags</a></li>
3084 <li><a href="/tags">tags</a></li>
3078 <li><a href="/bookmarks">bookmarks</a></li>
3085 <li><a href="/bookmarks">bookmarks</a></li>
3079 <li><a href="/branches">branches</a></li>
3086 <li><a href="/branches">branches</a></li>
3080 </ul>
3087 </ul>
3081 <ul>
3088 <ul>
3082 <li class="active"><a href="/help">help</a></li>
3089 <li class="active"><a href="/help">help</a></li>
3083 </ul>
3090 </ul>
3084 </div>
3091 </div>
3085
3092
3086 <div class="main">
3093 <div class="main">
3087 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3094 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3088 <h3>Help: internals.changegroups</h3>
3095 <h3>Help: internals.changegroups</h3>
3089
3096
3090 <form class="search" action="/log">
3097 <form class="search" action="/log">
3091
3098
3092 <p><input name="rev" id="search1" type="text" size="30" /></p>
3099 <p><input name="rev" id="search1" type="text" size="30" /></p>
3093 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3100 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3094 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3101 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3095 </form>
3102 </form>
3096 <div id="doc">
3103 <div id="doc">
3097 <h1>Changegroups</h1>
3104 <h1>Changegroups</h1>
3098 <p>
3105 <p>
3099 Changegroups are representations of repository revlog data, specifically
3106 Changegroups are representations of repository revlog data, specifically
3100 the changelog data, root/flat manifest data, treemanifest data, and
3107 the changelog data, root/flat manifest data, treemanifest data, and
3101 filelogs.
3108 filelogs.
3102 </p>
3109 </p>
3103 <p>
3110 <p>
3104 There are 3 versions of changegroups: &quot;1&quot;, &quot;2&quot;, and &quot;3&quot;. From a
3111 There are 3 versions of changegroups: &quot;1&quot;, &quot;2&quot;, and &quot;3&quot;. From a
3105 high-level, versions &quot;1&quot; and &quot;2&quot; are almost exactly the same, with the
3112 high-level, versions &quot;1&quot; and &quot;2&quot; are almost exactly the same, with the
3106 only difference being an additional item in the *delta header*. Version
3113 only difference being an additional item in the *delta header*. Version
3107 &quot;3&quot; adds support for revlog flags in the *delta header* and optionally
3114 &quot;3&quot; adds support for revlog flags in the *delta header* and optionally
3108 exchanging treemanifests (enabled by setting an option on the
3115 exchanging treemanifests (enabled by setting an option on the
3109 &quot;changegroup&quot; part in the bundle2).
3116 &quot;changegroup&quot; part in the bundle2).
3110 </p>
3117 </p>
3111 <p>
3118 <p>
3112 Changegroups when not exchanging treemanifests consist of 3 logical
3119 Changegroups when not exchanging treemanifests consist of 3 logical
3113 segments:
3120 segments:
3114 </p>
3121 </p>
3115 <pre>
3122 <pre>
3116 +---------------------------------+
3123 +---------------------------------+
3117 | | | |
3124 | | | |
3118 | changeset | manifest | filelogs |
3125 | changeset | manifest | filelogs |
3119 | | | |
3126 | | | |
3120 | | | |
3127 | | | |
3121 +---------------------------------+
3128 +---------------------------------+
3122 </pre>
3129 </pre>
3123 <p>
3130 <p>
3124 When exchanging treemanifests, there are 4 logical segments:
3131 When exchanging treemanifests, there are 4 logical segments:
3125 </p>
3132 </p>
3126 <pre>
3133 <pre>
3127 +-------------------------------------------------+
3134 +-------------------------------------------------+
3128 | | | | |
3135 | | | | |
3129 | changeset | root | treemanifests | filelogs |
3136 | changeset | root | treemanifests | filelogs |
3130 | | manifest | | |
3137 | | manifest | | |
3131 | | | | |
3138 | | | | |
3132 +-------------------------------------------------+
3139 +-------------------------------------------------+
3133 </pre>
3140 </pre>
3134 <p>
3141 <p>
3135 The principle building block of each segment is a *chunk*. A *chunk*
3142 The principle building block of each segment is a *chunk*. A *chunk*
3136 is a framed piece of data:
3143 is a framed piece of data:
3137 </p>
3144 </p>
3138 <pre>
3145 <pre>
3139 +---------------------------------------+
3146 +---------------------------------------+
3140 | | |
3147 | | |
3141 | length | data |
3148 | length | data |
3142 | (4 bytes) | (&lt;length - 4&gt; bytes) |
3149 | (4 bytes) | (&lt;length - 4&gt; bytes) |
3143 | | |
3150 | | |
3144 +---------------------------------------+
3151 +---------------------------------------+
3145 </pre>
3152 </pre>
3146 <p>
3153 <p>
3147 All integers are big-endian signed integers. Each chunk starts with a 32-bit
3154 All integers are big-endian signed integers. Each chunk starts with a 32-bit
3148 integer indicating the length of the entire chunk (including the length field
3155 integer indicating the length of the entire chunk (including the length field
3149 itself).
3156 itself).
3150 </p>
3157 </p>
3151 <p>
3158 <p>
3152 There is a special case chunk that has a value of 0 for the length
3159 There is a special case chunk that has a value of 0 for the length
3153 (&quot;0x00000000&quot;). We call this an *empty chunk*.
3160 (&quot;0x00000000&quot;). We call this an *empty chunk*.
3154 </p>
3161 </p>
3155 <h2>Delta Groups</h2>
3162 <h2>Delta Groups</h2>
3156 <p>
3163 <p>
3157 A *delta group* expresses the content of a revlog as a series of deltas,
3164 A *delta group* expresses the content of a revlog as a series of deltas,
3158 or patches against previous revisions.
3165 or patches against previous revisions.
3159 </p>
3166 </p>
3160 <p>
3167 <p>
3161 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
3168 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
3162 to signal the end of the delta group:
3169 to signal the end of the delta group:
3163 </p>
3170 </p>
3164 <pre>
3171 <pre>
3165 +------------------------------------------------------------------------+
3172 +------------------------------------------------------------------------+
3166 | | | | | |
3173 | | | | | |
3167 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
3174 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
3168 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
3175 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
3169 | | | | | |
3176 | | | | | |
3170 +------------------------------------------------------------------------+
3177 +------------------------------------------------------------------------+
3171 </pre>
3178 </pre>
3172 <p>
3179 <p>
3173 Each *chunk*'s data consists of the following:
3180 Each *chunk*'s data consists of the following:
3174 </p>
3181 </p>
3175 <pre>
3182 <pre>
3176 +---------------------------------------+
3183 +---------------------------------------+
3177 | | |
3184 | | |
3178 | delta header | delta data |
3185 | delta header | delta data |
3179 | (various by version) | (various) |
3186 | (various by version) | (various) |
3180 | | |
3187 | | |
3181 +---------------------------------------+
3188 +---------------------------------------+
3182 </pre>
3189 </pre>
3183 <p>
3190 <p>
3184 The *delta data* is a series of *delta*s that describe a diff from an existing
3191 The *delta data* is a series of *delta*s that describe a diff from an existing
3185 entry (either that the recipient already has, or previously specified in the
3192 entry (either that the recipient already has, or previously specified in the
3186 bundle/changegroup).
3193 bundle/changegroup).
3187 </p>
3194 </p>
3188 <p>
3195 <p>
3189 The *delta header* is different between versions &quot;1&quot;, &quot;2&quot;, and
3196 The *delta header* is different between versions &quot;1&quot;, &quot;2&quot;, and
3190 &quot;3&quot; of the changegroup format.
3197 &quot;3&quot; of the changegroup format.
3191 </p>
3198 </p>
3192 <p>
3199 <p>
3193 Version 1 (headerlen=80):
3200 Version 1 (headerlen=80):
3194 </p>
3201 </p>
3195 <pre>
3202 <pre>
3196 +------------------------------------------------------+
3203 +------------------------------------------------------+
3197 | | | | |
3204 | | | | |
3198 | node | p1 node | p2 node | link node |
3205 | node | p1 node | p2 node | link node |
3199 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3206 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3200 | | | | |
3207 | | | | |
3201 +------------------------------------------------------+
3208 +------------------------------------------------------+
3202 </pre>
3209 </pre>
3203 <p>
3210 <p>
3204 Version 2 (headerlen=100):
3211 Version 2 (headerlen=100):
3205 </p>
3212 </p>
3206 <pre>
3213 <pre>
3207 +------------------------------------------------------------------+
3214 +------------------------------------------------------------------+
3208 | | | | | |
3215 | | | | | |
3209 | node | p1 node | p2 node | base node | link node |
3216 | node | p1 node | p2 node | base node | link node |
3210 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3217 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3211 | | | | | |
3218 | | | | | |
3212 +------------------------------------------------------------------+
3219 +------------------------------------------------------------------+
3213 </pre>
3220 </pre>
3214 <p>
3221 <p>
3215 Version 3 (headerlen=102):
3222 Version 3 (headerlen=102):
3216 </p>
3223 </p>
3217 <pre>
3224 <pre>
3218 +------------------------------------------------------------------------------+
3225 +------------------------------------------------------------------------------+
3219 | | | | | | |
3226 | | | | | | |
3220 | node | p1 node | p2 node | base node | link node | flags |
3227 | node | p1 node | p2 node | base node | link node | flags |
3221 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
3228 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
3222 | | | | | | |
3229 | | | | | | |
3223 +------------------------------------------------------------------------------+
3230 +------------------------------------------------------------------------------+
3224 </pre>
3231 </pre>
3225 <p>
3232 <p>
3226 The *delta data* consists of &quot;chunklen - 4 - headerlen&quot; bytes, which contain a
3233 The *delta data* consists of &quot;chunklen - 4 - headerlen&quot; bytes, which contain a
3227 series of *delta*s, densely packed (no separators). These deltas describe a diff
3234 series of *delta*s, densely packed (no separators). These deltas describe a diff
3228 from an existing entry (either that the recipient already has, or previously
3235 from an existing entry (either that the recipient already has, or previously
3229 specified in the bundle/changegroup). The format is described more fully in
3236 specified in the bundle/changegroup). The format is described more fully in
3230 &quot;hg help internals.bdiff&quot;, but briefly:
3237 &quot;hg help internals.bdiff&quot;, but briefly:
3231 </p>
3238 </p>
3232 <pre>
3239 <pre>
3233 +---------------------------------------------------------------+
3240 +---------------------------------------------------------------+
3234 | | | | |
3241 | | | | |
3235 | start offset | end offset | new length | content |
3242 | start offset | end offset | new length | content |
3236 | (4 bytes) | (4 bytes) | (4 bytes) | (&lt;new length&gt; bytes) |
3243 | (4 bytes) | (4 bytes) | (4 bytes) | (&lt;new length&gt; bytes) |
3237 | | | | |
3244 | | | | |
3238 +---------------------------------------------------------------+
3245 +---------------------------------------------------------------+
3239 </pre>
3246 </pre>
3240 <p>
3247 <p>
3241 Please note that the length field in the delta data does *not* include itself.
3248 Please note that the length field in the delta data does *not* include itself.
3242 </p>
3249 </p>
3243 <p>
3250 <p>
3244 In version 1, the delta is always applied against the previous node from
3251 In version 1, the delta is always applied against the previous node from
3245 the changegroup or the first parent if this is the first entry in the
3252 the changegroup or the first parent if this is the first entry in the
3246 changegroup.
3253 changegroup.
3247 </p>
3254 </p>
3248 <p>
3255 <p>
3249 In version 2 and up, the delta base node is encoded in the entry in the
3256 In version 2 and up, the delta base node is encoded in the entry in the
3250 changegroup. This allows the delta to be expressed against any parent,
3257 changegroup. This allows the delta to be expressed against any parent,
3251 which can result in smaller deltas and more efficient encoding of data.
3258 which can result in smaller deltas and more efficient encoding of data.
3252 </p>
3259 </p>
3253 <h2>Changeset Segment</h2>
3260 <h2>Changeset Segment</h2>
3254 <p>
3261 <p>
3255 The *changeset segment* consists of a single *delta group* holding
3262 The *changeset segment* consists of a single *delta group* holding
3256 changelog data. The *empty chunk* at the end of the *delta group* denotes
3263 changelog data. The *empty chunk* at the end of the *delta group* denotes
3257 the boundary to the *manifest segment*.
3264 the boundary to the *manifest segment*.
3258 </p>
3265 </p>
3259 <h2>Manifest Segment</h2>
3266 <h2>Manifest Segment</h2>
3260 <p>
3267 <p>
3261 The *manifest segment* consists of a single *delta group* holding manifest
3268 The *manifest segment* consists of a single *delta group* holding manifest
3262 data. If treemanifests are in use, it contains only the manifest for the
3269 data. If treemanifests are in use, it contains only the manifest for the
3263 root directory of the repository. Otherwise, it contains the entire
3270 root directory of the repository. Otherwise, it contains the entire
3264 manifest data. The *empty chunk* at the end of the *delta group* denotes
3271 manifest data. The *empty chunk* at the end of the *delta group* denotes
3265 the boundary to the next segment (either the *treemanifests segment* or the
3272 the boundary to the next segment (either the *treemanifests segment* or the
3266 *filelogs segment*, depending on version and the request options).
3273 *filelogs segment*, depending on version and the request options).
3267 </p>
3274 </p>
3268 <h3>Treemanifests Segment</h3>
3275 <h3>Treemanifests Segment</h3>
3269 <p>
3276 <p>
3270 The *treemanifests segment* only exists in changegroup version &quot;3&quot;, and
3277 The *treemanifests segment* only exists in changegroup version &quot;3&quot;, and
3271 only if the 'treemanifest' param is part of the bundle2 changegroup part
3278 only if the 'treemanifest' param is part of the bundle2 changegroup part
3272 (it is not possible to use changegroup version 3 outside of bundle2).
3279 (it is not possible to use changegroup version 3 outside of bundle2).
3273 Aside from the filenames in the *treemanifests segment* containing a
3280 Aside from the filenames in the *treemanifests segment* containing a
3274 trailing &quot;/&quot; character, it behaves identically to the *filelogs segment*
3281 trailing &quot;/&quot; character, it behaves identically to the *filelogs segment*
3275 (see below). The final sub-segment is followed by an *empty chunk* (logically,
3282 (see below). The final sub-segment is followed by an *empty chunk* (logically,
3276 a sub-segment with filename size 0). This denotes the boundary to the
3283 a sub-segment with filename size 0). This denotes the boundary to the
3277 *filelogs segment*.
3284 *filelogs segment*.
3278 </p>
3285 </p>
3279 <h2>Filelogs Segment</h2>
3286 <h2>Filelogs Segment</h2>
3280 <p>
3287 <p>
3281 The *filelogs segment* consists of multiple sub-segments, each
3288 The *filelogs segment* consists of multiple sub-segments, each
3282 corresponding to an individual file whose data is being described:
3289 corresponding to an individual file whose data is being described:
3283 </p>
3290 </p>
3284 <pre>
3291 <pre>
3285 +--------------------------------------------------+
3292 +--------------------------------------------------+
3286 | | | | | |
3293 | | | | | |
3287 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
3294 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
3288 | | | | | (4 bytes) |
3295 | | | | | (4 bytes) |
3289 | | | | | |
3296 | | | | | |
3290 +--------------------------------------------------+
3297 +--------------------------------------------------+
3291 </pre>
3298 </pre>
3292 <p>
3299 <p>
3293 The final filelog sub-segment is followed by an *empty chunk* (logically,
3300 The final filelog sub-segment is followed by an *empty chunk* (logically,
3294 a sub-segment with filename size 0). This denotes the end of the segment
3301 a sub-segment with filename size 0). This denotes the end of the segment
3295 and of the overall changegroup.
3302 and of the overall changegroup.
3296 </p>
3303 </p>
3297 <p>
3304 <p>
3298 Each filelog sub-segment consists of the following:
3305 Each filelog sub-segment consists of the following:
3299 </p>
3306 </p>
3300 <pre>
3307 <pre>
3301 +------------------------------------------------------+
3308 +------------------------------------------------------+
3302 | | | |
3309 | | | |
3303 | filename length | filename | delta group |
3310 | filename length | filename | delta group |
3304 | (4 bytes) | (&lt;length - 4&gt; bytes) | (various) |
3311 | (4 bytes) | (&lt;length - 4&gt; bytes) | (various) |
3305 | | | |
3312 | | | |
3306 +------------------------------------------------------+
3313 +------------------------------------------------------+
3307 </pre>
3314 </pre>
3308 <p>
3315 <p>
3309 That is, a *chunk* consisting of the filename (not terminated or padded)
3316 That is, a *chunk* consisting of the filename (not terminated or padded)
3310 followed by N chunks constituting the *delta group* for this file. The
3317 followed by N chunks constituting the *delta group* for this file. The
3311 *empty chunk* at the end of each *delta group* denotes the boundary to the
3318 *empty chunk* at the end of each *delta group* denotes the boundary to the
3312 next filelog sub-segment.
3319 next filelog sub-segment.
3313 </p>
3320 </p>
3314
3321
3315 </div>
3322 </div>
3316 </div>
3323 </div>
3317 </div>
3324 </div>
3318
3325
3319
3326
3320
3327
3321 </body>
3328 </body>
3322 </html>
3329 </html>
3323
3330
3324
3331
3325 $ killdaemons.py
3332 $ killdaemons.py
3326
3333
3327 #endif
3334 #endif
@@ -1,1217 +1,1283 b''
1 test merge-tools configuration - mostly exercising filemerge.py
1 test merge-tools configuration - mostly exercising filemerge.py
2
2
3 $ unset HGMERGE # make sure HGMERGE doesn't interfere with the test
3 $ unset HGMERGE # make sure HGMERGE doesn't interfere with the test
4 $ hg init
4 $ hg init
5
5
6 revision 0
6 revision 0
7
7
8 $ echo "revision 0" > f
8 $ echo "revision 0" > f
9 $ echo "space" >> f
9 $ echo "space" >> f
10 $ hg commit -Am "revision 0"
10 $ hg commit -Am "revision 0"
11 adding f
11 adding f
12
12
13 revision 1
13 revision 1
14
14
15 $ echo "revision 1" > f
15 $ echo "revision 1" > f
16 $ echo "space" >> f
16 $ echo "space" >> f
17 $ hg commit -Am "revision 1"
17 $ hg commit -Am "revision 1"
18 $ hg update 0 > /dev/null
18 $ hg update 0 > /dev/null
19
19
20 revision 2
20 revision 2
21
21
22 $ echo "revision 2" > f
22 $ echo "revision 2" > f
23 $ echo "space" >> f
23 $ echo "space" >> f
24 $ hg commit -Am "revision 2"
24 $ hg commit -Am "revision 2"
25 created new head
25 created new head
26 $ hg update 0 > /dev/null
26 $ hg update 0 > /dev/null
27
27
28 revision 3 - simple to merge
28 revision 3 - simple to merge
29
29
30 $ echo "revision 3" >> f
30 $ echo "revision 3" >> f
31 $ hg commit -Am "revision 3"
31 $ hg commit -Am "revision 3"
32 created new head
32 created new head
33
33
34 revision 4 - hard to merge
34 revision 4 - hard to merge
35
35
36 $ hg update 0 > /dev/null
36 $ hg update 0 > /dev/null
37 $ echo "revision 4" > f
37 $ echo "revision 4" > f
38 $ hg commit -Am "revision 4"
38 $ hg commit -Am "revision 4"
39 created new head
39 created new head
40
40
41 $ echo "[merge-tools]" > .hg/hgrc
41 $ echo "[merge-tools]" > .hg/hgrc
42
42
43 $ beforemerge() {
43 $ beforemerge() {
44 > cat .hg/hgrc
44 > cat .hg/hgrc
45 > echo "# hg update -C 1"
45 > echo "# hg update -C 1"
46 > hg update -C 1 > /dev/null
46 > hg update -C 1 > /dev/null
47 > }
47 > }
48 $ aftermerge() {
48 $ aftermerge() {
49 > echo "# cat f"
49 > echo "# cat f"
50 > cat f
50 > cat f
51 > echo "# hg stat"
51 > echo "# hg stat"
52 > hg stat
52 > hg stat
53 > echo "# hg resolve --list"
53 > echo "# hg resolve --list"
54 > hg resolve --list
54 > hg resolve --list
55 > rm -f f.orig
55 > rm -f f.orig
56 > }
56 > }
57
57
58 Tool selection
58 Tool selection
59
59
60 default is internal merge:
60 default is internal merge:
61
61
62 $ beforemerge
62 $ beforemerge
63 [merge-tools]
63 [merge-tools]
64 # hg update -C 1
64 # hg update -C 1
65
65
66 hg merge -r 2
66 hg merge -r 2
67 override $PATH to ensure hgmerge not visible; use $PYTHON in case we're
67 override $PATH to ensure hgmerge not visible; use $PYTHON in case we're
68 running from a devel copy, not a temp installation
68 running from a devel copy, not a temp installation
69
69
70 $ PATH="$BINDIR:/usr/sbin" $PYTHON "$BINDIR"/hg merge -r 2
70 $ PATH="$BINDIR:/usr/sbin" $PYTHON "$BINDIR"/hg merge -r 2
71 merging f
71 merging f
72 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
72 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
73 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
73 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
74 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
74 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
75 [1]
75 [1]
76 $ aftermerge
76 $ aftermerge
77 # cat f
77 # cat f
78 <<<<<<< working copy: ef83787e2614 - test: revision 1
78 <<<<<<< working copy: ef83787e2614 - test: revision 1
79 revision 1
79 revision 1
80 =======
80 =======
81 revision 2
81 revision 2
82 >>>>>>> merge rev: 0185f4e0cf02 - test: revision 2
82 >>>>>>> merge rev: 0185f4e0cf02 - test: revision 2
83 space
83 space
84 # hg stat
84 # hg stat
85 M f
85 M f
86 ? f.orig
86 ? f.orig
87 # hg resolve --list
87 # hg resolve --list
88 U f
88 U f
89
89
90 simplest hgrc using false for merge:
90 simplest hgrc using false for merge:
91
91
92 $ echo "false.whatever=" >> .hg/hgrc
92 $ echo "false.whatever=" >> .hg/hgrc
93 $ beforemerge
93 $ beforemerge
94 [merge-tools]
94 [merge-tools]
95 false.whatever=
95 false.whatever=
96 # hg update -C 1
96 # hg update -C 1
97 $ hg merge -r 2
97 $ hg merge -r 2
98 merging f
98 merging f
99 merging f failed!
99 merging f failed!
100 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
100 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
101 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
101 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
102 [1]
102 [1]
103 $ aftermerge
103 $ aftermerge
104 # cat f
104 # cat f
105 revision 1
105 revision 1
106 space
106 space
107 # hg stat
107 # hg stat
108 M f
108 M f
109 ? f.orig
109 ? f.orig
110 # hg resolve --list
110 # hg resolve --list
111 U f
111 U f
112
112
113 #if unix-permissions
113 #if unix-permissions
114
114
115 unexecutable file in $PATH shouldn't be found:
115 unexecutable file in $PATH shouldn't be found:
116
116
117 $ echo "echo fail" > false
117 $ echo "echo fail" > false
118 $ hg up -qC 1
118 $ hg up -qC 1
119 $ PATH="`pwd`:$BINDIR:/usr/sbin" $PYTHON "$BINDIR"/hg merge -r 2
119 $ PATH="`pwd`:$BINDIR:/usr/sbin" $PYTHON "$BINDIR"/hg merge -r 2
120 merging f
120 merging f
121 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
121 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
122 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
122 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
123 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
123 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
124 [1]
124 [1]
125 $ rm false
125 $ rm false
126
126
127 #endif
127 #endif
128
128
129 executable directory in $PATH shouldn't be found:
129 executable directory in $PATH shouldn't be found:
130
130
131 $ mkdir false
131 $ mkdir false
132 $ hg up -qC 1
132 $ hg up -qC 1
133 $ PATH="`pwd`:$BINDIR:/usr/sbin" $PYTHON "$BINDIR"/hg merge -r 2
133 $ PATH="`pwd`:$BINDIR:/usr/sbin" $PYTHON "$BINDIR"/hg merge -r 2
134 merging f
134 merging f
135 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
135 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
136 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
136 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
137 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
137 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
138 [1]
138 [1]
139 $ rmdir false
139 $ rmdir false
140
140
141 true with higher .priority gets precedence:
141 true with higher .priority gets precedence:
142
142
143 $ echo "true.priority=1" >> .hg/hgrc
143 $ echo "true.priority=1" >> .hg/hgrc
144 $ beforemerge
144 $ beforemerge
145 [merge-tools]
145 [merge-tools]
146 false.whatever=
146 false.whatever=
147 true.priority=1
147 true.priority=1
148 # hg update -C 1
148 # hg update -C 1
149 $ hg merge -r 2
149 $ hg merge -r 2
150 merging f
150 merging f
151 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
151 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
152 (branch merge, don't forget to commit)
152 (branch merge, don't forget to commit)
153 $ aftermerge
153 $ aftermerge
154 # cat f
154 # cat f
155 revision 1
155 revision 1
156 space
156 space
157 # hg stat
157 # hg stat
158 M f
158 M f
159 # hg resolve --list
159 # hg resolve --list
160 R f
160 R f
161
161
162 unless lowered on command line:
162 unless lowered on command line:
163
163
164 $ beforemerge
164 $ beforemerge
165 [merge-tools]
165 [merge-tools]
166 false.whatever=
166 false.whatever=
167 true.priority=1
167 true.priority=1
168 # hg update -C 1
168 # hg update -C 1
169 $ hg merge -r 2 --config merge-tools.true.priority=-7
169 $ hg merge -r 2 --config merge-tools.true.priority=-7
170 merging f
170 merging f
171 merging f failed!
171 merging f failed!
172 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
172 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
173 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
173 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
174 [1]
174 [1]
175 $ aftermerge
175 $ aftermerge
176 # cat f
176 # cat f
177 revision 1
177 revision 1
178 space
178 space
179 # hg stat
179 # hg stat
180 M f
180 M f
181 ? f.orig
181 ? f.orig
182 # hg resolve --list
182 # hg resolve --list
183 U f
183 U f
184
184
185 or false set higher on command line:
185 or false set higher on command line:
186
186
187 $ beforemerge
187 $ beforemerge
188 [merge-tools]
188 [merge-tools]
189 false.whatever=
189 false.whatever=
190 true.priority=1
190 true.priority=1
191 # hg update -C 1
191 # hg update -C 1
192 $ hg merge -r 2 --config merge-tools.false.priority=117
192 $ hg merge -r 2 --config merge-tools.false.priority=117
193 merging f
193 merging f
194 merging f failed!
194 merging f failed!
195 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
195 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
196 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
196 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
197 [1]
197 [1]
198 $ aftermerge
198 $ aftermerge
199 # cat f
199 # cat f
200 revision 1
200 revision 1
201 space
201 space
202 # hg stat
202 # hg stat
203 M f
203 M f
204 ? f.orig
204 ? f.orig
205 # hg resolve --list
205 # hg resolve --list
206 U f
206 U f
207
207
208 or true set to disabled:
208 or true set to disabled:
209 $ beforemerge
209 $ beforemerge
210 [merge-tools]
210 [merge-tools]
211 false.whatever=
211 false.whatever=
212 true.priority=1
212 true.priority=1
213 # hg update -C 1
213 # hg update -C 1
214 $ hg merge -r 2 --config merge-tools.true.disabled=yes
214 $ hg merge -r 2 --config merge-tools.true.disabled=yes
215 merging f
215 merging f
216 merging f failed!
216 merging f failed!
217 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
217 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
218 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
218 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
219 [1]
219 [1]
220 $ aftermerge
220 $ aftermerge
221 # cat f
221 # cat f
222 revision 1
222 revision 1
223 space
223 space
224 # hg stat
224 # hg stat
225 M f
225 M f
226 ? f.orig
226 ? f.orig
227 # hg resolve --list
227 # hg resolve --list
228 U f
228 U f
229
229
230 or true.executable not found in PATH:
230 or true.executable not found in PATH:
231
231
232 $ beforemerge
232 $ beforemerge
233 [merge-tools]
233 [merge-tools]
234 false.whatever=
234 false.whatever=
235 true.priority=1
235 true.priority=1
236 # hg update -C 1
236 # hg update -C 1
237 $ hg merge -r 2 --config merge-tools.true.executable=nonexistentmergetool
237 $ hg merge -r 2 --config merge-tools.true.executable=nonexistentmergetool
238 merging f
238 merging f
239 merging f failed!
239 merging f failed!
240 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
240 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
241 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
241 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
242 [1]
242 [1]
243 $ aftermerge
243 $ aftermerge
244 # cat f
244 # cat f
245 revision 1
245 revision 1
246 space
246 space
247 # hg stat
247 # hg stat
248 M f
248 M f
249 ? f.orig
249 ? f.orig
250 # hg resolve --list
250 # hg resolve --list
251 U f
251 U f
252
252
253 or true.executable with bogus path:
253 or true.executable with bogus path:
254
254
255 $ beforemerge
255 $ beforemerge
256 [merge-tools]
256 [merge-tools]
257 false.whatever=
257 false.whatever=
258 true.priority=1
258 true.priority=1
259 # hg update -C 1
259 # hg update -C 1
260 $ hg merge -r 2 --config merge-tools.true.executable=/nonexistent/mergetool
260 $ hg merge -r 2 --config merge-tools.true.executable=/nonexistent/mergetool
261 merging f
261 merging f
262 merging f failed!
262 merging f failed!
263 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
263 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
264 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
264 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
265 [1]
265 [1]
266 $ aftermerge
266 $ aftermerge
267 # cat f
267 # cat f
268 revision 1
268 revision 1
269 space
269 space
270 # hg stat
270 # hg stat
271 M f
271 M f
272 ? f.orig
272 ? f.orig
273 # hg resolve --list
273 # hg resolve --list
274 U f
274 U f
275
275
276 but true.executable set to cat found in PATH works:
276 but true.executable set to cat found in PATH works:
277
277
278 $ echo "true.executable=cat" >> .hg/hgrc
278 $ echo "true.executable=cat" >> .hg/hgrc
279 $ beforemerge
279 $ beforemerge
280 [merge-tools]
280 [merge-tools]
281 false.whatever=
281 false.whatever=
282 true.priority=1
282 true.priority=1
283 true.executable=cat
283 true.executable=cat
284 # hg update -C 1
284 # hg update -C 1
285 $ hg merge -r 2
285 $ hg merge -r 2
286 merging f
286 merging f
287 revision 1
287 revision 1
288 space
288 space
289 revision 0
289 revision 0
290 space
290 space
291 revision 2
291 revision 2
292 space
292 space
293 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
293 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
294 (branch merge, don't forget to commit)
294 (branch merge, don't forget to commit)
295 $ aftermerge
295 $ aftermerge
296 # cat f
296 # cat f
297 revision 1
297 revision 1
298 space
298 space
299 # hg stat
299 # hg stat
300 M f
300 M f
301 # hg resolve --list
301 # hg resolve --list
302 R f
302 R f
303
303
304 and true.executable set to cat with path works:
304 and true.executable set to cat with path works:
305
305
306 $ beforemerge
306 $ beforemerge
307 [merge-tools]
307 [merge-tools]
308 false.whatever=
308 false.whatever=
309 true.priority=1
309 true.priority=1
310 true.executable=cat
310 true.executable=cat
311 # hg update -C 1
311 # hg update -C 1
312 $ hg merge -r 2 --config merge-tools.true.executable=cat
312 $ hg merge -r 2 --config merge-tools.true.executable=cat
313 merging f
313 merging f
314 revision 1
314 revision 1
315 space
315 space
316 revision 0
316 revision 0
317 space
317 space
318 revision 2
318 revision 2
319 space
319 space
320 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
320 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
321 (branch merge, don't forget to commit)
321 (branch merge, don't forget to commit)
322 $ aftermerge
322 $ aftermerge
323 # cat f
323 # cat f
324 revision 1
324 revision 1
325 space
325 space
326 # hg stat
326 # hg stat
327 M f
327 M f
328 # hg resolve --list
328 # hg resolve --list
329 R f
329 R f
330
330
331 #if unix-permissions
331 #if unix-permissions
332
332
333 environment variables in true.executable are handled:
333 environment variables in true.executable are handled:
334
334
335 $ echo 'echo "custom merge tool"' > .hg/merge.sh
335 $ echo 'echo "custom merge tool"' > .hg/merge.sh
336 $ beforemerge
336 $ beforemerge
337 [merge-tools]
337 [merge-tools]
338 false.whatever=
338 false.whatever=
339 true.priority=1
339 true.priority=1
340 true.executable=cat
340 true.executable=cat
341 # hg update -C 1
341 # hg update -C 1
342 $ hg --config merge-tools.true.executable='sh' \
342 $ hg --config merge-tools.true.executable='sh' \
343 > --config merge-tools.true.args=.hg/merge.sh \
343 > --config merge-tools.true.args=.hg/merge.sh \
344 > merge -r 2
344 > merge -r 2
345 merging f
345 merging f
346 custom merge tool
346 custom merge tool
347 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
347 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
348 (branch merge, don't forget to commit)
348 (branch merge, don't forget to commit)
349 $ aftermerge
349 $ aftermerge
350 # cat f
350 # cat f
351 revision 1
351 revision 1
352 space
352 space
353 # hg stat
353 # hg stat
354 M f
354 M f
355 # hg resolve --list
355 # hg resolve --list
356 R f
356 R f
357
357
358 #endif
358 #endif
359
359
360 Tool selection and merge-patterns
360 Tool selection and merge-patterns
361
361
362 merge-patterns specifies new tool false:
362 merge-patterns specifies new tool false:
363
363
364 $ beforemerge
364 $ beforemerge
365 [merge-tools]
365 [merge-tools]
366 false.whatever=
366 false.whatever=
367 true.priority=1
367 true.priority=1
368 true.executable=cat
368 true.executable=cat
369 # hg update -C 1
369 # hg update -C 1
370 $ hg merge -r 2 --config merge-patterns.f=false
370 $ hg merge -r 2 --config merge-patterns.f=false
371 merging f
371 merging f
372 merging f failed!
372 merging f failed!
373 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
373 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
374 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
374 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
375 [1]
375 [1]
376 $ aftermerge
376 $ aftermerge
377 # cat f
377 # cat f
378 revision 1
378 revision 1
379 space
379 space
380 # hg stat
380 # hg stat
381 M f
381 M f
382 ? f.orig
382 ? f.orig
383 # hg resolve --list
383 # hg resolve --list
384 U f
384 U f
385
385
386 merge-patterns specifies executable not found in PATH and gets warning:
386 merge-patterns specifies executable not found in PATH and gets warning:
387
387
388 $ beforemerge
388 $ beforemerge
389 [merge-tools]
389 [merge-tools]
390 false.whatever=
390 false.whatever=
391 true.priority=1
391 true.priority=1
392 true.executable=cat
392 true.executable=cat
393 # hg update -C 1
393 # hg update -C 1
394 $ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=nonexistentmergetool
394 $ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=nonexistentmergetool
395 couldn't find merge tool true (for pattern f)
395 couldn't find merge tool true (for pattern f)
396 merging f
396 merging f
397 couldn't find merge tool true (for pattern f)
397 couldn't find merge tool true (for pattern f)
398 merging f failed!
398 merging f failed!
399 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
399 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
400 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
400 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
401 [1]
401 [1]
402 $ aftermerge
402 $ aftermerge
403 # cat f
403 # cat f
404 revision 1
404 revision 1
405 space
405 space
406 # hg stat
406 # hg stat
407 M f
407 M f
408 ? f.orig
408 ? f.orig
409 # hg resolve --list
409 # hg resolve --list
410 U f
410 U f
411
411
412 merge-patterns specifies executable with bogus path and gets warning:
412 merge-patterns specifies executable with bogus path and gets warning:
413
413
414 $ beforemerge
414 $ beforemerge
415 [merge-tools]
415 [merge-tools]
416 false.whatever=
416 false.whatever=
417 true.priority=1
417 true.priority=1
418 true.executable=cat
418 true.executable=cat
419 # hg update -C 1
419 # hg update -C 1
420 $ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=/nonexistent/mergetool
420 $ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=/nonexistent/mergetool
421 couldn't find merge tool true (for pattern f)
421 couldn't find merge tool true (for pattern f)
422 merging f
422 merging f
423 couldn't find merge tool true (for pattern f)
423 couldn't find merge tool true (for pattern f)
424 merging f failed!
424 merging f failed!
425 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
425 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
426 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
426 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
427 [1]
427 [1]
428 $ aftermerge
428 $ aftermerge
429 # cat f
429 # cat f
430 revision 1
430 revision 1
431 space
431 space
432 # hg stat
432 # hg stat
433 M f
433 M f
434 ? f.orig
434 ? f.orig
435 # hg resolve --list
435 # hg resolve --list
436 U f
436 U f
437
437
438 ui.merge overrules priority
438 ui.merge overrules priority
439
439
440 ui.merge specifies false:
440 ui.merge specifies false:
441
441
442 $ beforemerge
442 $ beforemerge
443 [merge-tools]
443 [merge-tools]
444 false.whatever=
444 false.whatever=
445 true.priority=1
445 true.priority=1
446 true.executable=cat
446 true.executable=cat
447 # hg update -C 1
447 # hg update -C 1
448 $ hg merge -r 2 --config ui.merge=false
448 $ hg merge -r 2 --config ui.merge=false
449 merging f
449 merging f
450 merging f failed!
450 merging f failed!
451 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
451 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
452 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
452 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
453 [1]
453 [1]
454 $ aftermerge
454 $ aftermerge
455 # cat f
455 # cat f
456 revision 1
456 revision 1
457 space
457 space
458 # hg stat
458 # hg stat
459 M f
459 M f
460 ? f.orig
460 ? f.orig
461 # hg resolve --list
461 # hg resolve --list
462 U f
462 U f
463
463
464 ui.merge specifies internal:fail:
464 ui.merge specifies internal:fail:
465
465
466 $ beforemerge
466 $ beforemerge
467 [merge-tools]
467 [merge-tools]
468 false.whatever=
468 false.whatever=
469 true.priority=1
469 true.priority=1
470 true.executable=cat
470 true.executable=cat
471 # hg update -C 1
471 # hg update -C 1
472 $ hg merge -r 2 --config ui.merge=internal:fail
472 $ hg merge -r 2 --config ui.merge=internal:fail
473 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
473 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
474 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
474 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
475 [1]
475 [1]
476 $ aftermerge
476 $ aftermerge
477 # cat f
477 # cat f
478 revision 1
478 revision 1
479 space
479 space
480 # hg stat
480 # hg stat
481 M f
481 M f
482 # hg resolve --list
482 # hg resolve --list
483 U f
483 U f
484
484
485 ui.merge specifies :local (without internal prefix):
485 ui.merge specifies :local (without internal prefix):
486
486
487 $ beforemerge
487 $ beforemerge
488 [merge-tools]
488 [merge-tools]
489 false.whatever=
489 false.whatever=
490 true.priority=1
490 true.priority=1
491 true.executable=cat
491 true.executable=cat
492 # hg update -C 1
492 # hg update -C 1
493 $ hg merge -r 2 --config ui.merge=:local
493 $ hg merge -r 2 --config ui.merge=:local
494 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
494 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
495 (branch merge, don't forget to commit)
495 (branch merge, don't forget to commit)
496 $ aftermerge
496 $ aftermerge
497 # cat f
497 # cat f
498 revision 1
498 revision 1
499 space
499 space
500 # hg stat
500 # hg stat
501 M f
501 M f
502 # hg resolve --list
502 # hg resolve --list
503 R f
503 R f
504
504
505 ui.merge specifies internal:other:
505 ui.merge specifies internal:other:
506
506
507 $ beforemerge
507 $ beforemerge
508 [merge-tools]
508 [merge-tools]
509 false.whatever=
509 false.whatever=
510 true.priority=1
510 true.priority=1
511 true.executable=cat
511 true.executable=cat
512 # hg update -C 1
512 # hg update -C 1
513 $ hg merge -r 2 --config ui.merge=internal:other
513 $ hg merge -r 2 --config ui.merge=internal:other
514 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
514 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
515 (branch merge, don't forget to commit)
515 (branch merge, don't forget to commit)
516 $ aftermerge
516 $ aftermerge
517 # cat f
517 # cat f
518 revision 2
518 revision 2
519 space
519 space
520 # hg stat
520 # hg stat
521 M f
521 M f
522 # hg resolve --list
522 # hg resolve --list
523 R f
523 R f
524
524
525 ui.merge specifies internal:prompt:
525 ui.merge specifies internal:prompt:
526
526
527 $ beforemerge
527 $ beforemerge
528 [merge-tools]
528 [merge-tools]
529 false.whatever=
529 false.whatever=
530 true.priority=1
530 true.priority=1
531 true.executable=cat
531 true.executable=cat
532 # hg update -C 1
532 # hg update -C 1
533 $ hg merge -r 2 --config ui.merge=internal:prompt
533 $ hg merge -r 2 --config ui.merge=internal:prompt
534 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? u
534 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? u
535 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
535 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
536 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
536 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
537 [1]
537 [1]
538 $ aftermerge
538 $ aftermerge
539 # cat f
539 # cat f
540 revision 1
540 revision 1
541 space
541 space
542 # hg stat
542 # hg stat
543 M f
543 M f
544 # hg resolve --list
544 # hg resolve --list
545 U f
545 U f
546
546
547 ui.merge specifies :prompt, with 'leave unresolved' chosen
547 ui.merge specifies :prompt, with 'leave unresolved' chosen
548
548
549 $ beforemerge
549 $ beforemerge
550 [merge-tools]
550 [merge-tools]
551 false.whatever=
551 false.whatever=
552 true.priority=1
552 true.priority=1
553 true.executable=cat
553 true.executable=cat
554 # hg update -C 1
554 # hg update -C 1
555 $ hg merge -r 2 --config ui.merge=:prompt --config ui.interactive=True << EOF
555 $ hg merge -r 2 --config ui.merge=:prompt --config ui.interactive=True << EOF
556 > u
556 > u
557 > EOF
557 > EOF
558 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? u
558 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? u
559 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
559 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
560 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
560 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
561 [1]
561 [1]
562 $ aftermerge
562 $ aftermerge
563 # cat f
563 # cat f
564 revision 1
564 revision 1
565 space
565 space
566 # hg stat
566 # hg stat
567 M f
567 M f
568 # hg resolve --list
568 # hg resolve --list
569 U f
569 U f
570
570
571 prompt with EOF
571 prompt with EOF
572
572
573 $ beforemerge
573 $ beforemerge
574 [merge-tools]
574 [merge-tools]
575 false.whatever=
575 false.whatever=
576 true.priority=1
576 true.priority=1
577 true.executable=cat
577 true.executable=cat
578 # hg update -C 1
578 # hg update -C 1
579 $ hg merge -r 2 --config ui.merge=internal:prompt --config ui.interactive=true
579 $ hg merge -r 2 --config ui.merge=internal:prompt --config ui.interactive=true
580 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f?
580 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f?
581 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
581 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
582 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
582 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
583 [1]
583 [1]
584 $ aftermerge
584 $ aftermerge
585 # cat f
585 # cat f
586 revision 1
586 revision 1
587 space
587 space
588 # hg stat
588 # hg stat
589 M f
589 M f
590 # hg resolve --list
590 # hg resolve --list
591 U f
591 U f
592 $ hg resolve --all --config ui.merge=internal:prompt --config ui.interactive=true
592 $ hg resolve --all --config ui.merge=internal:prompt --config ui.interactive=true
593 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f?
593 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f?
594 [1]
594 [1]
595 $ aftermerge
595 $ aftermerge
596 # cat f
596 # cat f
597 revision 1
597 revision 1
598 space
598 space
599 # hg stat
599 # hg stat
600 M f
600 M f
601 ? f.orig
601 ? f.orig
602 # hg resolve --list
602 # hg resolve --list
603 U f
603 U f
604 $ rm f
604 $ rm f
605 $ hg resolve --all --config ui.merge=internal:prompt --config ui.interactive=true
605 $ hg resolve --all --config ui.merge=internal:prompt --config ui.interactive=true
606 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f?
606 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f?
607 [1]
607 [1]
608 $ aftermerge
608 $ aftermerge
609 # cat f
609 # cat f
610 revision 1
610 revision 1
611 space
611 space
612 # hg stat
612 # hg stat
613 M f
613 M f
614 # hg resolve --list
614 # hg resolve --list
615 U f
615 U f
616 $ hg resolve --all --config ui.merge=internal:prompt
616 $ hg resolve --all --config ui.merge=internal:prompt
617 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? u
617 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? u
618 [1]
618 [1]
619 $ aftermerge
619 $ aftermerge
620 # cat f
620 # cat f
621 revision 1
621 revision 1
622 space
622 space
623 # hg stat
623 # hg stat
624 M f
624 M f
625 ? f.orig
625 ? f.orig
626 # hg resolve --list
626 # hg resolve --list
627 U f
627 U f
628
628
629 ui.merge specifies internal:dump:
629 ui.merge specifies internal:dump:
630
630
631 $ beforemerge
631 $ beforemerge
632 [merge-tools]
632 [merge-tools]
633 false.whatever=
633 false.whatever=
634 true.priority=1
634 true.priority=1
635 true.executable=cat
635 true.executable=cat
636 # hg update -C 1
636 # hg update -C 1
637 $ hg merge -r 2 --config ui.merge=internal:dump
637 $ hg merge -r 2 --config ui.merge=internal:dump
638 merging f
638 merging f
639 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
639 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
640 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
640 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
641 [1]
641 [1]
642 $ aftermerge
642 $ aftermerge
643 # cat f
643 # cat f
644 revision 1
644 revision 1
645 space
645 space
646 # hg stat
646 # hg stat
647 M f
647 M f
648 ? f.base
648 ? f.base
649 ? f.local
649 ? f.local
650 ? f.orig
650 ? f.orig
651 ? f.other
651 ? f.other
652 # hg resolve --list
652 # hg resolve --list
653 U f
653 U f
654
654
655 f.base:
655 f.base:
656
656
657 $ cat f.base
657 $ cat f.base
658 revision 0
658 revision 0
659 space
659 space
660
660
661 f.local:
661 f.local:
662
662
663 $ cat f.local
663 $ cat f.local
664 revision 1
664 revision 1
665 space
665 space
666
666
667 f.other:
667 f.other:
668
668
669 $ cat f.other
669 $ cat f.other
670 revision 2
670 revision 2
671 space
671 space
672 $ rm f.base f.local f.other
672 $ rm f.base f.local f.other
673
673
674 check that internal:dump doesn't dump files if premerge runs
675 successfully
676
677 $ beforemerge
678 [merge-tools]
679 false.whatever=
680 true.priority=1
681 true.executable=cat
682 # hg update -C 1
683 $ hg merge -r 3 --config ui.merge=internal:dump
684 merging f
685 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
686 (branch merge, don't forget to commit)
687
688 $ aftermerge
689 # cat f
690 revision 1
691 space
692 revision 3
693 # hg stat
694 M f
695 # hg resolve --list
696 R f
697
698 check that internal:forcedump dumps files, even if local and other can
699 be merged easily
700
701 $ beforemerge
702 [merge-tools]
703 false.whatever=
704 true.priority=1
705 true.executable=cat
706 # hg update -C 1
707 $ hg merge -r 3 --config ui.merge=internal:forcedump
708 merging f
709 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
710 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
711 [1]
712 $ aftermerge
713 # cat f
714 revision 1
715 space
716 # hg stat
717 M f
718 ? f.base
719 ? f.local
720 ? f.orig
721 ? f.other
722 # hg resolve --list
723 U f
724
725 $ cat f.base
726 revision 0
727 space
728
729 $ cat f.local
730 revision 1
731 space
732
733 $ cat f.other
734 revision 0
735 space
736 revision 3
737
738 $ rm -f f.base f.local f.other
739
674 ui.merge specifies internal:other but is overruled by pattern for false:
740 ui.merge specifies internal:other but is overruled by pattern for false:
675
741
676 $ beforemerge
742 $ beforemerge
677 [merge-tools]
743 [merge-tools]
678 false.whatever=
744 false.whatever=
679 true.priority=1
745 true.priority=1
680 true.executable=cat
746 true.executable=cat
681 # hg update -C 1
747 # hg update -C 1
682 $ hg merge -r 2 --config ui.merge=internal:other --config merge-patterns.f=false
748 $ hg merge -r 2 --config ui.merge=internal:other --config merge-patterns.f=false
683 merging f
749 merging f
684 merging f failed!
750 merging f failed!
685 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
751 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
686 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
752 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
687 [1]
753 [1]
688 $ aftermerge
754 $ aftermerge
689 # cat f
755 # cat f
690 revision 1
756 revision 1
691 space
757 space
692 # hg stat
758 # hg stat
693 M f
759 M f
694 ? f.orig
760 ? f.orig
695 # hg resolve --list
761 # hg resolve --list
696 U f
762 U f
697
763
698 Premerge
764 Premerge
699
765
700 ui.merge specifies internal:other but is overruled by --tool=false
766 ui.merge specifies internal:other but is overruled by --tool=false
701
767
702 $ beforemerge
768 $ beforemerge
703 [merge-tools]
769 [merge-tools]
704 false.whatever=
770 false.whatever=
705 true.priority=1
771 true.priority=1
706 true.executable=cat
772 true.executable=cat
707 # hg update -C 1
773 # hg update -C 1
708 $ hg merge -r 2 --config ui.merge=internal:other --tool=false
774 $ hg merge -r 2 --config ui.merge=internal:other --tool=false
709 merging f
775 merging f
710 merging f failed!
776 merging f failed!
711 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
777 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
712 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
778 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
713 [1]
779 [1]
714 $ aftermerge
780 $ aftermerge
715 # cat f
781 # cat f
716 revision 1
782 revision 1
717 space
783 space
718 # hg stat
784 # hg stat
719 M f
785 M f
720 ? f.orig
786 ? f.orig
721 # hg resolve --list
787 # hg resolve --list
722 U f
788 U f
723
789
724 HGMERGE specifies internal:other but is overruled by --tool=false
790 HGMERGE specifies internal:other but is overruled by --tool=false
725
791
726 $ HGMERGE=internal:other ; export HGMERGE
792 $ HGMERGE=internal:other ; export HGMERGE
727 $ beforemerge
793 $ beforemerge
728 [merge-tools]
794 [merge-tools]
729 false.whatever=
795 false.whatever=
730 true.priority=1
796 true.priority=1
731 true.executable=cat
797 true.executable=cat
732 # hg update -C 1
798 # hg update -C 1
733 $ hg merge -r 2 --tool=false
799 $ hg merge -r 2 --tool=false
734 merging f
800 merging f
735 merging f failed!
801 merging f failed!
736 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
802 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
737 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
803 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
738 [1]
804 [1]
739 $ aftermerge
805 $ aftermerge
740 # cat f
806 # cat f
741 revision 1
807 revision 1
742 space
808 space
743 # hg stat
809 # hg stat
744 M f
810 M f
745 ? f.orig
811 ? f.orig
746 # hg resolve --list
812 # hg resolve --list
747 U f
813 U f
748
814
749 $ unset HGMERGE # make sure HGMERGE doesn't interfere with remaining tests
815 $ unset HGMERGE # make sure HGMERGE doesn't interfere with remaining tests
750
816
751 update is a merge ...
817 update is a merge ...
752
818
753 (this also tests that files reverted with '--rev REV' are treated as
819 (this also tests that files reverted with '--rev REV' are treated as
754 "modified", even if none of mode, size and timestamp of them isn't
820 "modified", even if none of mode, size and timestamp of them isn't
755 changed on the filesystem (see also issue4583))
821 changed on the filesystem (see also issue4583))
756
822
757 $ cat >> $HGRCPATH <<EOF
823 $ cat >> $HGRCPATH <<EOF
758 > [fakedirstatewritetime]
824 > [fakedirstatewritetime]
759 > # emulate invoking dirstate.write() via repo.status()
825 > # emulate invoking dirstate.write() via repo.status()
760 > # at 2000-01-01 00:00
826 > # at 2000-01-01 00:00
761 > fakenow = 200001010000
827 > fakenow = 200001010000
762 > EOF
828 > EOF
763
829
764 $ beforemerge
830 $ beforemerge
765 [merge-tools]
831 [merge-tools]
766 false.whatever=
832 false.whatever=
767 true.priority=1
833 true.priority=1
768 true.executable=cat
834 true.executable=cat
769 # hg update -C 1
835 # hg update -C 1
770 $ hg update -q 0
836 $ hg update -q 0
771 $ f -s f
837 $ f -s f
772 f: size=17
838 f: size=17
773 $ touch -t 200001010000 f
839 $ touch -t 200001010000 f
774 $ hg debugrebuildstate
840 $ hg debugrebuildstate
775 $ cat >> $HGRCPATH <<EOF
841 $ cat >> $HGRCPATH <<EOF
776 > [extensions]
842 > [extensions]
777 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
843 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
778 > EOF
844 > EOF
779 $ hg revert -q -r 1 .
845 $ hg revert -q -r 1 .
780 $ cat >> $HGRCPATH <<EOF
846 $ cat >> $HGRCPATH <<EOF
781 > [extensions]
847 > [extensions]
782 > fakedirstatewritetime = !
848 > fakedirstatewritetime = !
783 > EOF
849 > EOF
784 $ f -s f
850 $ f -s f
785 f: size=17
851 f: size=17
786 $ touch -t 200001010000 f
852 $ touch -t 200001010000 f
787 $ hg status f
853 $ hg status f
788 M f
854 M f
789 $ hg update -r 2
855 $ hg update -r 2
790 merging f
856 merging f
791 revision 1
857 revision 1
792 space
858 space
793 revision 0
859 revision 0
794 space
860 space
795 revision 2
861 revision 2
796 space
862 space
797 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
863 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
798 $ aftermerge
864 $ aftermerge
799 # cat f
865 # cat f
800 revision 1
866 revision 1
801 space
867 space
802 # hg stat
868 # hg stat
803 M f
869 M f
804 # hg resolve --list
870 # hg resolve --list
805 R f
871 R f
806
872
807 update should also have --tool
873 update should also have --tool
808
874
809 $ beforemerge
875 $ beforemerge
810 [merge-tools]
876 [merge-tools]
811 false.whatever=
877 false.whatever=
812 true.priority=1
878 true.priority=1
813 true.executable=cat
879 true.executable=cat
814 # hg update -C 1
880 # hg update -C 1
815 $ hg update -q 0
881 $ hg update -q 0
816 $ f -s f
882 $ f -s f
817 f: size=17
883 f: size=17
818 $ touch -t 200001010000 f
884 $ touch -t 200001010000 f
819 $ hg debugrebuildstate
885 $ hg debugrebuildstate
820 $ cat >> $HGRCPATH <<EOF
886 $ cat >> $HGRCPATH <<EOF
821 > [extensions]
887 > [extensions]
822 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
888 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
823 > EOF
889 > EOF
824 $ hg revert -q -r 1 .
890 $ hg revert -q -r 1 .
825 $ cat >> $HGRCPATH <<EOF
891 $ cat >> $HGRCPATH <<EOF
826 > [extensions]
892 > [extensions]
827 > fakedirstatewritetime = !
893 > fakedirstatewritetime = !
828 > EOF
894 > EOF
829 $ f -s f
895 $ f -s f
830 f: size=17
896 f: size=17
831 $ touch -t 200001010000 f
897 $ touch -t 200001010000 f
832 $ hg status f
898 $ hg status f
833 M f
899 M f
834 $ hg update -r 2 --tool false
900 $ hg update -r 2 --tool false
835 merging f
901 merging f
836 merging f failed!
902 merging f failed!
837 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
903 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
838 use 'hg resolve' to retry unresolved file merges
904 use 'hg resolve' to retry unresolved file merges
839 [1]
905 [1]
840 $ aftermerge
906 $ aftermerge
841 # cat f
907 # cat f
842 revision 1
908 revision 1
843 space
909 space
844 # hg stat
910 # hg stat
845 M f
911 M f
846 ? f.orig
912 ? f.orig
847 # hg resolve --list
913 # hg resolve --list
848 U f
914 U f
849
915
850 Default is silent simplemerge:
916 Default is silent simplemerge:
851
917
852 $ beforemerge
918 $ beforemerge
853 [merge-tools]
919 [merge-tools]
854 false.whatever=
920 false.whatever=
855 true.priority=1
921 true.priority=1
856 true.executable=cat
922 true.executable=cat
857 # hg update -C 1
923 # hg update -C 1
858 $ hg merge -r 3
924 $ hg merge -r 3
859 merging f
925 merging f
860 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
926 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
861 (branch merge, don't forget to commit)
927 (branch merge, don't forget to commit)
862 $ aftermerge
928 $ aftermerge
863 # cat f
929 # cat f
864 revision 1
930 revision 1
865 space
931 space
866 revision 3
932 revision 3
867 # hg stat
933 # hg stat
868 M f
934 M f
869 # hg resolve --list
935 # hg resolve --list
870 R f
936 R f
871
937
872 .premerge=True is same:
938 .premerge=True is same:
873
939
874 $ beforemerge
940 $ beforemerge
875 [merge-tools]
941 [merge-tools]
876 false.whatever=
942 false.whatever=
877 true.priority=1
943 true.priority=1
878 true.executable=cat
944 true.executable=cat
879 # hg update -C 1
945 # hg update -C 1
880 $ hg merge -r 3 --config merge-tools.true.premerge=True
946 $ hg merge -r 3 --config merge-tools.true.premerge=True
881 merging f
947 merging f
882 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
948 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
883 (branch merge, don't forget to commit)
949 (branch merge, don't forget to commit)
884 $ aftermerge
950 $ aftermerge
885 # cat f
951 # cat f
886 revision 1
952 revision 1
887 space
953 space
888 revision 3
954 revision 3
889 # hg stat
955 # hg stat
890 M f
956 M f
891 # hg resolve --list
957 # hg resolve --list
892 R f
958 R f
893
959
894 .premerge=False executes merge-tool:
960 .premerge=False executes merge-tool:
895
961
896 $ beforemerge
962 $ beforemerge
897 [merge-tools]
963 [merge-tools]
898 false.whatever=
964 false.whatever=
899 true.priority=1
965 true.priority=1
900 true.executable=cat
966 true.executable=cat
901 # hg update -C 1
967 # hg update -C 1
902 $ hg merge -r 3 --config merge-tools.true.premerge=False
968 $ hg merge -r 3 --config merge-tools.true.premerge=False
903 merging f
969 merging f
904 revision 1
970 revision 1
905 space
971 space
906 revision 0
972 revision 0
907 space
973 space
908 revision 0
974 revision 0
909 space
975 space
910 revision 3
976 revision 3
911 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
977 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
912 (branch merge, don't forget to commit)
978 (branch merge, don't forget to commit)
913 $ aftermerge
979 $ aftermerge
914 # cat f
980 # cat f
915 revision 1
981 revision 1
916 space
982 space
917 # hg stat
983 # hg stat
918 M f
984 M f
919 # hg resolve --list
985 # hg resolve --list
920 R f
986 R f
921
987
922 premerge=keep keeps conflict markers in:
988 premerge=keep keeps conflict markers in:
923
989
924 $ beforemerge
990 $ beforemerge
925 [merge-tools]
991 [merge-tools]
926 false.whatever=
992 false.whatever=
927 true.priority=1
993 true.priority=1
928 true.executable=cat
994 true.executable=cat
929 # hg update -C 1
995 # hg update -C 1
930 $ hg merge -r 4 --config merge-tools.true.premerge=keep
996 $ hg merge -r 4 --config merge-tools.true.premerge=keep
931 merging f
997 merging f
932 <<<<<<< working copy: ef83787e2614 - test: revision 1
998 <<<<<<< working copy: ef83787e2614 - test: revision 1
933 revision 1
999 revision 1
934 space
1000 space
935 =======
1001 =======
936 revision 4
1002 revision 4
937 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1003 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
938 revision 0
1004 revision 0
939 space
1005 space
940 revision 4
1006 revision 4
941 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1007 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
942 (branch merge, don't forget to commit)
1008 (branch merge, don't forget to commit)
943 $ aftermerge
1009 $ aftermerge
944 # cat f
1010 # cat f
945 <<<<<<< working copy: ef83787e2614 - test: revision 1
1011 <<<<<<< working copy: ef83787e2614 - test: revision 1
946 revision 1
1012 revision 1
947 space
1013 space
948 =======
1014 =======
949 revision 4
1015 revision 4
950 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1016 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
951 # hg stat
1017 # hg stat
952 M f
1018 M f
953 # hg resolve --list
1019 # hg resolve --list
954 R f
1020 R f
955
1021
956 premerge=keep-merge3 keeps conflict markers with base content:
1022 premerge=keep-merge3 keeps conflict markers with base content:
957
1023
958 $ beforemerge
1024 $ beforemerge
959 [merge-tools]
1025 [merge-tools]
960 false.whatever=
1026 false.whatever=
961 true.priority=1
1027 true.priority=1
962 true.executable=cat
1028 true.executable=cat
963 # hg update -C 1
1029 # hg update -C 1
964 $ hg merge -r 4 --config merge-tools.true.premerge=keep-merge3
1030 $ hg merge -r 4 --config merge-tools.true.premerge=keep-merge3
965 merging f
1031 merging f
966 <<<<<<< working copy: ef83787e2614 - test: revision 1
1032 <<<<<<< working copy: ef83787e2614 - test: revision 1
967 revision 1
1033 revision 1
968 space
1034 space
969 ||||||| base
1035 ||||||| base
970 revision 0
1036 revision 0
971 space
1037 space
972 =======
1038 =======
973 revision 4
1039 revision 4
974 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1040 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
975 revision 0
1041 revision 0
976 space
1042 space
977 revision 4
1043 revision 4
978 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1044 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
979 (branch merge, don't forget to commit)
1045 (branch merge, don't forget to commit)
980 $ aftermerge
1046 $ aftermerge
981 # cat f
1047 # cat f
982 <<<<<<< working copy: ef83787e2614 - test: revision 1
1048 <<<<<<< working copy: ef83787e2614 - test: revision 1
983 revision 1
1049 revision 1
984 space
1050 space
985 ||||||| base
1051 ||||||| base
986 revision 0
1052 revision 0
987 space
1053 space
988 =======
1054 =======
989 revision 4
1055 revision 4
990 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1056 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
991 # hg stat
1057 # hg stat
992 M f
1058 M f
993 # hg resolve --list
1059 # hg resolve --list
994 R f
1060 R f
995
1061
996
1062
997 Tool execution
1063 Tool execution
998
1064
999 set tools.args explicit to include $base $local $other $output:
1065 set tools.args explicit to include $base $local $other $output:
1000
1066
1001 $ beforemerge
1067 $ beforemerge
1002 [merge-tools]
1068 [merge-tools]
1003 false.whatever=
1069 false.whatever=
1004 true.priority=1
1070 true.priority=1
1005 true.executable=cat
1071 true.executable=cat
1006 # hg update -C 1
1072 # hg update -C 1
1007 $ hg merge -r 2 --config merge-tools.true.executable=head --config merge-tools.true.args='$base $local $other $output' \
1073 $ hg merge -r 2 --config merge-tools.true.executable=head --config merge-tools.true.args='$base $local $other $output' \
1008 > | sed 's,==> .* <==,==> ... <==,g'
1074 > | sed 's,==> .* <==,==> ... <==,g'
1009 merging f
1075 merging f
1010 ==> ... <==
1076 ==> ... <==
1011 revision 0
1077 revision 0
1012 space
1078 space
1013
1079
1014 ==> ... <==
1080 ==> ... <==
1015 revision 1
1081 revision 1
1016 space
1082 space
1017
1083
1018 ==> ... <==
1084 ==> ... <==
1019 revision 2
1085 revision 2
1020 space
1086 space
1021
1087
1022 ==> ... <==
1088 ==> ... <==
1023 revision 1
1089 revision 1
1024 space
1090 space
1025 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1091 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1026 (branch merge, don't forget to commit)
1092 (branch merge, don't forget to commit)
1027 $ aftermerge
1093 $ aftermerge
1028 # cat f
1094 # cat f
1029 revision 1
1095 revision 1
1030 space
1096 space
1031 # hg stat
1097 # hg stat
1032 M f
1098 M f
1033 # hg resolve --list
1099 # hg resolve --list
1034 R f
1100 R f
1035
1101
1036 Merge with "echo mergeresult > $local":
1102 Merge with "echo mergeresult > $local":
1037
1103
1038 $ beforemerge
1104 $ beforemerge
1039 [merge-tools]
1105 [merge-tools]
1040 false.whatever=
1106 false.whatever=
1041 true.priority=1
1107 true.priority=1
1042 true.executable=cat
1108 true.executable=cat
1043 # hg update -C 1
1109 # hg update -C 1
1044 $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $local'
1110 $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $local'
1045 merging f
1111 merging f
1046 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1112 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1047 (branch merge, don't forget to commit)
1113 (branch merge, don't forget to commit)
1048 $ aftermerge
1114 $ aftermerge
1049 # cat f
1115 # cat f
1050 mergeresult
1116 mergeresult
1051 # hg stat
1117 # hg stat
1052 M f
1118 M f
1053 # hg resolve --list
1119 # hg resolve --list
1054 R f
1120 R f
1055
1121
1056 - and $local is the file f:
1122 - and $local is the file f:
1057
1123
1058 $ beforemerge
1124 $ beforemerge
1059 [merge-tools]
1125 [merge-tools]
1060 false.whatever=
1126 false.whatever=
1061 true.priority=1
1127 true.priority=1
1062 true.executable=cat
1128 true.executable=cat
1063 # hg update -C 1
1129 # hg update -C 1
1064 $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > f'
1130 $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > f'
1065 merging f
1131 merging f
1066 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1132 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1067 (branch merge, don't forget to commit)
1133 (branch merge, don't forget to commit)
1068 $ aftermerge
1134 $ aftermerge
1069 # cat f
1135 # cat f
1070 mergeresult
1136 mergeresult
1071 # hg stat
1137 # hg stat
1072 M f
1138 M f
1073 # hg resolve --list
1139 # hg resolve --list
1074 R f
1140 R f
1075
1141
1076 Merge with "echo mergeresult > $output" - the variable is a bit magic:
1142 Merge with "echo mergeresult > $output" - the variable is a bit magic:
1077
1143
1078 $ beforemerge
1144 $ beforemerge
1079 [merge-tools]
1145 [merge-tools]
1080 false.whatever=
1146 false.whatever=
1081 true.priority=1
1147 true.priority=1
1082 true.executable=cat
1148 true.executable=cat
1083 # hg update -C 1
1149 # hg update -C 1
1084 $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $output'
1150 $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $output'
1085 merging f
1151 merging f
1086 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1152 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1087 (branch merge, don't forget to commit)
1153 (branch merge, don't forget to commit)
1088 $ aftermerge
1154 $ aftermerge
1089 # cat f
1155 # cat f
1090 mergeresult
1156 mergeresult
1091 # hg stat
1157 # hg stat
1092 M f
1158 M f
1093 # hg resolve --list
1159 # hg resolve --list
1094 R f
1160 R f
1095
1161
1096 Merge using tool with a path that must be quoted:
1162 Merge using tool with a path that must be quoted:
1097
1163
1098 $ beforemerge
1164 $ beforemerge
1099 [merge-tools]
1165 [merge-tools]
1100 false.whatever=
1166 false.whatever=
1101 true.priority=1
1167 true.priority=1
1102 true.executable=cat
1168 true.executable=cat
1103 # hg update -C 1
1169 # hg update -C 1
1104 $ cat <<EOF > 'my merge tool'
1170 $ cat <<EOF > 'my merge tool'
1105 > cat "\$1" "\$2" "\$3" > "\$4"
1171 > cat "\$1" "\$2" "\$3" > "\$4"
1106 > EOF
1172 > EOF
1107 $ hg --config merge-tools.true.executable='sh' \
1173 $ hg --config merge-tools.true.executable='sh' \
1108 > --config merge-tools.true.args='"./my merge tool" $base $local $other $output' \
1174 > --config merge-tools.true.args='"./my merge tool" $base $local $other $output' \
1109 > merge -r 2
1175 > merge -r 2
1110 merging f
1176 merging f
1111 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1177 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1112 (branch merge, don't forget to commit)
1178 (branch merge, don't forget to commit)
1113 $ rm -f 'my merge tool'
1179 $ rm -f 'my merge tool'
1114 $ aftermerge
1180 $ aftermerge
1115 # cat f
1181 # cat f
1116 revision 0
1182 revision 0
1117 space
1183 space
1118 revision 1
1184 revision 1
1119 space
1185 space
1120 revision 2
1186 revision 2
1121 space
1187 space
1122 # hg stat
1188 # hg stat
1123 M f
1189 M f
1124 # hg resolve --list
1190 # hg resolve --list
1125 R f
1191 R f
1126
1192
1127 Issue3581: Merging a filename that needs to be quoted
1193 Issue3581: Merging a filename that needs to be quoted
1128 (This test doesn't work on Windows filesystems even on Linux, so check
1194 (This test doesn't work on Windows filesystems even on Linux, so check
1129 for Unix-like permission)
1195 for Unix-like permission)
1130
1196
1131 #if unix-permissions
1197 #if unix-permissions
1132 $ beforemerge
1198 $ beforemerge
1133 [merge-tools]
1199 [merge-tools]
1134 false.whatever=
1200 false.whatever=
1135 true.priority=1
1201 true.priority=1
1136 true.executable=cat
1202 true.executable=cat
1137 # hg update -C 1
1203 # hg update -C 1
1138 $ echo "revision 5" > '"; exit 1; echo "'
1204 $ echo "revision 5" > '"; exit 1; echo "'
1139 $ hg commit -Am "revision 5"
1205 $ hg commit -Am "revision 5"
1140 adding "; exit 1; echo "
1206 adding "; exit 1; echo "
1141 warning: filename contains '"', which is reserved on Windows: '"; exit 1; echo "'
1207 warning: filename contains '"', which is reserved on Windows: '"; exit 1; echo "'
1142 $ hg update -C 1 > /dev/null
1208 $ hg update -C 1 > /dev/null
1143 $ echo "revision 6" > '"; exit 1; echo "'
1209 $ echo "revision 6" > '"; exit 1; echo "'
1144 $ hg commit -Am "revision 6"
1210 $ hg commit -Am "revision 6"
1145 adding "; exit 1; echo "
1211 adding "; exit 1; echo "
1146 warning: filename contains '"', which is reserved on Windows: '"; exit 1; echo "'
1212 warning: filename contains '"', which is reserved on Windows: '"; exit 1; echo "'
1147 created new head
1213 created new head
1148 $ hg merge --config merge-tools.true.executable="true" -r 5
1214 $ hg merge --config merge-tools.true.executable="true" -r 5
1149 merging "; exit 1; echo "
1215 merging "; exit 1; echo "
1150 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1216 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1151 (branch merge, don't forget to commit)
1217 (branch merge, don't forget to commit)
1152 $ hg update -C 1 > /dev/null
1218 $ hg update -C 1 > /dev/null
1153 #endif
1219 #endif
1154
1220
1155 Merge post-processing
1221 Merge post-processing
1156
1222
1157 cat is a bad merge-tool and doesn't change:
1223 cat is a bad merge-tool and doesn't change:
1158
1224
1159 $ beforemerge
1225 $ beforemerge
1160 [merge-tools]
1226 [merge-tools]
1161 false.whatever=
1227 false.whatever=
1162 true.priority=1
1228 true.priority=1
1163 true.executable=cat
1229 true.executable=cat
1164 # hg update -C 1
1230 # hg update -C 1
1165 $ hg merge -y -r 2 --config merge-tools.true.checkchanged=1
1231 $ hg merge -y -r 2 --config merge-tools.true.checkchanged=1
1166 merging f
1232 merging f
1167 revision 1
1233 revision 1
1168 space
1234 space
1169 revision 0
1235 revision 0
1170 space
1236 space
1171 revision 2
1237 revision 2
1172 space
1238 space
1173 output file f appears unchanged
1239 output file f appears unchanged
1174 was merge successful (yn)? n
1240 was merge successful (yn)? n
1175 merging f failed!
1241 merging f failed!
1176 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1242 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1177 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
1243 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
1178 [1]
1244 [1]
1179 $ aftermerge
1245 $ aftermerge
1180 # cat f
1246 # cat f
1181 revision 1
1247 revision 1
1182 space
1248 space
1183 # hg stat
1249 # hg stat
1184 M f
1250 M f
1185 ? f.orig
1251 ? f.orig
1186 # hg resolve --list
1252 # hg resolve --list
1187 U f
1253 U f
1188
1254
1189 #if symlink
1255 #if symlink
1190
1256
1191 internal merge cannot handle symlinks and shouldn't try:
1257 internal merge cannot handle symlinks and shouldn't try:
1192
1258
1193 $ hg update -q -C 1
1259 $ hg update -q -C 1
1194 $ rm f
1260 $ rm f
1195 $ ln -s symlink f
1261 $ ln -s symlink f
1196 $ hg commit -qm 'f is symlink'
1262 $ hg commit -qm 'f is symlink'
1197 $ hg merge -r 2 --tool internal:merge
1263 $ hg merge -r 2 --tool internal:merge
1198 merging f
1264 merging f
1199 warning: internal :merge cannot merge symlinks for f
1265 warning: internal :merge cannot merge symlinks for f
1200 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
1266 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
1201 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1267 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1202 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
1268 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
1203 [1]
1269 [1]
1204
1270
1205 #endif
1271 #endif
1206
1272
1207 Verify naming of temporary files and that extension is preserved:
1273 Verify naming of temporary files and that extension is preserved:
1208
1274
1209 $ hg update -q -C 1
1275 $ hg update -q -C 1
1210 $ hg mv f f.txt
1276 $ hg mv f f.txt
1211 $ hg ci -qm "f.txt"
1277 $ hg ci -qm "f.txt"
1212 $ hg update -q -C 2
1278 $ hg update -q -C 2
1213 $ hg merge -y -r tip --tool echo --config merge-tools.echo.args='$base $local $other $output'
1279 $ hg merge -y -r tip --tool echo --config merge-tools.echo.args='$base $local $other $output'
1214 merging f and f.txt to f.txt
1280 merging f and f.txt to f.txt
1215 */f~base.?????? $TESTTMP/f.txt.orig */f~other.??????.txt $TESTTMP/f.txt (glob)
1281 */f~base.?????? $TESTTMP/f.txt.orig */f~other.??????.txt $TESTTMP/f.txt (glob)
1216 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1282 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1217 (branch merge, don't forget to commit)
1283 (branch merge, don't forget to commit)
General Comments 0
You need to be logged in to leave comments. Login now