##// END OF EJS Templates
filemerge: fix the wrong placements of messages in prompt...
Pulkit Goyal -
r39321:a3fd84f4 default
parent child Browse files
Show More
@@ -1,1015 +1,1015 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 contextlib
10 import contextlib
11 import os
11 import os
12 import re
12 import re
13 import shutil
13 import shutil
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 registrar,
24 registrar,
25 scmutil,
25 scmutil,
26 simplemerge,
26 simplemerge,
27 tagmerge,
27 tagmerge,
28 templatekw,
28 templatekw,
29 templater,
29 templater,
30 util,
30 util,
31 )
31 )
32
32
33 from .utils import (
33 from .utils import (
34 procutil,
34 procutil,
35 stringutil,
35 stringutil,
36 )
36 )
37
37
38 def _toolstr(ui, tool, part, *args):
38 def _toolstr(ui, tool, part, *args):
39 return ui.config("merge-tools", tool + "." + part, *args)
39 return ui.config("merge-tools", tool + "." + part, *args)
40
40
41 def _toolbool(ui, tool, part,*args):
41 def _toolbool(ui, tool, part,*args):
42 return ui.configbool("merge-tools", tool + "." + part, *args)
42 return ui.configbool("merge-tools", tool + "." + part, *args)
43
43
44 def _toollist(ui, tool, part):
44 def _toollist(ui, tool, part):
45 return ui.configlist("merge-tools", tool + "." + part)
45 return ui.configlist("merge-tools", tool + "." + part)
46
46
47 internals = {}
47 internals = {}
48 # Merge tools to document.
48 # Merge tools to document.
49 internalsdoc = {}
49 internalsdoc = {}
50
50
51 internaltool = registrar.internalmerge()
51 internaltool = registrar.internalmerge()
52
52
53 # internal tool merge types
53 # internal tool merge types
54 nomerge = internaltool.nomerge
54 nomerge = internaltool.nomerge
55 mergeonly = internaltool.mergeonly # just the full merge, no premerge
55 mergeonly = internaltool.mergeonly # just the full merge, no premerge
56 fullmerge = internaltool.fullmerge # both premerge and merge
56 fullmerge = internaltool.fullmerge # both premerge and merge
57
57
58 _localchangedotherdeletedmsg = _(
58 _localchangedotherdeletedmsg = _(
59 "file '%(fd)s' was deleted in local%(l)s but was modified in other%(o)s.\n"
59 "file '%(fd)s' was deleted in other%(o)s but was modified in local%(l)s.\n"
60 "What do you want to do?\n"
60 "What do you want to do?\n"
61 "use (c)hanged version, (d)elete, or leave (u)nresolved?"
61 "use (c)hanged version, (d)elete, or leave (u)nresolved?"
62 "$$ &Changed $$ &Delete $$ &Unresolved")
62 "$$ &Changed $$ &Delete $$ &Unresolved")
63
63
64 _otherchangedlocaldeletedmsg = _(
64 _otherchangedlocaldeletedmsg = _(
65 "file '%(fd)s' was deleted in other%(o)s but was modified in local%(l)s.\n"
65 "file '%(fd)s' was deleted in local%(l)s but was modified in other%(o)s.\n"
66 "What do you want to do?\n"
66 "What do you want to do?\n"
67 "use (c)hanged version, leave (d)eleted, or "
67 "use (c)hanged version, leave (d)eleted, or "
68 "leave (u)nresolved?"
68 "leave (u)nresolved?"
69 "$$ &Changed $$ &Deleted $$ &Unresolved")
69 "$$ &Changed $$ &Deleted $$ &Unresolved")
70
70
71 class absentfilectx(object):
71 class absentfilectx(object):
72 """Represents a file that's ostensibly in a context but is actually not
72 """Represents a file that's ostensibly in a context but is actually not
73 present in it.
73 present in it.
74
74
75 This is here because it's very specific to the filemerge code for now --
75 This is here because it's very specific to the filemerge code for now --
76 other code is likely going to break with the values this returns."""
76 other code is likely going to break with the values this returns."""
77 def __init__(self, ctx, f):
77 def __init__(self, ctx, f):
78 self._ctx = ctx
78 self._ctx = ctx
79 self._f = f
79 self._f = f
80
80
81 def path(self):
81 def path(self):
82 return self._f
82 return self._f
83
83
84 def size(self):
84 def size(self):
85 return None
85 return None
86
86
87 def data(self):
87 def data(self):
88 return None
88 return None
89
89
90 def filenode(self):
90 def filenode(self):
91 return nullid
91 return nullid
92
92
93 _customcmp = True
93 _customcmp = True
94 def cmp(self, fctx):
94 def cmp(self, fctx):
95 """compare with other file context
95 """compare with other file context
96
96
97 returns True if different from fctx.
97 returns True if different from fctx.
98 """
98 """
99 return not (fctx.isabsent() and
99 return not (fctx.isabsent() and
100 fctx.ctx() == self.ctx() and
100 fctx.ctx() == self.ctx() and
101 fctx.path() == self.path())
101 fctx.path() == self.path())
102
102
103 def flags(self):
103 def flags(self):
104 return ''
104 return ''
105
105
106 def changectx(self):
106 def changectx(self):
107 return self._ctx
107 return self._ctx
108
108
109 def isbinary(self):
109 def isbinary(self):
110 return False
110 return False
111
111
112 def isabsent(self):
112 def isabsent(self):
113 return True
113 return True
114
114
115 def _findtool(ui, tool):
115 def _findtool(ui, tool):
116 if tool in internals:
116 if tool in internals:
117 return tool
117 return tool
118 cmd = _toolstr(ui, tool, "executable", tool)
118 cmd = _toolstr(ui, tool, "executable", tool)
119 if cmd.startswith('python:'):
119 if cmd.startswith('python:'):
120 return cmd
120 return cmd
121 return findexternaltool(ui, tool)
121 return findexternaltool(ui, tool)
122
122
123 def _quotetoolpath(cmd):
123 def _quotetoolpath(cmd):
124 if cmd.startswith('python:'):
124 if cmd.startswith('python:'):
125 return cmd
125 return cmd
126 return procutil.shellquote(cmd)
126 return procutil.shellquote(cmd)
127
127
128 def findexternaltool(ui, tool):
128 def findexternaltool(ui, tool):
129 for kn in ("regkey", "regkeyalt"):
129 for kn in ("regkey", "regkeyalt"):
130 k = _toolstr(ui, tool, kn)
130 k = _toolstr(ui, tool, kn)
131 if not k:
131 if not k:
132 continue
132 continue
133 p = util.lookupreg(k, _toolstr(ui, tool, "regname"))
133 p = util.lookupreg(k, _toolstr(ui, tool, "regname"))
134 if p:
134 if p:
135 p = procutil.findexe(p + _toolstr(ui, tool, "regappend", ""))
135 p = procutil.findexe(p + _toolstr(ui, tool, "regappend", ""))
136 if p:
136 if p:
137 return p
137 return p
138 exe = _toolstr(ui, tool, "executable", tool)
138 exe = _toolstr(ui, tool, "executable", tool)
139 return procutil.findexe(util.expandpath(exe))
139 return procutil.findexe(util.expandpath(exe))
140
140
141 def _picktool(repo, ui, path, binary, symlink, changedelete):
141 def _picktool(repo, ui, path, binary, symlink, changedelete):
142 strictcheck = ui.configbool('merge', 'strict-capability-check')
142 strictcheck = ui.configbool('merge', 'strict-capability-check')
143
143
144 def hascapability(tool, capability, strict=False):
144 def hascapability(tool, capability, strict=False):
145 if tool in internals:
145 if tool in internals:
146 return strict and internals[tool].capabilities.get(capability)
146 return strict and internals[tool].capabilities.get(capability)
147 return _toolbool(ui, tool, capability)
147 return _toolbool(ui, tool, capability)
148
148
149 def supportscd(tool):
149 def supportscd(tool):
150 return tool in internals and internals[tool].mergetype == nomerge
150 return tool in internals and internals[tool].mergetype == nomerge
151
151
152 def check(tool, pat, symlink, binary, changedelete):
152 def check(tool, pat, symlink, binary, changedelete):
153 tmsg = tool
153 tmsg = tool
154 if pat:
154 if pat:
155 tmsg = _("%s (for pattern %s)") % (tool, pat)
155 tmsg = _("%s (for pattern %s)") % (tool, pat)
156 if not _findtool(ui, tool):
156 if not _findtool(ui, tool):
157 if pat: # explicitly requested tool deserves a warning
157 if pat: # explicitly requested tool deserves a warning
158 ui.warn(_("couldn't find merge tool %s\n") % tmsg)
158 ui.warn(_("couldn't find merge tool %s\n") % tmsg)
159 else: # configured but non-existing tools are more silent
159 else: # configured but non-existing tools are more silent
160 ui.note(_("couldn't find merge tool %s\n") % tmsg)
160 ui.note(_("couldn't find merge tool %s\n") % tmsg)
161 elif symlink and not hascapability(tool, "symlink", strictcheck):
161 elif symlink and not hascapability(tool, "symlink", strictcheck):
162 ui.warn(_("tool %s can't handle symlinks\n") % tmsg)
162 ui.warn(_("tool %s can't handle symlinks\n") % tmsg)
163 elif binary and not hascapability(tool, "binary", strictcheck):
163 elif binary and not hascapability(tool, "binary", strictcheck):
164 ui.warn(_("tool %s can't handle binary\n") % tmsg)
164 ui.warn(_("tool %s can't handle binary\n") % tmsg)
165 elif changedelete and not supportscd(tool):
165 elif changedelete and not supportscd(tool):
166 # the nomerge tools are the only tools that support change/delete
166 # the nomerge tools are the only tools that support change/delete
167 # conflicts
167 # conflicts
168 pass
168 pass
169 elif not procutil.gui() and _toolbool(ui, tool, "gui"):
169 elif not procutil.gui() and _toolbool(ui, tool, "gui"):
170 ui.warn(_("tool %s requires a GUI\n") % tmsg)
170 ui.warn(_("tool %s requires a GUI\n") % tmsg)
171 else:
171 else:
172 return True
172 return True
173 return False
173 return False
174
174
175 # internal config: ui.forcemerge
175 # internal config: ui.forcemerge
176 # forcemerge comes from command line arguments, highest priority
176 # forcemerge comes from command line arguments, highest priority
177 force = ui.config('ui', 'forcemerge')
177 force = ui.config('ui', 'forcemerge')
178 if force:
178 if force:
179 toolpath = _findtool(ui, force)
179 toolpath = _findtool(ui, force)
180 if changedelete and not supportscd(toolpath):
180 if changedelete and not supportscd(toolpath):
181 return ":prompt", None
181 return ":prompt", None
182 else:
182 else:
183 if toolpath:
183 if toolpath:
184 return (force, _quotetoolpath(toolpath))
184 return (force, _quotetoolpath(toolpath))
185 else:
185 else:
186 # mimic HGMERGE if given tool not found
186 # mimic HGMERGE if given tool not found
187 return (force, force)
187 return (force, force)
188
188
189 # HGMERGE takes next precedence
189 # HGMERGE takes next precedence
190 hgmerge = encoding.environ.get("HGMERGE")
190 hgmerge = encoding.environ.get("HGMERGE")
191 if hgmerge:
191 if hgmerge:
192 if changedelete and not supportscd(hgmerge):
192 if changedelete and not supportscd(hgmerge):
193 return ":prompt", None
193 return ":prompt", None
194 else:
194 else:
195 return (hgmerge, hgmerge)
195 return (hgmerge, hgmerge)
196
196
197 # then patterns
197 # then patterns
198
198
199 # whether binary capability should be checked strictly
199 # whether binary capability should be checked strictly
200 binarycap = binary and strictcheck
200 binarycap = binary and strictcheck
201
201
202 for pat, tool in ui.configitems("merge-patterns"):
202 for pat, tool in ui.configitems("merge-patterns"):
203 mf = match.match(repo.root, '', [pat])
203 mf = match.match(repo.root, '', [pat])
204 if mf(path) and check(tool, pat, symlink, binarycap, changedelete):
204 if mf(path) and check(tool, pat, symlink, binarycap, changedelete):
205 if binary and not hascapability(tool, "binary", strict=True):
205 if binary and not hascapability(tool, "binary", strict=True):
206 ui.warn(_("warning: check merge-patterns configurations,"
206 ui.warn(_("warning: check merge-patterns configurations,"
207 " if %r for binary file %r is unintentional\n"
207 " if %r for binary file %r is unintentional\n"
208 "(see 'hg help merge-tools'"
208 "(see 'hg help merge-tools'"
209 " for binary files capability)\n")
209 " for binary files capability)\n")
210 % (pycompat.bytestr(tool), pycompat.bytestr(path)))
210 % (pycompat.bytestr(tool), pycompat.bytestr(path)))
211 toolpath = _findtool(ui, tool)
211 toolpath = _findtool(ui, tool)
212 return (tool, _quotetoolpath(toolpath))
212 return (tool, _quotetoolpath(toolpath))
213
213
214 # then merge tools
214 # then merge tools
215 tools = {}
215 tools = {}
216 disabled = set()
216 disabled = set()
217 for k, v in ui.configitems("merge-tools"):
217 for k, v in ui.configitems("merge-tools"):
218 t = k.split('.')[0]
218 t = k.split('.')[0]
219 if t not in tools:
219 if t not in tools:
220 tools[t] = int(_toolstr(ui, t, "priority"))
220 tools[t] = int(_toolstr(ui, t, "priority"))
221 if _toolbool(ui, t, "disabled"):
221 if _toolbool(ui, t, "disabled"):
222 disabled.add(t)
222 disabled.add(t)
223 names = tools.keys()
223 names = tools.keys()
224 tools = sorted([(-p, tool) for tool, p in tools.items()
224 tools = sorted([(-p, tool) for tool, p in tools.items()
225 if tool not in disabled])
225 if tool not in disabled])
226 uimerge = ui.config("ui", "merge")
226 uimerge = ui.config("ui", "merge")
227 if uimerge:
227 if uimerge:
228 # external tools defined in uimerge won't be able to handle
228 # external tools defined in uimerge won't be able to handle
229 # change/delete conflicts
229 # change/delete conflicts
230 if check(uimerge, path, symlink, binary, changedelete):
230 if check(uimerge, path, symlink, binary, changedelete):
231 if uimerge not in names and not changedelete:
231 if uimerge not in names and not changedelete:
232 return (uimerge, uimerge)
232 return (uimerge, uimerge)
233 tools.insert(0, (None, uimerge)) # highest priority
233 tools.insert(0, (None, uimerge)) # highest priority
234 tools.append((None, "hgmerge")) # the old default, if found
234 tools.append((None, "hgmerge")) # the old default, if found
235 for p, t in tools:
235 for p, t in tools:
236 if check(t, None, symlink, binary, changedelete):
236 if check(t, None, symlink, binary, changedelete):
237 toolpath = _findtool(ui, t)
237 toolpath = _findtool(ui, t)
238 return (t, _quotetoolpath(toolpath))
238 return (t, _quotetoolpath(toolpath))
239
239
240 # internal merge or prompt as last resort
240 # internal merge or prompt as last resort
241 if symlink or binary or changedelete:
241 if symlink or binary or changedelete:
242 if not changedelete and len(tools):
242 if not changedelete and len(tools):
243 # any tool is rejected by capability for symlink or binary
243 # any tool is rejected by capability for symlink or binary
244 ui.warn(_("no tool found to merge %s\n") % path)
244 ui.warn(_("no tool found to merge %s\n") % path)
245 return ":prompt", None
245 return ":prompt", None
246 return ":merge", None
246 return ":merge", None
247
247
248 def _eoltype(data):
248 def _eoltype(data):
249 "Guess the EOL type of a file"
249 "Guess the EOL type of a file"
250 if '\0' in data: # binary
250 if '\0' in data: # binary
251 return None
251 return None
252 if '\r\n' in data: # Windows
252 if '\r\n' in data: # Windows
253 return '\r\n'
253 return '\r\n'
254 if '\r' in data: # Old Mac
254 if '\r' in data: # Old Mac
255 return '\r'
255 return '\r'
256 if '\n' in data: # UNIX
256 if '\n' in data: # UNIX
257 return '\n'
257 return '\n'
258 return None # unknown
258 return None # unknown
259
259
260 def _matcheol(file, back):
260 def _matcheol(file, back):
261 "Convert EOL markers in a file to match origfile"
261 "Convert EOL markers in a file to match origfile"
262 tostyle = _eoltype(back.data()) # No repo.wread filters?
262 tostyle = _eoltype(back.data()) # No repo.wread filters?
263 if tostyle:
263 if tostyle:
264 data = util.readfile(file)
264 data = util.readfile(file)
265 style = _eoltype(data)
265 style = _eoltype(data)
266 if style:
266 if style:
267 newdata = data.replace(style, tostyle)
267 newdata = data.replace(style, tostyle)
268 if newdata != data:
268 if newdata != data:
269 util.writefile(file, newdata)
269 util.writefile(file, newdata)
270
270
271 @internaltool('prompt', nomerge)
271 @internaltool('prompt', nomerge)
272 def _iprompt(repo, mynode, orig, fcd, fco, fca, toolconf, labels=None):
272 def _iprompt(repo, mynode, orig, fcd, fco, fca, toolconf, labels=None):
273 """Asks the user which of the local `p1()` or the other `p2()` version to
273 """Asks the user which of the local `p1()` or the other `p2()` version to
274 keep as the merged version."""
274 keep as the merged version."""
275 ui = repo.ui
275 ui = repo.ui
276 fd = fcd.path()
276 fd = fcd.path()
277
277
278 # Avoid prompting during an in-memory merge since it doesn't support merge
278 # Avoid prompting during an in-memory merge since it doesn't support merge
279 # conflicts.
279 # conflicts.
280 if fcd.changectx().isinmemory():
280 if fcd.changectx().isinmemory():
281 raise error.InMemoryMergeConflictsError('in-memory merge does not '
281 raise error.InMemoryMergeConflictsError('in-memory merge does not '
282 'support file conflicts')
282 'support file conflicts')
283
283
284 prompts = partextras(labels)
284 prompts = partextras(labels)
285 prompts['fd'] = fd
285 prompts['fd'] = fd
286 try:
286 try:
287 if fco.isabsent():
287 if fco.isabsent():
288 index = ui.promptchoice(
288 index = ui.promptchoice(
289 _localchangedotherdeletedmsg % prompts, 2)
289 _localchangedotherdeletedmsg % prompts, 2)
290 choice = ['local', 'other', 'unresolved'][index]
290 choice = ['local', 'other', 'unresolved'][index]
291 elif fcd.isabsent():
291 elif fcd.isabsent():
292 index = ui.promptchoice(
292 index = ui.promptchoice(
293 _otherchangedlocaldeletedmsg % prompts, 2)
293 _otherchangedlocaldeletedmsg % prompts, 2)
294 choice = ['other', 'local', 'unresolved'][index]
294 choice = ['other', 'local', 'unresolved'][index]
295 else:
295 else:
296 index = ui.promptchoice(
296 index = ui.promptchoice(
297 _("keep (l)ocal%(l)s, take (o)ther%(o)s, or leave (u)nresolved"
297 _("keep (l)ocal%(l)s, take (o)ther%(o)s, or leave (u)nresolved"
298 " for %(fd)s?"
298 " for %(fd)s?"
299 "$$ &Local $$ &Other $$ &Unresolved") % prompts, 2)
299 "$$ &Local $$ &Other $$ &Unresolved") % prompts, 2)
300 choice = ['local', 'other', 'unresolved'][index]
300 choice = ['local', 'other', 'unresolved'][index]
301
301
302 if choice == 'other':
302 if choice == 'other':
303 return _iother(repo, mynode, orig, fcd, fco, fca, toolconf,
303 return _iother(repo, mynode, orig, fcd, fco, fca, toolconf,
304 labels)
304 labels)
305 elif choice == 'local':
305 elif choice == 'local':
306 return _ilocal(repo, mynode, orig, fcd, fco, fca, toolconf,
306 return _ilocal(repo, mynode, orig, fcd, fco, fca, toolconf,
307 labels)
307 labels)
308 elif choice == 'unresolved':
308 elif choice == 'unresolved':
309 return _ifail(repo, mynode, orig, fcd, fco, fca, toolconf,
309 return _ifail(repo, mynode, orig, fcd, fco, fca, toolconf,
310 labels)
310 labels)
311 except error.ResponseExpected:
311 except error.ResponseExpected:
312 ui.write("\n")
312 ui.write("\n")
313 return _ifail(repo, mynode, orig, fcd, fco, fca, toolconf,
313 return _ifail(repo, mynode, orig, fcd, fco, fca, toolconf,
314 labels)
314 labels)
315
315
316 @internaltool('local', nomerge)
316 @internaltool('local', nomerge)
317 def _ilocal(repo, mynode, orig, fcd, fco, fca, toolconf, labels=None):
317 def _ilocal(repo, mynode, orig, fcd, fco, fca, toolconf, labels=None):
318 """Uses the local `p1()` version of files as the merged version."""
318 """Uses the local `p1()` version of files as the merged version."""
319 return 0, fcd.isabsent()
319 return 0, fcd.isabsent()
320
320
321 @internaltool('other', nomerge)
321 @internaltool('other', nomerge)
322 def _iother(repo, mynode, orig, fcd, fco, fca, toolconf, labels=None):
322 def _iother(repo, mynode, orig, fcd, fco, fca, toolconf, labels=None):
323 """Uses the other `p2()` version of files as the merged version."""
323 """Uses the other `p2()` version of files as the merged version."""
324 if fco.isabsent():
324 if fco.isabsent():
325 # local changed, remote deleted -- 'deleted' picked
325 # local changed, remote deleted -- 'deleted' picked
326 _underlyingfctxifabsent(fcd).remove()
326 _underlyingfctxifabsent(fcd).remove()
327 deleted = True
327 deleted = True
328 else:
328 else:
329 _underlyingfctxifabsent(fcd).write(fco.data(), fco.flags())
329 _underlyingfctxifabsent(fcd).write(fco.data(), fco.flags())
330 deleted = False
330 deleted = False
331 return 0, deleted
331 return 0, deleted
332
332
333 @internaltool('fail', nomerge)
333 @internaltool('fail', nomerge)
334 def _ifail(repo, mynode, orig, fcd, fco, fca, toolconf, labels=None):
334 def _ifail(repo, mynode, orig, fcd, fco, fca, toolconf, labels=None):
335 """
335 """
336 Rather than attempting to merge files that were modified on both
336 Rather than attempting to merge files that were modified on both
337 branches, it marks them as unresolved. The resolve command must be
337 branches, it marks them as unresolved. The resolve command must be
338 used to resolve these conflicts."""
338 used to resolve these conflicts."""
339 # for change/delete conflicts write out the changed version, then fail
339 # for change/delete conflicts write out the changed version, then fail
340 if fcd.isabsent():
340 if fcd.isabsent():
341 _underlyingfctxifabsent(fcd).write(fco.data(), fco.flags())
341 _underlyingfctxifabsent(fcd).write(fco.data(), fco.flags())
342 return 1, False
342 return 1, False
343
343
344 def _underlyingfctxifabsent(filectx):
344 def _underlyingfctxifabsent(filectx):
345 """Sometimes when resolving, our fcd is actually an absentfilectx, but
345 """Sometimes when resolving, our fcd is actually an absentfilectx, but
346 we want to write to it (to do the resolve). This helper returns the
346 we want to write to it (to do the resolve). This helper returns the
347 underyling workingfilectx in that case.
347 underyling workingfilectx in that case.
348 """
348 """
349 if filectx.isabsent():
349 if filectx.isabsent():
350 return filectx.changectx()[filectx.path()]
350 return filectx.changectx()[filectx.path()]
351 else:
351 else:
352 return filectx
352 return filectx
353
353
354 def _premerge(repo, fcd, fco, fca, toolconf, files, labels=None):
354 def _premerge(repo, fcd, fco, fca, toolconf, files, labels=None):
355 tool, toolpath, binary, symlink, scriptfn = toolconf
355 tool, toolpath, binary, symlink, scriptfn = toolconf
356 if symlink or fcd.isabsent() or fco.isabsent():
356 if symlink or fcd.isabsent() or fco.isabsent():
357 return 1
357 return 1
358 unused, unused, unused, back = files
358 unused, unused, unused, back = files
359
359
360 ui = repo.ui
360 ui = repo.ui
361
361
362 validkeep = ['keep', 'keep-merge3']
362 validkeep = ['keep', 'keep-merge3']
363
363
364 # do we attempt to simplemerge first?
364 # do we attempt to simplemerge first?
365 try:
365 try:
366 premerge = _toolbool(ui, tool, "premerge", not binary)
366 premerge = _toolbool(ui, tool, "premerge", not binary)
367 except error.ConfigError:
367 except error.ConfigError:
368 premerge = _toolstr(ui, tool, "premerge", "").lower()
368 premerge = _toolstr(ui, tool, "premerge", "").lower()
369 if premerge not in validkeep:
369 if premerge not in validkeep:
370 _valid = ', '.join(["'" + v + "'" for v in validkeep])
370 _valid = ', '.join(["'" + v + "'" for v in validkeep])
371 raise error.ConfigError(_("%s.premerge not valid "
371 raise error.ConfigError(_("%s.premerge not valid "
372 "('%s' is neither boolean nor %s)") %
372 "('%s' is neither boolean nor %s)") %
373 (tool, premerge, _valid))
373 (tool, premerge, _valid))
374
374
375 if premerge:
375 if premerge:
376 if premerge == 'keep-merge3':
376 if premerge == 'keep-merge3':
377 if not labels:
377 if not labels:
378 labels = _defaultconflictlabels
378 labels = _defaultconflictlabels
379 if len(labels) < 3:
379 if len(labels) < 3:
380 labels.append('base')
380 labels.append('base')
381 r = simplemerge.simplemerge(ui, fcd, fca, fco, quiet=True, label=labels)
381 r = simplemerge.simplemerge(ui, fcd, fca, fco, quiet=True, label=labels)
382 if not r:
382 if not r:
383 ui.debug(" premerge successful\n")
383 ui.debug(" premerge successful\n")
384 return 0
384 return 0
385 if premerge not in validkeep:
385 if premerge not in validkeep:
386 # restore from backup and try again
386 # restore from backup and try again
387 _restorebackup(fcd, back)
387 _restorebackup(fcd, back)
388 return 1 # continue merging
388 return 1 # continue merging
389
389
390 def _mergecheck(repo, mynode, orig, fcd, fco, fca, toolconf):
390 def _mergecheck(repo, mynode, orig, fcd, fco, fca, toolconf):
391 tool, toolpath, binary, symlink, scriptfn = toolconf
391 tool, toolpath, binary, symlink, scriptfn = toolconf
392 if symlink:
392 if symlink:
393 repo.ui.warn(_('warning: internal %s cannot merge symlinks '
393 repo.ui.warn(_('warning: internal %s cannot merge symlinks '
394 'for %s\n') % (tool, fcd.path()))
394 'for %s\n') % (tool, fcd.path()))
395 return False
395 return False
396 if fcd.isabsent() or fco.isabsent():
396 if fcd.isabsent() or fco.isabsent():
397 repo.ui.warn(_('warning: internal %s cannot merge change/delete '
397 repo.ui.warn(_('warning: internal %s cannot merge change/delete '
398 'conflict for %s\n') % (tool, fcd.path()))
398 'conflict for %s\n') % (tool, fcd.path()))
399 return False
399 return False
400 return True
400 return True
401
401
402 def _merge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels, mode):
402 def _merge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels, mode):
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. Markers will have two sections, one for each side
406 the partially merged file. Markers will have two sections, one for each side
407 of merge, unless mode equals 'union' which suppresses the markers."""
407 of merge, unless mode equals 'union' which suppresses the markers."""
408 ui = repo.ui
408 ui = repo.ui
409
409
410 r = simplemerge.simplemerge(ui, fcd, fca, fco, label=labels, mode=mode)
410 r = simplemerge.simplemerge(ui, fcd, fca, fco, label=labels, mode=mode)
411 return True, r, False
411 return True, r, False
412
412
413 @internaltool('union', fullmerge,
413 @internaltool('union', fullmerge,
414 _("warning: conflicts while merging %s! "
414 _("warning: conflicts while merging %s! "
415 "(edit, then use 'hg resolve --mark')\n"),
415 "(edit, then use 'hg resolve --mark')\n"),
416 precheck=_mergecheck)
416 precheck=_mergecheck)
417 def _iunion(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
417 def _iunion(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
418 """
418 """
419 Uses the internal non-interactive simple merge algorithm for merging
419 Uses the internal non-interactive simple merge algorithm for merging
420 files. It will use both left and right sides for conflict regions.
420 files. It will use both left and right sides for conflict regions.
421 No markers are inserted."""
421 No markers are inserted."""
422 return _merge(repo, mynode, orig, fcd, fco, fca, toolconf,
422 return _merge(repo, mynode, orig, fcd, fco, fca, toolconf,
423 files, labels, 'union')
423 files, labels, 'union')
424
424
425 @internaltool('merge', fullmerge,
425 @internaltool('merge', fullmerge,
426 _("warning: conflicts while merging %s! "
426 _("warning: conflicts while merging %s! "
427 "(edit, then use 'hg resolve --mark')\n"),
427 "(edit, then use 'hg resolve --mark')\n"),
428 precheck=_mergecheck)
428 precheck=_mergecheck)
429 def _imerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
429 def _imerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
430 """
430 """
431 Uses the internal non-interactive simple merge algorithm for merging
431 Uses the internal non-interactive simple merge algorithm for merging
432 files. It will fail if there are any conflicts and leave markers in
432 files. It will fail if there are any conflicts and leave markers in
433 the partially merged file. Markers will have two sections, one for each side
433 the partially merged file. Markers will have two sections, one for each side
434 of merge."""
434 of merge."""
435 return _merge(repo, mynode, orig, fcd, fco, fca, toolconf,
435 return _merge(repo, mynode, orig, fcd, fco, fca, toolconf,
436 files, labels, 'merge')
436 files, labels, 'merge')
437
437
438 @internaltool('merge3', fullmerge,
438 @internaltool('merge3', fullmerge,
439 _("warning: conflicts while merging %s! "
439 _("warning: conflicts while merging %s! "
440 "(edit, then use 'hg resolve --mark')\n"),
440 "(edit, then use 'hg resolve --mark')\n"),
441 precheck=_mergecheck)
441 precheck=_mergecheck)
442 def _imerge3(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
442 def _imerge3(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
443 """
443 """
444 Uses the internal non-interactive simple merge algorithm for merging
444 Uses the internal non-interactive simple merge algorithm for merging
445 files. It will fail if there are any conflicts and leave markers in
445 files. It will fail if there are any conflicts and leave markers in
446 the partially merged file. Marker will have three sections, one from each
446 the partially merged file. Marker will have three sections, one from each
447 side of the merge and one for the base content."""
447 side of the merge and one for the base content."""
448 if not labels:
448 if not labels:
449 labels = _defaultconflictlabels
449 labels = _defaultconflictlabels
450 if len(labels) < 3:
450 if len(labels) < 3:
451 labels.append('base')
451 labels.append('base')
452 return _imerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels)
452 return _imerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels)
453
453
454 def _imergeauto(repo, mynode, orig, fcd, fco, fca, toolconf, files,
454 def _imergeauto(repo, mynode, orig, fcd, fco, fca, toolconf, files,
455 labels=None, localorother=None):
455 labels=None, localorother=None):
456 """
456 """
457 Generic driver for _imergelocal and _imergeother
457 Generic driver for _imergelocal and _imergeother
458 """
458 """
459 assert localorother is not None
459 assert localorother is not None
460 tool, toolpath, binary, symlink, scriptfn = toolconf
460 tool, toolpath, binary, symlink, scriptfn = toolconf
461 r = simplemerge.simplemerge(repo.ui, fcd, fca, fco, label=labels,
461 r = simplemerge.simplemerge(repo.ui, fcd, fca, fco, label=labels,
462 localorother=localorother)
462 localorother=localorother)
463 return True, r
463 return True, r
464
464
465 @internaltool('merge-local', mergeonly, precheck=_mergecheck)
465 @internaltool('merge-local', mergeonly, precheck=_mergecheck)
466 def _imergelocal(*args, **kwargs):
466 def _imergelocal(*args, **kwargs):
467 """
467 """
468 Like :merge, but resolve all conflicts non-interactively in favor
468 Like :merge, but resolve all conflicts non-interactively in favor
469 of the local `p1()` changes."""
469 of the local `p1()` changes."""
470 success, status = _imergeauto(localorother='local', *args, **kwargs)
470 success, status = _imergeauto(localorother='local', *args, **kwargs)
471 return success, status, False
471 return success, status, False
472
472
473 @internaltool('merge-other', mergeonly, precheck=_mergecheck)
473 @internaltool('merge-other', mergeonly, precheck=_mergecheck)
474 def _imergeother(*args, **kwargs):
474 def _imergeother(*args, **kwargs):
475 """
475 """
476 Like :merge, but resolve all conflicts non-interactively in favor
476 Like :merge, but resolve all conflicts non-interactively in favor
477 of the other `p2()` changes."""
477 of the other `p2()` changes."""
478 success, status = _imergeauto(localorother='other', *args, **kwargs)
478 success, status = _imergeauto(localorother='other', *args, **kwargs)
479 return success, status, False
479 return success, status, False
480
480
481 @internaltool('tagmerge', mergeonly,
481 @internaltool('tagmerge', mergeonly,
482 _("automatic tag merging of %s failed! "
482 _("automatic tag merging of %s failed! "
483 "(use 'hg resolve --tool :merge' or another merge "
483 "(use 'hg resolve --tool :merge' or another merge "
484 "tool of your choice)\n"))
484 "tool of your choice)\n"))
485 def _itagmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
485 def _itagmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
486 """
486 """
487 Uses the internal tag merge algorithm (experimental).
487 Uses the internal tag merge algorithm (experimental).
488 """
488 """
489 success, status = tagmerge.merge(repo, fcd, fco, fca)
489 success, status = tagmerge.merge(repo, fcd, fco, fca)
490 return success, status, False
490 return success, status, False
491
491
492 @internaltool('dump', fullmerge, binary=True, symlink=True)
492 @internaltool('dump', fullmerge, binary=True, symlink=True)
493 def _idump(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
493 def _idump(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
494 """
494 """
495 Creates three versions of the files to merge, containing the
495 Creates three versions of the files to merge, containing the
496 contents of local, other and base. These files can then be used to
496 contents of local, other and base. These files can then be used to
497 perform a merge manually. If the file to be merged is named
497 perform a merge manually. If the file to be merged is named
498 ``a.txt``, these files will accordingly be named ``a.txt.local``,
498 ``a.txt``, these files will accordingly be named ``a.txt.local``,
499 ``a.txt.other`` and ``a.txt.base`` and they will be placed in the
499 ``a.txt.other`` and ``a.txt.base`` and they will be placed in the
500 same directory as ``a.txt``.
500 same directory as ``a.txt``.
501
501
502 This implies premerge. Therefore, files aren't dumped, if premerge
502 This implies premerge. Therefore, files aren't dumped, if premerge
503 runs successfully. Use :forcedump to forcibly write files out.
503 runs successfully. Use :forcedump to forcibly write files out.
504 """
504 """
505 a = _workingpath(repo, fcd)
505 a = _workingpath(repo, fcd)
506 fd = fcd.path()
506 fd = fcd.path()
507
507
508 from . import context
508 from . import context
509 if isinstance(fcd, context.overlayworkingfilectx):
509 if isinstance(fcd, context.overlayworkingfilectx):
510 raise error.InMemoryMergeConflictsError('in-memory merge does not '
510 raise error.InMemoryMergeConflictsError('in-memory merge does not '
511 'support the :dump tool.')
511 'support the :dump tool.')
512
512
513 util.writefile(a + ".local", fcd.decodeddata())
513 util.writefile(a + ".local", fcd.decodeddata())
514 repo.wwrite(fd + ".other", fco.data(), fco.flags())
514 repo.wwrite(fd + ".other", fco.data(), fco.flags())
515 repo.wwrite(fd + ".base", fca.data(), fca.flags())
515 repo.wwrite(fd + ".base", fca.data(), fca.flags())
516 return False, 1, False
516 return False, 1, False
517
517
518 @internaltool('forcedump', mergeonly, binary=True, symlink=True)
518 @internaltool('forcedump', mergeonly, binary=True, symlink=True)
519 def _forcedump(repo, mynode, orig, fcd, fco, fca, toolconf, files,
519 def _forcedump(repo, mynode, orig, fcd, fco, fca, toolconf, files,
520 labels=None):
520 labels=None):
521 """
521 """
522 Creates three versions of the files as same as :dump, but omits premerge.
522 Creates three versions of the files as same as :dump, but omits premerge.
523 """
523 """
524 return _idump(repo, mynode, orig, fcd, fco, fca, toolconf, files,
524 return _idump(repo, mynode, orig, fcd, fco, fca, toolconf, files,
525 labels=labels)
525 labels=labels)
526
526
527 def _xmergeimm(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
527 def _xmergeimm(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
528 # In-memory merge simply raises an exception on all external merge tools,
528 # In-memory merge simply raises an exception on all external merge tools,
529 # for now.
529 # for now.
530 #
530 #
531 # It would be possible to run most tools with temporary files, but this
531 # It would be possible to run most tools with temporary files, but this
532 # raises the question of what to do if the user only partially resolves the
532 # raises the question of what to do if the user only partially resolves the
533 # file -- we can't leave a merge state. (Copy to somewhere in the .hg/
533 # file -- we can't leave a merge state. (Copy to somewhere in the .hg/
534 # directory and tell the user how to get it is my best idea, but it's
534 # directory and tell the user how to get it is my best idea, but it's
535 # clunky.)
535 # clunky.)
536 raise error.InMemoryMergeConflictsError('in-memory merge does not support '
536 raise error.InMemoryMergeConflictsError('in-memory merge does not support '
537 'external merge tools')
537 'external merge tools')
538
538
539 def _xmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
539 def _xmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
540 tool, toolpath, binary, symlink, scriptfn = toolconf
540 tool, toolpath, binary, symlink, scriptfn = toolconf
541 if fcd.isabsent() or fco.isabsent():
541 if fcd.isabsent() or fco.isabsent():
542 repo.ui.warn(_('warning: %s cannot merge change/delete conflict '
542 repo.ui.warn(_('warning: %s cannot merge change/delete conflict '
543 'for %s\n') % (tool, fcd.path()))
543 'for %s\n') % (tool, fcd.path()))
544 return False, 1, None
544 return False, 1, None
545 unused, unused, unused, back = files
545 unused, unused, unused, back = files
546 localpath = _workingpath(repo, fcd)
546 localpath = _workingpath(repo, fcd)
547 args = _toolstr(repo.ui, tool, "args")
547 args = _toolstr(repo.ui, tool, "args")
548
548
549 with _maketempfiles(repo, fco, fca, repo.wvfs.join(back.path()),
549 with _maketempfiles(repo, fco, fca, repo.wvfs.join(back.path()),
550 "$output" in args) as temppaths:
550 "$output" in args) as temppaths:
551 basepath, otherpath, localoutputpath = temppaths
551 basepath, otherpath, localoutputpath = temppaths
552 outpath = ""
552 outpath = ""
553 mylabel, otherlabel = labels[:2]
553 mylabel, otherlabel = labels[:2]
554 if len(labels) >= 3:
554 if len(labels) >= 3:
555 baselabel = labels[2]
555 baselabel = labels[2]
556 else:
556 else:
557 baselabel = 'base'
557 baselabel = 'base'
558 env = {'HG_FILE': fcd.path(),
558 env = {'HG_FILE': fcd.path(),
559 'HG_MY_NODE': short(mynode),
559 'HG_MY_NODE': short(mynode),
560 'HG_OTHER_NODE': short(fco.changectx().node()),
560 'HG_OTHER_NODE': short(fco.changectx().node()),
561 'HG_BASE_NODE': short(fca.changectx().node()),
561 'HG_BASE_NODE': short(fca.changectx().node()),
562 'HG_MY_ISLINK': 'l' in fcd.flags(),
562 'HG_MY_ISLINK': 'l' in fcd.flags(),
563 'HG_OTHER_ISLINK': 'l' in fco.flags(),
563 'HG_OTHER_ISLINK': 'l' in fco.flags(),
564 'HG_BASE_ISLINK': 'l' in fca.flags(),
564 'HG_BASE_ISLINK': 'l' in fca.flags(),
565 'HG_MY_LABEL': mylabel,
565 'HG_MY_LABEL': mylabel,
566 'HG_OTHER_LABEL': otherlabel,
566 'HG_OTHER_LABEL': otherlabel,
567 'HG_BASE_LABEL': baselabel,
567 'HG_BASE_LABEL': baselabel,
568 }
568 }
569 ui = repo.ui
569 ui = repo.ui
570
570
571 if "$output" in args:
571 if "$output" in args:
572 # read input from backup, write to original
572 # read input from backup, write to original
573 outpath = localpath
573 outpath = localpath
574 localpath = localoutputpath
574 localpath = localoutputpath
575 replace = {'local': localpath, 'base': basepath, 'other': otherpath,
575 replace = {'local': localpath, 'base': basepath, 'other': otherpath,
576 'output': outpath, 'labellocal': mylabel,
576 'output': outpath, 'labellocal': mylabel,
577 'labelother': otherlabel, 'labelbase': baselabel}
577 'labelother': otherlabel, 'labelbase': baselabel}
578 args = util.interpolate(
578 args = util.interpolate(
579 br'\$', replace, args,
579 br'\$', replace, args,
580 lambda s: procutil.shellquote(util.localpath(s)))
580 lambda s: procutil.shellquote(util.localpath(s)))
581 if _toolbool(ui, tool, "gui"):
581 if _toolbool(ui, tool, "gui"):
582 repo.ui.status(_('running merge tool %s for file %s\n') %
582 repo.ui.status(_('running merge tool %s for file %s\n') %
583 (tool, fcd.path()))
583 (tool, fcd.path()))
584 if scriptfn is None:
584 if scriptfn is None:
585 cmd = toolpath + ' ' + args
585 cmd = toolpath + ' ' + args
586 repo.ui.debug('launching merge tool: %s\n' % cmd)
586 repo.ui.debug('launching merge tool: %s\n' % cmd)
587 r = ui.system(cmd, cwd=repo.root, environ=env,
587 r = ui.system(cmd, cwd=repo.root, environ=env,
588 blockedtag='mergetool')
588 blockedtag='mergetool')
589 else:
589 else:
590 repo.ui.debug('launching python merge script: %s:%s\n' %
590 repo.ui.debug('launching python merge script: %s:%s\n' %
591 (toolpath, scriptfn))
591 (toolpath, scriptfn))
592 r = 0
592 r = 0
593 try:
593 try:
594 # avoid cycle cmdutil->merge->filemerge->extensions->cmdutil
594 # avoid cycle cmdutil->merge->filemerge->extensions->cmdutil
595 from . import extensions
595 from . import extensions
596 mod = extensions.loadpath(toolpath, 'hgmerge.%s' % tool)
596 mod = extensions.loadpath(toolpath, 'hgmerge.%s' % tool)
597 except Exception:
597 except Exception:
598 raise error.Abort(_("loading python merge script failed: %s") %
598 raise error.Abort(_("loading python merge script failed: %s") %
599 toolpath)
599 toolpath)
600 mergefn = getattr(mod, scriptfn, None)
600 mergefn = getattr(mod, scriptfn, None)
601 if mergefn is None:
601 if mergefn is None:
602 raise error.Abort(_("%s does not have function: %s") %
602 raise error.Abort(_("%s does not have function: %s") %
603 (toolpath, scriptfn))
603 (toolpath, scriptfn))
604 argslist = procutil.shellsplit(args)
604 argslist = procutil.shellsplit(args)
605 # avoid cycle cmdutil->merge->filemerge->hook->extensions->cmdutil
605 # avoid cycle cmdutil->merge->filemerge->hook->extensions->cmdutil
606 from . import hook
606 from . import hook
607 ret, raised = hook.pythonhook(ui, repo, "merge", toolpath,
607 ret, raised = hook.pythonhook(ui, repo, "merge", toolpath,
608 mergefn, {'args': argslist}, True)
608 mergefn, {'args': argslist}, True)
609 if raised:
609 if raised:
610 r = 1
610 r = 1
611 repo.ui.debug('merge tool returned: %d\n' % r)
611 repo.ui.debug('merge tool returned: %d\n' % r)
612 return True, r, False
612 return True, r, False
613
613
614 def _formatconflictmarker(ctx, template, label, pad):
614 def _formatconflictmarker(ctx, template, label, pad):
615 """Applies the given template to the ctx, prefixed by the label.
615 """Applies the given template to the ctx, prefixed by the label.
616
616
617 Pad is the minimum width of the label prefix, so that multiple markers
617 Pad is the minimum width of the label prefix, so that multiple markers
618 can have aligned templated parts.
618 can have aligned templated parts.
619 """
619 """
620 if ctx.node() is None:
620 if ctx.node() is None:
621 ctx = ctx.p1()
621 ctx = ctx.p1()
622
622
623 props = {'ctx': ctx}
623 props = {'ctx': ctx}
624 templateresult = template.renderdefault(props)
624 templateresult = template.renderdefault(props)
625
625
626 label = ('%s:' % label).ljust(pad + 1)
626 label = ('%s:' % label).ljust(pad + 1)
627 mark = '%s %s' % (label, templateresult)
627 mark = '%s %s' % (label, templateresult)
628
628
629 if mark:
629 if mark:
630 mark = mark.splitlines()[0] # split for safety
630 mark = mark.splitlines()[0] # split for safety
631
631
632 # 8 for the prefix of conflict marker lines (e.g. '<<<<<<< ')
632 # 8 for the prefix of conflict marker lines (e.g. '<<<<<<< ')
633 return stringutil.ellipsis(mark, 80 - 8)
633 return stringutil.ellipsis(mark, 80 - 8)
634
634
635 _defaultconflictlabels = ['local', 'other']
635 _defaultconflictlabels = ['local', 'other']
636
636
637 def _formatlabels(repo, fcd, fco, fca, labels, tool=None):
637 def _formatlabels(repo, fcd, fco, fca, labels, tool=None):
638 """Formats the given labels using the conflict marker template.
638 """Formats the given labels using the conflict marker template.
639
639
640 Returns a list of formatted labels.
640 Returns a list of formatted labels.
641 """
641 """
642 cd = fcd.changectx()
642 cd = fcd.changectx()
643 co = fco.changectx()
643 co = fco.changectx()
644 ca = fca.changectx()
644 ca = fca.changectx()
645
645
646 ui = repo.ui
646 ui = repo.ui
647 template = ui.config('ui', 'mergemarkertemplate')
647 template = ui.config('ui', 'mergemarkertemplate')
648 if tool is not None:
648 if tool is not None:
649 template = _toolstr(ui, tool, 'mergemarkertemplate', template)
649 template = _toolstr(ui, tool, 'mergemarkertemplate', template)
650 template = templater.unquotestring(template)
650 template = templater.unquotestring(template)
651 tres = formatter.templateresources(ui, repo)
651 tres = formatter.templateresources(ui, repo)
652 tmpl = formatter.maketemplater(ui, template, defaults=templatekw.keywords,
652 tmpl = formatter.maketemplater(ui, template, defaults=templatekw.keywords,
653 resources=tres)
653 resources=tres)
654
654
655 pad = max(len(l) for l in labels)
655 pad = max(len(l) for l in labels)
656
656
657 newlabels = [_formatconflictmarker(cd, tmpl, labels[0], pad),
657 newlabels = [_formatconflictmarker(cd, tmpl, labels[0], pad),
658 _formatconflictmarker(co, tmpl, labels[1], pad)]
658 _formatconflictmarker(co, tmpl, labels[1], pad)]
659 if len(labels) > 2:
659 if len(labels) > 2:
660 newlabels.append(_formatconflictmarker(ca, tmpl, labels[2], pad))
660 newlabels.append(_formatconflictmarker(ca, tmpl, labels[2], pad))
661 return newlabels
661 return newlabels
662
662
663 def partextras(labels):
663 def partextras(labels):
664 """Return a dictionary of extra labels for use in prompts to the user
664 """Return a dictionary of extra labels for use in prompts to the user
665
665
666 Intended use is in strings of the form "(l)ocal%(l)s".
666 Intended use is in strings of the form "(l)ocal%(l)s".
667 """
667 """
668 if labels is None:
668 if labels is None:
669 return {
669 return {
670 "l": "",
670 "l": "",
671 "o": "",
671 "o": "",
672 }
672 }
673
673
674 return {
674 return {
675 "l": " [%s]" % labels[0],
675 "l": " [%s]" % labels[0],
676 "o": " [%s]" % labels[1],
676 "o": " [%s]" % labels[1],
677 }
677 }
678
678
679 def _restorebackup(fcd, back):
679 def _restorebackup(fcd, back):
680 # TODO: Add a workingfilectx.write(otherfilectx) path so we can use
680 # TODO: Add a workingfilectx.write(otherfilectx) path so we can use
681 # util.copy here instead.
681 # util.copy here instead.
682 fcd.write(back.data(), fcd.flags())
682 fcd.write(back.data(), fcd.flags())
683
683
684 def _makebackup(repo, ui, wctx, fcd, premerge):
684 def _makebackup(repo, ui, wctx, fcd, premerge):
685 """Makes and returns a filectx-like object for ``fcd``'s backup file.
685 """Makes and returns a filectx-like object for ``fcd``'s backup file.
686
686
687 In addition to preserving the user's pre-existing modifications to `fcd`
687 In addition to preserving the user's pre-existing modifications to `fcd`
688 (if any), the backup is used to undo certain premerges, confirm whether a
688 (if any), the backup is used to undo certain premerges, confirm whether a
689 merge changed anything, and determine what line endings the new file should
689 merge changed anything, and determine what line endings the new file should
690 have.
690 have.
691
691
692 Backups only need to be written once (right before the premerge) since their
692 Backups only need to be written once (right before the premerge) since their
693 content doesn't change afterwards.
693 content doesn't change afterwards.
694 """
694 """
695 if fcd.isabsent():
695 if fcd.isabsent():
696 return None
696 return None
697 # TODO: Break this import cycle somehow. (filectx -> ctx -> fileset ->
697 # TODO: Break this import cycle somehow. (filectx -> ctx -> fileset ->
698 # merge -> filemerge). (I suspect the fileset import is the weakest link)
698 # merge -> filemerge). (I suspect the fileset import is the weakest link)
699 from . import context
699 from . import context
700 a = _workingpath(repo, fcd)
700 a = _workingpath(repo, fcd)
701 back = scmutil.origpath(ui, repo, a)
701 back = scmutil.origpath(ui, repo, a)
702 inworkingdir = (back.startswith(repo.wvfs.base) and not
702 inworkingdir = (back.startswith(repo.wvfs.base) and not
703 back.startswith(repo.vfs.base))
703 back.startswith(repo.vfs.base))
704 if isinstance(fcd, context.overlayworkingfilectx) and inworkingdir:
704 if isinstance(fcd, context.overlayworkingfilectx) and inworkingdir:
705 # If the backup file is to be in the working directory, and we're
705 # If the backup file is to be in the working directory, and we're
706 # merging in-memory, we must redirect the backup to the memory context
706 # merging in-memory, we must redirect the backup to the memory context
707 # so we don't disturb the working directory.
707 # so we don't disturb the working directory.
708 relpath = back[len(repo.wvfs.base) + 1:]
708 relpath = back[len(repo.wvfs.base) + 1:]
709 if premerge:
709 if premerge:
710 wctx[relpath].write(fcd.data(), fcd.flags())
710 wctx[relpath].write(fcd.data(), fcd.flags())
711 return wctx[relpath]
711 return wctx[relpath]
712 else:
712 else:
713 if premerge:
713 if premerge:
714 # Otherwise, write to wherever path the user specified the backups
714 # Otherwise, write to wherever path the user specified the backups
715 # should go. We still need to switch based on whether the source is
715 # should go. We still need to switch based on whether the source is
716 # in-memory so we can use the fast path of ``util.copy`` if both are
716 # in-memory so we can use the fast path of ``util.copy`` if both are
717 # on disk.
717 # on disk.
718 if isinstance(fcd, context.overlayworkingfilectx):
718 if isinstance(fcd, context.overlayworkingfilectx):
719 util.writefile(back, fcd.data())
719 util.writefile(back, fcd.data())
720 else:
720 else:
721 util.copyfile(a, back)
721 util.copyfile(a, back)
722 # A arbitraryfilectx is returned, so we can run the same functions on
722 # A arbitraryfilectx is returned, so we can run the same functions on
723 # the backup context regardless of where it lives.
723 # the backup context regardless of where it lives.
724 return context.arbitraryfilectx(back, repo=repo)
724 return context.arbitraryfilectx(back, repo=repo)
725
725
726 @contextlib.contextmanager
726 @contextlib.contextmanager
727 def _maketempfiles(repo, fco, fca, localpath, uselocalpath):
727 def _maketempfiles(repo, fco, fca, localpath, uselocalpath):
728 """Writes out `fco` and `fca` as temporary files, and (if uselocalpath)
728 """Writes out `fco` and `fca` as temporary files, and (if uselocalpath)
729 copies `localpath` to another temporary file, so an external merge tool may
729 copies `localpath` to another temporary file, so an external merge tool may
730 use them.
730 use them.
731 """
731 """
732 tmproot = None
732 tmproot = None
733 tmprootprefix = repo.ui.config('experimental', 'mergetempdirprefix')
733 tmprootprefix = repo.ui.config('experimental', 'mergetempdirprefix')
734 if tmprootprefix:
734 if tmprootprefix:
735 tmproot = pycompat.mkdtemp(prefix=tmprootprefix)
735 tmproot = pycompat.mkdtemp(prefix=tmprootprefix)
736
736
737 def maketempfrompath(prefix, path):
737 def maketempfrompath(prefix, path):
738 fullbase, ext = os.path.splitext(path)
738 fullbase, ext = os.path.splitext(path)
739 pre = "%s~%s" % (os.path.basename(fullbase), prefix)
739 pre = "%s~%s" % (os.path.basename(fullbase), prefix)
740 if tmproot:
740 if tmproot:
741 name = os.path.join(tmproot, pre)
741 name = os.path.join(tmproot, pre)
742 if ext:
742 if ext:
743 name += ext
743 name += ext
744 f = open(name, r"wb")
744 f = open(name, r"wb")
745 else:
745 else:
746 fd, name = pycompat.mkstemp(prefix=pre + '.', suffix=ext)
746 fd, name = pycompat.mkstemp(prefix=pre + '.', suffix=ext)
747 f = os.fdopen(fd, r"wb")
747 f = os.fdopen(fd, r"wb")
748 return f, name
748 return f, name
749
749
750 def tempfromcontext(prefix, ctx):
750 def tempfromcontext(prefix, ctx):
751 f, name = maketempfrompath(prefix, ctx.path())
751 f, name = maketempfrompath(prefix, ctx.path())
752 data = repo.wwritedata(ctx.path(), ctx.data())
752 data = repo.wwritedata(ctx.path(), ctx.data())
753 f.write(data)
753 f.write(data)
754 f.close()
754 f.close()
755 return name
755 return name
756
756
757 b = tempfromcontext("base", fca)
757 b = tempfromcontext("base", fca)
758 c = tempfromcontext("other", fco)
758 c = tempfromcontext("other", fco)
759 d = localpath
759 d = localpath
760 if uselocalpath:
760 if uselocalpath:
761 # We start off with this being the backup filename, so remove the .orig
761 # We start off with this being the backup filename, so remove the .orig
762 # to make syntax-highlighting more likely.
762 # to make syntax-highlighting more likely.
763 if d.endswith('.orig'):
763 if d.endswith('.orig'):
764 d, _ = os.path.splitext(d)
764 d, _ = os.path.splitext(d)
765 f, d = maketempfrompath("local", d)
765 f, d = maketempfrompath("local", d)
766 with open(localpath, 'rb') as src:
766 with open(localpath, 'rb') as src:
767 f.write(src.read())
767 f.write(src.read())
768 f.close()
768 f.close()
769
769
770 try:
770 try:
771 yield b, c, d
771 yield b, c, d
772 finally:
772 finally:
773 if tmproot:
773 if tmproot:
774 shutil.rmtree(tmproot)
774 shutil.rmtree(tmproot)
775 else:
775 else:
776 util.unlink(b)
776 util.unlink(b)
777 util.unlink(c)
777 util.unlink(c)
778 # if not uselocalpath, d is the 'orig'/backup file which we
778 # if not uselocalpath, d is the 'orig'/backup file which we
779 # shouldn't delete.
779 # shouldn't delete.
780 if d and uselocalpath:
780 if d and uselocalpath:
781 util.unlink(d)
781 util.unlink(d)
782
782
783 def _filemerge(premerge, repo, wctx, mynode, orig, fcd, fco, fca, labels=None):
783 def _filemerge(premerge, repo, wctx, mynode, orig, fcd, fco, fca, labels=None):
784 """perform a 3-way merge in the working directory
784 """perform a 3-way merge in the working directory
785
785
786 premerge = whether this is a premerge
786 premerge = whether this is a premerge
787 mynode = parent node before merge
787 mynode = parent node before merge
788 orig = original local filename before merge
788 orig = original local filename before merge
789 fco = other file context
789 fco = other file context
790 fca = ancestor file context
790 fca = ancestor file context
791 fcd = local file context for current/destination file
791 fcd = local file context for current/destination file
792
792
793 Returns whether the merge is complete, the return value of the merge, and
793 Returns whether the merge is complete, the return value of the merge, and
794 a boolean indicating whether the file was deleted from disk."""
794 a boolean indicating whether the file was deleted from disk."""
795
795
796 if not fco.cmp(fcd): # files identical?
796 if not fco.cmp(fcd): # files identical?
797 return True, None, False
797 return True, None, False
798
798
799 ui = repo.ui
799 ui = repo.ui
800 fd = fcd.path()
800 fd = fcd.path()
801 binary = fcd.isbinary() or fco.isbinary() or fca.isbinary()
801 binary = fcd.isbinary() or fco.isbinary() or fca.isbinary()
802 symlink = 'l' in fcd.flags() + fco.flags()
802 symlink = 'l' in fcd.flags() + fco.flags()
803 changedelete = fcd.isabsent() or fco.isabsent()
803 changedelete = fcd.isabsent() or fco.isabsent()
804 tool, toolpath = _picktool(repo, ui, fd, binary, symlink, changedelete)
804 tool, toolpath = _picktool(repo, ui, fd, binary, symlink, changedelete)
805 scriptfn = None
805 scriptfn = None
806 if tool in internals and tool.startswith('internal:'):
806 if tool in internals and tool.startswith('internal:'):
807 # normalize to new-style names (':merge' etc)
807 # normalize to new-style names (':merge' etc)
808 tool = tool[len('internal'):]
808 tool = tool[len('internal'):]
809 if toolpath and toolpath.startswith('python:'):
809 if toolpath and toolpath.startswith('python:'):
810 invalidsyntax = False
810 invalidsyntax = False
811 if toolpath.count(':') >= 2:
811 if toolpath.count(':') >= 2:
812 script, scriptfn = toolpath[7:].rsplit(':', 1)
812 script, scriptfn = toolpath[7:].rsplit(':', 1)
813 if not scriptfn:
813 if not scriptfn:
814 invalidsyntax = True
814 invalidsyntax = True
815 # missing :callable can lead to spliting on windows drive letter
815 # missing :callable can lead to spliting on windows drive letter
816 if '\\' in scriptfn or '/' in scriptfn:
816 if '\\' in scriptfn or '/' in scriptfn:
817 invalidsyntax = True
817 invalidsyntax = True
818 else:
818 else:
819 invalidsyntax = True
819 invalidsyntax = True
820 if invalidsyntax:
820 if invalidsyntax:
821 raise error.Abort(_("invalid 'python:' syntax: %s") % toolpath)
821 raise error.Abort(_("invalid 'python:' syntax: %s") % toolpath)
822 toolpath = script
822 toolpath = script
823 ui.debug("picked tool '%s' for %s (binary %s symlink %s changedelete %s)\n"
823 ui.debug("picked tool '%s' for %s (binary %s symlink %s changedelete %s)\n"
824 % (tool, fd, pycompat.bytestr(binary), pycompat.bytestr(symlink),
824 % (tool, fd, pycompat.bytestr(binary), pycompat.bytestr(symlink),
825 pycompat.bytestr(changedelete)))
825 pycompat.bytestr(changedelete)))
826
826
827 if tool in internals:
827 if tool in internals:
828 func = internals[tool]
828 func = internals[tool]
829 mergetype = func.mergetype
829 mergetype = func.mergetype
830 onfailure = func.onfailure
830 onfailure = func.onfailure
831 precheck = func.precheck
831 precheck = func.precheck
832 isexternal = False
832 isexternal = False
833 else:
833 else:
834 if wctx.isinmemory():
834 if wctx.isinmemory():
835 func = _xmergeimm
835 func = _xmergeimm
836 else:
836 else:
837 func = _xmerge
837 func = _xmerge
838 mergetype = fullmerge
838 mergetype = fullmerge
839 onfailure = _("merging %s failed!\n")
839 onfailure = _("merging %s failed!\n")
840 precheck = None
840 precheck = None
841 isexternal = True
841 isexternal = True
842
842
843 toolconf = tool, toolpath, binary, symlink, scriptfn
843 toolconf = tool, toolpath, binary, symlink, scriptfn
844
844
845 if mergetype == nomerge:
845 if mergetype == nomerge:
846 r, deleted = func(repo, mynode, orig, fcd, fco, fca, toolconf, labels)
846 r, deleted = func(repo, mynode, orig, fcd, fco, fca, toolconf, labels)
847 return True, r, deleted
847 return True, r, deleted
848
848
849 if premerge:
849 if premerge:
850 if orig != fco.path():
850 if orig != fco.path():
851 ui.status(_("merging %s and %s to %s\n") % (orig, fco.path(), fd))
851 ui.status(_("merging %s and %s to %s\n") % (orig, fco.path(), fd))
852 else:
852 else:
853 ui.status(_("merging %s\n") % fd)
853 ui.status(_("merging %s\n") % fd)
854
854
855 ui.debug("my %s other %s ancestor %s\n" % (fcd, fco, fca))
855 ui.debug("my %s other %s ancestor %s\n" % (fcd, fco, fca))
856
856
857 if precheck and not precheck(repo, mynode, orig, fcd, fco, fca,
857 if precheck and not precheck(repo, mynode, orig, fcd, fco, fca,
858 toolconf):
858 toolconf):
859 if onfailure:
859 if onfailure:
860 if wctx.isinmemory():
860 if wctx.isinmemory():
861 raise error.InMemoryMergeConflictsError('in-memory merge does '
861 raise error.InMemoryMergeConflictsError('in-memory merge does '
862 'not support merge '
862 'not support merge '
863 'conflicts')
863 'conflicts')
864 ui.warn(onfailure % fd)
864 ui.warn(onfailure % fd)
865 return True, 1, False
865 return True, 1, False
866
866
867 back = _makebackup(repo, ui, wctx, fcd, premerge)
867 back = _makebackup(repo, ui, wctx, fcd, premerge)
868 files = (None, None, None, back)
868 files = (None, None, None, back)
869 r = 1
869 r = 1
870 try:
870 try:
871 internalmarkerstyle = ui.config('ui', 'mergemarkers')
871 internalmarkerstyle = ui.config('ui', 'mergemarkers')
872 if isexternal:
872 if isexternal:
873 markerstyle = _toolstr(ui, tool, 'mergemarkers')
873 markerstyle = _toolstr(ui, tool, 'mergemarkers')
874 else:
874 else:
875 markerstyle = internalmarkerstyle
875 markerstyle = internalmarkerstyle
876
876
877 if not labels:
877 if not labels:
878 labels = _defaultconflictlabels
878 labels = _defaultconflictlabels
879 formattedlabels = labels
879 formattedlabels = labels
880 if markerstyle != 'basic':
880 if markerstyle != 'basic':
881 formattedlabels = _formatlabels(repo, fcd, fco, fca, labels,
881 formattedlabels = _formatlabels(repo, fcd, fco, fca, labels,
882 tool=tool)
882 tool=tool)
883
883
884 if premerge and mergetype == fullmerge:
884 if premerge and mergetype == fullmerge:
885 # conflict markers generated by premerge will use 'detailed'
885 # conflict markers generated by premerge will use 'detailed'
886 # settings if either ui.mergemarkers or the tool's mergemarkers
886 # settings if either ui.mergemarkers or the tool's mergemarkers
887 # setting is 'detailed'. This way tools can have basic labels in
887 # setting is 'detailed'. This way tools can have basic labels in
888 # space-constrained areas of the UI, but still get full information
888 # space-constrained areas of the UI, but still get full information
889 # in conflict markers if premerge is 'keep' or 'keep-merge3'.
889 # in conflict markers if premerge is 'keep' or 'keep-merge3'.
890 premergelabels = labels
890 premergelabels = labels
891 labeltool = None
891 labeltool = None
892 if markerstyle != 'basic':
892 if markerstyle != 'basic':
893 # respect 'tool's mergemarkertemplate (which defaults to
893 # respect 'tool's mergemarkertemplate (which defaults to
894 # ui.mergemarkertemplate)
894 # ui.mergemarkertemplate)
895 labeltool = tool
895 labeltool = tool
896 if internalmarkerstyle != 'basic' or markerstyle != 'basic':
896 if internalmarkerstyle != 'basic' or markerstyle != 'basic':
897 premergelabels = _formatlabels(repo, fcd, fco, fca,
897 premergelabels = _formatlabels(repo, fcd, fco, fca,
898 premergelabels, tool=labeltool)
898 premergelabels, tool=labeltool)
899
899
900 r = _premerge(repo, fcd, fco, fca, toolconf, files,
900 r = _premerge(repo, fcd, fco, fca, toolconf, files,
901 labels=premergelabels)
901 labels=premergelabels)
902 # complete if premerge successful (r is 0)
902 # complete if premerge successful (r is 0)
903 return not r, r, False
903 return not r, r, False
904
904
905 needcheck, r, deleted = func(repo, mynode, orig, fcd, fco, fca,
905 needcheck, r, deleted = func(repo, mynode, orig, fcd, fco, fca,
906 toolconf, files, labels=formattedlabels)
906 toolconf, files, labels=formattedlabels)
907
907
908 if needcheck:
908 if needcheck:
909 r = _check(repo, r, ui, tool, fcd, files)
909 r = _check(repo, r, ui, tool, fcd, files)
910
910
911 if r:
911 if r:
912 if onfailure:
912 if onfailure:
913 if wctx.isinmemory():
913 if wctx.isinmemory():
914 raise error.InMemoryMergeConflictsError('in-memory merge '
914 raise error.InMemoryMergeConflictsError('in-memory merge '
915 'does not support '
915 'does not support '
916 'merge conflicts')
916 'merge conflicts')
917 ui.warn(onfailure % fd)
917 ui.warn(onfailure % fd)
918 _onfilemergefailure(ui)
918 _onfilemergefailure(ui)
919
919
920 return True, r, deleted
920 return True, r, deleted
921 finally:
921 finally:
922 if not r and back is not None:
922 if not r and back is not None:
923 back.remove()
923 back.remove()
924
924
925 def _haltmerge():
925 def _haltmerge():
926 msg = _('merge halted after failed merge (see hg resolve)')
926 msg = _('merge halted after failed merge (see hg resolve)')
927 raise error.InterventionRequired(msg)
927 raise error.InterventionRequired(msg)
928
928
929 def _onfilemergefailure(ui):
929 def _onfilemergefailure(ui):
930 action = ui.config('merge', 'on-failure')
930 action = ui.config('merge', 'on-failure')
931 if action == 'prompt':
931 if action == 'prompt':
932 msg = _('continue merge operation (yn)?' '$$ &Yes $$ &No')
932 msg = _('continue merge operation (yn)?' '$$ &Yes $$ &No')
933 if ui.promptchoice(msg, 0) == 1:
933 if ui.promptchoice(msg, 0) == 1:
934 _haltmerge()
934 _haltmerge()
935 if action == 'halt':
935 if action == 'halt':
936 _haltmerge()
936 _haltmerge()
937 # default action is 'continue', in which case we neither prompt nor halt
937 # default action is 'continue', in which case we neither prompt nor halt
938
938
939 def hasconflictmarkers(data):
939 def hasconflictmarkers(data):
940 return bool(re.search("^(<<<<<<< .*|=======|>>>>>>> .*)$", data,
940 return bool(re.search("^(<<<<<<< .*|=======|>>>>>>> .*)$", data,
941 re.MULTILINE))
941 re.MULTILINE))
942
942
943 def _check(repo, r, ui, tool, fcd, files):
943 def _check(repo, r, ui, tool, fcd, files):
944 fd = fcd.path()
944 fd = fcd.path()
945 unused, unused, unused, back = files
945 unused, unused, unused, back = files
946
946
947 if not r and (_toolbool(ui, tool, "checkconflicts") or
947 if not r and (_toolbool(ui, tool, "checkconflicts") or
948 'conflicts' in _toollist(ui, tool, "check")):
948 'conflicts' in _toollist(ui, tool, "check")):
949 if hasconflictmarkers(fcd.data()):
949 if hasconflictmarkers(fcd.data()):
950 r = 1
950 r = 1
951
951
952 checked = False
952 checked = False
953 if 'prompt' in _toollist(ui, tool, "check"):
953 if 'prompt' in _toollist(ui, tool, "check"):
954 checked = True
954 checked = True
955 if ui.promptchoice(_("was merge of '%s' successful (yn)?"
955 if ui.promptchoice(_("was merge of '%s' successful (yn)?"
956 "$$ &Yes $$ &No") % fd, 1):
956 "$$ &Yes $$ &No") % fd, 1):
957 r = 1
957 r = 1
958
958
959 if not r and not checked and (_toolbool(ui, tool, "checkchanged") or
959 if not r and not checked and (_toolbool(ui, tool, "checkchanged") or
960 'changed' in
960 'changed' in
961 _toollist(ui, tool, "check")):
961 _toollist(ui, tool, "check")):
962 if back is not None and not fcd.cmp(back):
962 if back is not None and not fcd.cmp(back):
963 if ui.promptchoice(_(" output file %s appears unchanged\n"
963 if ui.promptchoice(_(" output file %s appears unchanged\n"
964 "was merge successful (yn)?"
964 "was merge successful (yn)?"
965 "$$ &Yes $$ &No") % fd, 1):
965 "$$ &Yes $$ &No") % fd, 1):
966 r = 1
966 r = 1
967
967
968 if back is not None and _toolbool(ui, tool, "fixeol"):
968 if back is not None and _toolbool(ui, tool, "fixeol"):
969 _matcheol(_workingpath(repo, fcd), back)
969 _matcheol(_workingpath(repo, fcd), back)
970
970
971 return r
971 return r
972
972
973 def _workingpath(repo, ctx):
973 def _workingpath(repo, ctx):
974 return repo.wjoin(ctx.path())
974 return repo.wjoin(ctx.path())
975
975
976 def premerge(repo, wctx, mynode, orig, fcd, fco, fca, labels=None):
976 def premerge(repo, wctx, mynode, orig, fcd, fco, fca, labels=None):
977 return _filemerge(True, repo, wctx, mynode, orig, fcd, fco, fca,
977 return _filemerge(True, repo, wctx, mynode, orig, fcd, fco, fca,
978 labels=labels)
978 labels=labels)
979
979
980 def filemerge(repo, wctx, mynode, orig, fcd, fco, fca, labels=None):
980 def filemerge(repo, wctx, mynode, orig, fcd, fco, fca, labels=None):
981 return _filemerge(False, repo, wctx, mynode, orig, fcd, fco, fca,
981 return _filemerge(False, repo, wctx, mynode, orig, fcd, fco, fca,
982 labels=labels)
982 labels=labels)
983
983
984 def loadinternalmerge(ui, extname, registrarobj):
984 def loadinternalmerge(ui, extname, registrarobj):
985 """Load internal merge tool from specified registrarobj
985 """Load internal merge tool from specified registrarobj
986 """
986 """
987 for name, func in registrarobj._table.iteritems():
987 for name, func in registrarobj._table.iteritems():
988 fullname = ':' + name
988 fullname = ':' + name
989 internals[fullname] = func
989 internals[fullname] = func
990 internals['internal:' + name] = func
990 internals['internal:' + name] = func
991 internalsdoc[fullname] = func
991 internalsdoc[fullname] = func
992
992
993 capabilities = sorted([k for k, v in func.capabilities.items() if v])
993 capabilities = sorted([k for k, v in func.capabilities.items() if v])
994 if capabilities:
994 if capabilities:
995 capdesc = " (actual capabilities: %s)" % ', '.join(capabilities)
995 capdesc = " (actual capabilities: %s)" % ', '.join(capabilities)
996 func.__doc__ = (func.__doc__ +
996 func.__doc__ = (func.__doc__ +
997 pycompat.sysstr("\n\n%s" % capdesc))
997 pycompat.sysstr("\n\n%s" % capdesc))
998
998
999 # to put i18n comments into hg.pot for automatically generated texts
999 # to put i18n comments into hg.pot for automatically generated texts
1000
1000
1001 # i18n: "binary" and "symlik" are keywords
1001 # i18n: "binary" and "symlik" are keywords
1002 # i18n: this text is added automatically
1002 # i18n: this text is added automatically
1003 _(" (actual capabilities: binary, symlink)")
1003 _(" (actual capabilities: binary, symlink)")
1004 # i18n: "binary" is keyword
1004 # i18n: "binary" is keyword
1005 # i18n: this text is added automatically
1005 # i18n: this text is added automatically
1006 _(" (actual capabilities: binary)")
1006 _(" (actual capabilities: binary)")
1007 # i18n: "symlink" is keyword
1007 # i18n: "symlink" is keyword
1008 # i18n: this text is added automatically
1008 # i18n: this text is added automatically
1009 _(" (actual capabilities: symlink)")
1009 _(" (actual capabilities: symlink)")
1010
1010
1011 # load built-in merge tools explicitly to setup internalsdoc
1011 # load built-in merge tools explicitly to setup internalsdoc
1012 loadinternalmerge(None, None, internaltool)
1012 loadinternalmerge(None, None, internaltool)
1013
1013
1014 # tell hggettext to extract docstrings from these functions:
1014 # tell hggettext to extract docstrings from these functions:
1015 i18nfunctions = internals.values()
1015 i18nfunctions = internals.values()
@@ -1,1284 +1,1284 b''
1 $ hg init
1 $ hg init
2
2
3 Setup:
3 Setup:
4
4
5 $ echo a >> a
5 $ echo a >> a
6 $ hg ci -Am 'base'
6 $ hg ci -Am 'base'
7 adding a
7 adding a
8
8
9 Refuse to amend public csets:
9 Refuse to amend public csets:
10
10
11 $ hg phase -r . -p
11 $ hg phase -r . -p
12 $ hg ci --amend
12 $ hg ci --amend
13 abort: cannot amend public changesets
13 abort: cannot amend public changesets
14 (see 'hg help phases' for details)
14 (see 'hg help phases' for details)
15 [255]
15 [255]
16 $ hg phase -r . -f -d
16 $ hg phase -r . -f -d
17
17
18 $ echo a >> a
18 $ echo a >> a
19 $ hg ci -Am 'base1'
19 $ hg ci -Am 'base1'
20
20
21 Nothing to amend:
21 Nothing to amend:
22
22
23 $ hg ci --amend -m 'base1'
23 $ hg ci --amend -m 'base1'
24 nothing changed
24 nothing changed
25 [1]
25 [1]
26
26
27 $ cat >> $HGRCPATH <<EOF
27 $ cat >> $HGRCPATH <<EOF
28 > [hooks]
28 > [hooks]
29 > pretxncommit.foo = sh -c "echo \\"pretxncommit \$HG_NODE\\"; hg id -r \$HG_NODE"
29 > pretxncommit.foo = sh -c "echo \\"pretxncommit \$HG_NODE\\"; hg id -r \$HG_NODE"
30 > EOF
30 > EOF
31
31
32 Amending changeset with changes in working dir:
32 Amending changeset with changes in working dir:
33 (and check that --message does not trigger an editor)
33 (and check that --message does not trigger an editor)
34
34
35 $ echo a >> a
35 $ echo a >> a
36 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -m 'amend base1'
36 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -m 'amend base1'
37 pretxncommit 43f1ba15f28a50abf0aae529cf8a16bfced7b149
37 pretxncommit 43f1ba15f28a50abf0aae529cf8a16bfced7b149
38 43f1ba15f28a tip
38 43f1ba15f28a tip
39 saved backup bundle to $TESTTMP/.hg/strip-backup/489edb5b847d-5ab4f721-amend.hg
39 saved backup bundle to $TESTTMP/.hg/strip-backup/489edb5b847d-5ab4f721-amend.hg
40 $ echo 'pretxncommit.foo = ' >> $HGRCPATH
40 $ echo 'pretxncommit.foo = ' >> $HGRCPATH
41 $ hg diff -c .
41 $ hg diff -c .
42 diff -r ad120869acf0 -r 43f1ba15f28a a
42 diff -r ad120869acf0 -r 43f1ba15f28a a
43 --- a/a Thu Jan 01 00:00:00 1970 +0000
43 --- a/a Thu Jan 01 00:00:00 1970 +0000
44 +++ b/a Thu Jan 01 00:00:00 1970 +0000
44 +++ b/a Thu Jan 01 00:00:00 1970 +0000
45 @@ -1,1 +1,3 @@
45 @@ -1,1 +1,3 @@
46 a
46 a
47 +a
47 +a
48 +a
48 +a
49 $ hg log
49 $ hg log
50 changeset: 1:43f1ba15f28a
50 changeset: 1:43f1ba15f28a
51 tag: tip
51 tag: tip
52 user: test
52 user: test
53 date: Thu Jan 01 00:00:00 1970 +0000
53 date: Thu Jan 01 00:00:00 1970 +0000
54 summary: amend base1
54 summary: amend base1
55
55
56 changeset: 0:ad120869acf0
56 changeset: 0:ad120869acf0
57 user: test
57 user: test
58 date: Thu Jan 01 00:00:00 1970 +0000
58 date: Thu Jan 01 00:00:00 1970 +0000
59 summary: base
59 summary: base
60
60
61
61
62 Check proper abort for empty message
62 Check proper abort for empty message
63
63
64 $ cat > editor.sh << '__EOF__'
64 $ cat > editor.sh << '__EOF__'
65 > #!/bin/sh
65 > #!/bin/sh
66 > echo "" > "$1"
66 > echo "" > "$1"
67 > __EOF__
67 > __EOF__
68
68
69 Update the existing file to ensure that the dirstate is not in pending state
69 Update the existing file to ensure that the dirstate is not in pending state
70 (where the status of some files in the working copy is not known yet). This in
70 (where the status of some files in the working copy is not known yet). This in
71 turn ensures that when the transaction is aborted due to an empty message during
71 turn ensures that when the transaction is aborted due to an empty message during
72 the amend, there should be no rollback.
72 the amend, there should be no rollback.
73 $ echo a >> a
73 $ echo a >> a
74
74
75 $ echo b > b
75 $ echo b > b
76 $ hg add b
76 $ hg add b
77 $ hg summary
77 $ hg summary
78 parent: 1:43f1ba15f28a tip
78 parent: 1:43f1ba15f28a tip
79 amend base1
79 amend base1
80 branch: default
80 branch: default
81 commit: 1 modified, 1 added, 1 unknown
81 commit: 1 modified, 1 added, 1 unknown
82 update: (current)
82 update: (current)
83 phases: 2 draft
83 phases: 2 draft
84 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend
84 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend
85 abort: empty commit message
85 abort: empty commit message
86 [255]
86 [255]
87 $ hg summary
87 $ hg summary
88 parent: 1:43f1ba15f28a tip
88 parent: 1:43f1ba15f28a tip
89 amend base1
89 amend base1
90 branch: default
90 branch: default
91 commit: 1 modified, 1 added, 1 unknown
91 commit: 1 modified, 1 added, 1 unknown
92 update: (current)
92 update: (current)
93 phases: 2 draft
93 phases: 2 draft
94
94
95 Add new file along with modified existing file:
95 Add new file along with modified existing file:
96 $ hg ci --amend -m 'amend base1 new file'
96 $ hg ci --amend -m 'amend base1 new file'
97 saved backup bundle to $TESTTMP/.hg/strip-backup/43f1ba15f28a-007467c2-amend.hg
97 saved backup bundle to $TESTTMP/.hg/strip-backup/43f1ba15f28a-007467c2-amend.hg
98
98
99 Remove file that was added in amended commit:
99 Remove file that was added in amended commit:
100 (and test logfile option)
100 (and test logfile option)
101 (and test that logfile option do not trigger an editor)
101 (and test that logfile option do not trigger an editor)
102
102
103 $ hg rm b
103 $ hg rm b
104 $ echo 'amend base1 remove new file' > ../logfile
104 $ echo 'amend base1 remove new file' > ../logfile
105 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg ci --amend --logfile ../logfile
105 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg ci --amend --logfile ../logfile
106 saved backup bundle to $TESTTMP/.hg/strip-backup/c16295aaf401-1ada9901-amend.hg
106 saved backup bundle to $TESTTMP/.hg/strip-backup/c16295aaf401-1ada9901-amend.hg
107
107
108 $ hg cat b
108 $ hg cat b
109 b: no such file in rev 47343646fa3d
109 b: no such file in rev 47343646fa3d
110 [1]
110 [1]
111
111
112 No changes, just a different message:
112 No changes, just a different message:
113
113
114 $ hg ci -v --amend -m 'no changes, new message'
114 $ hg ci -v --amend -m 'no changes, new message'
115 amending changeset 47343646fa3d
115 amending changeset 47343646fa3d
116 copying changeset 47343646fa3d to ad120869acf0
116 copying changeset 47343646fa3d to ad120869acf0
117 committing files:
117 committing files:
118 a
118 a
119 committing manifest
119 committing manifest
120 committing changelog
120 committing changelog
121 1 changesets found
121 1 changesets found
122 uncompressed size of bundle content:
122 uncompressed size of bundle content:
123 254 (changelog)
123 254 (changelog)
124 163 (manifests)
124 163 (manifests)
125 131 a
125 131 a
126 saved backup bundle to $TESTTMP/.hg/strip-backup/47343646fa3d-c2758885-amend.hg
126 saved backup bundle to $TESTTMP/.hg/strip-backup/47343646fa3d-c2758885-amend.hg
127 1 changesets found
127 1 changesets found
128 uncompressed size of bundle content:
128 uncompressed size of bundle content:
129 250 (changelog)
129 250 (changelog)
130 163 (manifests)
130 163 (manifests)
131 131 a
131 131 a
132 adding branch
132 adding branch
133 adding changesets
133 adding changesets
134 adding manifests
134 adding manifests
135 adding file changes
135 adding file changes
136 added 1 changesets with 1 changes to 1 files
136 added 1 changesets with 1 changes to 1 files
137 committed changeset 1:401431e913a1
137 committed changeset 1:401431e913a1
138 $ hg diff -c .
138 $ hg diff -c .
139 diff -r ad120869acf0 -r 401431e913a1 a
139 diff -r ad120869acf0 -r 401431e913a1 a
140 --- a/a Thu Jan 01 00:00:00 1970 +0000
140 --- a/a Thu Jan 01 00:00:00 1970 +0000
141 +++ b/a Thu Jan 01 00:00:00 1970 +0000
141 +++ b/a Thu Jan 01 00:00:00 1970 +0000
142 @@ -1,1 +1,4 @@
142 @@ -1,1 +1,4 @@
143 a
143 a
144 +a
144 +a
145 +a
145 +a
146 +a
146 +a
147 $ hg log
147 $ hg log
148 changeset: 1:401431e913a1
148 changeset: 1:401431e913a1
149 tag: tip
149 tag: tip
150 user: test
150 user: test
151 date: Thu Jan 01 00:00:00 1970 +0000
151 date: Thu Jan 01 00:00:00 1970 +0000
152 summary: no changes, new message
152 summary: no changes, new message
153
153
154 changeset: 0:ad120869acf0
154 changeset: 0:ad120869acf0
155 user: test
155 user: test
156 date: Thu Jan 01 00:00:00 1970 +0000
156 date: Thu Jan 01 00:00:00 1970 +0000
157 summary: base
157 summary: base
158
158
159
159
160 Disable default date on commit so when -d isn't given, the old date is preserved:
160 Disable default date on commit so when -d isn't given, the old date is preserved:
161
161
162 $ echo '[defaults]' >> $HGRCPATH
162 $ echo '[defaults]' >> $HGRCPATH
163 $ echo 'commit=' >> $HGRCPATH
163 $ echo 'commit=' >> $HGRCPATH
164
164
165 Test -u/-d:
165 Test -u/-d:
166
166
167 $ cat > .hg/checkeditform.sh <<EOF
167 $ cat > .hg/checkeditform.sh <<EOF
168 > env | grep HGEDITFORM
168 > env | grep HGEDITFORM
169 > true
169 > true
170 > EOF
170 > EOF
171 $ HGEDITOR="sh .hg/checkeditform.sh" hg ci --amend -u foo -d '1 0'
171 $ HGEDITOR="sh .hg/checkeditform.sh" hg ci --amend -u foo -d '1 0'
172 HGEDITFORM=commit.amend.normal
172 HGEDITFORM=commit.amend.normal
173 saved backup bundle to $TESTTMP/.hg/strip-backup/401431e913a1-5e8e532c-amend.hg
173 saved backup bundle to $TESTTMP/.hg/strip-backup/401431e913a1-5e8e532c-amend.hg
174 $ echo a >> a
174 $ echo a >> a
175 $ hg ci --amend -u foo -d '1 0'
175 $ hg ci --amend -u foo -d '1 0'
176 saved backup bundle to $TESTTMP/.hg/strip-backup/d96b1d28ae33-677e0afb-amend.hg
176 saved backup bundle to $TESTTMP/.hg/strip-backup/d96b1d28ae33-677e0afb-amend.hg
177 $ hg log -r .
177 $ hg log -r .
178 changeset: 1:a9a13940fc03
178 changeset: 1:a9a13940fc03
179 tag: tip
179 tag: tip
180 user: foo
180 user: foo
181 date: Thu Jan 01 00:00:01 1970 +0000
181 date: Thu Jan 01 00:00:01 1970 +0000
182 summary: no changes, new message
182 summary: no changes, new message
183
183
184
184
185 Open editor with old commit message if a message isn't given otherwise:
185 Open editor with old commit message if a message isn't given otherwise:
186
186
187 $ cat > editor.sh << '__EOF__'
187 $ cat > editor.sh << '__EOF__'
188 > #!/bin/sh
188 > #!/bin/sh
189 > cat $1
189 > cat $1
190 > echo "another precious commit message" > "$1"
190 > echo "another precious commit message" > "$1"
191 > __EOF__
191 > __EOF__
192
192
193 at first, test saving last-message.txt
193 at first, test saving last-message.txt
194
194
195 $ cat > .hg/hgrc << '__EOF__'
195 $ cat > .hg/hgrc << '__EOF__'
196 > [hooks]
196 > [hooks]
197 > pretxncommit.test-saving-last-message = false
197 > pretxncommit.test-saving-last-message = false
198 > __EOF__
198 > __EOF__
199
199
200 $ rm -f .hg/last-message.txt
200 $ rm -f .hg/last-message.txt
201 $ hg commit --amend -v -m "message given from command line"
201 $ hg commit --amend -v -m "message given from command line"
202 amending changeset a9a13940fc03
202 amending changeset a9a13940fc03
203 copying changeset a9a13940fc03 to ad120869acf0
203 copying changeset a9a13940fc03 to ad120869acf0
204 committing files:
204 committing files:
205 a
205 a
206 committing manifest
206 committing manifest
207 committing changelog
207 committing changelog
208 running hook pretxncommit.test-saving-last-message: false
208 running hook pretxncommit.test-saving-last-message: false
209 transaction abort!
209 transaction abort!
210 rollback completed
210 rollback completed
211 abort: pretxncommit.test-saving-last-message hook exited with status 1
211 abort: pretxncommit.test-saving-last-message hook exited with status 1
212 [255]
212 [255]
213 $ cat .hg/last-message.txt
213 $ cat .hg/last-message.txt
214 message given from command line (no-eol)
214 message given from command line (no-eol)
215
215
216 $ rm -f .hg/last-message.txt
216 $ rm -f .hg/last-message.txt
217 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
217 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
218 amending changeset a9a13940fc03
218 amending changeset a9a13940fc03
219 copying changeset a9a13940fc03 to ad120869acf0
219 copying changeset a9a13940fc03 to ad120869acf0
220 no changes, new message
220 no changes, new message
221
221
222
222
223 HG: Enter commit message. Lines beginning with 'HG:' are removed.
223 HG: Enter commit message. Lines beginning with 'HG:' are removed.
224 HG: Leave message empty to abort commit.
224 HG: Leave message empty to abort commit.
225 HG: --
225 HG: --
226 HG: user: foo
226 HG: user: foo
227 HG: branch 'default'
227 HG: branch 'default'
228 HG: changed a
228 HG: changed a
229 committing files:
229 committing files:
230 a
230 a
231 committing manifest
231 committing manifest
232 committing changelog
232 committing changelog
233 running hook pretxncommit.test-saving-last-message: false
233 running hook pretxncommit.test-saving-last-message: false
234 transaction abort!
234 transaction abort!
235 rollback completed
235 rollback completed
236 abort: pretxncommit.test-saving-last-message hook exited with status 1
236 abort: pretxncommit.test-saving-last-message hook exited with status 1
237 [255]
237 [255]
238
238
239 $ cat .hg/last-message.txt
239 $ cat .hg/last-message.txt
240 another precious commit message
240 another precious commit message
241
241
242 $ cat > .hg/hgrc << '__EOF__'
242 $ cat > .hg/hgrc << '__EOF__'
243 > [hooks]
243 > [hooks]
244 > pretxncommit.test-saving-last-message =
244 > pretxncommit.test-saving-last-message =
245 > __EOF__
245 > __EOF__
246
246
247 then, test editing custom commit message
247 then, test editing custom commit message
248
248
249 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
249 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
250 amending changeset a9a13940fc03
250 amending changeset a9a13940fc03
251 copying changeset a9a13940fc03 to ad120869acf0
251 copying changeset a9a13940fc03 to ad120869acf0
252 no changes, new message
252 no changes, new message
253
253
254
254
255 HG: Enter commit message. Lines beginning with 'HG:' are removed.
255 HG: Enter commit message. Lines beginning with 'HG:' are removed.
256 HG: Leave message empty to abort commit.
256 HG: Leave message empty to abort commit.
257 HG: --
257 HG: --
258 HG: user: foo
258 HG: user: foo
259 HG: branch 'default'
259 HG: branch 'default'
260 HG: changed a
260 HG: changed a
261 committing files:
261 committing files:
262 a
262 a
263 committing manifest
263 committing manifest
264 committing changelog
264 committing changelog
265 1 changesets found
265 1 changesets found
266 uncompressed size of bundle content:
266 uncompressed size of bundle content:
267 249 (changelog)
267 249 (changelog)
268 163 (manifests)
268 163 (manifests)
269 133 a
269 133 a
270 saved backup bundle to $TESTTMP/.hg/strip-backup/a9a13940fc03-7c2e8674-amend.hg
270 saved backup bundle to $TESTTMP/.hg/strip-backup/a9a13940fc03-7c2e8674-amend.hg
271 1 changesets found
271 1 changesets found
272 uncompressed size of bundle content:
272 uncompressed size of bundle content:
273 257 (changelog)
273 257 (changelog)
274 163 (manifests)
274 163 (manifests)
275 133 a
275 133 a
276 adding branch
276 adding branch
277 adding changesets
277 adding changesets
278 adding manifests
278 adding manifests
279 adding file changes
279 adding file changes
280 added 1 changesets with 1 changes to 1 files
280 added 1 changesets with 1 changes to 1 files
281 committed changeset 1:64a124ba1b44
281 committed changeset 1:64a124ba1b44
282
282
283 Same, but with changes in working dir (different code path):
283 Same, but with changes in working dir (different code path):
284
284
285 $ echo a >> a
285 $ echo a >> a
286 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
286 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
287 amending changeset 64a124ba1b44
287 amending changeset 64a124ba1b44
288 another precious commit message
288 another precious commit message
289
289
290
290
291 HG: Enter commit message. Lines beginning with 'HG:' are removed.
291 HG: Enter commit message. Lines beginning with 'HG:' are removed.
292 HG: Leave message empty to abort commit.
292 HG: Leave message empty to abort commit.
293 HG: --
293 HG: --
294 HG: user: foo
294 HG: user: foo
295 HG: branch 'default'
295 HG: branch 'default'
296 HG: changed a
296 HG: changed a
297 committing files:
297 committing files:
298 a
298 a
299 committing manifest
299 committing manifest
300 committing changelog
300 committing changelog
301 1 changesets found
301 1 changesets found
302 uncompressed size of bundle content:
302 uncompressed size of bundle content:
303 257 (changelog)
303 257 (changelog)
304 163 (manifests)
304 163 (manifests)
305 133 a
305 133 a
306 saved backup bundle to $TESTTMP/.hg/strip-backup/64a124ba1b44-10374b8f-amend.hg
306 saved backup bundle to $TESTTMP/.hg/strip-backup/64a124ba1b44-10374b8f-amend.hg
307 1 changesets found
307 1 changesets found
308 uncompressed size of bundle content:
308 uncompressed size of bundle content:
309 257 (changelog)
309 257 (changelog)
310 163 (manifests)
310 163 (manifests)
311 135 a
311 135 a
312 adding branch
312 adding branch
313 adding changesets
313 adding changesets
314 adding manifests
314 adding manifests
315 adding file changes
315 adding file changes
316 added 1 changesets with 1 changes to 1 files
316 added 1 changesets with 1 changes to 1 files
317 committed changeset 1:7892795b8e38
317 committed changeset 1:7892795b8e38
318
318
319 $ rm editor.sh
319 $ rm editor.sh
320 $ hg log -r .
320 $ hg log -r .
321 changeset: 1:7892795b8e38
321 changeset: 1:7892795b8e38
322 tag: tip
322 tag: tip
323 user: foo
323 user: foo
324 date: Thu Jan 01 00:00:01 1970 +0000
324 date: Thu Jan 01 00:00:01 1970 +0000
325 summary: another precious commit message
325 summary: another precious commit message
326
326
327
327
328 Moving bookmarks, preserve active bookmark:
328 Moving bookmarks, preserve active bookmark:
329
329
330 $ hg book book1
330 $ hg book book1
331 $ hg book book2
331 $ hg book book2
332 $ hg ci --amend -m 'move bookmarks'
332 $ hg ci --amend -m 'move bookmarks'
333 saved backup bundle to $TESTTMP/.hg/strip-backup/7892795b8e38-3fb46217-amend.hg
333 saved backup bundle to $TESTTMP/.hg/strip-backup/7892795b8e38-3fb46217-amend.hg
334 $ hg book
334 $ hg book
335 book1 1:8311f17e2616
335 book1 1:8311f17e2616
336 * book2 1:8311f17e2616
336 * book2 1:8311f17e2616
337 $ echo a >> a
337 $ echo a >> a
338 $ hg ci --amend -m 'move bookmarks'
338 $ hg ci --amend -m 'move bookmarks'
339 saved backup bundle to $TESTTMP/.hg/strip-backup/8311f17e2616-f0504fe3-amend.hg
339 saved backup bundle to $TESTTMP/.hg/strip-backup/8311f17e2616-f0504fe3-amend.hg
340 $ hg book
340 $ hg book
341 book1 1:a3b65065808c
341 book1 1:a3b65065808c
342 * book2 1:a3b65065808c
342 * book2 1:a3b65065808c
343
343
344 abort does not loose bookmarks
344 abort does not loose bookmarks
345
345
346 $ cat > editor.sh << '__EOF__'
346 $ cat > editor.sh << '__EOF__'
347 > #!/bin/sh
347 > #!/bin/sh
348 > echo "" > "$1"
348 > echo "" > "$1"
349 > __EOF__
349 > __EOF__
350 $ echo a >> a
350 $ echo a >> a
351 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend
351 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend
352 abort: empty commit message
352 abort: empty commit message
353 [255]
353 [255]
354 $ hg book
354 $ hg book
355 book1 1:a3b65065808c
355 book1 1:a3b65065808c
356 * book2 1:a3b65065808c
356 * book2 1:a3b65065808c
357 $ hg revert -Caq
357 $ hg revert -Caq
358 $ rm editor.sh
358 $ rm editor.sh
359
359
360 $ echo '[defaults]' >> $HGRCPATH
360 $ echo '[defaults]' >> $HGRCPATH
361 $ echo "commit=-d '0 0'" >> $HGRCPATH
361 $ echo "commit=-d '0 0'" >> $HGRCPATH
362
362
363 Moving branches:
363 Moving branches:
364
364
365 $ hg branch foo
365 $ hg branch foo
366 marked working directory as branch foo
366 marked working directory as branch foo
367 (branches are permanent and global, did you want a bookmark?)
367 (branches are permanent and global, did you want a bookmark?)
368 $ echo a >> a
368 $ echo a >> a
369 $ hg ci -m 'branch foo'
369 $ hg ci -m 'branch foo'
370 $ hg branch default -f
370 $ hg branch default -f
371 marked working directory as branch default
371 marked working directory as branch default
372 $ hg ci --amend -m 'back to default'
372 $ hg ci --amend -m 'back to default'
373 saved backup bundle to $TESTTMP/.hg/strip-backup/f8339a38efe1-c18453c9-amend.hg
373 saved backup bundle to $TESTTMP/.hg/strip-backup/f8339a38efe1-c18453c9-amend.hg
374 $ hg branches
374 $ hg branches
375 default 2:9c07515f2650
375 default 2:9c07515f2650
376
376
377 Close branch:
377 Close branch:
378
378
379 $ hg up -q 0
379 $ hg up -q 0
380 $ echo b >> b
380 $ echo b >> b
381 $ hg branch foo
381 $ hg branch foo
382 marked working directory as branch foo
382 marked working directory as branch foo
383 (branches are permanent and global, did you want a bookmark?)
383 (branches are permanent and global, did you want a bookmark?)
384 $ hg ci -Am 'fork'
384 $ hg ci -Am 'fork'
385 adding b
385 adding b
386 $ echo b >> b
386 $ echo b >> b
387 $ hg ci -mb
387 $ hg ci -mb
388 $ hg ci --amend --close-branch -m 'closing branch foo'
388 $ hg ci --amend --close-branch -m 'closing branch foo'
389 saved backup bundle to $TESTTMP/.hg/strip-backup/c962248fa264-54245dc7-amend.hg
389 saved backup bundle to $TESTTMP/.hg/strip-backup/c962248fa264-54245dc7-amend.hg
390
390
391 Same thing, different code path:
391 Same thing, different code path:
392
392
393 $ echo b >> b
393 $ echo b >> b
394 $ hg ci -m 'reopen branch'
394 $ hg ci -m 'reopen branch'
395 reopening closed branch head 4
395 reopening closed branch head 4
396 $ echo b >> b
396 $ echo b >> b
397 $ hg ci --amend --close-branch
397 $ hg ci --amend --close-branch
398 saved backup bundle to $TESTTMP/.hg/strip-backup/027371728205-b900d9fa-amend.hg
398 saved backup bundle to $TESTTMP/.hg/strip-backup/027371728205-b900d9fa-amend.hg
399 $ hg branches
399 $ hg branches
400 default 2:9c07515f2650
400 default 2:9c07515f2650
401
401
402 Refuse to amend during a merge:
402 Refuse to amend during a merge:
403
403
404 $ hg up -q default
404 $ hg up -q default
405 $ hg merge foo
405 $ hg merge foo
406 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
406 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
407 (branch merge, don't forget to commit)
407 (branch merge, don't forget to commit)
408 $ hg ci --amend
408 $ hg ci --amend
409 abort: cannot amend while merging
409 abort: cannot amend while merging
410 [255]
410 [255]
411 $ hg ci -m 'merge'
411 $ hg ci -m 'merge'
412
412
413 Refuse to amend if there is a merge conflict (issue5805):
413 Refuse to amend if there is a merge conflict (issue5805):
414
414
415 $ hg up -q foo
415 $ hg up -q foo
416 $ echo c > a
416 $ echo c > a
417 $ hg up default -t :fail
417 $ hg up default -t :fail
418 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
418 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
419 use 'hg resolve' to retry unresolved file merges
419 use 'hg resolve' to retry unresolved file merges
420 [1]
420 [1]
421 $ hg resolve -l
421 $ hg resolve -l
422 U a
422 U a
423
423
424 $ hg ci --amend
424 $ hg ci --amend
425 abort: unresolved merge conflicts (see 'hg help resolve')
425 abort: unresolved merge conflicts (see 'hg help resolve')
426 [255]
426 [255]
427
427
428 $ hg up -qC .
428 $ hg up -qC .
429
429
430 Follow copies/renames:
430 Follow copies/renames:
431
431
432 $ hg mv b c
432 $ hg mv b c
433 $ hg ci -m 'b -> c'
433 $ hg ci -m 'b -> c'
434 $ hg mv c d
434 $ hg mv c d
435 $ hg ci --amend -m 'b -> d'
435 $ hg ci --amend -m 'b -> d'
436 saved backup bundle to $TESTTMP/.hg/strip-backup/42f3f27a067d-f23cc9f7-amend.hg
436 saved backup bundle to $TESTTMP/.hg/strip-backup/42f3f27a067d-f23cc9f7-amend.hg
437 $ hg st --rev '.^' --copies d
437 $ hg st --rev '.^' --copies d
438 A d
438 A d
439 b
439 b
440 $ hg cp d e
440 $ hg cp d e
441 $ hg ci -m 'e = d'
441 $ hg ci -m 'e = d'
442 $ hg cp e f
442 $ hg cp e f
443 $ hg ci --amend -m 'f = d'
443 $ hg ci --amend -m 'f = d'
444 saved backup bundle to $TESTTMP/.hg/strip-backup/9198f73182d5-251d584a-amend.hg
444 saved backup bundle to $TESTTMP/.hg/strip-backup/9198f73182d5-251d584a-amend.hg
445 $ hg st --rev '.^' --copies f
445 $ hg st --rev '.^' --copies f
446 A f
446 A f
447 d
447 d
448
448
449 $ mv f f.orig
449 $ mv f f.orig
450 $ hg rm -A f
450 $ hg rm -A f
451 $ hg ci -m removef
451 $ hg ci -m removef
452 $ hg cp a f
452 $ hg cp a f
453 $ mv f.orig f
453 $ mv f.orig f
454 $ hg ci --amend -m replacef
454 $ hg ci --amend -m replacef
455 saved backup bundle to $TESTTMP/.hg/strip-backup/f0993ab6b482-eda301bf-amend.hg
455 saved backup bundle to $TESTTMP/.hg/strip-backup/f0993ab6b482-eda301bf-amend.hg
456 $ hg st --change . --copies
456 $ hg st --change . --copies
457 $ hg log -r . --template "{file_copies}\n"
457 $ hg log -r . --template "{file_copies}\n"
458
458
459
459
460 Move added file (issue3410):
460 Move added file (issue3410):
461
461
462 $ echo g >> g
462 $ echo g >> g
463 $ hg ci -Am g
463 $ hg ci -Am g
464 adding g
464 adding g
465 $ hg mv g h
465 $ hg mv g h
466 $ hg ci --amend
466 $ hg ci --amend
467 saved backup bundle to $TESTTMP/.hg/strip-backup/58585e3f095c-0f5ebcda-amend.hg
467 saved backup bundle to $TESTTMP/.hg/strip-backup/58585e3f095c-0f5ebcda-amend.hg
468 $ hg st --change . --copies h
468 $ hg st --change . --copies h
469 A h
469 A h
470 $ hg log -r . --template "{file_copies}\n"
470 $ hg log -r . --template "{file_copies}\n"
471
471
472
472
473 Can't rollback an amend:
473 Can't rollback an amend:
474
474
475 $ hg rollback
475 $ hg rollback
476 no rollback information available
476 no rollback information available
477 [1]
477 [1]
478
478
479 Preserve extra dict (issue3430):
479 Preserve extra dict (issue3430):
480
480
481 $ hg branch a
481 $ hg branch a
482 marked working directory as branch a
482 marked working directory as branch a
483 (branches are permanent and global, did you want a bookmark?)
483 (branches are permanent and global, did you want a bookmark?)
484 $ echo a >> a
484 $ echo a >> a
485 $ hg ci -ma
485 $ hg ci -ma
486 $ hg ci --amend -m "a'"
486 $ hg ci --amend -m "a'"
487 saved backup bundle to $TESTTMP/.hg/strip-backup/39a162f1d65e-9dfe13d8-amend.hg
487 saved backup bundle to $TESTTMP/.hg/strip-backup/39a162f1d65e-9dfe13d8-amend.hg
488 $ hg log -r . --template "{branch}\n"
488 $ hg log -r . --template "{branch}\n"
489 a
489 a
490 $ hg ci --amend -m "a''"
490 $ hg ci --amend -m "a''"
491 saved backup bundle to $TESTTMP/.hg/strip-backup/d5ca7b1ac72b-0b4c1a34-amend.hg
491 saved backup bundle to $TESTTMP/.hg/strip-backup/d5ca7b1ac72b-0b4c1a34-amend.hg
492 $ hg log -r . --template "{branch}\n"
492 $ hg log -r . --template "{branch}\n"
493 a
493 a
494
494
495 Also preserve other entries in the dict that are in the old commit,
495 Also preserve other entries in the dict that are in the old commit,
496 first graft something so there's an additional entry:
496 first graft something so there's an additional entry:
497
497
498 $ hg up 0 -q
498 $ hg up 0 -q
499 $ echo z > z
499 $ echo z > z
500 $ hg ci -Am 'fork'
500 $ hg ci -Am 'fork'
501 adding z
501 adding z
502 created new head
502 created new head
503 $ hg up 11
503 $ hg up 11
504 5 files updated, 0 files merged, 1 files removed, 0 files unresolved
504 5 files updated, 0 files merged, 1 files removed, 0 files unresolved
505 $ hg graft 12
505 $ hg graft 12
506 grafting 12:2647734878ef "fork" (tip)
506 grafting 12:2647734878ef "fork" (tip)
507 $ hg ci --amend -m 'graft amend'
507 $ hg ci --amend -m 'graft amend'
508 saved backup bundle to $TESTTMP/.hg/strip-backup/fe8c6f7957ca-25638666-amend.hg
508 saved backup bundle to $TESTTMP/.hg/strip-backup/fe8c6f7957ca-25638666-amend.hg
509 $ hg log -r . --debug | grep extra
509 $ hg log -r . --debug | grep extra
510 extra: amend_source=fe8c6f7957ca1665ed77496ed7a07657d469ac60
510 extra: amend_source=fe8c6f7957ca1665ed77496ed7a07657d469ac60
511 extra: branch=a
511 extra: branch=a
512 extra: source=2647734878ef0236dda712fae9c1651cf694ea8a
512 extra: source=2647734878ef0236dda712fae9c1651cf694ea8a
513
513
514 Preserve phase
514 Preserve phase
515
515
516 $ hg phase '.^::.'
516 $ hg phase '.^::.'
517 11: draft
517 11: draft
518 13: draft
518 13: draft
519 $ hg phase --secret --force .
519 $ hg phase --secret --force .
520 $ hg phase '.^::.'
520 $ hg phase '.^::.'
521 11: draft
521 11: draft
522 13: secret
522 13: secret
523 $ hg commit --amend -m 'amend for phase' -q
523 $ hg commit --amend -m 'amend for phase' -q
524 $ hg phase '.^::.'
524 $ hg phase '.^::.'
525 11: draft
525 11: draft
526 13: secret
526 13: secret
527
527
528 Test amend with obsolete
528 Test amend with obsolete
529 ---------------------------
529 ---------------------------
530
530
531 Enable obsolete
531 Enable obsolete
532
532
533 $ cat >> $HGRCPATH << EOF
533 $ cat >> $HGRCPATH << EOF
534 > [experimental]
534 > [experimental]
535 > evolution.createmarkers=True
535 > evolution.createmarkers=True
536 > evolution.allowunstable=True
536 > evolution.allowunstable=True
537 > EOF
537 > EOF
538
538
539 Amend with no files changes
539 Amend with no files changes
540
540
541 $ hg id -n
541 $ hg id -n
542 13
542 13
543 $ hg ci --amend -m 'babar'
543 $ hg ci --amend -m 'babar'
544 $ hg id -n
544 $ hg id -n
545 14
545 14
546 $ hg log -Gl 3 --style=compact
546 $ hg log -Gl 3 --style=compact
547 @ 14[tip]:11 682950e85999 1970-01-01 00:00 +0000 test
547 @ 14[tip]:11 682950e85999 1970-01-01 00:00 +0000 test
548 | babar
548 | babar
549 |
549 |
550 | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test
550 | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test
551 | | fork
551 | | fork
552 | ~
552 | ~
553 o 11 0ddb275cfad1 1970-01-01 00:00 +0000 test
553 o 11 0ddb275cfad1 1970-01-01 00:00 +0000 test
554 | a''
554 | a''
555 ~
555 ~
556 $ hg log -Gl 4 --hidden --style=compact
556 $ hg log -Gl 4 --hidden --style=compact
557 @ 14[tip]:11 682950e85999 1970-01-01 00:00 +0000 test
557 @ 14[tip]:11 682950e85999 1970-01-01 00:00 +0000 test
558 | babar
558 | babar
559 |
559 |
560 | x 13:11 5167600b0f7a 1970-01-01 00:00 +0000 test
560 | x 13:11 5167600b0f7a 1970-01-01 00:00 +0000 test
561 |/ amend for phase
561 |/ amend for phase
562 |
562 |
563 | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test
563 | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test
564 | | fork
564 | | fork
565 | ~
565 | ~
566 o 11 0ddb275cfad1 1970-01-01 00:00 +0000 test
566 o 11 0ddb275cfad1 1970-01-01 00:00 +0000 test
567 | a''
567 | a''
568 ~
568 ~
569
569
570 Amend with files changes
570 Amend with files changes
571
571
572 (note: the extra commit over 15 is a temporary junk I would be happy to get
572 (note: the extra commit over 15 is a temporary junk I would be happy to get
573 ride of)
573 ride of)
574
574
575 $ echo 'babar' >> a
575 $ echo 'babar' >> a
576 $ hg commit --amend
576 $ hg commit --amend
577 $ hg log -Gl 6 --hidden --style=compact
577 $ hg log -Gl 6 --hidden --style=compact
578 @ 15[tip]:11 a5b42b49b0d5 1970-01-01 00:00 +0000 test
578 @ 15[tip]:11 a5b42b49b0d5 1970-01-01 00:00 +0000 test
579 | babar
579 | babar
580 |
580 |
581 | x 14:11 682950e85999 1970-01-01 00:00 +0000 test
581 | x 14:11 682950e85999 1970-01-01 00:00 +0000 test
582 |/ babar
582 |/ babar
583 |
583 |
584 | x 13:11 5167600b0f7a 1970-01-01 00:00 +0000 test
584 | x 13:11 5167600b0f7a 1970-01-01 00:00 +0000 test
585 |/ amend for phase
585 |/ amend for phase
586 |
586 |
587 | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test
587 | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test
588 | | fork
588 | | fork
589 | ~
589 | ~
590 o 11 0ddb275cfad1 1970-01-01 00:00 +0000 test
590 o 11 0ddb275cfad1 1970-01-01 00:00 +0000 test
591 | a''
591 | a''
592 |
592 |
593 o 10 5fa75032e226 1970-01-01 00:00 +0000 test
593 o 10 5fa75032e226 1970-01-01 00:00 +0000 test
594 | g
594 | g
595 ~
595 ~
596
596
597
597
598 Test that amend does not make it easy to create obsolescence cycle
598 Test that amend does not make it easy to create obsolescence cycle
599 ---------------------------------------------------------------------
599 ---------------------------------------------------------------------
600
600
601 $ hg id -r 14 --hidden
601 $ hg id -r 14 --hidden
602 682950e85999 (a)
602 682950e85999 (a)
603 $ hg revert -ar 14 --hidden
603 $ hg revert -ar 14 --hidden
604 reverting a
604 reverting a
605 $ hg commit --amend
605 $ hg commit --amend
606 $ hg id
606 $ hg id
607 37973c7e0b61 (a) tip
607 37973c7e0b61 (a) tip
608
608
609 Test that rewriting leaving instability behind is allowed
609 Test that rewriting leaving instability behind is allowed
610 ---------------------------------------------------------------------
610 ---------------------------------------------------------------------
611
611
612 $ hg up '.^'
612 $ hg up '.^'
613 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
613 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
614 $ echo 'b' >> a
614 $ echo 'b' >> a
615 $ hg log --style compact -r 'children(.)'
615 $ hg log --style compact -r 'children(.)'
616 16[tip]:11 37973c7e0b61 1970-01-01 00:00 +0000 test
616 16[tip]:11 37973c7e0b61 1970-01-01 00:00 +0000 test
617 babar
617 babar
618
618
619 $ hg commit --amend
619 $ hg commit --amend
620 1 new orphan changesets
620 1 new orphan changesets
621 $ hg log -r 'orphan()'
621 $ hg log -r 'orphan()'
622 changeset: 16:37973c7e0b61
622 changeset: 16:37973c7e0b61
623 branch: a
623 branch: a
624 parent: 11:0ddb275cfad1
624 parent: 11:0ddb275cfad1
625 user: test
625 user: test
626 date: Thu Jan 01 00:00:00 1970 +0000
626 date: Thu Jan 01 00:00:00 1970 +0000
627 instability: orphan
627 instability: orphan
628 summary: babar
628 summary: babar
629
629
630
630
631 Amend a merge changeset (with renames and conflicts from the second parent):
631 Amend a merge changeset (with renames and conflicts from the second parent):
632
632
633 $ hg up -q default
633 $ hg up -q default
634 $ hg branch -q bar
634 $ hg branch -q bar
635 $ hg cp a aa
635 $ hg cp a aa
636 $ hg mv z zz
636 $ hg mv z zz
637 $ echo cc > cc
637 $ echo cc > cc
638 $ hg add cc
638 $ hg add cc
639 $ hg ci -m aazzcc
639 $ hg ci -m aazzcc
640 $ hg up -q default
640 $ hg up -q default
641 $ echo a >> a
641 $ echo a >> a
642 $ echo dd > cc
642 $ echo dd > cc
643 $ hg add cc
643 $ hg add cc
644 $ hg ci -m aa
644 $ hg ci -m aa
645 $ hg merge -q bar
645 $ hg merge -q bar
646 warning: conflicts while merging cc! (edit, then use 'hg resolve --mark')
646 warning: conflicts while merging cc! (edit, then use 'hg resolve --mark')
647 [1]
647 [1]
648 $ hg resolve -m cc
648 $ hg resolve -m cc
649 (no more unresolved files)
649 (no more unresolved files)
650 $ hg ci -m 'merge bar'
650 $ hg ci -m 'merge bar'
651 $ hg log --config diff.git=1 -pr .
651 $ hg log --config diff.git=1 -pr .
652 changeset: 20:163cfd7219f7
652 changeset: 20:163cfd7219f7
653 tag: tip
653 tag: tip
654 parent: 19:30d96aeaf27b
654 parent: 19:30d96aeaf27b
655 parent: 18:1aa437659d19
655 parent: 18:1aa437659d19
656 user: test
656 user: test
657 date: Thu Jan 01 00:00:00 1970 +0000
657 date: Thu Jan 01 00:00:00 1970 +0000
658 summary: merge bar
658 summary: merge bar
659
659
660 diff --git a/a b/aa
660 diff --git a/a b/aa
661 copy from a
661 copy from a
662 copy to aa
662 copy to aa
663 diff --git a/cc b/cc
663 diff --git a/cc b/cc
664 --- a/cc
664 --- a/cc
665 +++ b/cc
665 +++ b/cc
666 @@ -1,1 +1,5 @@
666 @@ -1,1 +1,5 @@
667 +<<<<<<< working copy: 30d96aeaf27b - test: aa
667 +<<<<<<< working copy: 30d96aeaf27b - test: aa
668 dd
668 dd
669 +=======
669 +=======
670 +cc
670 +cc
671 +>>>>>>> merge rev: 1aa437659d19 bar - test: aazzcc
671 +>>>>>>> merge rev: 1aa437659d19 bar - test: aazzcc
672 diff --git a/z b/zz
672 diff --git a/z b/zz
673 rename from z
673 rename from z
674 rename to zz
674 rename to zz
675
675
676 $ hg debugrename aa
676 $ hg debugrename aa
677 aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e
677 aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e
678 $ hg debugrename zz
678 $ hg debugrename zz
679 zz renamed from z:69a1b67522704ec122181c0890bd16e9d3e7516a
679 zz renamed from z:69a1b67522704ec122181c0890bd16e9d3e7516a
680 $ hg debugrename cc
680 $ hg debugrename cc
681 cc not renamed
681 cc not renamed
682 $ HGEDITOR="sh .hg/checkeditform.sh" hg ci --amend -m 'merge bar (amend message)' --edit
682 $ HGEDITOR="sh .hg/checkeditform.sh" hg ci --amend -m 'merge bar (amend message)' --edit
683 HGEDITFORM=commit.amend.merge
683 HGEDITFORM=commit.amend.merge
684 $ hg log --config diff.git=1 -pr .
684 $ hg log --config diff.git=1 -pr .
685 changeset: 21:bca52d4ed186
685 changeset: 21:bca52d4ed186
686 tag: tip
686 tag: tip
687 parent: 19:30d96aeaf27b
687 parent: 19:30d96aeaf27b
688 parent: 18:1aa437659d19
688 parent: 18:1aa437659d19
689 user: test
689 user: test
690 date: Thu Jan 01 00:00:00 1970 +0000
690 date: Thu Jan 01 00:00:00 1970 +0000
691 summary: merge bar (amend message)
691 summary: merge bar (amend message)
692
692
693 diff --git a/a b/aa
693 diff --git a/a b/aa
694 copy from a
694 copy from a
695 copy to aa
695 copy to aa
696 diff --git a/cc b/cc
696 diff --git a/cc b/cc
697 --- a/cc
697 --- a/cc
698 +++ b/cc
698 +++ b/cc
699 @@ -1,1 +1,5 @@
699 @@ -1,1 +1,5 @@
700 +<<<<<<< working copy: 30d96aeaf27b - test: aa
700 +<<<<<<< working copy: 30d96aeaf27b - test: aa
701 dd
701 dd
702 +=======
702 +=======
703 +cc
703 +cc
704 +>>>>>>> merge rev: 1aa437659d19 bar - test: aazzcc
704 +>>>>>>> merge rev: 1aa437659d19 bar - test: aazzcc
705 diff --git a/z b/zz
705 diff --git a/z b/zz
706 rename from z
706 rename from z
707 rename to zz
707 rename to zz
708
708
709 $ hg debugrename aa
709 $ hg debugrename aa
710 aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e
710 aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e
711 $ hg debugrename zz
711 $ hg debugrename zz
712 zz renamed from z:69a1b67522704ec122181c0890bd16e9d3e7516a
712 zz renamed from z:69a1b67522704ec122181c0890bd16e9d3e7516a
713 $ hg debugrename cc
713 $ hg debugrename cc
714 cc not renamed
714 cc not renamed
715 $ hg mv zz z
715 $ hg mv zz z
716 $ hg ci --amend -m 'merge bar (undo rename)'
716 $ hg ci --amend -m 'merge bar (undo rename)'
717 $ hg log --config diff.git=1 -pr .
717 $ hg log --config diff.git=1 -pr .
718 changeset: 22:12594a98ca3f
718 changeset: 22:12594a98ca3f
719 tag: tip
719 tag: tip
720 parent: 19:30d96aeaf27b
720 parent: 19:30d96aeaf27b
721 parent: 18:1aa437659d19
721 parent: 18:1aa437659d19
722 user: test
722 user: test
723 date: Thu Jan 01 00:00:00 1970 +0000
723 date: Thu Jan 01 00:00:00 1970 +0000
724 summary: merge bar (undo rename)
724 summary: merge bar (undo rename)
725
725
726 diff --git a/a b/aa
726 diff --git a/a b/aa
727 copy from a
727 copy from a
728 copy to aa
728 copy to aa
729 diff --git a/cc b/cc
729 diff --git a/cc b/cc
730 --- a/cc
730 --- a/cc
731 +++ b/cc
731 +++ b/cc
732 @@ -1,1 +1,5 @@
732 @@ -1,1 +1,5 @@
733 +<<<<<<< working copy: 30d96aeaf27b - test: aa
733 +<<<<<<< working copy: 30d96aeaf27b - test: aa
734 dd
734 dd
735 +=======
735 +=======
736 +cc
736 +cc
737 +>>>>>>> merge rev: 1aa437659d19 bar - test: aazzcc
737 +>>>>>>> merge rev: 1aa437659d19 bar - test: aazzcc
738
738
739 $ hg debugrename z
739 $ hg debugrename z
740 z not renamed
740 z not renamed
741
741
742 Amend a merge changeset (with renames during the merge):
742 Amend a merge changeset (with renames during the merge):
743
743
744 $ hg up -q bar
744 $ hg up -q bar
745 $ echo x > x
745 $ echo x > x
746 $ hg add x
746 $ hg add x
747 $ hg ci -m x
747 $ hg ci -m x
748 $ hg up -q default
748 $ hg up -q default
749 $ hg merge -q bar
749 $ hg merge -q bar
750 $ hg mv aa aaa
750 $ hg mv aa aaa
751 $ echo aa >> aaa
751 $ echo aa >> aaa
752 $ hg ci -m 'merge bar again'
752 $ hg ci -m 'merge bar again'
753 $ hg log --config diff.git=1 -pr .
753 $ hg log --config diff.git=1 -pr .
754 changeset: 24:dffde028b388
754 changeset: 24:dffde028b388
755 tag: tip
755 tag: tip
756 parent: 22:12594a98ca3f
756 parent: 22:12594a98ca3f
757 parent: 23:4c94d5bc65f5
757 parent: 23:4c94d5bc65f5
758 user: test
758 user: test
759 date: Thu Jan 01 00:00:00 1970 +0000
759 date: Thu Jan 01 00:00:00 1970 +0000
760 summary: merge bar again
760 summary: merge bar again
761
761
762 diff --git a/aa b/aa
762 diff --git a/aa b/aa
763 deleted file mode 100644
763 deleted file mode 100644
764 --- a/aa
764 --- a/aa
765 +++ /dev/null
765 +++ /dev/null
766 @@ -1,2 +0,0 @@
766 @@ -1,2 +0,0 @@
767 -a
767 -a
768 -a
768 -a
769 diff --git a/aaa b/aaa
769 diff --git a/aaa b/aaa
770 new file mode 100644
770 new file mode 100644
771 --- /dev/null
771 --- /dev/null
772 +++ b/aaa
772 +++ b/aaa
773 @@ -0,0 +1,3 @@
773 @@ -0,0 +1,3 @@
774 +a
774 +a
775 +a
775 +a
776 +aa
776 +aa
777 diff --git a/x b/x
777 diff --git a/x b/x
778 new file mode 100644
778 new file mode 100644
779 --- /dev/null
779 --- /dev/null
780 +++ b/x
780 +++ b/x
781 @@ -0,0 +1,1 @@
781 @@ -0,0 +1,1 @@
782 +x
782 +x
783
783
784 $ hg debugrename aaa
784 $ hg debugrename aaa
785 aaa renamed from aa:37d9b5d994eab34eda9c16b195ace52c7b129980
785 aaa renamed from aa:37d9b5d994eab34eda9c16b195ace52c7b129980
786 $ hg mv aaa aa
786 $ hg mv aaa aa
787 $ hg ci --amend -m 'merge bar again (undo rename)'
787 $ hg ci --amend -m 'merge bar again (undo rename)'
788 $ hg log --config diff.git=1 -pr .
788 $ hg log --config diff.git=1 -pr .
789 changeset: 25:18e3ba160489
789 changeset: 25:18e3ba160489
790 tag: tip
790 tag: tip
791 parent: 22:12594a98ca3f
791 parent: 22:12594a98ca3f
792 parent: 23:4c94d5bc65f5
792 parent: 23:4c94d5bc65f5
793 user: test
793 user: test
794 date: Thu Jan 01 00:00:00 1970 +0000
794 date: Thu Jan 01 00:00:00 1970 +0000
795 summary: merge bar again (undo rename)
795 summary: merge bar again (undo rename)
796
796
797 diff --git a/aa b/aa
797 diff --git a/aa b/aa
798 --- a/aa
798 --- a/aa
799 +++ b/aa
799 +++ b/aa
800 @@ -1,2 +1,3 @@
800 @@ -1,2 +1,3 @@
801 a
801 a
802 a
802 a
803 +aa
803 +aa
804 diff --git a/x b/x
804 diff --git a/x b/x
805 new file mode 100644
805 new file mode 100644
806 --- /dev/null
806 --- /dev/null
807 +++ b/x
807 +++ b/x
808 @@ -0,0 +1,1 @@
808 @@ -0,0 +1,1 @@
809 +x
809 +x
810
810
811 $ hg debugrename aa
811 $ hg debugrename aa
812 aa not renamed
812 aa not renamed
813 $ hg debugrename -r '.^' aa
813 $ hg debugrename -r '.^' aa
814 aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e
814 aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e
815
815
816 Amend a merge changeset (with manifest-level conflicts):
816 Amend a merge changeset (with manifest-level conflicts):
817
817
818 $ hg up -q bar
818 $ hg up -q bar
819 $ hg rm aa
819 $ hg rm aa
820 $ hg ci -m 'rm aa'
820 $ hg ci -m 'rm aa'
821 $ hg up -q default
821 $ hg up -q default
822 $ echo aa >> aa
822 $ echo aa >> aa
823 $ hg ci -m aa
823 $ hg ci -m aa
824 $ hg merge -q bar --config ui.interactive=True << EOF
824 $ hg merge -q bar --config ui.interactive=True << EOF
825 > c
825 > c
826 > EOF
826 > EOF
827 file 'aa' was deleted in local [working copy] but was modified in other [merge rev].
827 file 'aa' was deleted in other [merge rev] but was modified in local [working copy].
828 What do you want to do?
828 What do you want to do?
829 use (c)hanged version, (d)elete, or leave (u)nresolved? c
829 use (c)hanged version, (d)elete, or leave (u)nresolved? c
830 $ hg ci -m 'merge bar (with conflicts)'
830 $ hg ci -m 'merge bar (with conflicts)'
831 $ hg log --config diff.git=1 -pr .
831 $ hg log --config diff.git=1 -pr .
832 changeset: 28:b4c3035e2544
832 changeset: 28:b4c3035e2544
833 tag: tip
833 tag: tip
834 parent: 27:4b216ca5ba97
834 parent: 27:4b216ca5ba97
835 parent: 26:67db8847a540
835 parent: 26:67db8847a540
836 user: test
836 user: test
837 date: Thu Jan 01 00:00:00 1970 +0000
837 date: Thu Jan 01 00:00:00 1970 +0000
838 summary: merge bar (with conflicts)
838 summary: merge bar (with conflicts)
839
839
840
840
841 $ hg rm aa
841 $ hg rm aa
842 $ hg ci --amend -m 'merge bar (with conflicts, amended)'
842 $ hg ci --amend -m 'merge bar (with conflicts, amended)'
843 $ hg log --config diff.git=1 -pr .
843 $ hg log --config diff.git=1 -pr .
844 changeset: 29:1205ed810051
844 changeset: 29:1205ed810051
845 tag: tip
845 tag: tip
846 parent: 27:4b216ca5ba97
846 parent: 27:4b216ca5ba97
847 parent: 26:67db8847a540
847 parent: 26:67db8847a540
848 user: test
848 user: test
849 date: Thu Jan 01 00:00:00 1970 +0000
849 date: Thu Jan 01 00:00:00 1970 +0000
850 summary: merge bar (with conflicts, amended)
850 summary: merge bar (with conflicts, amended)
851
851
852 diff --git a/aa b/aa
852 diff --git a/aa b/aa
853 deleted file mode 100644
853 deleted file mode 100644
854 --- a/aa
854 --- a/aa
855 +++ /dev/null
855 +++ /dev/null
856 @@ -1,4 +0,0 @@
856 @@ -1,4 +0,0 @@
857 -a
857 -a
858 -a
858 -a
859 -aa
859 -aa
860 -aa
860 -aa
861
861
862 Issue 3445: amending with --close-branch a commit that created a new head should fail
862 Issue 3445: amending with --close-branch a commit that created a new head should fail
863 This shouldn't be possible:
863 This shouldn't be possible:
864
864
865 $ hg up -q default
865 $ hg up -q default
866 $ hg branch closewithamend
866 $ hg branch closewithamend
867 marked working directory as branch closewithamend
867 marked working directory as branch closewithamend
868 $ echo foo > foo
868 $ echo foo > foo
869 $ hg add foo
869 $ hg add foo
870 $ hg ci -m..
870 $ hg ci -m..
871 $ hg ci --amend --close-branch -m 'closing'
871 $ hg ci --amend --close-branch -m 'closing'
872 abort: can only close branch heads
872 abort: can only close branch heads
873 [255]
873 [255]
874
874
875 This silliness fails:
875 This silliness fails:
876
876
877 $ hg branch silliness
877 $ hg branch silliness
878 marked working directory as branch silliness
878 marked working directory as branch silliness
879 $ echo b >> b
879 $ echo b >> b
880 $ hg ci --close-branch -m'open and close'
880 $ hg ci --close-branch -m'open and close'
881 abort: can only close branch heads
881 abort: can only close branch heads
882 [255]
882 [255]
883
883
884 Test that amend with --secret creates new secret changeset forcibly
884 Test that amend with --secret creates new secret changeset forcibly
885 ---------------------------------------------------------------------
885 ---------------------------------------------------------------------
886
886
887 $ hg phase '.^::.'
887 $ hg phase '.^::.'
888 29: draft
888 29: draft
889 30: draft
889 30: draft
890 $ hg commit --amend --secret -m 'amend as secret' -q
890 $ hg commit --amend --secret -m 'amend as secret' -q
891 $ hg phase '.^::.'
891 $ hg phase '.^::.'
892 29: draft
892 29: draft
893 31: secret
893 31: secret
894
894
895 Test that amend with --edit invokes editor forcibly
895 Test that amend with --edit invokes editor forcibly
896 ---------------------------------------------------
896 ---------------------------------------------------
897
897
898 $ hg parents --template "{desc}\n"
898 $ hg parents --template "{desc}\n"
899 amend as secret
899 amend as secret
900 $ HGEDITOR=cat hg commit --amend -m "editor should be suppressed"
900 $ HGEDITOR=cat hg commit --amend -m "editor should be suppressed"
901 $ hg parents --template "{desc}\n"
901 $ hg parents --template "{desc}\n"
902 editor should be suppressed
902 editor should be suppressed
903
903
904 $ hg status --rev '.^1::.'
904 $ hg status --rev '.^1::.'
905 A foo
905 A foo
906 $ HGEDITOR=cat hg commit --amend -m "editor should be invoked" --edit
906 $ HGEDITOR=cat hg commit --amend -m "editor should be invoked" --edit
907 editor should be invoked
907 editor should be invoked
908
908
909
909
910 HG: Enter commit message. Lines beginning with 'HG:' are removed.
910 HG: Enter commit message. Lines beginning with 'HG:' are removed.
911 HG: Leave message empty to abort commit.
911 HG: Leave message empty to abort commit.
912 HG: --
912 HG: --
913 HG: user: test
913 HG: user: test
914 HG: branch 'silliness'
914 HG: branch 'silliness'
915 HG: added foo
915 HG: added foo
916 $ hg parents --template "{desc}\n"
916 $ hg parents --template "{desc}\n"
917 editor should be invoked
917 editor should be invoked
918
918
919 Test that "diff()" in committemplate works correctly for amending
919 Test that "diff()" in committemplate works correctly for amending
920 -----------------------------------------------------------------
920 -----------------------------------------------------------------
921
921
922 $ cat >> .hg/hgrc <<EOF
922 $ cat >> .hg/hgrc <<EOF
923 > [committemplate]
923 > [committemplate]
924 > changeset.commit.amend = {desc}\n
924 > changeset.commit.amend = {desc}\n
925 > HG: M: {file_mods}
925 > HG: M: {file_mods}
926 > HG: A: {file_adds}
926 > HG: A: {file_adds}
927 > HG: R: {file_dels}
927 > HG: R: {file_dels}
928 > {splitlines(diff()) % 'HG: {line}\n'}
928 > {splitlines(diff()) % 'HG: {line}\n'}
929 > EOF
929 > EOF
930
930
931 $ hg parents --template "M: {file_mods}\nA: {file_adds}\nR: {file_dels}\n"
931 $ hg parents --template "M: {file_mods}\nA: {file_adds}\nR: {file_dels}\n"
932 M:
932 M:
933 A: foo
933 A: foo
934 R:
934 R:
935 $ hg status -amr
935 $ hg status -amr
936 $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of foo"
936 $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of foo"
937 expecting diff of foo
937 expecting diff of foo
938
938
939 HG: M:
939 HG: M:
940 HG: A: foo
940 HG: A: foo
941 HG: R:
941 HG: R:
942 HG: diff -r 1205ed810051 foo
942 HG: diff -r 1205ed810051 foo
943 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
943 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
944 HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000
944 HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000
945 HG: @@ -0,0 +1,1 @@
945 HG: @@ -0,0 +1,1 @@
946 HG: +foo
946 HG: +foo
947
947
948 $ echo y > y
948 $ echo y > y
949 $ hg add y
949 $ hg add y
950 $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of foo and y"
950 $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of foo and y"
951 expecting diff of foo and y
951 expecting diff of foo and y
952
952
953 HG: M:
953 HG: M:
954 HG: A: foo y
954 HG: A: foo y
955 HG: R:
955 HG: R:
956 HG: diff -r 1205ed810051 foo
956 HG: diff -r 1205ed810051 foo
957 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
957 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
958 HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000
958 HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000
959 HG: @@ -0,0 +1,1 @@
959 HG: @@ -0,0 +1,1 @@
960 HG: +foo
960 HG: +foo
961 HG: diff -r 1205ed810051 y
961 HG: diff -r 1205ed810051 y
962 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
962 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
963 HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000
963 HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000
964 HG: @@ -0,0 +1,1 @@
964 HG: @@ -0,0 +1,1 @@
965 HG: +y
965 HG: +y
966
966
967 $ hg rm a
967 $ hg rm a
968 $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of a, foo and y"
968 $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of a, foo and y"
969 expecting diff of a, foo and y
969 expecting diff of a, foo and y
970
970
971 HG: M:
971 HG: M:
972 HG: A: foo y
972 HG: A: foo y
973 HG: R: a
973 HG: R: a
974 HG: diff -r 1205ed810051 a
974 HG: diff -r 1205ed810051 a
975 HG: --- a/a Thu Jan 01 00:00:00 1970 +0000
975 HG: --- a/a Thu Jan 01 00:00:00 1970 +0000
976 HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
976 HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
977 HG: @@ -1,2 +0,0 @@
977 HG: @@ -1,2 +0,0 @@
978 HG: -a
978 HG: -a
979 HG: -a
979 HG: -a
980 HG: diff -r 1205ed810051 foo
980 HG: diff -r 1205ed810051 foo
981 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
981 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
982 HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000
982 HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000
983 HG: @@ -0,0 +1,1 @@
983 HG: @@ -0,0 +1,1 @@
984 HG: +foo
984 HG: +foo
985 HG: diff -r 1205ed810051 y
985 HG: diff -r 1205ed810051 y
986 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
986 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
987 HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000
987 HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000
988 HG: @@ -0,0 +1,1 @@
988 HG: @@ -0,0 +1,1 @@
989 HG: +y
989 HG: +y
990
990
991 $ hg rm x
991 $ hg rm x
992 $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of a, foo, x and y"
992 $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of a, foo, x and y"
993 expecting diff of a, foo, x and y
993 expecting diff of a, foo, x and y
994
994
995 HG: M:
995 HG: M:
996 HG: A: foo y
996 HG: A: foo y
997 HG: R: a x
997 HG: R: a x
998 HG: diff -r 1205ed810051 a
998 HG: diff -r 1205ed810051 a
999 HG: --- a/a Thu Jan 01 00:00:00 1970 +0000
999 HG: --- a/a Thu Jan 01 00:00:00 1970 +0000
1000 HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1000 HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1001 HG: @@ -1,2 +0,0 @@
1001 HG: @@ -1,2 +0,0 @@
1002 HG: -a
1002 HG: -a
1003 HG: -a
1003 HG: -a
1004 HG: diff -r 1205ed810051 foo
1004 HG: diff -r 1205ed810051 foo
1005 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1005 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1006 HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000
1006 HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000
1007 HG: @@ -0,0 +1,1 @@
1007 HG: @@ -0,0 +1,1 @@
1008 HG: +foo
1008 HG: +foo
1009 HG: diff -r 1205ed810051 x
1009 HG: diff -r 1205ed810051 x
1010 HG: --- a/x Thu Jan 01 00:00:00 1970 +0000
1010 HG: --- a/x Thu Jan 01 00:00:00 1970 +0000
1011 HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1011 HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1012 HG: @@ -1,1 +0,0 @@
1012 HG: @@ -1,1 +0,0 @@
1013 HG: -x
1013 HG: -x
1014 HG: diff -r 1205ed810051 y
1014 HG: diff -r 1205ed810051 y
1015 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1015 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1016 HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000
1016 HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000
1017 HG: @@ -0,0 +1,1 @@
1017 HG: @@ -0,0 +1,1 @@
1018 HG: +y
1018 HG: +y
1019
1019
1020 $ echo cccc >> cc
1020 $ echo cccc >> cc
1021 $ hg status -amr
1021 $ hg status -amr
1022 M cc
1022 M cc
1023 $ HGEDITOR=cat hg commit --amend -e -m "cc should be excluded" -X cc
1023 $ HGEDITOR=cat hg commit --amend -e -m "cc should be excluded" -X cc
1024 cc should be excluded
1024 cc should be excluded
1025
1025
1026 HG: M:
1026 HG: M:
1027 HG: A: foo y
1027 HG: A: foo y
1028 HG: R: a x
1028 HG: R: a x
1029 HG: diff -r 1205ed810051 a
1029 HG: diff -r 1205ed810051 a
1030 HG: --- a/a Thu Jan 01 00:00:00 1970 +0000
1030 HG: --- a/a Thu Jan 01 00:00:00 1970 +0000
1031 HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1031 HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1032 HG: @@ -1,2 +0,0 @@
1032 HG: @@ -1,2 +0,0 @@
1033 HG: -a
1033 HG: -a
1034 HG: -a
1034 HG: -a
1035 HG: diff -r 1205ed810051 foo
1035 HG: diff -r 1205ed810051 foo
1036 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1036 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1037 HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000
1037 HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000
1038 HG: @@ -0,0 +1,1 @@
1038 HG: @@ -0,0 +1,1 @@
1039 HG: +foo
1039 HG: +foo
1040 HG: diff -r 1205ed810051 x
1040 HG: diff -r 1205ed810051 x
1041 HG: --- a/x Thu Jan 01 00:00:00 1970 +0000
1041 HG: --- a/x Thu Jan 01 00:00:00 1970 +0000
1042 HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1042 HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1043 HG: @@ -1,1 +0,0 @@
1043 HG: @@ -1,1 +0,0 @@
1044 HG: -x
1044 HG: -x
1045 HG: diff -r 1205ed810051 y
1045 HG: diff -r 1205ed810051 y
1046 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1046 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1047 HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000
1047 HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000
1048 HG: @@ -0,0 +1,1 @@
1048 HG: @@ -0,0 +1,1 @@
1049 HG: +y
1049 HG: +y
1050
1050
1051 Check for issue4405
1051 Check for issue4405
1052 -------------------
1052 -------------------
1053
1053
1054 Setup the repo with a file that gets moved in a second commit.
1054 Setup the repo with a file that gets moved in a second commit.
1055 $ hg init repo
1055 $ hg init repo
1056 $ cd repo
1056 $ cd repo
1057 $ touch a0
1057 $ touch a0
1058 $ hg add a0
1058 $ hg add a0
1059 $ hg commit -m a0
1059 $ hg commit -m a0
1060 $ hg mv a0 a1
1060 $ hg mv a0 a1
1061 $ hg commit -m a1
1061 $ hg commit -m a1
1062 $ hg up -q 0
1062 $ hg up -q 0
1063 $ hg log -G --template '{rev} {desc}'
1063 $ hg log -G --template '{rev} {desc}'
1064 o 1 a1
1064 o 1 a1
1065 |
1065 |
1066 @ 0 a0
1066 @ 0 a0
1067
1067
1068
1068
1069 Now we branch the repro, but re-use the file contents, so we have a divergence
1069 Now we branch the repro, but re-use the file contents, so we have a divergence
1070 in the file revlog topology and the changelog topology.
1070 in the file revlog topology and the changelog topology.
1071 $ hg revert --rev 1 --all
1071 $ hg revert --rev 1 --all
1072 removing a0
1072 removing a0
1073 adding a1
1073 adding a1
1074 $ hg ci -qm 'a1-amend'
1074 $ hg ci -qm 'a1-amend'
1075 $ hg log -G --template '{rev} {desc}'
1075 $ hg log -G --template '{rev} {desc}'
1076 @ 2 a1-amend
1076 @ 2 a1-amend
1077 |
1077 |
1078 | o 1 a1
1078 | o 1 a1
1079 |/
1079 |/
1080 o 0 a0
1080 o 0 a0
1081
1081
1082
1082
1083 The way mercurial does amends is by folding the working copy and old commit
1083 The way mercurial does amends is by folding the working copy and old commit
1084 together into another commit (rev 3). During this process, _findlimit is called
1084 together into another commit (rev 3). During this process, _findlimit is called
1085 to check how far back to look for the transitive closure of file copy
1085 to check how far back to look for the transitive closure of file copy
1086 information, but due to the divergence of the filelog and changelog graph
1086 information, but due to the divergence of the filelog and changelog graph
1087 topologies, before _findlimit was fixed, it returned a rev which was not far
1087 topologies, before _findlimit was fixed, it returned a rev which was not far
1088 enough back in this case.
1088 enough back in this case.
1089 $ hg mv a1 a2
1089 $ hg mv a1 a2
1090 $ hg status --copies --rev 0
1090 $ hg status --copies --rev 0
1091 A a2
1091 A a2
1092 a0
1092 a0
1093 R a0
1093 R a0
1094 $ hg ci --amend -q
1094 $ hg ci --amend -q
1095 $ hg log -G --template '{rev} {desc}'
1095 $ hg log -G --template '{rev} {desc}'
1096 @ 3 a1-amend
1096 @ 3 a1-amend
1097 |
1097 |
1098 | o 1 a1
1098 | o 1 a1
1099 |/
1099 |/
1100 o 0 a0
1100 o 0 a0
1101
1101
1102
1102
1103 Before the fix, the copy information was lost.
1103 Before the fix, the copy information was lost.
1104 $ hg status --copies --rev 0
1104 $ hg status --copies --rev 0
1105 A a2
1105 A a2
1106 a0
1106 a0
1107 R a0
1107 R a0
1108 $ cd ..
1108 $ cd ..
1109
1109
1110 Check that amend properly preserve rename from directory rename (issue-4516)
1110 Check that amend properly preserve rename from directory rename (issue-4516)
1111
1111
1112 If a parent of the merge renames a full directory, any files added to the old
1112 If a parent of the merge renames a full directory, any files added to the old
1113 directory in the other parent will be renamed to the new directory. For some
1113 directory in the other parent will be renamed to the new directory. For some
1114 reason, the rename metadata was when amending such merge. This test ensure we
1114 reason, the rename metadata was when amending such merge. This test ensure we
1115 do not regress. We have a dedicated repo because it needs a setup with renamed
1115 do not regress. We have a dedicated repo because it needs a setup with renamed
1116 directory)
1116 directory)
1117
1117
1118 $ hg init issue4516
1118 $ hg init issue4516
1119 $ cd issue4516
1119 $ cd issue4516
1120 $ mkdir olddirname
1120 $ mkdir olddirname
1121 $ echo line1 > olddirname/commonfile.py
1121 $ echo line1 > olddirname/commonfile.py
1122 $ hg add olddirname/commonfile.py
1122 $ hg add olddirname/commonfile.py
1123 $ hg ci -m first
1123 $ hg ci -m first
1124
1124
1125 $ hg branch newdirname
1125 $ hg branch newdirname
1126 marked working directory as branch newdirname
1126 marked working directory as branch newdirname
1127 (branches are permanent and global, did you want a bookmark?)
1127 (branches are permanent and global, did you want a bookmark?)
1128 $ hg mv olddirname newdirname
1128 $ hg mv olddirname newdirname
1129 moving olddirname/commonfile.py to newdirname/commonfile.py
1129 moving olddirname/commonfile.py to newdirname/commonfile.py
1130 $ hg ci -m rename
1130 $ hg ci -m rename
1131
1131
1132 $ hg update default
1132 $ hg update default
1133 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1133 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1134 $ echo line1 > olddirname/newfile.py
1134 $ echo line1 > olddirname/newfile.py
1135 $ hg add olddirname/newfile.py
1135 $ hg add olddirname/newfile.py
1136 $ hg ci -m log
1136 $ hg ci -m log
1137
1137
1138 $ hg up newdirname
1138 $ hg up newdirname
1139 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
1139 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
1140 $ # create newdirname/newfile.py
1140 $ # create newdirname/newfile.py
1141 $ hg merge default
1141 $ hg merge default
1142 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1142 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1143 (branch merge, don't forget to commit)
1143 (branch merge, don't forget to commit)
1144 $ hg ci -m add
1144 $ hg ci -m add
1145 $
1145 $
1146 $ hg debugrename newdirname/newfile.py
1146 $ hg debugrename newdirname/newfile.py
1147 newdirname/newfile.py renamed from olddirname/newfile.py:690b295714aed510803d3020da9c70fca8336def
1147 newdirname/newfile.py renamed from olddirname/newfile.py:690b295714aed510803d3020da9c70fca8336def
1148 $ hg status -C --change .
1148 $ hg status -C --change .
1149 A newdirname/newfile.py
1149 A newdirname/newfile.py
1150 $ hg status -C --rev 1
1150 $ hg status -C --rev 1
1151 A newdirname/newfile.py
1151 A newdirname/newfile.py
1152 $ hg status -C --rev 2
1152 $ hg status -C --rev 2
1153 A newdirname/commonfile.py
1153 A newdirname/commonfile.py
1154 olddirname/commonfile.py
1154 olddirname/commonfile.py
1155 A newdirname/newfile.py
1155 A newdirname/newfile.py
1156 olddirname/newfile.py
1156 olddirname/newfile.py
1157 R olddirname/commonfile.py
1157 R olddirname/commonfile.py
1158 R olddirname/newfile.py
1158 R olddirname/newfile.py
1159 $ hg debugindex newdirname/newfile.py
1159 $ hg debugindex newdirname/newfile.py
1160 rev linkrev nodeid p1 p2
1160 rev linkrev nodeid p1 p2
1161 0 3 34a4d536c0c0 000000000000 000000000000
1161 0 3 34a4d536c0c0 000000000000 000000000000
1162
1162
1163 $ echo a >> newdirname/commonfile.py
1163 $ echo a >> newdirname/commonfile.py
1164 $ hg ci --amend -m bug
1164 $ hg ci --amend -m bug
1165 $ hg debugrename newdirname/newfile.py
1165 $ hg debugrename newdirname/newfile.py
1166 newdirname/newfile.py renamed from olddirname/newfile.py:690b295714aed510803d3020da9c70fca8336def
1166 newdirname/newfile.py renamed from olddirname/newfile.py:690b295714aed510803d3020da9c70fca8336def
1167 $ hg debugindex newdirname/newfile.py
1167 $ hg debugindex newdirname/newfile.py
1168 rev linkrev nodeid p1 p2
1168 rev linkrev nodeid p1 p2
1169 0 3 34a4d536c0c0 000000000000 000000000000
1169 0 3 34a4d536c0c0 000000000000 000000000000
1170
1170
1171 #if execbit
1171 #if execbit
1172
1172
1173 Test if amend preserves executable bit changes
1173 Test if amend preserves executable bit changes
1174 $ chmod +x newdirname/commonfile.py
1174 $ chmod +x newdirname/commonfile.py
1175 $ hg ci -m chmod
1175 $ hg ci -m chmod
1176 $ hg ci --amend -m "chmod amended"
1176 $ hg ci --amend -m "chmod amended"
1177 $ hg ci --amend -m "chmod amended second time"
1177 $ hg ci --amend -m "chmod amended second time"
1178 $ hg log -p --git -r .
1178 $ hg log -p --git -r .
1179 changeset: 7:b1326f52dddf
1179 changeset: 7:b1326f52dddf
1180 branch: newdirname
1180 branch: newdirname
1181 tag: tip
1181 tag: tip
1182 parent: 4:7fd235f7cb2f
1182 parent: 4:7fd235f7cb2f
1183 user: test
1183 user: test
1184 date: Thu Jan 01 00:00:00 1970 +0000
1184 date: Thu Jan 01 00:00:00 1970 +0000
1185 summary: chmod amended second time
1185 summary: chmod amended second time
1186
1186
1187 diff --git a/newdirname/commonfile.py b/newdirname/commonfile.py
1187 diff --git a/newdirname/commonfile.py b/newdirname/commonfile.py
1188 old mode 100644
1188 old mode 100644
1189 new mode 100755
1189 new mode 100755
1190
1190
1191 #endif
1191 #endif
1192
1192
1193 Test amend with file inclusion options
1193 Test amend with file inclusion options
1194 --------------------------------------
1194 --------------------------------------
1195
1195
1196 These tests ensure that we are always amending some files that were part of the
1196 These tests ensure that we are always amending some files that were part of the
1197 pre-amend commit. We want to test that the remaining files in the pre-amend
1197 pre-amend commit. We want to test that the remaining files in the pre-amend
1198 commit were not changed in the amended commit. We do so by performing a diff of
1198 commit were not changed in the amended commit. We do so by performing a diff of
1199 the amended commit against its parent commit.
1199 the amended commit against its parent commit.
1200 $ cd ..
1200 $ cd ..
1201 $ hg init testfileinclusions
1201 $ hg init testfileinclusions
1202 $ cd testfileinclusions
1202 $ cd testfileinclusions
1203 $ echo a > a
1203 $ echo a > a
1204 $ echo b > b
1204 $ echo b > b
1205 $ hg commit -Aqm "Adding a and b"
1205 $ hg commit -Aqm "Adding a and b"
1206
1206
1207 Only add changes to a particular file
1207 Only add changes to a particular file
1208 $ echo a >> a
1208 $ echo a >> a
1209 $ echo b >> b
1209 $ echo b >> b
1210 $ hg commit --amend -I a
1210 $ hg commit --amend -I a
1211 $ hg diff --git -r null -r .
1211 $ hg diff --git -r null -r .
1212 diff --git a/a b/a
1212 diff --git a/a b/a
1213 new file mode 100644
1213 new file mode 100644
1214 --- /dev/null
1214 --- /dev/null
1215 +++ b/a
1215 +++ b/a
1216 @@ -0,0 +1,2 @@
1216 @@ -0,0 +1,2 @@
1217 +a
1217 +a
1218 +a
1218 +a
1219 diff --git a/b b/b
1219 diff --git a/b b/b
1220 new file mode 100644
1220 new file mode 100644
1221 --- /dev/null
1221 --- /dev/null
1222 +++ b/b
1222 +++ b/b
1223 @@ -0,0 +1,1 @@
1223 @@ -0,0 +1,1 @@
1224 +b
1224 +b
1225
1225
1226 $ echo a >> a
1226 $ echo a >> a
1227 $ hg commit --amend b
1227 $ hg commit --amend b
1228 $ hg diff --git -r null -r .
1228 $ hg diff --git -r null -r .
1229 diff --git a/a b/a
1229 diff --git a/a b/a
1230 new file mode 100644
1230 new file mode 100644
1231 --- /dev/null
1231 --- /dev/null
1232 +++ b/a
1232 +++ b/a
1233 @@ -0,0 +1,2 @@
1233 @@ -0,0 +1,2 @@
1234 +a
1234 +a
1235 +a
1235 +a
1236 diff --git a/b b/b
1236 diff --git a/b b/b
1237 new file mode 100644
1237 new file mode 100644
1238 --- /dev/null
1238 --- /dev/null
1239 +++ b/b
1239 +++ b/b
1240 @@ -0,0 +1,2 @@
1240 @@ -0,0 +1,2 @@
1241 +b
1241 +b
1242 +b
1242 +b
1243
1243
1244 Exclude changes to a particular file
1244 Exclude changes to a particular file
1245 $ echo b >> b
1245 $ echo b >> b
1246 $ hg commit --amend -X a
1246 $ hg commit --amend -X a
1247 $ hg diff --git -r null -r .
1247 $ hg diff --git -r null -r .
1248 diff --git a/a b/a
1248 diff --git a/a b/a
1249 new file mode 100644
1249 new file mode 100644
1250 --- /dev/null
1250 --- /dev/null
1251 +++ b/a
1251 +++ b/a
1252 @@ -0,0 +1,2 @@
1252 @@ -0,0 +1,2 @@
1253 +a
1253 +a
1254 +a
1254 +a
1255 diff --git a/b b/b
1255 diff --git a/b b/b
1256 new file mode 100644
1256 new file mode 100644
1257 --- /dev/null
1257 --- /dev/null
1258 +++ b/b
1258 +++ b/b
1259 @@ -0,0 +1,3 @@
1259 @@ -0,0 +1,3 @@
1260 +b
1260 +b
1261 +b
1261 +b
1262 +b
1262 +b
1263
1263
1264 Check the addremove flag
1264 Check the addremove flag
1265 $ echo c > c
1265 $ echo c > c
1266 $ rm a
1266 $ rm a
1267 $ hg commit --amend -A
1267 $ hg commit --amend -A
1268 removing a
1268 removing a
1269 adding c
1269 adding c
1270 $ hg diff --git -r null -r .
1270 $ hg diff --git -r null -r .
1271 diff --git a/b b/b
1271 diff --git a/b b/b
1272 new file mode 100644
1272 new file mode 100644
1273 --- /dev/null
1273 --- /dev/null
1274 +++ b/b
1274 +++ b/b
1275 @@ -0,0 +1,3 @@
1275 @@ -0,0 +1,3 @@
1276 +b
1276 +b
1277 +b
1277 +b
1278 +b
1278 +b
1279 diff --git a/c b/c
1279 diff --git a/c b/c
1280 new file mode 100644
1280 new file mode 100644
1281 --- /dev/null
1281 --- /dev/null
1282 +++ b/c
1282 +++ b/c
1283 @@ -0,0 +1,1 @@
1283 @@ -0,0 +1,1 @@
1284 +c
1284 +c
@@ -1,172 +1,172 b''
1 Test for the full copytracing algorithm
1 Test for the full copytracing algorithm
2 =======================================
2 =======================================
3
3
4 $ hg init t
4 $ hg init t
5 $ cd t
5 $ cd t
6
6
7 $ echo 1 > a
7 $ echo 1 > a
8 $ hg ci -qAm "first"
8 $ hg ci -qAm "first"
9
9
10 $ hg cp a b
10 $ hg cp a b
11 $ hg mv a c
11 $ hg mv a c
12 $ echo 2 >> b
12 $ echo 2 >> b
13 $ echo 2 >> c
13 $ echo 2 >> c
14
14
15 $ hg ci -qAm "second"
15 $ hg ci -qAm "second"
16
16
17 $ hg co -C 0
17 $ hg co -C 0
18 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
18 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
19
19
20 $ echo 0 > a
20 $ echo 0 > a
21 $ echo 1 >> a
21 $ echo 1 >> a
22
22
23 $ hg ci -qAm "other"
23 $ hg ci -qAm "other"
24
24
25 $ hg merge --debug
25 $ hg merge --debug
26 searching for copies back to rev 1
26 searching for copies back to rev 1
27 unmatched files in other:
27 unmatched files in other:
28 b
28 b
29 c
29 c
30 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
30 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
31 src: 'a' -> dst: 'b' *
31 src: 'a' -> dst: 'b' *
32 src: 'a' -> dst: 'c' *
32 src: 'a' -> dst: 'c' *
33 checking for directory renames
33 checking for directory renames
34 resolving manifests
34 resolving manifests
35 branchmerge: True, force: False, partial: False
35 branchmerge: True, force: False, partial: False
36 ancestor: b8bf91eeebbc, local: add3f11052fa+, remote: 17c05bb7fcb6
36 ancestor: b8bf91eeebbc, local: add3f11052fa+, remote: 17c05bb7fcb6
37 preserving a for resolve of b
37 preserving a for resolve of b
38 preserving a for resolve of c
38 preserving a for resolve of c
39 removing a
39 removing a
40 starting 4 threads for background file closing (?)
40 starting 4 threads for background file closing (?)
41 b: remote moved from a -> m (premerge)
41 b: remote moved from a -> m (premerge)
42 picked tool ':merge' for b (binary False symlink False changedelete False)
42 picked tool ':merge' for b (binary False symlink False changedelete False)
43 merging a and b to b
43 merging a and b to b
44 my b@add3f11052fa+ other b@17c05bb7fcb6 ancestor a@b8bf91eeebbc
44 my b@add3f11052fa+ other b@17c05bb7fcb6 ancestor a@b8bf91eeebbc
45 premerge successful
45 premerge successful
46 c: remote moved from a -> m (premerge)
46 c: remote moved from a -> m (premerge)
47 picked tool ':merge' for c (binary False symlink False changedelete False)
47 picked tool ':merge' for c (binary False symlink False changedelete False)
48 merging a and c to c
48 merging a and c to c
49 my c@add3f11052fa+ other c@17c05bb7fcb6 ancestor a@b8bf91eeebbc
49 my c@add3f11052fa+ other c@17c05bb7fcb6 ancestor a@b8bf91eeebbc
50 premerge successful
50 premerge successful
51 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
51 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
52 (branch merge, don't forget to commit)
52 (branch merge, don't forget to commit)
53
53
54 file b
54 file b
55 $ cat b
55 $ cat b
56 0
56 0
57 1
57 1
58 2
58 2
59
59
60 file c
60 file c
61 $ cat c
61 $ cat c
62 0
62 0
63 1
63 1
64 2
64 2
65
65
66 Test disabling copy tracing
66 Test disabling copy tracing
67
67
68 - first verify copy metadata was kept
68 - first verify copy metadata was kept
69
69
70 $ hg up -qC 2
70 $ hg up -qC 2
71 $ hg rebase --keep -d 1 -b 2 --config extensions.rebase=
71 $ hg rebase --keep -d 1 -b 2 --config extensions.rebase=
72 rebasing 2:add3f11052fa "other" (tip)
72 rebasing 2:add3f11052fa "other" (tip)
73 merging b and a to b
73 merging b and a to b
74 merging c and a to c
74 merging c and a to c
75
75
76 $ cat b
76 $ cat b
77 0
77 0
78 1
78 1
79 2
79 2
80
80
81 - next verify copy metadata is lost when disabled
81 - next verify copy metadata is lost when disabled
82
82
83 $ hg strip -r . --config extensions.strip=
83 $ hg strip -r . --config extensions.strip=
84 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
84 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
85 saved backup bundle to $TESTTMP/t/.hg/strip-backup/550bd84c0cd3-fc575957-backup.hg
85 saved backup bundle to $TESTTMP/t/.hg/strip-backup/550bd84c0cd3-fc575957-backup.hg
86 $ hg up -qC 2
86 $ hg up -qC 2
87 $ hg rebase --keep -d 1 -b 2 --config extensions.rebase= --config experimental.copytrace=off --config ui.interactive=True << EOF
87 $ hg rebase --keep -d 1 -b 2 --config extensions.rebase= --config experimental.copytrace=off --config ui.interactive=True << EOF
88 > c
88 > c
89 > EOF
89 > EOF
90 rebasing 2:add3f11052fa "other" (tip)
90 rebasing 2:add3f11052fa "other" (tip)
91 file 'a' was deleted in other [source] but was modified in local [dest].
91 file 'a' was deleted in local [dest] but was modified in other [source].
92 What do you want to do?
92 What do you want to do?
93 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? c
93 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? c
94
94
95 $ cat b
95 $ cat b
96 1
96 1
97 2
97 2
98
98
99 $ cd ..
99 $ cd ..
100
100
101 Verify disabling copy tracing still keeps copies from rebase source
101 Verify disabling copy tracing still keeps copies from rebase source
102
102
103 $ hg init copydisable
103 $ hg init copydisable
104 $ cd copydisable
104 $ cd copydisable
105 $ touch a
105 $ touch a
106 $ hg ci -Aqm 'add a'
106 $ hg ci -Aqm 'add a'
107 $ touch b
107 $ touch b
108 $ hg ci -Aqm 'add b, c'
108 $ hg ci -Aqm 'add b, c'
109 $ hg cp b x
109 $ hg cp b x
110 $ echo x >> x
110 $ echo x >> x
111 $ hg ci -qm 'copy b->x'
111 $ hg ci -qm 'copy b->x'
112 $ hg up -q 1
112 $ hg up -q 1
113 $ touch z
113 $ touch z
114 $ hg ci -Aqm 'add z'
114 $ hg ci -Aqm 'add z'
115 $ hg log -G -T '{rev} {desc}\n'
115 $ hg log -G -T '{rev} {desc}\n'
116 @ 3 add z
116 @ 3 add z
117 |
117 |
118 | o 2 copy b->x
118 | o 2 copy b->x
119 |/
119 |/
120 o 1 add b, c
120 o 1 add b, c
121 |
121 |
122 o 0 add a
122 o 0 add a
123
123
124 $ hg rebase -d . -b 2 --config extensions.rebase= --config experimental.copytrace=off
124 $ hg rebase -d . -b 2 --config extensions.rebase= --config experimental.copytrace=off
125 rebasing 2:6adcf8c12e7d "copy b->x"
125 rebasing 2:6adcf8c12e7d "copy b->x"
126 saved backup bundle to $TESTTMP/copydisable/.hg/strip-backup/6adcf8c12e7d-ce4b3e75-rebase.hg
126 saved backup bundle to $TESTTMP/copydisable/.hg/strip-backup/6adcf8c12e7d-ce4b3e75-rebase.hg
127 $ hg up -q 3
127 $ hg up -q 3
128 $ hg log -f x -T '{rev} {desc}\n'
128 $ hg log -f x -T '{rev} {desc}\n'
129 3 copy b->x
129 3 copy b->x
130 1 add b, c
130 1 add b, c
131
131
132 $ cd ../
132 $ cd ../
133
133
134 Verify we duplicate existing copies, instead of detecting them
134 Verify we duplicate existing copies, instead of detecting them
135
135
136 $ hg init copydisable3
136 $ hg init copydisable3
137 $ cd copydisable3
137 $ cd copydisable3
138 $ touch a
138 $ touch a
139 $ hg ci -Aqm 'add a'
139 $ hg ci -Aqm 'add a'
140 $ hg cp a b
140 $ hg cp a b
141 $ hg ci -Aqm 'copy a->b'
141 $ hg ci -Aqm 'copy a->b'
142 $ hg mv b c
142 $ hg mv b c
143 $ hg ci -Aqm 'move b->c'
143 $ hg ci -Aqm 'move b->c'
144 $ hg up -q 0
144 $ hg up -q 0
145 $ hg cp a b
145 $ hg cp a b
146 $ echo b >> b
146 $ echo b >> b
147 $ hg ci -Aqm 'copy a->b (2)'
147 $ hg ci -Aqm 'copy a->b (2)'
148 $ hg log -G -T '{rev} {desc}\n'
148 $ hg log -G -T '{rev} {desc}\n'
149 @ 3 copy a->b (2)
149 @ 3 copy a->b (2)
150 |
150 |
151 | o 2 move b->c
151 | o 2 move b->c
152 | |
152 | |
153 | o 1 copy a->b
153 | o 1 copy a->b
154 |/
154 |/
155 o 0 add a
155 o 0 add a
156
156
157 $ hg rebase -d 2 -s 3 --config extensions.rebase= --config experimental.copytrace=off
157 $ hg rebase -d 2 -s 3 --config extensions.rebase= --config experimental.copytrace=off
158 rebasing 3:47e1a9e6273b "copy a->b (2)" (tip)
158 rebasing 3:47e1a9e6273b "copy a->b (2)" (tip)
159 saved backup bundle to $TESTTMP/copydisable3/.hg/strip-backup/47e1a9e6273b-2d099c59-rebase.hg
159 saved backup bundle to $TESTTMP/copydisable3/.hg/strip-backup/47e1a9e6273b-2d099c59-rebase.hg
160
160
161 $ hg log -G -f b
161 $ hg log -G -f b
162 @ changeset: 3:76024fb4b05b
162 @ changeset: 3:76024fb4b05b
163 : tag: tip
163 : tag: tip
164 : user: test
164 : user: test
165 : date: Thu Jan 01 00:00:00 1970 +0000
165 : date: Thu Jan 01 00:00:00 1970 +0000
166 : summary: copy a->b (2)
166 : summary: copy a->b (2)
167 :
167 :
168 o changeset: 0:ac82d8b1f7c4
168 o changeset: 0:ac82d8b1f7c4
169 user: test
169 user: test
170 date: Thu Jan 01 00:00:00 1970 +0000
170 date: Thu Jan 01 00:00:00 1970 +0000
171 summary: add a
171 summary: add a
172
172
@@ -1,718 +1,718 b''
1 Test for the heuristic copytracing algorithm
1 Test for the heuristic copytracing algorithm
2 ============================================
2 ============================================
3
3
4 $ cat >> $TESTTMP/copytrace.sh << '__EOF__'
4 $ cat >> $TESTTMP/copytrace.sh << '__EOF__'
5 > initclient() {
5 > initclient() {
6 > cat >> $1/.hg/hgrc <<EOF
6 > cat >> $1/.hg/hgrc <<EOF
7 > [experimental]
7 > [experimental]
8 > copytrace = heuristics
8 > copytrace = heuristics
9 > copytrace.sourcecommitlimit = -1
9 > copytrace.sourcecommitlimit = -1
10 > EOF
10 > EOF
11 > }
11 > }
12 > __EOF__
12 > __EOF__
13 $ . "$TESTTMP/copytrace.sh"
13 $ . "$TESTTMP/copytrace.sh"
14
14
15 $ cat >> $HGRCPATH << EOF
15 $ cat >> $HGRCPATH << EOF
16 > [extensions]
16 > [extensions]
17 > rebase=
17 > rebase=
18 > shelve=
18 > shelve=
19 > EOF
19 > EOF
20
20
21 NOTE: calling initclient() set copytrace.sourcecommitlimit=-1 as we want to
21 NOTE: calling initclient() set copytrace.sourcecommitlimit=-1 as we want to
22 prevent the full copytrace algorithm to run and test the heuristic algorithm
22 prevent the full copytrace algorithm to run and test the heuristic algorithm
23 without complexing the test cases with public and draft commits.
23 without complexing the test cases with public and draft commits.
24
24
25 Check filename heuristics (same dirname and same basename)
25 Check filename heuristics (same dirname and same basename)
26 ----------------------------------------------------------
26 ----------------------------------------------------------
27
27
28 $ hg init repo
28 $ hg init repo
29 $ initclient repo
29 $ initclient repo
30 $ cd repo
30 $ cd repo
31 $ echo a > a
31 $ echo a > a
32 $ mkdir dir
32 $ mkdir dir
33 $ echo a > dir/file.txt
33 $ echo a > dir/file.txt
34 $ hg addremove
34 $ hg addremove
35 adding a
35 adding a
36 adding dir/file.txt
36 adding dir/file.txt
37 $ hg ci -m initial
37 $ hg ci -m initial
38 $ hg mv a b
38 $ hg mv a b
39 $ hg mv -q dir dir2
39 $ hg mv -q dir dir2
40 $ hg ci -m 'mv a b, mv dir/ dir2/'
40 $ hg ci -m 'mv a b, mv dir/ dir2/'
41 $ hg up -q 0
41 $ hg up -q 0
42 $ echo b > a
42 $ echo b > a
43 $ echo b > dir/file.txt
43 $ echo b > dir/file.txt
44 $ hg ci -qm 'mod a, mod dir/file.txt'
44 $ hg ci -qm 'mod a, mod dir/file.txt'
45
45
46 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
46 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
47 @ changeset: 557f403c0afd2a3cf15d7e2fb1f1001a8b85e081
47 @ changeset: 557f403c0afd2a3cf15d7e2fb1f1001a8b85e081
48 | desc: mod a, mod dir/file.txt
48 | desc: mod a, mod dir/file.txt
49 | o changeset: 928d74bc9110681920854d845c06959f6dfc9547
49 | o changeset: 928d74bc9110681920854d845c06959f6dfc9547
50 |/ desc: mv a b, mv dir/ dir2/
50 |/ desc: mv a b, mv dir/ dir2/
51 o changeset: 3c482b16e54596fed340d05ffaf155f156cda7ee
51 o changeset: 3c482b16e54596fed340d05ffaf155f156cda7ee
52 desc: initial
52 desc: initial
53
53
54 $ hg rebase -s . -d 1
54 $ hg rebase -s . -d 1
55 rebasing 2:557f403c0afd "mod a, mod dir/file.txt" (tip)
55 rebasing 2:557f403c0afd "mod a, mod dir/file.txt" (tip)
56 merging b and a to b
56 merging b and a to b
57 merging dir2/file.txt and dir/file.txt to dir2/file.txt
57 merging dir2/file.txt and dir/file.txt to dir2/file.txt
58 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/557f403c0afd-9926eeff-rebase.hg
58 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/557f403c0afd-9926eeff-rebase.hg
59 $ cd ..
59 $ cd ..
60 $ rm -rf repo
60 $ rm -rf repo
61
61
62 Make sure filename heuristics do not when they are not related
62 Make sure filename heuristics do not when they are not related
63 --------------------------------------------------------------
63 --------------------------------------------------------------
64
64
65 $ hg init repo
65 $ hg init repo
66 $ initclient repo
66 $ initclient repo
67 $ cd repo
67 $ cd repo
68 $ echo 'somecontent' > a
68 $ echo 'somecontent' > a
69 $ hg add a
69 $ hg add a
70 $ hg ci -m initial
70 $ hg ci -m initial
71 $ hg rm a
71 $ hg rm a
72 $ echo 'completelydifferentcontext' > b
72 $ echo 'completelydifferentcontext' > b
73 $ hg add b
73 $ hg add b
74 $ hg ci -m 'rm a, add b'
74 $ hg ci -m 'rm a, add b'
75 $ hg up -q 0
75 $ hg up -q 0
76 $ printf 'somecontent\nmoarcontent' > a
76 $ printf 'somecontent\nmoarcontent' > a
77 $ hg ci -qm 'mode a'
77 $ hg ci -qm 'mode a'
78
78
79 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
79 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
80 @ changeset: d526312210b9e8f795d576a77dc643796384d86e
80 @ changeset: d526312210b9e8f795d576a77dc643796384d86e
81 | desc: mode a
81 | desc: mode a
82 | o changeset: 46985f76c7e5e5123433527f5c8526806145650b
82 | o changeset: 46985f76c7e5e5123433527f5c8526806145650b
83 |/ desc: rm a, add b
83 |/ desc: rm a, add b
84 o changeset: e5b71fb099c29d9172ef4a23485aaffd497e4cc0
84 o changeset: e5b71fb099c29d9172ef4a23485aaffd497e4cc0
85 desc: initial
85 desc: initial
86
86
87 $ hg rebase -s . -d 1
87 $ hg rebase -s . -d 1
88 rebasing 2:d526312210b9 "mode a" (tip)
88 rebasing 2:d526312210b9 "mode a" (tip)
89 file 'a' was deleted in other [source] but was modified in local [dest].
89 file 'a' was deleted in local [dest] but was modified in other [source].
90 What do you want to do?
90 What do you want to do?
91 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
91 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
92 unresolved conflicts (see hg resolve, then hg rebase --continue)
92 unresolved conflicts (see hg resolve, then hg rebase --continue)
93 [1]
93 [1]
94
94
95 $ cd ..
95 $ cd ..
96 $ rm -rf repo
96 $ rm -rf repo
97
97
98 Test when lca didn't modified the file that was moved
98 Test when lca didn't modified the file that was moved
99 -----------------------------------------------------
99 -----------------------------------------------------
100
100
101 $ hg init repo
101 $ hg init repo
102 $ initclient repo
102 $ initclient repo
103 $ cd repo
103 $ cd repo
104 $ echo 'somecontent' > a
104 $ echo 'somecontent' > a
105 $ hg add a
105 $ hg add a
106 $ hg ci -m initial
106 $ hg ci -m initial
107 $ echo c > c
107 $ echo c > c
108 $ hg add c
108 $ hg add c
109 $ hg ci -m randomcommit
109 $ hg ci -m randomcommit
110 $ hg mv a b
110 $ hg mv a b
111 $ hg ci -m 'mv a b'
111 $ hg ci -m 'mv a b'
112 $ hg up -q 1
112 $ hg up -q 1
113 $ echo b > a
113 $ echo b > a
114 $ hg ci -qm 'mod a'
114 $ hg ci -qm 'mod a'
115
115
116 $ hg log -G -T 'changeset: {node}\n desc: {desc}, phase: {phase}\n'
116 $ hg log -G -T 'changeset: {node}\n desc: {desc}, phase: {phase}\n'
117 @ changeset: 9d5cf99c3d9f8e8b05ba55421f7f56530cfcf3bc
117 @ changeset: 9d5cf99c3d9f8e8b05ba55421f7f56530cfcf3bc
118 | desc: mod a, phase: draft
118 | desc: mod a, phase: draft
119 | o changeset: d760186dd240fc47b91eb9f0b58b0002aaeef95d
119 | o changeset: d760186dd240fc47b91eb9f0b58b0002aaeef95d
120 |/ desc: mv a b, phase: draft
120 |/ desc: mv a b, phase: draft
121 o changeset: 48e1b6ba639d5d7fb313fa7989eebabf99c9eb83
121 o changeset: 48e1b6ba639d5d7fb313fa7989eebabf99c9eb83
122 | desc: randomcommit, phase: draft
122 | desc: randomcommit, phase: draft
123 o changeset: e5b71fb099c29d9172ef4a23485aaffd497e4cc0
123 o changeset: e5b71fb099c29d9172ef4a23485aaffd497e4cc0
124 desc: initial, phase: draft
124 desc: initial, phase: draft
125
125
126 $ hg rebase -s . -d 2
126 $ hg rebase -s . -d 2
127 rebasing 3:9d5cf99c3d9f "mod a" (tip)
127 rebasing 3:9d5cf99c3d9f "mod a" (tip)
128 merging b and a to b
128 merging b and a to b
129 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/9d5cf99c3d9f-f02358cc-rebase.hg
129 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/9d5cf99c3d9f-f02358cc-rebase.hg
130 $ cd ..
130 $ cd ..
131 $ rm -rf repo
131 $ rm -rf repo
132
132
133 Rebase "backwards"
133 Rebase "backwards"
134 ------------------
134 ------------------
135
135
136 $ hg init repo
136 $ hg init repo
137 $ initclient repo
137 $ initclient repo
138 $ cd repo
138 $ cd repo
139 $ echo 'somecontent' > a
139 $ echo 'somecontent' > a
140 $ hg add a
140 $ hg add a
141 $ hg ci -m initial
141 $ hg ci -m initial
142 $ echo c > c
142 $ echo c > c
143 $ hg add c
143 $ hg add c
144 $ hg ci -m randomcommit
144 $ hg ci -m randomcommit
145 $ hg mv a b
145 $ hg mv a b
146 $ hg ci -m 'mv a b'
146 $ hg ci -m 'mv a b'
147 $ hg up -q 2
147 $ hg up -q 2
148 $ echo b > b
148 $ echo b > b
149 $ hg ci -qm 'mod b'
149 $ hg ci -qm 'mod b'
150
150
151 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
151 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
152 @ changeset: fbe97126b3969056795c462a67d93faf13e4d298
152 @ changeset: fbe97126b3969056795c462a67d93faf13e4d298
153 | desc: mod b
153 | desc: mod b
154 o changeset: d760186dd240fc47b91eb9f0b58b0002aaeef95d
154 o changeset: d760186dd240fc47b91eb9f0b58b0002aaeef95d
155 | desc: mv a b
155 | desc: mv a b
156 o changeset: 48e1b6ba639d5d7fb313fa7989eebabf99c9eb83
156 o changeset: 48e1b6ba639d5d7fb313fa7989eebabf99c9eb83
157 | desc: randomcommit
157 | desc: randomcommit
158 o changeset: e5b71fb099c29d9172ef4a23485aaffd497e4cc0
158 o changeset: e5b71fb099c29d9172ef4a23485aaffd497e4cc0
159 desc: initial
159 desc: initial
160
160
161 $ hg rebase -s . -d 0
161 $ hg rebase -s . -d 0
162 rebasing 3:fbe97126b396 "mod b" (tip)
162 rebasing 3:fbe97126b396 "mod b" (tip)
163 merging a and b to a
163 merging a and b to a
164 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/fbe97126b396-cf5452a1-rebase.hg
164 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/fbe97126b396-cf5452a1-rebase.hg
165 $ cd ..
165 $ cd ..
166 $ rm -rf repo
166 $ rm -rf repo
167
167
168 Check a few potential move candidates
168 Check a few potential move candidates
169 -------------------------------------
169 -------------------------------------
170
170
171 $ hg init repo
171 $ hg init repo
172 $ initclient repo
172 $ initclient repo
173 $ cd repo
173 $ cd repo
174 $ mkdir dir
174 $ mkdir dir
175 $ echo a > dir/a
175 $ echo a > dir/a
176 $ hg add dir/a
176 $ hg add dir/a
177 $ hg ci -qm initial
177 $ hg ci -qm initial
178 $ hg mv dir/a dir/b
178 $ hg mv dir/a dir/b
179 $ hg ci -qm 'mv dir/a dir/b'
179 $ hg ci -qm 'mv dir/a dir/b'
180 $ mkdir dir2
180 $ mkdir dir2
181 $ echo b > dir2/a
181 $ echo b > dir2/a
182 $ hg add dir2/a
182 $ hg add dir2/a
183 $ hg ci -qm 'create dir2/a'
183 $ hg ci -qm 'create dir2/a'
184 $ hg up -q 0
184 $ hg up -q 0
185 $ echo b > dir/a
185 $ echo b > dir/a
186 $ hg ci -qm 'mod dir/a'
186 $ hg ci -qm 'mod dir/a'
187
187
188 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
188 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
189 @ changeset: 6b2f4cece40fd320f41229f23821256ffc08efea
189 @ changeset: 6b2f4cece40fd320f41229f23821256ffc08efea
190 | desc: mod dir/a
190 | desc: mod dir/a
191 | o changeset: 4494bf7efd2e0dfdd388e767fb913a8a3731e3fa
191 | o changeset: 4494bf7efd2e0dfdd388e767fb913a8a3731e3fa
192 | | desc: create dir2/a
192 | | desc: create dir2/a
193 | o changeset: b1784dfab6ea6bfafeb11c0ac50a2981b0fe6ade
193 | o changeset: b1784dfab6ea6bfafeb11c0ac50a2981b0fe6ade
194 |/ desc: mv dir/a dir/b
194 |/ desc: mv dir/a dir/b
195 o changeset: 36859b8907c513a3a87ae34ba5b1e7eea8c20944
195 o changeset: 36859b8907c513a3a87ae34ba5b1e7eea8c20944
196 desc: initial
196 desc: initial
197
197
198 $ hg rebase -s . -d 2
198 $ hg rebase -s . -d 2
199 rebasing 3:6b2f4cece40f "mod dir/a" (tip)
199 rebasing 3:6b2f4cece40f "mod dir/a" (tip)
200 merging dir/b and dir/a to dir/b
200 merging dir/b and dir/a to dir/b
201 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/6b2f4cece40f-503efe60-rebase.hg
201 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/6b2f4cece40f-503efe60-rebase.hg
202 $ cd ..
202 $ cd ..
203 $ rm -rf repo
203 $ rm -rf repo
204
204
205 Test the copytrace.movecandidateslimit with many move candidates
205 Test the copytrace.movecandidateslimit with many move candidates
206 ----------------------------------------------------------------
206 ----------------------------------------------------------------
207
207
208 $ hg init repo
208 $ hg init repo
209 $ initclient repo
209 $ initclient repo
210 $ cd repo
210 $ cd repo
211 $ echo a > a
211 $ echo a > a
212 $ hg add a
212 $ hg add a
213 $ hg ci -m initial
213 $ hg ci -m initial
214 $ hg mv a foo
214 $ hg mv a foo
215 $ echo a > b
215 $ echo a > b
216 $ echo a > c
216 $ echo a > c
217 $ echo a > d
217 $ echo a > d
218 $ echo a > e
218 $ echo a > e
219 $ echo a > f
219 $ echo a > f
220 $ echo a > g
220 $ echo a > g
221 $ hg add b
221 $ hg add b
222 $ hg add c
222 $ hg add c
223 $ hg add d
223 $ hg add d
224 $ hg add e
224 $ hg add e
225 $ hg add f
225 $ hg add f
226 $ hg add g
226 $ hg add g
227 $ hg ci -m 'mv a foo, add many files'
227 $ hg ci -m 'mv a foo, add many files'
228 $ hg up -q ".^"
228 $ hg up -q ".^"
229 $ echo b > a
229 $ echo b > a
230 $ hg ci -m 'mod a'
230 $ hg ci -m 'mod a'
231 created new head
231 created new head
232
232
233 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
233 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
234 @ changeset: ef716627c70bf4ca0bdb623cfb0d6fe5b9acc51e
234 @ changeset: ef716627c70bf4ca0bdb623cfb0d6fe5b9acc51e
235 | desc: mod a
235 | desc: mod a
236 | o changeset: 8329d5c6bf479ec5ca59b9864f3f45d07213f5a4
236 | o changeset: 8329d5c6bf479ec5ca59b9864f3f45d07213f5a4
237 |/ desc: mv a foo, add many files
237 |/ desc: mv a foo, add many files
238 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
238 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
239 desc: initial
239 desc: initial
240
240
241 With small limit
241 With small limit
242
242
243 $ hg rebase -s 2 -d 1 --config experimental.copytrace.movecandidateslimit=0
243 $ hg rebase -s 2 -d 1 --config experimental.copytrace.movecandidateslimit=0
244 rebasing 2:ef716627c70b "mod a" (tip)
244 rebasing 2:ef716627c70b "mod a" (tip)
245 skipping copytracing for 'a', more candidates than the limit: 7
245 skipping copytracing for 'a', more candidates than the limit: 7
246 file 'a' was deleted in other [source] but was modified in local [dest].
246 file 'a' was deleted in local [dest] but was modified in other [source].
247 What do you want to do?
247 What do you want to do?
248 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
248 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
249 unresolved conflicts (see hg resolve, then hg rebase --continue)
249 unresolved conflicts (see hg resolve, then hg rebase --continue)
250 [1]
250 [1]
251
251
252 $ hg rebase --abort
252 $ hg rebase --abort
253 rebase aborted
253 rebase aborted
254
254
255 With default limit which is 100
255 With default limit which is 100
256
256
257 $ hg rebase -s 2 -d 1
257 $ hg rebase -s 2 -d 1
258 rebasing 2:ef716627c70b "mod a" (tip)
258 rebasing 2:ef716627c70b "mod a" (tip)
259 merging foo and a to foo
259 merging foo and a to foo
260 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/ef716627c70b-24681561-rebase.hg
260 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/ef716627c70b-24681561-rebase.hg
261
261
262 $ cd ..
262 $ cd ..
263 $ rm -rf repo
263 $ rm -rf repo
264
264
265 Move file in one branch and delete it in another
265 Move file in one branch and delete it in another
266 -----------------------------------------------
266 -----------------------------------------------
267
267
268 $ hg init repo
268 $ hg init repo
269 $ initclient repo
269 $ initclient repo
270 $ cd repo
270 $ cd repo
271 $ echo a > a
271 $ echo a > a
272 $ hg add a
272 $ hg add a
273 $ hg ci -m initial
273 $ hg ci -m initial
274 $ hg mv a b
274 $ hg mv a b
275 $ hg ci -m 'mv a b'
275 $ hg ci -m 'mv a b'
276 $ hg up -q ".^"
276 $ hg up -q ".^"
277 $ hg rm a
277 $ hg rm a
278 $ hg ci -m 'del a'
278 $ hg ci -m 'del a'
279 created new head
279 created new head
280
280
281 $ hg log -G -T 'changeset: {node}\n desc: {desc}, phase: {phase}\n'
281 $ hg log -G -T 'changeset: {node}\n desc: {desc}, phase: {phase}\n'
282 @ changeset: 7d61ee3b1e48577891a072024968428ba465c47b
282 @ changeset: 7d61ee3b1e48577891a072024968428ba465c47b
283 | desc: del a, phase: draft
283 | desc: del a, phase: draft
284 | o changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
284 | o changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
285 |/ desc: mv a b, phase: draft
285 |/ desc: mv a b, phase: draft
286 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
286 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
287 desc: initial, phase: draft
287 desc: initial, phase: draft
288
288
289 $ hg rebase -s 1 -d 2
289 $ hg rebase -s 1 -d 2
290 rebasing 1:472e38d57782 "mv a b"
290 rebasing 1:472e38d57782 "mv a b"
291 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/472e38d57782-17d50e29-rebase.hg
291 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/472e38d57782-17d50e29-rebase.hg
292 $ hg up -q c492ed3c7e35dcd1dc938053b8adf56e2cfbd062
292 $ hg up -q c492ed3c7e35dcd1dc938053b8adf56e2cfbd062
293 $ ls
293 $ ls
294 b
294 b
295 $ cd ..
295 $ cd ..
296 $ rm -rf repo
296 $ rm -rf repo
297
297
298 Move a directory in draft branch
298 Move a directory in draft branch
299 --------------------------------
299 --------------------------------
300
300
301 $ hg init repo
301 $ hg init repo
302 $ initclient repo
302 $ initclient repo
303 $ cd repo
303 $ cd repo
304 $ mkdir dir
304 $ mkdir dir
305 $ echo a > dir/a
305 $ echo a > dir/a
306 $ hg add dir/a
306 $ hg add dir/a
307 $ hg ci -qm initial
307 $ hg ci -qm initial
308 $ echo b > dir/a
308 $ echo b > dir/a
309 $ hg ci -qm 'mod dir/a'
309 $ hg ci -qm 'mod dir/a'
310 $ hg up -q ".^"
310 $ hg up -q ".^"
311 $ hg mv -q dir/ dir2
311 $ hg mv -q dir/ dir2
312 $ hg ci -qm 'mv dir/ dir2/'
312 $ hg ci -qm 'mv dir/ dir2/'
313
313
314 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
314 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
315 @ changeset: a33d80b6e352591dfd82784e1ad6cdd86b25a239
315 @ changeset: a33d80b6e352591dfd82784e1ad6cdd86b25a239
316 | desc: mv dir/ dir2/
316 | desc: mv dir/ dir2/
317 | o changeset: 6b2f4cece40fd320f41229f23821256ffc08efea
317 | o changeset: 6b2f4cece40fd320f41229f23821256ffc08efea
318 |/ desc: mod dir/a
318 |/ desc: mod dir/a
319 o changeset: 36859b8907c513a3a87ae34ba5b1e7eea8c20944
319 o changeset: 36859b8907c513a3a87ae34ba5b1e7eea8c20944
320 desc: initial
320 desc: initial
321
321
322 $ hg rebase -s . -d 1
322 $ hg rebase -s . -d 1
323 rebasing 2:a33d80b6e352 "mv dir/ dir2/" (tip)
323 rebasing 2:a33d80b6e352 "mv dir/ dir2/" (tip)
324 merging dir/a and dir2/a to dir2/a
324 merging dir/a and dir2/a to dir2/a
325 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/a33d80b6e352-fecb9ada-rebase.hg
325 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/a33d80b6e352-fecb9ada-rebase.hg
326 $ cd ..
326 $ cd ..
327 $ rm -rf server
327 $ rm -rf server
328 $ rm -rf repo
328 $ rm -rf repo
329
329
330 Move file twice and rebase mod on top of moves
330 Move file twice and rebase mod on top of moves
331 ----------------------------------------------
331 ----------------------------------------------
332
332
333 $ hg init repo
333 $ hg init repo
334 $ initclient repo
334 $ initclient repo
335 $ cd repo
335 $ cd repo
336 $ echo a > a
336 $ echo a > a
337 $ hg add a
337 $ hg add a
338 $ hg ci -m initial
338 $ hg ci -m initial
339 $ hg mv a b
339 $ hg mv a b
340 $ hg ci -m 'mv a b'
340 $ hg ci -m 'mv a b'
341 $ hg mv b c
341 $ hg mv b c
342 $ hg ci -m 'mv b c'
342 $ hg ci -m 'mv b c'
343 $ hg up -q 0
343 $ hg up -q 0
344 $ echo c > a
344 $ echo c > a
345 $ hg ci -m 'mod a'
345 $ hg ci -m 'mod a'
346 created new head
346 created new head
347
347
348 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
348 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
349 @ changeset: d413169422167a3fa5275fc5d71f7dea9f5775f3
349 @ changeset: d413169422167a3fa5275fc5d71f7dea9f5775f3
350 | desc: mod a
350 | desc: mod a
351 | o changeset: d3efd280421d24f9f229997c19e654761c942a71
351 | o changeset: d3efd280421d24f9f229997c19e654761c942a71
352 | | desc: mv b c
352 | | desc: mv b c
353 | o changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
353 | o changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
354 |/ desc: mv a b
354 |/ desc: mv a b
355 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
355 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
356 desc: initial
356 desc: initial
357 $ hg rebase -s . -d 2
357 $ hg rebase -s . -d 2
358 rebasing 3:d41316942216 "mod a" (tip)
358 rebasing 3:d41316942216 "mod a" (tip)
359 merging c and a to c
359 merging c and a to c
360 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/d41316942216-2b5949bc-rebase.hg
360 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/d41316942216-2b5949bc-rebase.hg
361
361
362 $ cd ..
362 $ cd ..
363 $ rm -rf repo
363 $ rm -rf repo
364
364
365 Move file twice and rebase moves on top of mods
365 Move file twice and rebase moves on top of mods
366 -----------------------------------------------
366 -----------------------------------------------
367
367
368 $ hg init repo
368 $ hg init repo
369 $ initclient repo
369 $ initclient repo
370 $ cd repo
370 $ cd repo
371 $ echo a > a
371 $ echo a > a
372 $ hg add a
372 $ hg add a
373 $ hg ci -m initial
373 $ hg ci -m initial
374 $ hg mv a b
374 $ hg mv a b
375 $ hg ci -m 'mv a b'
375 $ hg ci -m 'mv a b'
376 $ hg mv b c
376 $ hg mv b c
377 $ hg ci -m 'mv b c'
377 $ hg ci -m 'mv b c'
378 $ hg up -q 0
378 $ hg up -q 0
379 $ echo c > a
379 $ echo c > a
380 $ hg ci -m 'mod a'
380 $ hg ci -m 'mod a'
381 created new head
381 created new head
382 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
382 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
383 @ changeset: d413169422167a3fa5275fc5d71f7dea9f5775f3
383 @ changeset: d413169422167a3fa5275fc5d71f7dea9f5775f3
384 | desc: mod a
384 | desc: mod a
385 | o changeset: d3efd280421d24f9f229997c19e654761c942a71
385 | o changeset: d3efd280421d24f9f229997c19e654761c942a71
386 | | desc: mv b c
386 | | desc: mv b c
387 | o changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
387 | o changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
388 |/ desc: mv a b
388 |/ desc: mv a b
389 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
389 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
390 desc: initial
390 desc: initial
391 $ hg rebase -s 1 -d .
391 $ hg rebase -s 1 -d .
392 rebasing 1:472e38d57782 "mv a b"
392 rebasing 1:472e38d57782 "mv a b"
393 merging a and b to b
393 merging a and b to b
394 rebasing 2:d3efd280421d "mv b c"
394 rebasing 2:d3efd280421d "mv b c"
395 merging b and c to c
395 merging b and c to c
396 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/472e38d57782-ab8d3c58-rebase.hg
396 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/472e38d57782-ab8d3c58-rebase.hg
397
397
398 $ cd ..
398 $ cd ..
399 $ rm -rf repo
399 $ rm -rf repo
400
400
401 Move one file and add another file in the same folder in one branch, modify file in another branch
401 Move one file and add another file in the same folder in one branch, modify file in another branch
402 --------------------------------------------------------------------------------------------------
402 --------------------------------------------------------------------------------------------------
403
403
404 $ hg init repo
404 $ hg init repo
405 $ initclient repo
405 $ initclient repo
406 $ cd repo
406 $ cd repo
407 $ echo a > a
407 $ echo a > a
408 $ hg add a
408 $ hg add a
409 $ hg ci -m initial
409 $ hg ci -m initial
410 $ hg mv a b
410 $ hg mv a b
411 $ hg ci -m 'mv a b'
411 $ hg ci -m 'mv a b'
412 $ echo c > c
412 $ echo c > c
413 $ hg add c
413 $ hg add c
414 $ hg ci -m 'add c'
414 $ hg ci -m 'add c'
415 $ hg up -q 0
415 $ hg up -q 0
416 $ echo b > a
416 $ echo b > a
417 $ hg ci -m 'mod a'
417 $ hg ci -m 'mod a'
418 created new head
418 created new head
419
419
420 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
420 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
421 @ changeset: ef716627c70bf4ca0bdb623cfb0d6fe5b9acc51e
421 @ changeset: ef716627c70bf4ca0bdb623cfb0d6fe5b9acc51e
422 | desc: mod a
422 | desc: mod a
423 | o changeset: b1a6187e79fbce851bb584eadcb0cc4a80290fd9
423 | o changeset: b1a6187e79fbce851bb584eadcb0cc4a80290fd9
424 | | desc: add c
424 | | desc: add c
425 | o changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
425 | o changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
426 |/ desc: mv a b
426 |/ desc: mv a b
427 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
427 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
428 desc: initial
428 desc: initial
429
429
430 $ hg rebase -s . -d 2
430 $ hg rebase -s . -d 2
431 rebasing 3:ef716627c70b "mod a" (tip)
431 rebasing 3:ef716627c70b "mod a" (tip)
432 merging b and a to b
432 merging b and a to b
433 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/ef716627c70b-24681561-rebase.hg
433 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/ef716627c70b-24681561-rebase.hg
434 $ ls
434 $ ls
435 b
435 b
436 c
436 c
437 $ cat b
437 $ cat b
438 b
438 b
439 $ rm -rf repo
439 $ rm -rf repo
440
440
441 Merge test
441 Merge test
442 ----------
442 ----------
443
443
444 $ hg init repo
444 $ hg init repo
445 $ initclient repo
445 $ initclient repo
446 $ cd repo
446 $ cd repo
447 $ echo a > a
447 $ echo a > a
448 $ hg add a
448 $ hg add a
449 $ hg ci -m initial
449 $ hg ci -m initial
450 $ echo b > a
450 $ echo b > a
451 $ hg ci -m 'modify a'
451 $ hg ci -m 'modify a'
452 $ hg up -q 0
452 $ hg up -q 0
453 $ hg mv a b
453 $ hg mv a b
454 $ hg ci -m 'mv a b'
454 $ hg ci -m 'mv a b'
455 created new head
455 created new head
456 $ hg up -q 2
456 $ hg up -q 2
457
457
458 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
458 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
459 @ changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
459 @ changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
460 | desc: mv a b
460 | desc: mv a b
461 | o changeset: b0357b07f79129a3d08a68621271ca1352ae8a09
461 | o changeset: b0357b07f79129a3d08a68621271ca1352ae8a09
462 |/ desc: modify a
462 |/ desc: modify a
463 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
463 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
464 desc: initial
464 desc: initial
465
465
466 $ hg merge 1
466 $ hg merge 1
467 merging b and a to b
467 merging b and a to b
468 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
468 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
469 (branch merge, don't forget to commit)
469 (branch merge, don't forget to commit)
470 $ hg ci -m merge
470 $ hg ci -m merge
471 $ ls
471 $ ls
472 b
472 b
473 $ cd ..
473 $ cd ..
474 $ rm -rf repo
474 $ rm -rf repo
475
475
476 Copy and move file
476 Copy and move file
477 ------------------
477 ------------------
478
478
479 $ hg init repo
479 $ hg init repo
480 $ initclient repo
480 $ initclient repo
481 $ cd repo
481 $ cd repo
482 $ echo a > a
482 $ echo a > a
483 $ hg add a
483 $ hg add a
484 $ hg ci -m initial
484 $ hg ci -m initial
485 $ hg cp a c
485 $ hg cp a c
486 $ hg mv a b
486 $ hg mv a b
487 $ hg ci -m 'cp a c, mv a b'
487 $ hg ci -m 'cp a c, mv a b'
488 $ hg up -q 0
488 $ hg up -q 0
489 $ echo b > a
489 $ echo b > a
490 $ hg ci -m 'mod a'
490 $ hg ci -m 'mod a'
491 created new head
491 created new head
492
492
493 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
493 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
494 @ changeset: ef716627c70bf4ca0bdb623cfb0d6fe5b9acc51e
494 @ changeset: ef716627c70bf4ca0bdb623cfb0d6fe5b9acc51e
495 | desc: mod a
495 | desc: mod a
496 | o changeset: 4fc3fd13fbdb89ada6b75bfcef3911a689a0dde8
496 | o changeset: 4fc3fd13fbdb89ada6b75bfcef3911a689a0dde8
497 |/ desc: cp a c, mv a b
497 |/ desc: cp a c, mv a b
498 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
498 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
499 desc: initial
499 desc: initial
500
500
501 $ hg rebase -s . -d 1
501 $ hg rebase -s . -d 1
502 rebasing 2:ef716627c70b "mod a" (tip)
502 rebasing 2:ef716627c70b "mod a" (tip)
503 merging b and a to b
503 merging b and a to b
504 merging c and a to c
504 merging c and a to c
505 saved backup bundle to $TESTTMP/repo/repo/.hg/strip-backup/ef716627c70b-24681561-rebase.hg
505 saved backup bundle to $TESTTMP/repo/repo/.hg/strip-backup/ef716627c70b-24681561-rebase.hg
506 $ ls
506 $ ls
507 b
507 b
508 c
508 c
509 $ cat b
509 $ cat b
510 b
510 b
511 $ cat c
511 $ cat c
512 b
512 b
513 $ cd ..
513 $ cd ..
514 $ rm -rf repo
514 $ rm -rf repo
515
515
516 Do a merge commit with many consequent moves in one branch
516 Do a merge commit with many consequent moves in one branch
517 ----------------------------------------------------------
517 ----------------------------------------------------------
518
518
519 $ hg init repo
519 $ hg init repo
520 $ initclient repo
520 $ initclient repo
521 $ cd repo
521 $ cd repo
522 $ echo a > a
522 $ echo a > a
523 $ hg add a
523 $ hg add a
524 $ hg ci -m initial
524 $ hg ci -m initial
525 $ echo b > a
525 $ echo b > a
526 $ hg ci -qm 'mod a'
526 $ hg ci -qm 'mod a'
527 $ hg up -q ".^"
527 $ hg up -q ".^"
528 $ hg mv a b
528 $ hg mv a b
529 $ hg ci -qm 'mv a b'
529 $ hg ci -qm 'mv a b'
530 $ hg mv b c
530 $ hg mv b c
531 $ hg ci -qm 'mv b c'
531 $ hg ci -qm 'mv b c'
532 $ hg up -q 1
532 $ hg up -q 1
533 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
533 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
534 o changeset: d3efd280421d24f9f229997c19e654761c942a71
534 o changeset: d3efd280421d24f9f229997c19e654761c942a71
535 | desc: mv b c
535 | desc: mv b c
536 o changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
536 o changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
537 | desc: mv a b
537 | desc: mv a b
538 | @ changeset: ef716627c70bf4ca0bdb623cfb0d6fe5b9acc51e
538 | @ changeset: ef716627c70bf4ca0bdb623cfb0d6fe5b9acc51e
539 |/ desc: mod a
539 |/ desc: mod a
540 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
540 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
541 desc: initial
541 desc: initial
542
542
543 $ hg merge 3
543 $ hg merge 3
544 merging a and c to c
544 merging a and c to c
545 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
545 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
546 (branch merge, don't forget to commit)
546 (branch merge, don't forget to commit)
547 $ hg ci -qm 'merge'
547 $ hg ci -qm 'merge'
548 $ hg log -G -T 'changeset: {node}\n desc: {desc}, phase: {phase}\n'
548 $ hg log -G -T 'changeset: {node}\n desc: {desc}, phase: {phase}\n'
549 @ changeset: cd29b0d08c0f39bfed4cde1b40e30f419db0c825
549 @ changeset: cd29b0d08c0f39bfed4cde1b40e30f419db0c825
550 |\ desc: merge, phase: draft
550 |\ desc: merge, phase: draft
551 | o changeset: d3efd280421d24f9f229997c19e654761c942a71
551 | o changeset: d3efd280421d24f9f229997c19e654761c942a71
552 | | desc: mv b c, phase: draft
552 | | desc: mv b c, phase: draft
553 | o changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
553 | o changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
554 | | desc: mv a b, phase: draft
554 | | desc: mv a b, phase: draft
555 o | changeset: ef716627c70bf4ca0bdb623cfb0d6fe5b9acc51e
555 o | changeset: ef716627c70bf4ca0bdb623cfb0d6fe5b9acc51e
556 |/ desc: mod a, phase: draft
556 |/ desc: mod a, phase: draft
557 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
557 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
558 desc: initial, phase: draft
558 desc: initial, phase: draft
559 $ ls
559 $ ls
560 c
560 c
561 $ cd ..
561 $ cd ..
562 $ rm -rf repo
562 $ rm -rf repo
563
563
564 Test shelve/unshelve
564 Test shelve/unshelve
565 -------------------
565 -------------------
566
566
567 $ hg init repo
567 $ hg init repo
568 $ initclient repo
568 $ initclient repo
569 $ cd repo
569 $ cd repo
570 $ echo a > a
570 $ echo a > a
571 $ hg add a
571 $ hg add a
572 $ hg ci -m initial
572 $ hg ci -m initial
573 $ echo b > a
573 $ echo b > a
574 $ hg shelve
574 $ hg shelve
575 shelved as default
575 shelved as default
576 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
576 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
577 $ hg mv a b
577 $ hg mv a b
578 $ hg ci -m 'mv a b'
578 $ hg ci -m 'mv a b'
579
579
580 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
580 $ hg log -G -T 'changeset: {node}\n desc: {desc}\n'
581 @ changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
581 @ changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
582 | desc: mv a b
582 | desc: mv a b
583 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
583 o changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
584 desc: initial
584 desc: initial
585 $ hg unshelve
585 $ hg unshelve
586 unshelving change 'default'
586 unshelving change 'default'
587 rebasing shelved changes
587 rebasing shelved changes
588 merging b and a to b
588 merging b and a to b
589 $ ls
589 $ ls
590 b
590 b
591 $ cat b
591 $ cat b
592 b
592 b
593 $ cd ..
593 $ cd ..
594 $ rm -rf repo
594 $ rm -rf repo
595
595
596 Test full copytrace ability on draft branch
596 Test full copytrace ability on draft branch
597 -------------------------------------------
597 -------------------------------------------
598
598
599 File directory and base name changed in same move
599 File directory and base name changed in same move
600 $ hg init repo
600 $ hg init repo
601 $ initclient repo
601 $ initclient repo
602 $ mkdir repo/dir1
602 $ mkdir repo/dir1
603 $ cd repo/dir1
603 $ cd repo/dir1
604 $ echo a > a
604 $ echo a > a
605 $ hg add a
605 $ hg add a
606 $ hg ci -qm initial
606 $ hg ci -qm initial
607 $ cd ..
607 $ cd ..
608 $ hg mv -q dir1 dir2
608 $ hg mv -q dir1 dir2
609 $ hg mv dir2/a dir2/b
609 $ hg mv dir2/a dir2/b
610 $ hg ci -qm 'mv a b; mv dir1 dir2'
610 $ hg ci -qm 'mv a b; mv dir1 dir2'
611 $ hg up -q '.^'
611 $ hg up -q '.^'
612 $ cd dir1
612 $ cd dir1
613 $ echo b >> a
613 $ echo b >> a
614 $ cd ..
614 $ cd ..
615 $ hg ci -qm 'mod a'
615 $ hg ci -qm 'mod a'
616
616
617 $ hg log -G -T 'changeset {node}\n desc {desc}, phase: {phase}\n'
617 $ hg log -G -T 'changeset {node}\n desc {desc}, phase: {phase}\n'
618 @ changeset 6207d2d318e710b882e3d5ada2a89770efc42c96
618 @ changeset 6207d2d318e710b882e3d5ada2a89770efc42c96
619 | desc mod a, phase: draft
619 | desc mod a, phase: draft
620 | o changeset abffdd4e3dfc04bc375034b970299b2a309a1cce
620 | o changeset abffdd4e3dfc04bc375034b970299b2a309a1cce
621 |/ desc mv a b; mv dir1 dir2, phase: draft
621 |/ desc mv a b; mv dir1 dir2, phase: draft
622 o changeset 81973cd24b58db2fdf18ce3d64fb2cc3284e9ab3
622 o changeset 81973cd24b58db2fdf18ce3d64fb2cc3284e9ab3
623 desc initial, phase: draft
623 desc initial, phase: draft
624
624
625 $ hg rebase -s . -d 1 --config experimental.copytrace.sourcecommitlimit=100
625 $ hg rebase -s . -d 1 --config experimental.copytrace.sourcecommitlimit=100
626 rebasing 2:6207d2d318e7 "mod a" (tip)
626 rebasing 2:6207d2d318e7 "mod a" (tip)
627 merging dir2/b and dir1/a to dir2/b
627 merging dir2/b and dir1/a to dir2/b
628 saved backup bundle to $TESTTMP/repo/repo/.hg/strip-backup/6207d2d318e7-1c9779ad-rebase.hg
628 saved backup bundle to $TESTTMP/repo/repo/.hg/strip-backup/6207d2d318e7-1c9779ad-rebase.hg
629 $ cat dir2/b
629 $ cat dir2/b
630 a
630 a
631 b
631 b
632 $ cd ..
632 $ cd ..
633 $ rm -rf repo
633 $ rm -rf repo
634
634
635 Move directory in one merge parent, while adding file to original directory
635 Move directory in one merge parent, while adding file to original directory
636 in other merge parent. File moved on rebase.
636 in other merge parent. File moved on rebase.
637
637
638 $ hg init repo
638 $ hg init repo
639 $ initclient repo
639 $ initclient repo
640 $ mkdir repo/dir1
640 $ mkdir repo/dir1
641 $ cd repo/dir1
641 $ cd repo/dir1
642 $ echo dummy > dummy
642 $ echo dummy > dummy
643 $ hg add dummy
643 $ hg add dummy
644 $ cd ..
644 $ cd ..
645 $ hg ci -qm initial
645 $ hg ci -qm initial
646 $ cd dir1
646 $ cd dir1
647 $ echo a > a
647 $ echo a > a
648 $ hg add a
648 $ hg add a
649 $ cd ..
649 $ cd ..
650 $ hg ci -qm 'hg add dir1/a'
650 $ hg ci -qm 'hg add dir1/a'
651 $ hg up -q '.^'
651 $ hg up -q '.^'
652 $ hg mv -q dir1 dir2
652 $ hg mv -q dir1 dir2
653 $ hg ci -qm 'mv dir1 dir2'
653 $ hg ci -qm 'mv dir1 dir2'
654
654
655 $ hg log -G -T 'changeset {node}\n desc {desc}, phase: {phase}\n'
655 $ hg log -G -T 'changeset {node}\n desc {desc}, phase: {phase}\n'
656 @ changeset e8919e7df8d036e07b906045eddcd4a42ff1915f
656 @ changeset e8919e7df8d036e07b906045eddcd4a42ff1915f
657 | desc mv dir1 dir2, phase: draft
657 | desc mv dir1 dir2, phase: draft
658 | o changeset 7c7c6f339be00f849c3cb2df738ca91db78b32c8
658 | o changeset 7c7c6f339be00f849c3cb2df738ca91db78b32c8
659 |/ desc hg add dir1/a, phase: draft
659 |/ desc hg add dir1/a, phase: draft
660 o changeset a235dcce55dcf42034c4e374cb200662d0bb4a13
660 o changeset a235dcce55dcf42034c4e374cb200662d0bb4a13
661 desc initial, phase: draft
661 desc initial, phase: draft
662
662
663 $ hg rebase -s . -d 1 --config experimental.copytrace.sourcecommitlimit=100
663 $ hg rebase -s . -d 1 --config experimental.copytrace.sourcecommitlimit=100
664 rebasing 2:e8919e7df8d0 "mv dir1 dir2" (tip)
664 rebasing 2:e8919e7df8d0 "mv dir1 dir2" (tip)
665 saved backup bundle to $TESTTMP/repo/repo/.hg/strip-backup/e8919e7df8d0-f62fab62-rebase.hg
665 saved backup bundle to $TESTTMP/repo/repo/.hg/strip-backup/e8919e7df8d0-f62fab62-rebase.hg
666 $ ls dir2
666 $ ls dir2
667 a
667 a
668 dummy
668 dummy
669 $ rm -rf repo
669 $ rm -rf repo
670
670
671 Testing the sourcecommitlimit config
671 Testing the sourcecommitlimit config
672 -----------------------------------
672 -----------------------------------
673
673
674 $ hg init repo
674 $ hg init repo
675 $ initclient repo
675 $ initclient repo
676 $ cd repo
676 $ cd repo
677 $ echo a > a
677 $ echo a > a
678 $ hg ci -Aqm "added a"
678 $ hg ci -Aqm "added a"
679 $ echo "more things" >> a
679 $ echo "more things" >> a
680 $ hg ci -qm "added more things to a"
680 $ hg ci -qm "added more things to a"
681 $ hg up 0
681 $ hg up 0
682 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
682 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
683 $ echo b > b
683 $ echo b > b
684 $ hg ci -Aqm "added b"
684 $ hg ci -Aqm "added b"
685 $ mkdir foo
685 $ mkdir foo
686 $ hg mv a foo/bar
686 $ hg mv a foo/bar
687 $ hg ci -m "Moved a to foo/bar"
687 $ hg ci -m "Moved a to foo/bar"
688 $ hg log -G -T 'changeset {node}\n desc {desc}, phase: {phase}\n'
688 $ hg log -G -T 'changeset {node}\n desc {desc}, phase: {phase}\n'
689 @ changeset b4b0f7880e500b5c364a5f07b4a2b167de7a6fb0
689 @ changeset b4b0f7880e500b5c364a5f07b4a2b167de7a6fb0
690 | desc Moved a to foo/bar, phase: draft
690 | desc Moved a to foo/bar, phase: draft
691 o changeset 5f6d8a4bf34ab274ccc9f631c2536964b8a3666d
691 o changeset 5f6d8a4bf34ab274ccc9f631c2536964b8a3666d
692 | desc added b, phase: draft
692 | desc added b, phase: draft
693 | o changeset 8b6e13696c38e8445a759516474640c2f8dddef6
693 | o changeset 8b6e13696c38e8445a759516474640c2f8dddef6
694 |/ desc added more things to a, phase: draft
694 |/ desc added more things to a, phase: draft
695 o changeset 9092f1db7931481f93b37d5c9fbcfc341bcd7318
695 o changeset 9092f1db7931481f93b37d5c9fbcfc341bcd7318
696 desc added a, phase: draft
696 desc added a, phase: draft
697
697
698 When the sourcecommitlimit is small and we have more drafts, we use heuristics only
698 When the sourcecommitlimit is small and we have more drafts, we use heuristics only
699
699
700 $ hg rebase -s 8b6e13696 -d .
700 $ hg rebase -s 8b6e13696 -d .
701 rebasing 1:8b6e13696c38 "added more things to a"
701 rebasing 1:8b6e13696c38 "added more things to a"
702 file 'a' was deleted in other [source] but was modified in local [dest].
702 file 'a' was deleted in local [dest] but was modified in other [source].
703 What do you want to do?
703 What do you want to do?
704 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
704 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
705 unresolved conflicts (see hg resolve, then hg rebase --continue)
705 unresolved conflicts (see hg resolve, then hg rebase --continue)
706 [1]
706 [1]
707
707
708 But when we have "sourcecommitlimit > (no. of drafts from base to c1)", we do
708 But when we have "sourcecommitlimit > (no. of drafts from base to c1)", we do
709 fullcopytracing
709 fullcopytracing
710
710
711 $ hg rebase --abort
711 $ hg rebase --abort
712 rebase aborted
712 rebase aborted
713 $ hg rebase -s 8b6e13696 -d . --config experimental.copytrace.sourcecommitlimit=100
713 $ hg rebase -s 8b6e13696 -d . --config experimental.copytrace.sourcecommitlimit=100
714 rebasing 1:8b6e13696c38 "added more things to a"
714 rebasing 1:8b6e13696c38 "added more things to a"
715 merging foo/bar and a to foo/bar
715 merging foo/bar and a to foo/bar
716 saved backup bundle to $TESTTMP/repo/repo/repo/.hg/strip-backup/8b6e13696c38-fc14ac83-rebase.hg
716 saved backup bundle to $TESTTMP/repo/repo/repo/.hg/strip-backup/8b6e13696c38-fc14ac83-rebase.hg
717 $ cd ..
717 $ cd ..
718 $ rm -rf repo
718 $ rm -rf repo
@@ -1,795 +1,795 b''
1 #require no-reposimplestore
1 #require no-reposimplestore
2
2
3 This file focuses mainly on updating largefiles in the working
3 This file focuses mainly on updating largefiles in the working
4 directory (and ".hg/largefiles/dirstate")
4 directory (and ".hg/largefiles/dirstate")
5
5
6 $ cat >> $HGRCPATH <<EOF
6 $ cat >> $HGRCPATH <<EOF
7 > [ui]
7 > [ui]
8 > merge = internal:fail
8 > merge = internal:fail
9 > [extensions]
9 > [extensions]
10 > largefiles =
10 > largefiles =
11 > [extdiff]
11 > [extdiff]
12 > # for portability:
12 > # for portability:
13 > pdiff = sh "$RUNTESTDIR/pdiff"
13 > pdiff = sh "$RUNTESTDIR/pdiff"
14 > EOF
14 > EOF
15
15
16 $ hg init repo
16 $ hg init repo
17 $ cd repo
17 $ cd repo
18
18
19 $ echo large1 > large1
19 $ echo large1 > large1
20 $ echo large2 > large2
20 $ echo large2 > large2
21 $ hg add --large large1 large2
21 $ hg add --large large1 large2
22 $ echo normal1 > normal1
22 $ echo normal1 > normal1
23 $ hg add normal1
23 $ hg add normal1
24 $ hg commit -m '#0'
24 $ hg commit -m '#0'
25 $ echo 'large1 in #1' > large1
25 $ echo 'large1 in #1' > large1
26 $ echo 'normal1 in #1' > normal1
26 $ echo 'normal1 in #1' > normal1
27 $ hg commit -m '#1'
27 $ hg commit -m '#1'
28 $ hg pdiff -r '.^' --config extensions.extdiff=
28 $ hg pdiff -r '.^' --config extensions.extdiff=
29 diff -Nru repo.0d9d9b8dc9a3/.hglf/large1 repo/.hglf/large1
29 diff -Nru repo.0d9d9b8dc9a3/.hglf/large1 repo/.hglf/large1
30 --- repo.0d9d9b8dc9a3/.hglf/large1 * (glob)
30 --- repo.0d9d9b8dc9a3/.hglf/large1 * (glob)
31 +++ repo/.hglf/large1 * (glob)
31 +++ repo/.hglf/large1 * (glob)
32 @@ -1* +1* @@ (glob)
32 @@ -1* +1* @@ (glob)
33 -4669e532d5b2c093a78eca010077e708a071bb64
33 -4669e532d5b2c093a78eca010077e708a071bb64
34 +58e24f733a964da346e2407a2bee99d9001184f5
34 +58e24f733a964da346e2407a2bee99d9001184f5
35 diff -Nru repo.0d9d9b8dc9a3/normal1 repo/normal1
35 diff -Nru repo.0d9d9b8dc9a3/normal1 repo/normal1
36 --- repo.0d9d9b8dc9a3/normal1 * (glob)
36 --- repo.0d9d9b8dc9a3/normal1 * (glob)
37 +++ repo/normal1 * (glob)
37 +++ repo/normal1 * (glob)
38 @@ -1* +1* @@ (glob)
38 @@ -1* +1* @@ (glob)
39 -normal1
39 -normal1
40 +normal1 in #1
40 +normal1 in #1
41 [1]
41 [1]
42 $ hg update -q -C 0
42 $ hg update -q -C 0
43 $ echo 'large2 in #2' > large2
43 $ echo 'large2 in #2' > large2
44 $ hg commit -m '#2'
44 $ hg commit -m '#2'
45 created new head
45 created new head
46
46
47 Test that update also updates the lfdirstate of 'unsure' largefiles after
47 Test that update also updates the lfdirstate of 'unsure' largefiles after
48 hashing them:
48 hashing them:
49
49
50 The previous operations will usually have left us with largefiles with a mtime
50 The previous operations will usually have left us with largefiles with a mtime
51 within the same second as the dirstate was written.
51 within the same second as the dirstate was written.
52 The lfdirstate entries will thus have been written with an invalidated/unset
52 The lfdirstate entries will thus have been written with an invalidated/unset
53 mtime to make sure further changes within the same second is detected.
53 mtime to make sure further changes within the same second is detected.
54 We will however occasionally be "lucky" and get a tick between writing
54 We will however occasionally be "lucky" and get a tick between writing
55 largefiles and writing dirstate so we get valid lfdirstate timestamps. The
55 largefiles and writing dirstate so we get valid lfdirstate timestamps. The
56 following verification is thus disabled but can be verified manually.
56 following verification is thus disabled but can be verified manually.
57
57
58 #if false
58 #if false
59 $ hg debugdirstate --large --nodate
59 $ hg debugdirstate --large --nodate
60 n 644 7 unset large1
60 n 644 7 unset large1
61 n 644 13 unset large2
61 n 644 13 unset large2
62 #endif
62 #endif
63
63
64 Wait to make sure we get a tick so the mtime of the largefiles become valid.
64 Wait to make sure we get a tick so the mtime of the largefiles become valid.
65
65
66 $ sleep 1
66 $ sleep 1
67
67
68 A linear merge will update standins before performing the actual merge. It will
68 A linear merge will update standins before performing the actual merge. It will
69 do a lfdirstate status walk and find 'unset'/'unsure' files, hash them, and
69 do a lfdirstate status walk and find 'unset'/'unsure' files, hash them, and
70 update the corresponding standins.
70 update the corresponding standins.
71 Verify that it actually marks the clean files as clean in lfdirstate so
71 Verify that it actually marks the clean files as clean in lfdirstate so
72 we don't have to hash them again next time we update.
72 we don't have to hash them again next time we update.
73
73
74 $ hg up
74 $ hg up
75 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
75 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
76 updated to "f74e50bd9e55: #2"
76 updated to "f74e50bd9e55: #2"
77 1 other heads for branch "default"
77 1 other heads for branch "default"
78 $ hg debugdirstate --large --nodate
78 $ hg debugdirstate --large --nodate
79 n 644 7 set large1
79 n 644 7 set large1
80 n 644 13 set large2
80 n 644 13 set large2
81
81
82 Test that lfdirstate keeps track of last modification of largefiles and
82 Test that lfdirstate keeps track of last modification of largefiles and
83 prevents unnecessary hashing of content - also after linear/noop update
83 prevents unnecessary hashing of content - also after linear/noop update
84
84
85 $ sleep 1
85 $ sleep 1
86 $ hg st
86 $ hg st
87 $ hg debugdirstate --large --nodate
87 $ hg debugdirstate --large --nodate
88 n 644 7 set large1
88 n 644 7 set large1
89 n 644 13 set large2
89 n 644 13 set large2
90 $ hg up
90 $ hg up
91 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
91 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
92 updated to "f74e50bd9e55: #2"
92 updated to "f74e50bd9e55: #2"
93 1 other heads for branch "default"
93 1 other heads for branch "default"
94 $ hg debugdirstate --large --nodate
94 $ hg debugdirstate --large --nodate
95 n 644 7 set large1
95 n 644 7 set large1
96 n 644 13 set large2
96 n 644 13 set large2
97
97
98 Test that "hg merge" updates largefiles from "other" correctly
98 Test that "hg merge" updates largefiles from "other" correctly
99
99
100 (getting largefiles from "other" normally)
100 (getting largefiles from "other" normally)
101
101
102 $ hg status -A large1
102 $ hg status -A large1
103 C large1
103 C large1
104 $ cat large1
104 $ cat large1
105 large1
105 large1
106 $ cat .hglf/large1
106 $ cat .hglf/large1
107 4669e532d5b2c093a78eca010077e708a071bb64
107 4669e532d5b2c093a78eca010077e708a071bb64
108 $ hg merge --config debug.dirstate.delaywrite=2
108 $ hg merge --config debug.dirstate.delaywrite=2
109 getting changed largefiles
109 getting changed largefiles
110 1 largefiles updated, 0 removed
110 1 largefiles updated, 0 removed
111 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
111 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
112 (branch merge, don't forget to commit)
112 (branch merge, don't forget to commit)
113 $ hg status -A large1
113 $ hg status -A large1
114 M large1
114 M large1
115 $ cat large1
115 $ cat large1
116 large1 in #1
116 large1 in #1
117 $ cat .hglf/large1
117 $ cat .hglf/large1
118 58e24f733a964da346e2407a2bee99d9001184f5
118 58e24f733a964da346e2407a2bee99d9001184f5
119 $ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
119 $ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
120 -4669e532d5b2c093a78eca010077e708a071bb64
120 -4669e532d5b2c093a78eca010077e708a071bb64
121 +58e24f733a964da346e2407a2bee99d9001184f5
121 +58e24f733a964da346e2407a2bee99d9001184f5
122
122
123 (getting largefiles from "other" via conflict prompt)
123 (getting largefiles from "other" via conflict prompt)
124
124
125 $ hg update -q -C 2
125 $ hg update -q -C 2
126 $ echo 'large1 in #3' > large1
126 $ echo 'large1 in #3' > large1
127 $ echo 'normal1 in #3' > normal1
127 $ echo 'normal1 in #3' > normal1
128 $ hg commit -m '#3'
128 $ hg commit -m '#3'
129 $ cat .hglf/large1
129 $ cat .hglf/large1
130 e5bb990443d6a92aaf7223813720f7566c9dd05b
130 e5bb990443d6a92aaf7223813720f7566c9dd05b
131 $ hg merge --config debug.dirstate.delaywrite=2 --config ui.interactive=True <<EOF
131 $ hg merge --config debug.dirstate.delaywrite=2 --config ui.interactive=True <<EOF
132 > o
132 > o
133 > EOF
133 > EOF
134 largefile large1 has a merge conflict
134 largefile large1 has a merge conflict
135 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
135 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
136 keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
136 keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
137 take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
137 take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
138 merging normal1
138 merging normal1
139 warning: conflicts while merging normal1! (edit, then use 'hg resolve --mark')
139 warning: conflicts while merging normal1! (edit, then use 'hg resolve --mark')
140 getting changed largefiles
140 getting changed largefiles
141 1 largefiles updated, 0 removed
141 1 largefiles updated, 0 removed
142 0 files updated, 1 files merged, 0 files removed, 1 files unresolved
142 0 files updated, 1 files merged, 0 files removed, 1 files unresolved
143 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
143 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
144 [1]
144 [1]
145 $ hg status -A large1
145 $ hg status -A large1
146 M large1
146 M large1
147 $ cat large1
147 $ cat large1
148 large1 in #1
148 large1 in #1
149 $ cat .hglf/large1
149 $ cat .hglf/large1
150 58e24f733a964da346e2407a2bee99d9001184f5
150 58e24f733a964da346e2407a2bee99d9001184f5
151 $ rm normal1.orig
151 $ rm normal1.orig
152
152
153 (merge non-existing largefiles from "other" via conflict prompt -
153 (merge non-existing largefiles from "other" via conflict prompt -
154 make sure the following commit doesn't abort in a confusing way when trying to
154 make sure the following commit doesn't abort in a confusing way when trying to
155 mark the non-existing file as normal in lfdirstate)
155 mark the non-existing file as normal in lfdirstate)
156
156
157 $ mv .hg/largefiles/58e24f733a964da346e2407a2bee99d9001184f5 .
157 $ mv .hg/largefiles/58e24f733a964da346e2407a2bee99d9001184f5 .
158 $ hg update -q -C 3
158 $ hg update -q -C 3
159 $ hg merge --config largefiles.usercache=not --config debug.dirstate.delaywrite=2 --tool :local --config ui.interactive=True <<EOF
159 $ hg merge --config largefiles.usercache=not --config debug.dirstate.delaywrite=2 --tool :local --config ui.interactive=True <<EOF
160 > o
160 > o
161 > EOF
161 > EOF
162 largefile large1 has a merge conflict
162 largefile large1 has a merge conflict
163 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
163 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
164 keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
164 keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
165 take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
165 take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
166 getting changed largefiles
166 getting changed largefiles
167 large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from file:/*/$TESTTMP/repo (glob)
167 large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from file:/*/$TESTTMP/repo (glob)
168 0 largefiles updated, 0 removed
168 0 largefiles updated, 0 removed
169 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
169 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
170 (branch merge, don't forget to commit)
170 (branch merge, don't forget to commit)
171 $ hg commit -m '1-2-3 testing' --config largefiles.usercache=not
171 $ hg commit -m '1-2-3 testing' --config largefiles.usercache=not
172 large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from local store
172 large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from local store
173 $ hg up -C . --config largefiles.usercache=not
173 $ hg up -C . --config largefiles.usercache=not
174 getting changed largefiles
174 getting changed largefiles
175 large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from file:/*/$TESTTMP/repo (glob)
175 large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from file:/*/$TESTTMP/repo (glob)
176 0 largefiles updated, 0 removed
176 0 largefiles updated, 0 removed
177 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
177 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
178 $ hg st large1
178 $ hg st large1
179 ! large1
179 ! large1
180 $ hg rollback -q
180 $ hg rollback -q
181 $ mv 58e24f733a964da346e2407a2bee99d9001184f5 .hg/largefiles/
181 $ mv 58e24f733a964da346e2407a2bee99d9001184f5 .hg/largefiles/
182
182
183 Test that "hg revert -r REV" updates largefiles from "REV" correctly
183 Test that "hg revert -r REV" updates largefiles from "REV" correctly
184
184
185 $ hg update -q -C 3
185 $ hg update -q -C 3
186 $ hg status -A large1
186 $ hg status -A large1
187 C large1
187 C large1
188 $ cat large1
188 $ cat large1
189 large1 in #3
189 large1 in #3
190 $ cat .hglf/large1
190 $ cat .hglf/large1
191 e5bb990443d6a92aaf7223813720f7566c9dd05b
191 e5bb990443d6a92aaf7223813720f7566c9dd05b
192 $ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
192 $ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
193 -4669e532d5b2c093a78eca010077e708a071bb64
193 -4669e532d5b2c093a78eca010077e708a071bb64
194 +58e24f733a964da346e2407a2bee99d9001184f5
194 +58e24f733a964da346e2407a2bee99d9001184f5
195 $ hg revert --no-backup -r 1 --config debug.dirstate.delaywrite=2 large1
195 $ hg revert --no-backup -r 1 --config debug.dirstate.delaywrite=2 large1
196 $ hg status -A large1
196 $ hg status -A large1
197 M large1
197 M large1
198 $ cat large1
198 $ cat large1
199 large1 in #1
199 large1 in #1
200 $ cat .hglf/large1
200 $ cat .hglf/large1
201 58e24f733a964da346e2407a2bee99d9001184f5
201 58e24f733a964da346e2407a2bee99d9001184f5
202
202
203 Test that "hg rollback" restores status of largefiles correctly
203 Test that "hg rollback" restores status of largefiles correctly
204
204
205 $ hg update -C -q
205 $ hg update -C -q
206 $ hg remove large1
206 $ hg remove large1
207 $ test -f .hglf/large1
207 $ test -f .hglf/large1
208 [1]
208 [1]
209 $ hg forget large2
209 $ hg forget large2
210 $ test -f .hglf/large2
210 $ test -f .hglf/large2
211 [1]
211 [1]
212 $ echo largeX > largeX
212 $ echo largeX > largeX
213 $ hg add --large largeX
213 $ hg add --large largeX
214 $ cat .hglf/largeX
214 $ cat .hglf/largeX
215
215
216 $ hg commit -m 'will be rollback-ed soon'
216 $ hg commit -m 'will be rollback-ed soon'
217 $ echo largeY > largeY
217 $ echo largeY > largeY
218 $ hg add --large largeY
218 $ hg add --large largeY
219
219
220 $ hg status -A large1
220 $ hg status -A large1
221 large1: $ENOENT$
221 large1: $ENOENT$
222
222
223 $ hg status -A large2
223 $ hg status -A large2
224 ? large2
224 ? large2
225 $ hg status -A largeX
225 $ hg status -A largeX
226 C largeX
226 C largeX
227 $ hg status -A largeY
227 $ hg status -A largeY
228 A largeY
228 A largeY
229 $ hg rollback
229 $ hg rollback
230 repository tip rolled back to revision 3 (undo commit)
230 repository tip rolled back to revision 3 (undo commit)
231 working directory now based on revision 3
231 working directory now based on revision 3
232 $ hg status -A large1
232 $ hg status -A large1
233 R large1
233 R large1
234 $ test -f .hglf/large1
234 $ test -f .hglf/large1
235 [1]
235 [1]
236 $ hg status -A large2
236 $ hg status -A large2
237 R large2
237 R large2
238 $ test -f .hglf/large2
238 $ test -f .hglf/large2
239 [1]
239 [1]
240 $ hg status -A largeX
240 $ hg status -A largeX
241 A largeX
241 A largeX
242 $ cat .hglf/largeX
242 $ cat .hglf/largeX
243
243
244 $ hg status -A largeY
244 $ hg status -A largeY
245 ? largeY
245 ? largeY
246 $ test -f .hglf/largeY
246 $ test -f .hglf/largeY
247 [1]
247 [1]
248 $ rm largeY
248 $ rm largeY
249
249
250 Test that "hg rollback" restores standins correctly
250 Test that "hg rollback" restores standins correctly
251
251
252 $ hg commit -m 'will be rollback-ed soon'
252 $ hg commit -m 'will be rollback-ed soon'
253 $ hg update -q -C 2
253 $ hg update -q -C 2
254 $ cat large1
254 $ cat large1
255 large1
255 large1
256 $ cat .hglf/large1
256 $ cat .hglf/large1
257 4669e532d5b2c093a78eca010077e708a071bb64
257 4669e532d5b2c093a78eca010077e708a071bb64
258 $ cat large2
258 $ cat large2
259 large2 in #2
259 large2 in #2
260 $ cat .hglf/large2
260 $ cat .hglf/large2
261 3cfce6277e7668985707b6887ce56f9f62f6ccd9
261 3cfce6277e7668985707b6887ce56f9f62f6ccd9
262
262
263 $ hg rollback -q -f
263 $ hg rollback -q -f
264 $ cat large1
264 $ cat large1
265 large1
265 large1
266 $ cat .hglf/large1
266 $ cat .hglf/large1
267 4669e532d5b2c093a78eca010077e708a071bb64
267 4669e532d5b2c093a78eca010077e708a071bb64
268 $ cat large2
268 $ cat large2
269 large2 in #2
269 large2 in #2
270 $ cat .hglf/large2
270 $ cat .hglf/large2
271 3cfce6277e7668985707b6887ce56f9f62f6ccd9
271 3cfce6277e7668985707b6887ce56f9f62f6ccd9
272
272
273 (rollback the parent of the working directory, when the parent of it
273 (rollback the parent of the working directory, when the parent of it
274 is not branch-tip)
274 is not branch-tip)
275
275
276 $ hg update -q -C 1
276 $ hg update -q -C 1
277 $ cat .hglf/large1
277 $ cat .hglf/large1
278 58e24f733a964da346e2407a2bee99d9001184f5
278 58e24f733a964da346e2407a2bee99d9001184f5
279 $ cat .hglf/large2
279 $ cat .hglf/large2
280 1deebade43c8c498a3c8daddac0244dc55d1331d
280 1deebade43c8c498a3c8daddac0244dc55d1331d
281
281
282 $ echo normalX > normalX
282 $ echo normalX > normalX
283 $ hg add normalX
283 $ hg add normalX
284 $ hg commit -m 'will be rollback-ed soon'
284 $ hg commit -m 'will be rollback-ed soon'
285 $ hg rollback -q
285 $ hg rollback -q
286
286
287 $ cat .hglf/large1
287 $ cat .hglf/large1
288 58e24f733a964da346e2407a2bee99d9001184f5
288 58e24f733a964da346e2407a2bee99d9001184f5
289 $ cat .hglf/large2
289 $ cat .hglf/large2
290 1deebade43c8c498a3c8daddac0244dc55d1331d
290 1deebade43c8c498a3c8daddac0244dc55d1331d
291 $ rm normalX
291 $ rm normalX
292
292
293 Test that "hg status" shows status of largefiles correctly just after
293 Test that "hg status" shows status of largefiles correctly just after
294 automated commit like rebase/transplant
294 automated commit like rebase/transplant
295
295
296 $ cat >> .hg/hgrc <<EOF
296 $ cat >> .hg/hgrc <<EOF
297 > [extensions]
297 > [extensions]
298 > rebase =
298 > rebase =
299 > strip =
299 > strip =
300 > transplant =
300 > transplant =
301 > EOF
301 > EOF
302 $ hg update -q -C 1
302 $ hg update -q -C 1
303 $ hg remove large1
303 $ hg remove large1
304 $ echo largeX > largeX
304 $ echo largeX > largeX
305 $ hg add --large largeX
305 $ hg add --large largeX
306 $ hg commit -m '#4'
306 $ hg commit -m '#4'
307
307
308 $ hg rebase -s 1 -d 2 --keep
308 $ hg rebase -s 1 -d 2 --keep
309 rebasing 1:72518492caa6 "#1"
309 rebasing 1:72518492caa6 "#1"
310 rebasing 4:07d6153b5c04 "#4" (tip)
310 rebasing 4:07d6153b5c04 "#4" (tip)
311
311
312 $ hg status -A large1
312 $ hg status -A large1
313 large1: $ENOENT$
313 large1: $ENOENT$
314
314
315 $ hg status -A largeX
315 $ hg status -A largeX
316 C largeX
316 C largeX
317 $ hg strip -q 5
317 $ hg strip -q 5
318
318
319 $ hg update -q -C 2
319 $ hg update -q -C 2
320 $ hg transplant -q 1 4
320 $ hg transplant -q 1 4
321
321
322 $ hg status -A large1
322 $ hg status -A large1
323 large1: $ENOENT$
323 large1: $ENOENT$
324
324
325 $ hg status -A largeX
325 $ hg status -A largeX
326 C largeX
326 C largeX
327 $ hg strip -q 5
327 $ hg strip -q 5
328
328
329 $ hg update -q -C 2
329 $ hg update -q -C 2
330 $ hg transplant -q --merge 1 --merge 4
330 $ hg transplant -q --merge 1 --merge 4
331
331
332 $ hg status -A large1
332 $ hg status -A large1
333 large1: $ENOENT$
333 large1: $ENOENT$
334
334
335 $ hg status -A largeX
335 $ hg status -A largeX
336 C largeX
336 C largeX
337 $ hg strip -q 5
337 $ hg strip -q 5
338
338
339 Test that linear merge can detect modification (and conflict) correctly
339 Test that linear merge can detect modification (and conflict) correctly
340
340
341 (linear merge without conflict)
341 (linear merge without conflict)
342
342
343 $ echo 'large2 for linear merge (no conflict)' > large2
343 $ echo 'large2 for linear merge (no conflict)' > large2
344 $ hg update 3 --config debug.dirstate.delaywrite=2
344 $ hg update 3 --config debug.dirstate.delaywrite=2
345 getting changed largefiles
345 getting changed largefiles
346 1 largefiles updated, 0 removed
346 1 largefiles updated, 0 removed
347 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
347 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
348 $ hg status -A large2
348 $ hg status -A large2
349 M large2
349 M large2
350 $ cat large2
350 $ cat large2
351 large2 for linear merge (no conflict)
351 large2 for linear merge (no conflict)
352 $ cat .hglf/large2
352 $ cat .hglf/large2
353 9c4bf8f1b33536d6e5f89447e10620cfe52ea710
353 9c4bf8f1b33536d6e5f89447e10620cfe52ea710
354
354
355 (linear merge with conflict, choosing "other")
355 (linear merge with conflict, choosing "other")
356
356
357 $ hg update -q -C 2
357 $ hg update -q -C 2
358 $ echo 'large1 for linear merge (conflict)' > large1
358 $ echo 'large1 for linear merge (conflict)' > large1
359 $ hg update 3 --config ui.interactive=True <<EOF
359 $ hg update 3 --config ui.interactive=True <<EOF
360 > o
360 > o
361 > EOF
361 > EOF
362 largefile large1 has a merge conflict
362 largefile large1 has a merge conflict
363 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
363 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
364 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
364 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
365 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? o
365 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? o
366 getting changed largefiles
366 getting changed largefiles
367 1 largefiles updated, 0 removed
367 1 largefiles updated, 0 removed
368 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
368 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
369 $ hg status -A large1
369 $ hg status -A large1
370 C large1
370 C large1
371 $ cat large1
371 $ cat large1
372 large1 in #3
372 large1 in #3
373 $ cat .hglf/large1
373 $ cat .hglf/large1
374 e5bb990443d6a92aaf7223813720f7566c9dd05b
374 e5bb990443d6a92aaf7223813720f7566c9dd05b
375
375
376 (linear merge with conflict, choosing "local")
376 (linear merge with conflict, choosing "local")
377
377
378 $ hg update -q -C 2
378 $ hg update -q -C 2
379 $ echo 'large1 for linear merge (conflict)' > large1
379 $ echo 'large1 for linear merge (conflict)' > large1
380 $ hg update 3 --config debug.dirstate.delaywrite=2
380 $ hg update 3 --config debug.dirstate.delaywrite=2
381 largefile large1 has a merge conflict
381 largefile large1 has a merge conflict
382 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
382 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
383 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
383 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
384 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
384 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
385 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
385 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
386 $ hg status -A large1
386 $ hg status -A large1
387 M large1
387 M large1
388 $ cat large1
388 $ cat large1
389 large1 for linear merge (conflict)
389 large1 for linear merge (conflict)
390 $ cat .hglf/large1
390 $ cat .hglf/large1
391 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
391 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
392
392
393 Test a linear merge to a revision containing same-name normal file
393 Test a linear merge to a revision containing same-name normal file
394
394
395 $ hg update -q -C 3
395 $ hg update -q -C 3
396 $ hg remove large2
396 $ hg remove large2
397 $ echo 'large2 as normal file' > large2
397 $ echo 'large2 as normal file' > large2
398 $ hg add large2
398 $ hg add large2
399 $ echo 'large3 as normal file' > large3
399 $ echo 'large3 as normal file' > large3
400 $ hg add large3
400 $ hg add large3
401 $ hg commit -m '#5'
401 $ hg commit -m '#5'
402 $ hg manifest
402 $ hg manifest
403 .hglf/large1
403 .hglf/large1
404 large2
404 large2
405 large3
405 large3
406 normal1
406 normal1
407
407
408 (modified largefile is already switched to normal)
408 (modified largefile is already switched to normal)
409
409
410 $ hg update -q -C 2
410 $ hg update -q -C 2
411 $ echo 'modified large2 for linear merge' > large2
411 $ echo 'modified large2 for linear merge' > large2
412 $ hg update -q 5
412 $ hg update -q 5
413 remote turned local largefile large2 into a normal file
413 remote turned local largefile large2 into a normal file
414 keep (l)argefile or use (n)ormal file? l
414 keep (l)argefile or use (n)ormal file? l
415 $ hg debugdirstate --nodates | grep large2
415 $ hg debugdirstate --nodates | grep large2
416 a 0 -1 unset .hglf/large2
416 a 0 -1 unset .hglf/large2
417 r 0 0 set large2
417 r 0 0 set large2
418 $ hg status -A large2
418 $ hg status -A large2
419 A large2
419 A large2
420 $ cat large2
420 $ cat large2
421 modified large2 for linear merge
421 modified large2 for linear merge
422
422
423 (added largefile is already committed as normal)
423 (added largefile is already committed as normal)
424
424
425 $ hg update -q -C 2
425 $ hg update -q -C 2
426 $ echo 'large3 as large file for linear merge' > large3
426 $ echo 'large3 as large file for linear merge' > large3
427 $ hg add --large large3
427 $ hg add --large large3
428 $ hg update -q 5
428 $ hg update -q 5
429 remote turned local largefile large3 into a normal file
429 remote turned local largefile large3 into a normal file
430 keep (l)argefile or use (n)ormal file? l
430 keep (l)argefile or use (n)ormal file? l
431 $ hg debugdirstate --nodates | grep large3
431 $ hg debugdirstate --nodates | grep large3
432 a 0 -1 unset .hglf/large3
432 a 0 -1 unset .hglf/large3
433 r 0 0 set large3
433 r 0 0 set large3
434 $ hg status -A large3
434 $ hg status -A large3
435 A large3
435 A large3
436 $ cat large3
436 $ cat large3
437 large3 as large file for linear merge
437 large3 as large file for linear merge
438 $ rm -f large3 .hglf/large3
438 $ rm -f large3 .hglf/large3
439
439
440 Test that the internal linear merging works correctly
440 Test that the internal linear merging works correctly
441 (both heads are stripped to keep pairing of revision number and commit log)
441 (both heads are stripped to keep pairing of revision number and commit log)
442
442
443 $ hg update -q -C 2
443 $ hg update -q -C 2
444 $ hg strip 3 4
444 $ hg strip 3 4
445 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/9530e27857f7-2e7b195d-backup.hg
445 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/9530e27857f7-2e7b195d-backup.hg
446 $ mv .hg/strip-backup/9530e27857f7-2e7b195d-backup.hg $TESTTMP
446 $ mv .hg/strip-backup/9530e27857f7-2e7b195d-backup.hg $TESTTMP
447
447
448 (internal linear merging at "hg pull --update")
448 (internal linear merging at "hg pull --update")
449
449
450 $ echo 'large1 for linear merge (conflict)' > large1
450 $ echo 'large1 for linear merge (conflict)' > large1
451 $ echo 'large2 for linear merge (conflict with normal file)' > large2
451 $ echo 'large2 for linear merge (conflict with normal file)' > large2
452 $ hg pull --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-2e7b195d-backup.hg
452 $ hg pull --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-2e7b195d-backup.hg
453 pulling from $TESTTMP/9530e27857f7-2e7b195d-backup.hg
453 pulling from $TESTTMP/9530e27857f7-2e7b195d-backup.hg
454 searching for changes
454 searching for changes
455 adding changesets
455 adding changesets
456 adding manifests
456 adding manifests
457 adding file changes
457 adding file changes
458 added 3 changesets with 5 changes to 5 files
458 added 3 changesets with 5 changes to 5 files
459 new changesets 9530e27857f7:d65e59e952a9
459 new changesets 9530e27857f7:d65e59e952a9
460 remote turned local largefile large2 into a normal file
460 remote turned local largefile large2 into a normal file
461 keep (l)argefile or use (n)ormal file? l
461 keep (l)argefile or use (n)ormal file? l
462 largefile large1 has a merge conflict
462 largefile large1 has a merge conflict
463 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
463 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
464 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
464 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
465 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
465 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
466 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
466 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
467 updated to "d65e59e952a9: #5"
467 updated to "d65e59e952a9: #5"
468 1 other heads for branch "default"
468 1 other heads for branch "default"
469
469
470 $ hg status -A large1
470 $ hg status -A large1
471 M large1
471 M large1
472 $ cat large1
472 $ cat large1
473 large1 for linear merge (conflict)
473 large1 for linear merge (conflict)
474 $ cat .hglf/large1
474 $ cat .hglf/large1
475 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
475 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
476 $ hg status -A large2
476 $ hg status -A large2
477 A large2
477 A large2
478 $ cat large2
478 $ cat large2
479 large2 for linear merge (conflict with normal file)
479 large2 for linear merge (conflict with normal file)
480 $ cat .hglf/large2
480 $ cat .hglf/large2
481 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
481 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
482
482
483 (internal linear merging at "hg unbundle --update")
483 (internal linear merging at "hg unbundle --update")
484
484
485 $ hg update -q -C 2
485 $ hg update -q -C 2
486 $ hg rollback -q
486 $ hg rollback -q
487
487
488 $ echo 'large1 for linear merge (conflict)' > large1
488 $ echo 'large1 for linear merge (conflict)' > large1
489 $ echo 'large2 for linear merge (conflict with normal file)' > large2
489 $ echo 'large2 for linear merge (conflict with normal file)' > large2
490 $ hg unbundle --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-2e7b195d-backup.hg
490 $ hg unbundle --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-2e7b195d-backup.hg
491 adding changesets
491 adding changesets
492 adding manifests
492 adding manifests
493 adding file changes
493 adding file changes
494 added 3 changesets with 5 changes to 5 files
494 added 3 changesets with 5 changes to 5 files
495 new changesets 9530e27857f7:d65e59e952a9
495 new changesets 9530e27857f7:d65e59e952a9
496 remote turned local largefile large2 into a normal file
496 remote turned local largefile large2 into a normal file
497 keep (l)argefile or use (n)ormal file? l
497 keep (l)argefile or use (n)ormal file? l
498 largefile large1 has a merge conflict
498 largefile large1 has a merge conflict
499 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
499 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
500 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
500 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
501 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
501 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
502 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
502 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
503 updated to "d65e59e952a9: #5"
503 updated to "d65e59e952a9: #5"
504 1 other heads for branch "default"
504 1 other heads for branch "default"
505
505
506 $ hg status -A large1
506 $ hg status -A large1
507 M large1
507 M large1
508 $ cat large1
508 $ cat large1
509 large1 for linear merge (conflict)
509 large1 for linear merge (conflict)
510 $ cat .hglf/large1
510 $ cat .hglf/large1
511 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
511 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
512 $ hg status -A large2
512 $ hg status -A large2
513 A large2
513 A large2
514 $ cat large2
514 $ cat large2
515 large2 for linear merge (conflict with normal file)
515 large2 for linear merge (conflict with normal file)
516 $ cat .hglf/large2
516 $ cat .hglf/large2
517 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
517 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
518
518
519 (internal linear merging in subrepo at "hg update")
519 (internal linear merging in subrepo at "hg update")
520
520
521 $ cd ..
521 $ cd ..
522 $ hg init subparent
522 $ hg init subparent
523 $ cd subparent
523 $ cd subparent
524
524
525 $ hg clone -q -u 2 ../repo sub
525 $ hg clone -q -u 2 ../repo sub
526 $ cat > .hgsub <<EOF
526 $ cat > .hgsub <<EOF
527 > sub = sub
527 > sub = sub
528 > EOF
528 > EOF
529 $ hg add .hgsub
529 $ hg add .hgsub
530 $ hg commit -m '#0@parent'
530 $ hg commit -m '#0@parent'
531 $ cat .hgsubstate
531 $ cat .hgsubstate
532 f74e50bd9e5594b7cf1e6c5cbab86ddd25f3ca2f sub
532 f74e50bd9e5594b7cf1e6c5cbab86ddd25f3ca2f sub
533 $ hg -R sub update -q
533 $ hg -R sub update -q
534 $ hg commit -m '#1@parent'
534 $ hg commit -m '#1@parent'
535 $ cat .hgsubstate
535 $ cat .hgsubstate
536 d65e59e952a9638e2ce863b41a420ca723dd3e8d sub
536 d65e59e952a9638e2ce863b41a420ca723dd3e8d sub
537 $ hg update -q 0
537 $ hg update -q 0
538
538
539 $ echo 'large1 for linear merge (conflict)' > sub/large1
539 $ echo 'large1 for linear merge (conflict)' > sub/large1
540 $ echo 'large2 for linear merge (conflict with normal file)' > sub/large2
540 $ echo 'large2 for linear merge (conflict with normal file)' > sub/large2
541 $ hg update --config ui.interactive=True --config debug.dirstate.delaywrite=2 <<EOF
541 $ hg update --config ui.interactive=True --config debug.dirstate.delaywrite=2 <<EOF
542 > m
542 > m
543 > r
543 > r
544 > l
544 > l
545 > l
545 > l
546 > EOF
546 > EOF
547 subrepository sub diverged (local revision: f74e50bd9e55, remote revision: d65e59e952a9)
547 subrepository sub diverged (local revision: f74e50bd9e55, remote revision: d65e59e952a9)
548 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
548 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
549 subrepository sources for sub differ (in checked out version)
549 subrepository sources for sub differ (in checked out version)
550 use (l)ocal source (f74e50bd9e55) or (r)emote source (d65e59e952a9)? r
550 use (l)ocal source (f74e50bd9e55) or (r)emote source (d65e59e952a9)? r
551 remote turned local largefile large2 into a normal file
551 remote turned local largefile large2 into a normal file
552 keep (l)argefile or use (n)ormal file? l
552 keep (l)argefile or use (n)ormal file? l
553 largefile large1 has a merge conflict
553 largefile large1 has a merge conflict
554 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
554 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
555 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
555 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
556 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
556 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
557 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
557 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
558 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
558 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
559
559
560 $ hg -R sub status -A sub/large1
560 $ hg -R sub status -A sub/large1
561 M sub/large1
561 M sub/large1
562 $ cat sub/large1
562 $ cat sub/large1
563 large1 for linear merge (conflict)
563 large1 for linear merge (conflict)
564 $ cat sub/.hglf/large1
564 $ cat sub/.hglf/large1
565 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
565 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
566 $ hg -R sub status -A sub/large2
566 $ hg -R sub status -A sub/large2
567 A sub/large2
567 A sub/large2
568 $ cat sub/large2
568 $ cat sub/large2
569 large2 for linear merge (conflict with normal file)
569 large2 for linear merge (conflict with normal file)
570 $ cat sub/.hglf/large2
570 $ cat sub/.hglf/large2
571 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
571 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
572
572
573 $ cd ..
573 $ cd ..
574 $ cd repo
574 $ cd repo
575
575
576 Test that rebase updates largefiles in the working directory even if
576 Test that rebase updates largefiles in the working directory even if
577 it is aborted by conflict.
577 it is aborted by conflict.
578
578
579 $ hg update -q -C 3
579 $ hg update -q -C 3
580 $ cat .hglf/large1
580 $ cat .hglf/large1
581 e5bb990443d6a92aaf7223813720f7566c9dd05b
581 e5bb990443d6a92aaf7223813720f7566c9dd05b
582 $ cat large1
582 $ cat large1
583 large1 in #3
583 large1 in #3
584 $ hg rebase -s 1 -d 3 --keep --config ui.interactive=True <<EOF
584 $ hg rebase -s 1 -d 3 --keep --config ui.interactive=True <<EOF
585 > o
585 > o
586 > EOF
586 > EOF
587 rebasing 1:72518492caa6 "#1"
587 rebasing 1:72518492caa6 "#1"
588 largefile large1 has a merge conflict
588 largefile large1 has a merge conflict
589 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
589 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
590 keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
590 keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
591 take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
591 take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
592 merging normal1
592 merging normal1
593 warning: conflicts while merging normal1! (edit, then use 'hg resolve --mark')
593 warning: conflicts while merging normal1! (edit, then use 'hg resolve --mark')
594 unresolved conflicts (see hg resolve, then hg rebase --continue)
594 unresolved conflicts (see hg resolve, then hg rebase --continue)
595 [1]
595 [1]
596 $ cat .hglf/large1
596 $ cat .hglf/large1
597 58e24f733a964da346e2407a2bee99d9001184f5
597 58e24f733a964da346e2407a2bee99d9001184f5
598 $ cat large1
598 $ cat large1
599 large1 in #1
599 large1 in #1
600 $ rm normal1.orig
600 $ rm normal1.orig
601
601
602 Test that rebase updates standins for manually modified largefiles at
602 Test that rebase updates standins for manually modified largefiles at
603 the 1st commit of resuming.
603 the 1st commit of resuming.
604
604
605 $ echo "manually modified before 'hg rebase --continue'" > large1
605 $ echo "manually modified before 'hg rebase --continue'" > large1
606 $ hg resolve -m normal1
606 $ hg resolve -m normal1
607 (no more unresolved files)
607 (no more unresolved files)
608 continue: hg rebase --continue
608 continue: hg rebase --continue
609 $ hg rebase --continue --config ui.interactive=True <<EOF
609 $ hg rebase --continue --config ui.interactive=True <<EOF
610 > c
610 > c
611 > EOF
611 > EOF
612 rebasing 1:72518492caa6 "#1"
612 rebasing 1:72518492caa6 "#1"
613 rebasing 4:07d6153b5c04 "#4"
613 rebasing 4:07d6153b5c04 "#4"
614 file '.hglf/large1' was deleted in local [dest] but was modified in other [source].
614 file '.hglf/large1' was deleted in other [source] but was modified in local [dest].
615 What do you want to do?
615 What do you want to do?
616 use (c)hanged version, (d)elete, or leave (u)nresolved? c
616 use (c)hanged version, (d)elete, or leave (u)nresolved? c
617
617
618 $ hg diff -c "tip~1" --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
618 $ hg diff -c "tip~1" --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
619 -e5bb990443d6a92aaf7223813720f7566c9dd05b
619 -e5bb990443d6a92aaf7223813720f7566c9dd05b
620 +8a4f783556e7dea21139ca0466eafce954c75c13
620 +8a4f783556e7dea21139ca0466eafce954c75c13
621 $ rm -f large1
621 $ rm -f large1
622 $ hg update -q -C tip
622 $ hg update -q -C tip
623 $ cat large1
623 $ cat large1
624 manually modified before 'hg rebase --continue'
624 manually modified before 'hg rebase --continue'
625
625
626 Test that transplant updates largefiles, of which standins are safely
626 Test that transplant updates largefiles, of which standins are safely
627 changed, even if it is aborted by conflict of other.
627 changed, even if it is aborted by conflict of other.
628
628
629 $ hg update -q -C 5
629 $ hg update -q -C 5
630 $ cat .hglf/large1
630 $ cat .hglf/large1
631 e5bb990443d6a92aaf7223813720f7566c9dd05b
631 e5bb990443d6a92aaf7223813720f7566c9dd05b
632 $ cat large1
632 $ cat large1
633 large1 in #3
633 large1 in #3
634 $ hg diff -c 4 .hglf/largeX | grep '^[+-][0-9a-z]'
634 $ hg diff -c 4 .hglf/largeX | grep '^[+-][0-9a-z]'
635 +fa44618ea25181aff4f48b70428294790cec9f61
635 +fa44618ea25181aff4f48b70428294790cec9f61
636 $ hg transplant 4
636 $ hg transplant 4
637 applying 07d6153b5c04
637 applying 07d6153b5c04
638 patching file .hglf/large1
638 patching file .hglf/large1
639 Hunk #1 FAILED at 0
639 Hunk #1 FAILED at 0
640 1 out of 1 hunks FAILED -- saving rejects to file .hglf/large1.rej
640 1 out of 1 hunks FAILED -- saving rejects to file .hglf/large1.rej
641 patch failed to apply
641 patch failed to apply
642 abort: fix up the working directory and run hg transplant --continue
642 abort: fix up the working directory and run hg transplant --continue
643 [255]
643 [255]
644 $ hg status -A large1
644 $ hg status -A large1
645 C large1
645 C large1
646 $ cat .hglf/large1
646 $ cat .hglf/large1
647 e5bb990443d6a92aaf7223813720f7566c9dd05b
647 e5bb990443d6a92aaf7223813720f7566c9dd05b
648 $ cat large1
648 $ cat large1
649 large1 in #3
649 large1 in #3
650 $ hg status -A largeX
650 $ hg status -A largeX
651 A largeX
651 A largeX
652 $ cat .hglf/largeX
652 $ cat .hglf/largeX
653 fa44618ea25181aff4f48b70428294790cec9f61
653 fa44618ea25181aff4f48b70428294790cec9f61
654 $ cat largeX
654 $ cat largeX
655 largeX
655 largeX
656
656
657 Test that transplant updates standins for manually modified largefiles
657 Test that transplant updates standins for manually modified largefiles
658 at the 1st commit of resuming.
658 at the 1st commit of resuming.
659
659
660 $ echo "manually modified before 'hg transplant --continue'" > large1
660 $ echo "manually modified before 'hg transplant --continue'" > large1
661 $ hg transplant --continue
661 $ hg transplant --continue
662 07d6153b5c04 transplanted as f1bf30eb88cc
662 07d6153b5c04 transplanted as f1bf30eb88cc
663 $ hg diff -c tip .hglf/large1 | grep '^[+-][0-9a-z]'
663 $ hg diff -c tip .hglf/large1 | grep '^[+-][0-9a-z]'
664 -e5bb990443d6a92aaf7223813720f7566c9dd05b
664 -e5bb990443d6a92aaf7223813720f7566c9dd05b
665 +6a4f36d4075fbe0f30ec1d26ca44e63c05903671
665 +6a4f36d4075fbe0f30ec1d26ca44e63c05903671
666 $ rm -f large1
666 $ rm -f large1
667 $ hg update -q -C tip
667 $ hg update -q -C tip
668 $ cat large1
668 $ cat large1
669 manually modified before 'hg transplant --continue'
669 manually modified before 'hg transplant --continue'
670
670
671 Test that "hg status" doesn't show removal of largefiles not managed
671 Test that "hg status" doesn't show removal of largefiles not managed
672 in the target context.
672 in the target context.
673
673
674 $ hg update -q -C 4
674 $ hg update -q -C 4
675 $ hg remove largeX
675 $ hg remove largeX
676 $ hg status -A largeX
676 $ hg status -A largeX
677 R largeX
677 R largeX
678 $ hg status -A --rev '.^1' largeX
678 $ hg status -A --rev '.^1' largeX
679
679
680 #if execbit
680 #if execbit
681
681
682 Test that "hg status" against revisions other than parent notices exec
682 Test that "hg status" against revisions other than parent notices exec
683 bit changes of largefiles.
683 bit changes of largefiles.
684
684
685 $ hg update -q -C 4
685 $ hg update -q -C 4
686
686
687 (the case that large2 doesn't have exec bit in the target context but
687 (the case that large2 doesn't have exec bit in the target context but
688 in the working context)
688 in the working context)
689
689
690 $ chmod +x large2
690 $ chmod +x large2
691 $ hg status -A --rev 0 large2
691 $ hg status -A --rev 0 large2
692 M large2
692 M large2
693 $ hg commit -m 'chmod +x large2'
693 $ hg commit -m 'chmod +x large2'
694
694
695 (the case that large2 has exec bit in the target context but not in
695 (the case that large2 has exec bit in the target context but not in
696 the working context)
696 the working context)
697
697
698 $ echo dummy > dummy
698 $ echo dummy > dummy
699 $ hg add dummy
699 $ hg add dummy
700 $ hg commit -m 'revision for separation'
700 $ hg commit -m 'revision for separation'
701 $ chmod -x large2
701 $ chmod -x large2
702 $ hg status -A --rev '.^1' large2
702 $ hg status -A --rev '.^1' large2
703 M large2
703 M large2
704
704
705 #else
705 #else
706
706
707 Test that "hg status" against revisions other than parent ignores exec
707 Test that "hg status" against revisions other than parent ignores exec
708 bit correctly on the platform being unaware of it.
708 bit correctly on the platform being unaware of it.
709
709
710 $ hg update -q -C 4
710 $ hg update -q -C 4
711
711
712 $ cat > ../exec-bit.patch <<EOF
712 $ cat > ../exec-bit.patch <<EOF
713 > # HG changeset patch
713 > # HG changeset patch
714 > # User test
714 > # User test
715 > # Date 0 0
715 > # Date 0 0
716 > # Thu Jan 01 00:00:00 1970 +0000
716 > # Thu Jan 01 00:00:00 1970 +0000
717 > # Node ID be1b433a65b12b27b5519d92213e14f7e1769b90
717 > # Node ID be1b433a65b12b27b5519d92213e14f7e1769b90
718 > # Parent 07d6153b5c04313efb75deec9ba577de7faeb727
718 > # Parent 07d6153b5c04313efb75deec9ba577de7faeb727
719 > chmod +x large2
719 > chmod +x large2
720 >
720 >
721 > diff --git a/.hglf/large2 b/.hglf/large2
721 > diff --git a/.hglf/large2 b/.hglf/large2
722 > old mode 100644
722 > old mode 100644
723 > new mode 100755
723 > new mode 100755
724 > EOF
724 > EOF
725 $ hg import --exact --bypass ../exec-bit.patch
725 $ hg import --exact --bypass ../exec-bit.patch
726 applying ../exec-bit.patch
726 applying ../exec-bit.patch
727 $ hg status -A --rev tip large2
727 $ hg status -A --rev tip large2
728 C large2
728 C large2
729
729
730 #endif
730 #endif
731
731
732 The fileset revset is evaluated for each revision, instead of once on wdir(),
732 The fileset revset is evaluated for each revision, instead of once on wdir(),
733 and then patterns matched on each revision. Here, no exec bits are set in
733 and then patterns matched on each revision. Here, no exec bits are set in
734 wdir(), but a matching revision is detected.
734 wdir(), but a matching revision is detected.
735
735
736 (Teach large2 is not an executable. Maybe this is a bug of largefiles.)
736 (Teach large2 is not an executable. Maybe this is a bug of largefiles.)
737 #if execbit
737 #if execbit
738 $ chmod -x .hglf/large2
738 $ chmod -x .hglf/large2
739 #endif
739 #endif
740
740
741 $ hg files 'set:exec()'
741 $ hg files 'set:exec()'
742 [1]
742 [1]
743 $ hg log -qr 'file("set:exec()")'
743 $ hg log -qr 'file("set:exec()")'
744 9:be1b433a65b1
744 9:be1b433a65b1
745
745
746 Test a fatal error interrupting an update. Verify that status report dirty
746 Test a fatal error interrupting an update. Verify that status report dirty
747 files correctly after an interrupted update. Also verify that checking all
747 files correctly after an interrupted update. Also verify that checking all
748 hashes reveals it isn't clean.
748 hashes reveals it isn't clean.
749
749
750 Start with clean dirstates:
750 Start with clean dirstates:
751 $ hg up --quiet --clean --rev "8^"
751 $ hg up --quiet --clean --rev "8^"
752 $ sleep 1
752 $ sleep 1
753 $ hg st
753 $ hg st
754 Update standins without updating largefiles - large1 is modified and largeX is
754 Update standins without updating largefiles - large1 is modified and largeX is
755 added:
755 added:
756 $ cat << EOF > ../crashupdatelfiles.py
756 $ cat << EOF > ../crashupdatelfiles.py
757 > import hgext.largefiles.lfutil
757 > import hgext.largefiles.lfutil
758 > def getlfilestoupdate(oldstandins, newstandins):
758 > def getlfilestoupdate(oldstandins, newstandins):
759 > raise SystemExit(7)
759 > raise SystemExit(7)
760 > hgext.largefiles.lfutil.getlfilestoupdate = getlfilestoupdate
760 > hgext.largefiles.lfutil.getlfilestoupdate = getlfilestoupdate
761 > EOF
761 > EOF
762 $ hg up -Cr "8" --config extensions.crashupdatelfiles=../crashupdatelfiles.py
762 $ hg up -Cr "8" --config extensions.crashupdatelfiles=../crashupdatelfiles.py
763 [7]
763 [7]
764 Check large1 content and status ... and that update will undo modifications:
764 Check large1 content and status ... and that update will undo modifications:
765 $ cat large1
765 $ cat large1
766 large1 in #3
766 large1 in #3
767 $ hg st
767 $ hg st
768 M large1
768 M large1
769 ! largeX
769 ! largeX
770 $ hg up -Cr .
770 $ hg up -Cr .
771 getting changed largefiles
771 getting changed largefiles
772 2 largefiles updated, 0 removed
772 2 largefiles updated, 0 removed
773 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
773 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
774 $ cat large1
774 $ cat large1
775 manually modified before 'hg transplant --continue'
775 manually modified before 'hg transplant --continue'
776 $ hg st
776 $ hg st
777 Force largefiles rehashing and check that all changes have been caught by
777 Force largefiles rehashing and check that all changes have been caught by
778 status and update:
778 status and update:
779 $ rm .hg/largefiles/dirstate
779 $ rm .hg/largefiles/dirstate
780 $ hg st
780 $ hg st
781
781
782 $ cd ..
782 $ cd ..
783
783
784 Test that "hg convert" avoids copying largefiles from the working
784 Test that "hg convert" avoids copying largefiles from the working
785 directory into store, because "hg convert" doesn't update largefiles
785 directory into store, because "hg convert" doesn't update largefiles
786 in the working directory (removing files under ".cache/largefiles"
786 in the working directory (removing files under ".cache/largefiles"
787 forces "hg convert" to copy corresponding largefiles)
787 forces "hg convert" to copy corresponding largefiles)
788
788
789 $ cat >> $HGRCPATH <<EOF
789 $ cat >> $HGRCPATH <<EOF
790 > [extensions]
790 > [extensions]
791 > convert =
791 > convert =
792 > EOF
792 > EOF
793
793
794 $ rm $TESTTMP/.cache/largefiles/6a4f36d4075fbe0f30ec1d26ca44e63c05903671
794 $ rm $TESTTMP/.cache/largefiles/6a4f36d4075fbe0f30ec1d26ca44e63c05903671
795 $ hg convert -q repo repo.converted
795 $ hg convert -q repo repo.converted
@@ -1,1130 +1,1130 b''
1 Tests for change/delete conflicts, including:
1 Tests for change/delete conflicts, including:
2 b5605d88dc27: Make ui.prompt repeat on "unrecognized response" again
2 b5605d88dc27: Make ui.prompt repeat on "unrecognized response" again
3 (issue897)
3 (issue897)
4
4
5 840e2b315c1f: Fix misleading error and prompts during update/merge
5 840e2b315c1f: Fix misleading error and prompts during update/merge
6 (issue556)
6 (issue556)
7
7
8 Make sure HGMERGE doesn't interfere with the test
8 Make sure HGMERGE doesn't interfere with the test
9 $ unset HGMERGE
9 $ unset HGMERGE
10
10
11 $ status() {
11 $ status() {
12 > echo "--- status ---"
12 > echo "--- status ---"
13 > hg st -A file1 file2 file3
13 > hg st -A file1 file2 file3
14 > echo "--- resolve --list ---"
14 > echo "--- resolve --list ---"
15 > hg resolve --list file1 file2 file3
15 > hg resolve --list file1 file2 file3
16 > echo "--- debugmergestate ---"
16 > echo "--- debugmergestate ---"
17 > hg debugmergestate
17 > hg debugmergestate
18 > for file in file1 file2 file3; do
18 > for file in file1 file2 file3; do
19 > if [ -f $file ]; then
19 > if [ -f $file ]; then
20 > echo "--- $file ---"
20 > echo "--- $file ---"
21 > cat $file
21 > cat $file
22 > else
22 > else
23 > echo "*** $file does not exist"
23 > echo "*** $file does not exist"
24 > fi
24 > fi
25 > done
25 > done
26 > }
26 > }
27
27
28 $ hg init repo
28 $ hg init repo
29 $ cd repo
29 $ cd repo
30
30
31 $ echo 1 > file1
31 $ echo 1 > file1
32 $ echo 2 > file2
32 $ echo 2 > file2
33 $ echo 3 > file3
33 $ echo 3 > file3
34 $ hg ci -Am 'added files'
34 $ hg ci -Am 'added files'
35 adding file1
35 adding file1
36 adding file2
36 adding file2
37 adding file3
37 adding file3
38
38
39 $ hg rm file1
39 $ hg rm file1
40 $ echo changed >> file2
40 $ echo changed >> file2
41 $ echo changed1 >> file3
41 $ echo changed1 >> file3
42 $ hg ci -m 'removed file1, changed file2, changed file3'
42 $ hg ci -m 'removed file1, changed file2, changed file3'
43
43
44 $ hg co 0
44 $ hg co 0
45 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
45 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
46
46
47 $ echo changed >> file1
47 $ echo changed >> file1
48 $ hg rm file2
48 $ hg rm file2
49 $ echo changed2 >> file3
49 $ echo changed2 >> file3
50 $ hg ci -m 'changed file1, removed file2, changed file3'
50 $ hg ci -m 'changed file1, removed file2, changed file3'
51 created new head
51 created new head
52
52
53
53
54 Non-interactive merge:
54 Non-interactive merge:
55
55
56 $ hg merge -y
56 $ hg merge -y
57 file 'file1' was deleted in local [working copy] but was modified in other [merge rev].
57 file 'file1' was deleted in other [merge rev] but was modified in local [working copy].
58 What do you want to do?
58 What do you want to do?
59 use (c)hanged version, (d)elete, or leave (u)nresolved? u
59 use (c)hanged version, (d)elete, or leave (u)nresolved? u
60 file 'file2' was deleted in other [merge rev] but was modified in local [working copy].
60 file 'file2' was deleted in local [working copy] but was modified in other [merge rev].
61 What do you want to do?
61 What do you want to do?
62 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
62 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
63 merging file3
63 merging file3
64 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
64 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
65 0 files updated, 0 files merged, 0 files removed, 3 files unresolved
65 0 files updated, 0 files merged, 0 files removed, 3 files unresolved
66 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
66 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
67 [1]
67 [1]
68
68
69 $ status
69 $ status
70 --- status ---
70 --- status ---
71 M file2
71 M file2
72 M file3
72 M file3
73 C file1
73 C file1
74 --- resolve --list ---
74 --- resolve --list ---
75 U file1
75 U file1
76 U file2
76 U file2
77 U file3
77 U file3
78 --- debugmergestate ---
78 --- debugmergestate ---
79 * version 2 records
79 * version 2 records
80 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
80 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
81 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
81 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
82 labels:
82 labels:
83 local: working copy
83 local: working copy
84 other: merge rev
84 other: merge rev
85 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
85 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
86 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
86 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
87 local path: file1 (flags "")
87 local path: file1 (flags "")
88 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
88 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
89 other path: file1 (node null)
89 other path: file1 (node null)
90 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
90 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
91 file: file2 (record type "C", state "u", hash null)
91 file: file2 (record type "C", state "u", hash null)
92 local path: file2 (flags "")
92 local path: file2 (flags "")
93 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
93 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
94 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
94 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
95 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
95 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
96 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
96 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
97 local path: file3 (flags "")
97 local path: file3 (flags "")
98 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
98 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
99 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
99 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
100 --- file1 ---
100 --- file1 ---
101 1
101 1
102 changed
102 changed
103 --- file2 ---
103 --- file2 ---
104 2
104 2
105 changed
105 changed
106 --- file3 ---
106 --- file3 ---
107 3
107 3
108 <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan...
108 <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan...
109 changed2
109 changed2
110 =======
110 =======
111 changed1
111 changed1
112 >>>>>>> merge rev: 10f9a0a634e8 - test: removed file1, changed file2, chan...
112 >>>>>>> merge rev: 10f9a0a634e8 - test: removed file1, changed file2, chan...
113
113
114
114
115 Interactive merge:
115 Interactive merge:
116
116
117 $ hg co -C
117 $ hg co -C
118 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
118 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
119 updated to "13910f48cf7b: changed file1, removed file2, changed file3"
119 updated to "13910f48cf7b: changed file1, removed file2, changed file3"
120 1 other heads for branch "default"
120 1 other heads for branch "default"
121
121
122 $ hg merge --config ui.interactive=true <<EOF
122 $ hg merge --config ui.interactive=true <<EOF
123 > c
123 > c
124 > d
124 > d
125 > EOF
125 > EOF
126 file 'file1' was deleted in local [working copy] but was modified in other [merge rev].
126 file 'file1' was deleted in other [merge rev] but was modified in local [working copy].
127 What do you want to do?
127 What do you want to do?
128 use (c)hanged version, (d)elete, or leave (u)nresolved? c
128 use (c)hanged version, (d)elete, or leave (u)nresolved? c
129 file 'file2' was deleted in other [merge rev] but was modified in local [working copy].
129 file 'file2' was deleted in local [working copy] but was modified in other [merge rev].
130 What do you want to do?
130 What do you want to do?
131 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? d
131 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? d
132 merging file3
132 merging file3
133 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
133 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
134 0 files updated, 2 files merged, 0 files removed, 1 files unresolved
134 0 files updated, 2 files merged, 0 files removed, 1 files unresolved
135 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
135 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
136 [1]
136 [1]
137
137
138 $ status
138 $ status
139 --- status ---
139 --- status ---
140 file2: * (glob)
140 file2: * (glob)
141 M file3
141 M file3
142 C file1
142 C file1
143 --- resolve --list ---
143 --- resolve --list ---
144 R file1
144 R file1
145 R file2
145 R file2
146 U file3
146 U file3
147 --- debugmergestate ---
147 --- debugmergestate ---
148 * version 2 records
148 * version 2 records
149 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
149 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
150 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
150 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
151 labels:
151 labels:
152 local: working copy
152 local: working copy
153 other: merge rev
153 other: merge rev
154 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
154 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
155 file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
155 file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
156 local path: file1 (flags "")
156 local path: file1 (flags "")
157 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
157 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
158 other path: file1 (node null)
158 other path: file1 (node null)
159 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
159 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
160 file: file2 (record type "C", state "r", hash null)
160 file: file2 (record type "C", state "r", hash null)
161 local path: file2 (flags "")
161 local path: file2 (flags "")
162 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
162 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
163 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
163 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
164 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
164 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
165 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
165 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
166 local path: file3 (flags "")
166 local path: file3 (flags "")
167 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
167 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
168 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
168 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
169 --- file1 ---
169 --- file1 ---
170 1
170 1
171 changed
171 changed
172 *** file2 does not exist
172 *** file2 does not exist
173 --- file3 ---
173 --- file3 ---
174 3
174 3
175 <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan...
175 <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan...
176 changed2
176 changed2
177 =======
177 =======
178 changed1
178 changed1
179 >>>>>>> merge rev: 10f9a0a634e8 - test: removed file1, changed file2, chan...
179 >>>>>>> merge rev: 10f9a0a634e8 - test: removed file1, changed file2, chan...
180
180
181
181
182 Interactive merge with bad input:
182 Interactive merge with bad input:
183
183
184 $ hg co -C
184 $ hg co -C
185 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
185 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
186 updated to "13910f48cf7b: changed file1, removed file2, changed file3"
186 updated to "13910f48cf7b: changed file1, removed file2, changed file3"
187 1 other heads for branch "default"
187 1 other heads for branch "default"
188
188
189 $ hg merge --config ui.interactive=true <<EOF
189 $ hg merge --config ui.interactive=true <<EOF
190 > foo
190 > foo
191 > bar
191 > bar
192 > d
192 > d
193 > baz
193 > baz
194 > c
194 > c
195 > EOF
195 > EOF
196 file 'file1' was deleted in local [working copy] but was modified in other [merge rev].
196 file 'file1' was deleted in other [merge rev] but was modified in local [working copy].
197 What do you want to do?
197 What do you want to do?
198 use (c)hanged version, (d)elete, or leave (u)nresolved? foo
198 use (c)hanged version, (d)elete, or leave (u)nresolved? foo
199 unrecognized response
199 unrecognized response
200 file 'file1' was deleted in local [working copy] but was modified in other [merge rev].
200 file 'file1' was deleted in other [merge rev] but was modified in local [working copy].
201 What do you want to do?
201 What do you want to do?
202 use (c)hanged version, (d)elete, or leave (u)nresolved? bar
202 use (c)hanged version, (d)elete, or leave (u)nresolved? bar
203 unrecognized response
203 unrecognized response
204 file 'file1' was deleted in local [working copy] but was modified in other [merge rev].
204 file 'file1' was deleted in other [merge rev] but was modified in local [working copy].
205 What do you want to do?
205 What do you want to do?
206 use (c)hanged version, (d)elete, or leave (u)nresolved? d
206 use (c)hanged version, (d)elete, or leave (u)nresolved? d
207 file 'file2' was deleted in other [merge rev] but was modified in local [working copy].
207 file 'file2' was deleted in local [working copy] but was modified in other [merge rev].
208 What do you want to do?
208 What do you want to do?
209 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? baz
209 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? baz
210 unrecognized response
210 unrecognized response
211 file 'file2' was deleted in other [merge rev] but was modified in local [working copy].
211 file 'file2' was deleted in local [working copy] but was modified in other [merge rev].
212 What do you want to do?
212 What do you want to do?
213 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? c
213 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? c
214 merging file3
214 merging file3
215 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
215 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
216 0 files updated, 1 files merged, 1 files removed, 1 files unresolved
216 0 files updated, 1 files merged, 1 files removed, 1 files unresolved
217 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
217 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
218 [1]
218 [1]
219
219
220 $ status
220 $ status
221 --- status ---
221 --- status ---
222 M file2
222 M file2
223 M file3
223 M file3
224 R file1
224 R file1
225 --- resolve --list ---
225 --- resolve --list ---
226 R file1
226 R file1
227 R file2
227 R file2
228 U file3
228 U file3
229 --- debugmergestate ---
229 --- debugmergestate ---
230 * version 2 records
230 * version 2 records
231 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
231 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
232 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
232 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
233 labels:
233 labels:
234 local: working copy
234 local: working copy
235 other: merge rev
235 other: merge rev
236 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
236 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
237 file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
237 file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
238 local path: file1 (flags "")
238 local path: file1 (flags "")
239 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
239 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
240 other path: file1 (node null)
240 other path: file1 (node null)
241 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
241 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
242 file: file2 (record type "C", state "r", hash null)
242 file: file2 (record type "C", state "r", hash null)
243 local path: file2 (flags "")
243 local path: file2 (flags "")
244 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
244 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
245 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
245 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
246 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
246 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
247 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
247 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
248 local path: file3 (flags "")
248 local path: file3 (flags "")
249 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
249 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
250 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
250 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
251 *** file1 does not exist
251 *** file1 does not exist
252 --- file2 ---
252 --- file2 ---
253 2
253 2
254 changed
254 changed
255 --- file3 ---
255 --- file3 ---
256 3
256 3
257 <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan...
257 <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan...
258 changed2
258 changed2
259 =======
259 =======
260 changed1
260 changed1
261 >>>>>>> merge rev: 10f9a0a634e8 - test: removed file1, changed file2, chan...
261 >>>>>>> merge rev: 10f9a0a634e8 - test: removed file1, changed file2, chan...
262
262
263
263
264 Interactive merge with not enough input:
264 Interactive merge with not enough input:
265
265
266 $ hg co -C
266 $ hg co -C
267 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
267 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
268 updated to "13910f48cf7b: changed file1, removed file2, changed file3"
268 updated to "13910f48cf7b: changed file1, removed file2, changed file3"
269 1 other heads for branch "default"
269 1 other heads for branch "default"
270
270
271 $ hg merge --config ui.interactive=true <<EOF
271 $ hg merge --config ui.interactive=true <<EOF
272 > d
272 > d
273 > EOF
273 > EOF
274 file 'file1' was deleted in local [working copy] but was modified in other [merge rev].
274 file 'file1' was deleted in other [merge rev] but was modified in local [working copy].
275 What do you want to do?
275 What do you want to do?
276 use (c)hanged version, (d)elete, or leave (u)nresolved? d
276 use (c)hanged version, (d)elete, or leave (u)nresolved? d
277 file 'file2' was deleted in other [merge rev] but was modified in local [working copy].
277 file 'file2' was deleted in local [working copy] but was modified in other [merge rev].
278 What do you want to do?
278 What do you want to do?
279 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
279 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
280 merging file3
280 merging file3
281 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
281 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
282 0 files updated, 0 files merged, 1 files removed, 2 files unresolved
282 0 files updated, 0 files merged, 1 files removed, 2 files unresolved
283 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
283 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
284 [1]
284 [1]
285
285
286 $ status
286 $ status
287 --- status ---
287 --- status ---
288 M file2
288 M file2
289 M file3
289 M file3
290 R file1
290 R file1
291 --- resolve --list ---
291 --- resolve --list ---
292 R file1
292 R file1
293 U file2
293 U file2
294 U file3
294 U file3
295 --- debugmergestate ---
295 --- debugmergestate ---
296 * version 2 records
296 * version 2 records
297 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
297 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
298 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
298 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
299 labels:
299 labels:
300 local: working copy
300 local: working copy
301 other: merge rev
301 other: merge rev
302 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
302 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
303 file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
303 file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
304 local path: file1 (flags "")
304 local path: file1 (flags "")
305 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
305 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
306 other path: file1 (node null)
306 other path: file1 (node null)
307 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
307 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
308 file: file2 (record type "C", state "u", hash null)
308 file: file2 (record type "C", state "u", hash null)
309 local path: file2 (flags "")
309 local path: file2 (flags "")
310 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
310 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
311 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
311 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
312 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
312 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
313 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
313 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
314 local path: file3 (flags "")
314 local path: file3 (flags "")
315 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
315 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
316 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
316 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
317 *** file1 does not exist
317 *** file1 does not exist
318 --- file2 ---
318 --- file2 ---
319 2
319 2
320 changed
320 changed
321 --- file3 ---
321 --- file3 ---
322 3
322 3
323 <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan...
323 <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan...
324 changed2
324 changed2
325 =======
325 =======
326 changed1
326 changed1
327 >>>>>>> merge rev: 10f9a0a634e8 - test: removed file1, changed file2, chan...
327 >>>>>>> merge rev: 10f9a0a634e8 - test: removed file1, changed file2, chan...
328
328
329 Choose local versions of files
329 Choose local versions of files
330
330
331 $ hg co -C
331 $ hg co -C
332 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
332 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
333 updated to "13910f48cf7b: changed file1, removed file2, changed file3"
333 updated to "13910f48cf7b: changed file1, removed file2, changed file3"
334 1 other heads for branch "default"
334 1 other heads for branch "default"
335
335
336 $ hg merge --tool :local
336 $ hg merge --tool :local
337 0 files updated, 3 files merged, 0 files removed, 0 files unresolved
337 0 files updated, 3 files merged, 0 files removed, 0 files unresolved
338 (branch merge, don't forget to commit)
338 (branch merge, don't forget to commit)
339 $ status 2>&1 | tee $TESTTMP/local.status
339 $ status 2>&1 | tee $TESTTMP/local.status
340 --- status ---
340 --- status ---
341 file2: * (glob)
341 file2: * (glob)
342 M file3
342 M file3
343 C file1
343 C file1
344 --- resolve --list ---
344 --- resolve --list ---
345 R file1
345 R file1
346 R file2
346 R file2
347 R file3
347 R file3
348 --- debugmergestate ---
348 --- debugmergestate ---
349 * version 2 records
349 * version 2 records
350 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
350 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
351 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
351 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
352 labels:
352 labels:
353 local: working copy
353 local: working copy
354 other: merge rev
354 other: merge rev
355 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
355 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
356 file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
356 file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
357 local path: file1 (flags "")
357 local path: file1 (flags "")
358 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
358 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
359 other path: file1 (node null)
359 other path: file1 (node null)
360 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
360 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
361 file: file2 (record type "C", state "r", hash null)
361 file: file2 (record type "C", state "r", hash null)
362 local path: file2 (flags "")
362 local path: file2 (flags "")
363 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
363 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
364 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
364 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
365 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
365 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
366 file: file3 (record type "F", state "r", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
366 file: file3 (record type "F", state "r", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
367 local path: file3 (flags "")
367 local path: file3 (flags "")
368 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
368 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
369 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
369 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
370 --- file1 ---
370 --- file1 ---
371 1
371 1
372 changed
372 changed
373 *** file2 does not exist
373 *** file2 does not exist
374 --- file3 ---
374 --- file3 ---
375 3
375 3
376 changed2
376 changed2
377
377
378 Choose other versions of files
378 Choose other versions of files
379
379
380 $ hg co -C
380 $ hg co -C
381 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
381 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
382 updated to "13910f48cf7b: changed file1, removed file2, changed file3"
382 updated to "13910f48cf7b: changed file1, removed file2, changed file3"
383 1 other heads for branch "default"
383 1 other heads for branch "default"
384
384
385 $ hg merge --tool :other
385 $ hg merge --tool :other
386 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
386 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
387 (branch merge, don't forget to commit)
387 (branch merge, don't forget to commit)
388 $ status 2>&1 | tee $TESTTMP/other.status
388 $ status 2>&1 | tee $TESTTMP/other.status
389 --- status ---
389 --- status ---
390 M file2
390 M file2
391 M file3
391 M file3
392 R file1
392 R file1
393 --- resolve --list ---
393 --- resolve --list ---
394 R file1
394 R file1
395 R file2
395 R file2
396 R file3
396 R file3
397 --- debugmergestate ---
397 --- debugmergestate ---
398 * version 2 records
398 * version 2 records
399 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
399 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
400 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
400 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
401 labels:
401 labels:
402 local: working copy
402 local: working copy
403 other: merge rev
403 other: merge rev
404 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
404 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
405 file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
405 file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
406 local path: file1 (flags "")
406 local path: file1 (flags "")
407 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
407 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
408 other path: file1 (node null)
408 other path: file1 (node null)
409 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
409 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
410 file: file2 (record type "C", state "r", hash null)
410 file: file2 (record type "C", state "r", hash null)
411 local path: file2 (flags "")
411 local path: file2 (flags "")
412 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
412 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
413 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
413 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
414 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
414 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
415 file: file3 (record type "F", state "r", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
415 file: file3 (record type "F", state "r", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
416 local path: file3 (flags "")
416 local path: file3 (flags "")
417 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
417 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
418 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
418 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
419 *** file1 does not exist
419 *** file1 does not exist
420 --- file2 ---
420 --- file2 ---
421 2
421 2
422 changed
422 changed
423 --- file3 ---
423 --- file3 ---
424 3
424 3
425 changed1
425 changed1
426
426
427 Fail
427 Fail
428
428
429 $ hg co -C
429 $ hg co -C
430 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
430 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
431 updated to "13910f48cf7b: changed file1, removed file2, changed file3"
431 updated to "13910f48cf7b: changed file1, removed file2, changed file3"
432 1 other heads for branch "default"
432 1 other heads for branch "default"
433
433
434 $ hg merge --tool :fail
434 $ hg merge --tool :fail
435 0 files updated, 0 files merged, 0 files removed, 3 files unresolved
435 0 files updated, 0 files merged, 0 files removed, 3 files unresolved
436 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
436 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
437 [1]
437 [1]
438 $ status 2>&1 | tee $TESTTMP/fail.status
438 $ status 2>&1 | tee $TESTTMP/fail.status
439 --- status ---
439 --- status ---
440 M file2
440 M file2
441 M file3
441 M file3
442 C file1
442 C file1
443 --- resolve --list ---
443 --- resolve --list ---
444 U file1
444 U file1
445 U file2
445 U file2
446 U file3
446 U file3
447 --- debugmergestate ---
447 --- debugmergestate ---
448 * version 2 records
448 * version 2 records
449 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
449 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
450 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
450 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
451 labels:
451 labels:
452 local: working copy
452 local: working copy
453 other: merge rev
453 other: merge rev
454 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
454 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
455 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
455 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
456 local path: file1 (flags "")
456 local path: file1 (flags "")
457 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
457 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
458 other path: file1 (node null)
458 other path: file1 (node null)
459 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
459 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
460 file: file2 (record type "C", state "u", hash null)
460 file: file2 (record type "C", state "u", hash null)
461 local path: file2 (flags "")
461 local path: file2 (flags "")
462 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
462 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
463 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
463 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
464 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
464 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
465 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
465 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
466 local path: file3 (flags "")
466 local path: file3 (flags "")
467 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
467 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
468 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
468 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
469 --- file1 ---
469 --- file1 ---
470 1
470 1
471 changed
471 changed
472 --- file2 ---
472 --- file2 ---
473 2
473 2
474 changed
474 changed
475 --- file3 ---
475 --- file3 ---
476 3
476 3
477 changed2
477 changed2
478
478
479 Force prompts with no input (should be similar to :fail)
479 Force prompts with no input (should be similar to :fail)
480
480
481 $ hg co -C
481 $ hg co -C
482 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
482 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
483 updated to "13910f48cf7b: changed file1, removed file2, changed file3"
483 updated to "13910f48cf7b: changed file1, removed file2, changed file3"
484 1 other heads for branch "default"
484 1 other heads for branch "default"
485
485
486 $ hg merge --config ui.interactive=True --tool :prompt
486 $ hg merge --config ui.interactive=True --tool :prompt
487 file 'file1' was deleted in local [working copy] but was modified in other [merge rev].
487 file 'file1' was deleted in other [merge rev] but was modified in local [working copy].
488 What do you want to do?
488 What do you want to do?
489 use (c)hanged version, (d)elete, or leave (u)nresolved?
489 use (c)hanged version, (d)elete, or leave (u)nresolved?
490 file 'file2' was deleted in other [merge rev] but was modified in local [working copy].
490 file 'file2' was deleted in local [working copy] but was modified in other [merge rev].
491 What do you want to do?
491 What do you want to do?
492 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
492 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
493 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for file3?
493 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for file3?
494 0 files updated, 0 files merged, 0 files removed, 3 files unresolved
494 0 files updated, 0 files merged, 0 files removed, 3 files unresolved
495 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
495 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
496 [1]
496 [1]
497 $ status 2>&1 | tee $TESTTMP/prompt.status
497 $ status 2>&1 | tee $TESTTMP/prompt.status
498 --- status ---
498 --- status ---
499 M file2
499 M file2
500 M file3
500 M file3
501 C file1
501 C file1
502 --- resolve --list ---
502 --- resolve --list ---
503 U file1
503 U file1
504 U file2
504 U file2
505 U file3
505 U file3
506 --- debugmergestate ---
506 --- debugmergestate ---
507 * version 2 records
507 * version 2 records
508 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
508 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
509 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
509 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
510 labels:
510 labels:
511 local: working copy
511 local: working copy
512 other: merge rev
512 other: merge rev
513 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
513 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
514 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
514 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
515 local path: file1 (flags "")
515 local path: file1 (flags "")
516 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
516 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
517 other path: file1 (node null)
517 other path: file1 (node null)
518 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
518 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
519 file: file2 (record type "C", state "u", hash null)
519 file: file2 (record type "C", state "u", hash null)
520 local path: file2 (flags "")
520 local path: file2 (flags "")
521 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
521 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
522 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
522 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
523 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
523 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
524 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
524 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
525 local path: file3 (flags "")
525 local path: file3 (flags "")
526 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
526 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
527 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
527 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
528 --- file1 ---
528 --- file1 ---
529 1
529 1
530 changed
530 changed
531 --- file2 ---
531 --- file2 ---
532 2
532 2
533 changed
533 changed
534 --- file3 ---
534 --- file3 ---
535 3
535 3
536 changed2
536 changed2
537 $ cmp $TESTTMP/fail.status $TESTTMP/prompt.status || diff -U8 $TESTTMP/fail.status $TESTTMP/prompt.status
537 $ cmp $TESTTMP/fail.status $TESTTMP/prompt.status || diff -U8 $TESTTMP/fail.status $TESTTMP/prompt.status
538
538
539
539
540 Force prompts
540 Force prompts
541
541
542 $ hg co -C
542 $ hg co -C
543 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
543 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
544 updated to "13910f48cf7b: changed file1, removed file2, changed file3"
544 updated to "13910f48cf7b: changed file1, removed file2, changed file3"
545 1 other heads for branch "default"
545 1 other heads for branch "default"
546
546
547 $ hg merge --tool :prompt
547 $ hg merge --tool :prompt
548 file 'file1' was deleted in local [working copy] but was modified in other [merge rev].
548 file 'file1' was deleted in other [merge rev] but was modified in local [working copy].
549 What do you want to do?
549 What do you want to do?
550 use (c)hanged version, (d)elete, or leave (u)nresolved? u
550 use (c)hanged version, (d)elete, or leave (u)nresolved? u
551 file 'file2' was deleted in other [merge rev] but was modified in local [working copy].
551 file 'file2' was deleted in local [working copy] but was modified in other [merge rev].
552 What do you want to do?
552 What do you want to do?
553 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
553 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
554 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for file3? u
554 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for file3? u
555 0 files updated, 0 files merged, 0 files removed, 3 files unresolved
555 0 files updated, 0 files merged, 0 files removed, 3 files unresolved
556 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
556 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
557 [1]
557 [1]
558 $ status
558 $ status
559 --- status ---
559 --- status ---
560 M file2
560 M file2
561 M file3
561 M file3
562 C file1
562 C file1
563 --- resolve --list ---
563 --- resolve --list ---
564 U file1
564 U file1
565 U file2
565 U file2
566 U file3
566 U file3
567 --- debugmergestate ---
567 --- debugmergestate ---
568 * version 2 records
568 * version 2 records
569 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
569 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
570 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
570 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
571 labels:
571 labels:
572 local: working copy
572 local: working copy
573 other: merge rev
573 other: merge rev
574 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
574 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
575 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
575 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
576 local path: file1 (flags "")
576 local path: file1 (flags "")
577 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
577 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
578 other path: file1 (node null)
578 other path: file1 (node null)
579 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
579 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
580 file: file2 (record type "C", state "u", hash null)
580 file: file2 (record type "C", state "u", hash null)
581 local path: file2 (flags "")
581 local path: file2 (flags "")
582 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
582 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
583 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
583 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
584 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
584 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
585 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
585 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
586 local path: file3 (flags "")
586 local path: file3 (flags "")
587 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
587 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
588 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
588 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
589 --- file1 ---
589 --- file1 ---
590 1
590 1
591 changed
591 changed
592 --- file2 ---
592 --- file2 ---
593 2
593 2
594 changed
594 changed
595 --- file3 ---
595 --- file3 ---
596 3
596 3
597 changed2
597 changed2
598
598
599 Choose to merge all files
599 Choose to merge all files
600
600
601 $ hg co -C
601 $ hg co -C
602 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
602 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
603 updated to "13910f48cf7b: changed file1, removed file2, changed file3"
603 updated to "13910f48cf7b: changed file1, removed file2, changed file3"
604 1 other heads for branch "default"
604 1 other heads for branch "default"
605
605
606 $ hg merge --tool :merge3
606 $ hg merge --tool :merge3
607 file 'file1' was deleted in local [working copy] but was modified in other [merge rev].
607 file 'file1' was deleted in other [merge rev] but was modified in local [working copy].
608 What do you want to do?
608 What do you want to do?
609 use (c)hanged version, (d)elete, or leave (u)nresolved? u
609 use (c)hanged version, (d)elete, or leave (u)nresolved? u
610 file 'file2' was deleted in other [merge rev] but was modified in local [working copy].
610 file 'file2' was deleted in local [working copy] but was modified in other [merge rev].
611 What do you want to do?
611 What do you want to do?
612 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
612 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
613 merging file3
613 merging file3
614 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
614 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
615 0 files updated, 0 files merged, 0 files removed, 3 files unresolved
615 0 files updated, 0 files merged, 0 files removed, 3 files unresolved
616 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
616 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
617 [1]
617 [1]
618 $ status
618 $ status
619 --- status ---
619 --- status ---
620 M file2
620 M file2
621 M file3
621 M file3
622 C file1
622 C file1
623 --- resolve --list ---
623 --- resolve --list ---
624 U file1
624 U file1
625 U file2
625 U file2
626 U file3
626 U file3
627 --- debugmergestate ---
627 --- debugmergestate ---
628 * version 2 records
628 * version 2 records
629 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
629 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
630 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
630 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
631 labels:
631 labels:
632 local: working copy
632 local: working copy
633 other: merge rev
633 other: merge rev
634 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
634 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
635 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
635 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
636 local path: file1 (flags "")
636 local path: file1 (flags "")
637 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
637 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
638 other path: file1 (node null)
638 other path: file1 (node null)
639 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
639 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
640 file: file2 (record type "C", state "u", hash null)
640 file: file2 (record type "C", state "u", hash null)
641 local path: file2 (flags "")
641 local path: file2 (flags "")
642 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
642 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
643 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
643 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
644 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
644 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
645 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
645 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
646 local path: file3 (flags "")
646 local path: file3 (flags "")
647 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
647 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
648 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
648 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
649 --- file1 ---
649 --- file1 ---
650 1
650 1
651 changed
651 changed
652 --- file2 ---
652 --- file2 ---
653 2
653 2
654 changed
654 changed
655 --- file3 ---
655 --- file3 ---
656 3
656 3
657 <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan...
657 <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan...
658 changed2
658 changed2
659 ||||||| base
659 ||||||| base
660 =======
660 =======
661 changed1
661 changed1
662 >>>>>>> merge rev: 10f9a0a634e8 - test: removed file1, changed file2, chan...
662 >>>>>>> merge rev: 10f9a0a634e8 - test: removed file1, changed file2, chan...
663
663
664 Exercise transitions between local, other, fail and prompt, and make sure the
664 Exercise transitions between local, other, fail and prompt, and make sure the
665 dirstate stays consistent. (Compare with each other and to the above
665 dirstate stays consistent. (Compare with each other and to the above
666 invocations.)
666 invocations.)
667
667
668 $ testtransitions() {
668 $ testtransitions() {
669 > # this traversal order covers every transition
669 > # this traversal order covers every transition
670 > tools="local other prompt local fail other local prompt other fail prompt fail local"
670 > tools="local other prompt local fail other local prompt other fail prompt fail local"
671 > lasttool="merge3"
671 > lasttool="merge3"
672 > for tool in $tools; do
672 > for tool in $tools; do
673 > echo "=== :$lasttool -> :$tool ==="
673 > echo "=== :$lasttool -> :$tool ==="
674 > ref="$TESTTMP/$tool.status"
674 > ref="$TESTTMP/$tool.status"
675 > hg resolve --unmark --all
675 > hg resolve --unmark --all
676 > hg resolve --tool ":$tool" --all --config ui.interactive=True
676 > hg resolve --tool ":$tool" --all --config ui.interactive=True
677 > status > "$TESTTMP/compare.status" 2>&1
677 > status > "$TESTTMP/compare.status" 2>&1
678 > echo '--- diff of status ---'
678 > echo '--- diff of status ---'
679 > if cmp "$TESTTMP/$tool.status" "$TESTTMP/compare.status" || diff -U8 "$TESTTMP/$tool.status" "$TESTTMP/compare.status"; then
679 > if cmp "$TESTTMP/$tool.status" "$TESTTMP/compare.status" || diff -U8 "$TESTTMP/$tool.status" "$TESTTMP/compare.status"; then
680 > echo '(status identical)'
680 > echo '(status identical)'
681 > fi
681 > fi
682 > lasttool="$tool"
682 > lasttool="$tool"
683 > echo
683 > echo
684 > done
684 > done
685 > }
685 > }
686
686
687 $ testtransitions
687 $ testtransitions
688 === :merge3 -> :local ===
688 === :merge3 -> :local ===
689 (no more unresolved files)
689 (no more unresolved files)
690 --- diff of status ---
690 --- diff of status ---
691 (status identical)
691 (status identical)
692
692
693 === :local -> :other ===
693 === :local -> :other ===
694 (no more unresolved files)
694 (no more unresolved files)
695 --- diff of status ---
695 --- diff of status ---
696 (status identical)
696 (status identical)
697
697
698 === :other -> :prompt ===
698 === :other -> :prompt ===
699 file 'file1' was deleted in local [working copy] but was modified in other [merge rev].
699 file 'file1' was deleted in other [merge rev] but was modified in local [working copy].
700 What do you want to do?
700 What do you want to do?
701 use (c)hanged version, (d)elete, or leave (u)nresolved?
701 use (c)hanged version, (d)elete, or leave (u)nresolved?
702 file 'file2' was deleted in other [merge rev] but was modified in local [working copy].
702 file 'file2' was deleted in local [working copy] but was modified in other [merge rev].
703 What do you want to do?
703 What do you want to do?
704 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
704 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
705 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for file3?
705 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for file3?
706 --- diff of status ---
706 --- diff of status ---
707 (status identical)
707 (status identical)
708
708
709 === :prompt -> :local ===
709 === :prompt -> :local ===
710 (no more unresolved files)
710 (no more unresolved files)
711 --- diff of status ---
711 --- diff of status ---
712 (status identical)
712 (status identical)
713
713
714 === :local -> :fail ===
714 === :local -> :fail ===
715 --- diff of status ---
715 --- diff of status ---
716 (status identical)
716 (status identical)
717
717
718 === :fail -> :other ===
718 === :fail -> :other ===
719 (no more unresolved files)
719 (no more unresolved files)
720 --- diff of status ---
720 --- diff of status ---
721 (status identical)
721 (status identical)
722
722
723 === :other -> :local ===
723 === :other -> :local ===
724 (no more unresolved files)
724 (no more unresolved files)
725 --- diff of status ---
725 --- diff of status ---
726 (status identical)
726 (status identical)
727
727
728 === :local -> :prompt ===
728 === :local -> :prompt ===
729 file 'file1' was deleted in local [working copy] but was modified in other [merge rev].
729 file 'file1' was deleted in other [merge rev] but was modified in local [working copy].
730 What do you want to do?
730 What do you want to do?
731 use (c)hanged version, (d)elete, or leave (u)nresolved?
731 use (c)hanged version, (d)elete, or leave (u)nresolved?
732 file 'file2' was deleted in other [merge rev] but was modified in local [working copy].
732 file 'file2' was deleted in local [working copy] but was modified in other [merge rev].
733 What do you want to do?
733 What do you want to do?
734 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
734 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
735 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for file3?
735 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for file3?
736 --- diff of status ---
736 --- diff of status ---
737 (status identical)
737 (status identical)
738
738
739 === :prompt -> :other ===
739 === :prompt -> :other ===
740 (no more unresolved files)
740 (no more unresolved files)
741 --- diff of status ---
741 --- diff of status ---
742 (status identical)
742 (status identical)
743
743
744 === :other -> :fail ===
744 === :other -> :fail ===
745 --- diff of status ---
745 --- diff of status ---
746 (status identical)
746 (status identical)
747
747
748 === :fail -> :prompt ===
748 === :fail -> :prompt ===
749 file 'file1' was deleted in local [working copy] but was modified in other [merge rev].
749 file 'file1' was deleted in other [merge rev] but was modified in local [working copy].
750 What do you want to do?
750 What do you want to do?
751 use (c)hanged version, (d)elete, or leave (u)nresolved?
751 use (c)hanged version, (d)elete, or leave (u)nresolved?
752 file 'file2' was deleted in other [merge rev] but was modified in local [working copy].
752 file 'file2' was deleted in local [working copy] but was modified in other [merge rev].
753 What do you want to do?
753 What do you want to do?
754 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
754 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
755 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for file3?
755 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for file3?
756 --- diff of status ---
756 --- diff of status ---
757 (status identical)
757 (status identical)
758
758
759 === :prompt -> :fail ===
759 === :prompt -> :fail ===
760 --- diff of status ---
760 --- diff of status ---
761 (status identical)
761 (status identical)
762
762
763 === :fail -> :local ===
763 === :fail -> :local ===
764 (no more unresolved files)
764 (no more unresolved files)
765 --- diff of status ---
765 --- diff of status ---
766 (status identical)
766 (status identical)
767
767
768
768
769
769
770 Non-interactive linear update
770 Non-interactive linear update
771
771
772 $ hg co -C 0
772 $ hg co -C 0
773 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
773 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
774 $ echo changed >> file1
774 $ echo changed >> file1
775 $ hg rm file2
775 $ hg rm file2
776 $ hg update 1 -y
776 $ hg update 1 -y
777 file 'file1' was deleted in local [working copy] but was modified in other [destination].
777 file 'file1' was deleted in other [destination] but was modified in local [working copy].
778 What do you want to do?
778 What do you want to do?
779 use (c)hanged version, (d)elete, or leave (u)nresolved? u
779 use (c)hanged version, (d)elete, or leave (u)nresolved? u
780 file 'file2' was deleted in other [destination] but was modified in local [working copy].
780 file 'file2' was deleted in local [working copy] but was modified in other [destination].
781 What do you want to do?
781 What do you want to do?
782 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
782 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
783 1 files updated, 0 files merged, 0 files removed, 2 files unresolved
783 1 files updated, 0 files merged, 0 files removed, 2 files unresolved
784 use 'hg resolve' to retry unresolved file merges
784 use 'hg resolve' to retry unresolved file merges
785 [1]
785 [1]
786 $ status
786 $ status
787 --- status ---
787 --- status ---
788 A file1
788 A file1
789 C file2
789 C file2
790 C file3
790 C file3
791 --- resolve --list ---
791 --- resolve --list ---
792 U file1
792 U file1
793 U file2
793 U file2
794 --- debugmergestate ---
794 --- debugmergestate ---
795 * version 2 records
795 * version 2 records
796 local: ab57bf49aa276a22d35a473592d4c34b5abc3eff
796 local: ab57bf49aa276a22d35a473592d4c34b5abc3eff
797 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
797 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
798 labels:
798 labels:
799 local: working copy
799 local: working copy
800 other: destination
800 other: destination
801 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
801 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
802 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
802 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
803 local path: file1 (flags "")
803 local path: file1 (flags "")
804 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
804 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
805 other path: file1 (node null)
805 other path: file1 (node null)
806 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
806 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
807 file: file2 (record type "C", state "u", hash null)
807 file: file2 (record type "C", state "u", hash null)
808 local path: file2 (flags "")
808 local path: file2 (flags "")
809 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
809 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
810 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
810 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
811 --- file1 ---
811 --- file1 ---
812 1
812 1
813 changed
813 changed
814 --- file2 ---
814 --- file2 ---
815 2
815 2
816 changed
816 changed
817 --- file3 ---
817 --- file3 ---
818 3
818 3
819 changed1
819 changed1
820
820
821 Choose local versions of files
821 Choose local versions of files
822
822
823 $ hg co -C 0
823 $ hg co -C 0
824 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
824 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
825 $ echo changed >> file1
825 $ echo changed >> file1
826 $ hg rm file2
826 $ hg rm file2
827 $ hg update 1 --tool :local
827 $ hg update 1 --tool :local
828 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
828 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
829 $ status 2>&1 | tee $TESTTMP/local.status
829 $ status 2>&1 | tee $TESTTMP/local.status
830 --- status ---
830 --- status ---
831 file2: * (glob)
831 file2: * (glob)
832 A file1
832 A file1
833 C file3
833 C file3
834 --- resolve --list ---
834 --- resolve --list ---
835 R file1
835 R file1
836 R file2
836 R file2
837 --- debugmergestate ---
837 --- debugmergestate ---
838 * version 2 records
838 * version 2 records
839 local: ab57bf49aa276a22d35a473592d4c34b5abc3eff
839 local: ab57bf49aa276a22d35a473592d4c34b5abc3eff
840 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
840 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
841 labels:
841 labels:
842 local: working copy
842 local: working copy
843 other: destination
843 other: destination
844 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
844 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
845 file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
845 file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
846 local path: file1 (flags "")
846 local path: file1 (flags "")
847 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
847 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
848 other path: file1 (node null)
848 other path: file1 (node null)
849 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
849 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
850 file: file2 (record type "C", state "r", hash null)
850 file: file2 (record type "C", state "r", hash null)
851 local path: file2 (flags "")
851 local path: file2 (flags "")
852 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
852 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
853 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
853 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
854 --- file1 ---
854 --- file1 ---
855 1
855 1
856 changed
856 changed
857 *** file2 does not exist
857 *** file2 does not exist
858 --- file3 ---
858 --- file3 ---
859 3
859 3
860 changed1
860 changed1
861
861
862 Choose other versions of files
862 Choose other versions of files
863
863
864 $ hg co -C 0
864 $ hg co -C 0
865 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
865 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
866 $ echo changed >> file1
866 $ echo changed >> file1
867 $ hg rm file2
867 $ hg rm file2
868 $ hg update 1 --tool :other
868 $ hg update 1 --tool :other
869 1 files updated, 1 files merged, 1 files removed, 0 files unresolved
869 1 files updated, 1 files merged, 1 files removed, 0 files unresolved
870 $ status 2>&1 | tee $TESTTMP/other.status
870 $ status 2>&1 | tee $TESTTMP/other.status
871 --- status ---
871 --- status ---
872 file1: * (glob)
872 file1: * (glob)
873 C file2
873 C file2
874 C file3
874 C file3
875 --- resolve --list ---
875 --- resolve --list ---
876 R file1
876 R file1
877 R file2
877 R file2
878 --- debugmergestate ---
878 --- debugmergestate ---
879 * version 2 records
879 * version 2 records
880 local: ab57bf49aa276a22d35a473592d4c34b5abc3eff
880 local: ab57bf49aa276a22d35a473592d4c34b5abc3eff
881 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
881 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
882 labels:
882 labels:
883 local: working copy
883 local: working copy
884 other: destination
884 other: destination
885 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
885 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
886 file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
886 file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
887 local path: file1 (flags "")
887 local path: file1 (flags "")
888 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
888 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
889 other path: file1 (node null)
889 other path: file1 (node null)
890 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
890 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
891 file: file2 (record type "C", state "r", hash null)
891 file: file2 (record type "C", state "r", hash null)
892 local path: file2 (flags "")
892 local path: file2 (flags "")
893 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
893 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
894 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
894 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
895 *** file1 does not exist
895 *** file1 does not exist
896 --- file2 ---
896 --- file2 ---
897 2
897 2
898 changed
898 changed
899 --- file3 ---
899 --- file3 ---
900 3
900 3
901 changed1
901 changed1
902
902
903 Fail
903 Fail
904
904
905 $ hg co -C 0
905 $ hg co -C 0
906 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
906 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
907 $ echo changed >> file1
907 $ echo changed >> file1
908 $ hg rm file2
908 $ hg rm file2
909 $ hg update 1 --tool :fail
909 $ hg update 1 --tool :fail
910 1 files updated, 0 files merged, 0 files removed, 2 files unresolved
910 1 files updated, 0 files merged, 0 files removed, 2 files unresolved
911 use 'hg resolve' to retry unresolved file merges
911 use 'hg resolve' to retry unresolved file merges
912 [1]
912 [1]
913 $ status 2>&1 | tee $TESTTMP/fail.status
913 $ status 2>&1 | tee $TESTTMP/fail.status
914 --- status ---
914 --- status ---
915 A file1
915 A file1
916 C file2
916 C file2
917 C file3
917 C file3
918 --- resolve --list ---
918 --- resolve --list ---
919 U file1
919 U file1
920 U file2
920 U file2
921 --- debugmergestate ---
921 --- debugmergestate ---
922 * version 2 records
922 * version 2 records
923 local: ab57bf49aa276a22d35a473592d4c34b5abc3eff
923 local: ab57bf49aa276a22d35a473592d4c34b5abc3eff
924 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
924 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
925 labels:
925 labels:
926 local: working copy
926 local: working copy
927 other: destination
927 other: destination
928 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
928 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
929 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
929 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
930 local path: file1 (flags "")
930 local path: file1 (flags "")
931 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
931 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
932 other path: file1 (node null)
932 other path: file1 (node null)
933 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
933 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
934 file: file2 (record type "C", state "u", hash null)
934 file: file2 (record type "C", state "u", hash null)
935 local path: file2 (flags "")
935 local path: file2 (flags "")
936 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
936 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
937 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
937 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
938 --- file1 ---
938 --- file1 ---
939 1
939 1
940 changed
940 changed
941 --- file2 ---
941 --- file2 ---
942 2
942 2
943 changed
943 changed
944 --- file3 ---
944 --- file3 ---
945 3
945 3
946 changed1
946 changed1
947
947
948 Force prompts with no input
948 Force prompts with no input
949
949
950 $ hg co -C 0
950 $ hg co -C 0
951 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
951 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
952 $ echo changed >> file1
952 $ echo changed >> file1
953 $ hg rm file2
953 $ hg rm file2
954 $ hg update 1 --config ui.interactive=True --tool :prompt
954 $ hg update 1 --config ui.interactive=True --tool :prompt
955 file 'file1' was deleted in local [working copy] but was modified in other [destination].
955 file 'file1' was deleted in other [destination] but was modified in local [working copy].
956 What do you want to do?
956 What do you want to do?
957 use (c)hanged version, (d)elete, or leave (u)nresolved?
957 use (c)hanged version, (d)elete, or leave (u)nresolved?
958 file 'file2' was deleted in other [destination] but was modified in local [working copy].
958 file 'file2' was deleted in local [working copy] but was modified in other [destination].
959 What do you want to do?
959 What do you want to do?
960 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
960 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
961 1 files updated, 0 files merged, 0 files removed, 2 files unresolved
961 1 files updated, 0 files merged, 0 files removed, 2 files unresolved
962 use 'hg resolve' to retry unresolved file merges
962 use 'hg resolve' to retry unresolved file merges
963 [1]
963 [1]
964 $ status 2>&1 | tee $TESTTMP/prompt.status
964 $ status 2>&1 | tee $TESTTMP/prompt.status
965 --- status ---
965 --- status ---
966 A file1
966 A file1
967 C file2
967 C file2
968 C file3
968 C file3
969 --- resolve --list ---
969 --- resolve --list ---
970 U file1
970 U file1
971 U file2
971 U file2
972 --- debugmergestate ---
972 --- debugmergestate ---
973 * version 2 records
973 * version 2 records
974 local: ab57bf49aa276a22d35a473592d4c34b5abc3eff
974 local: ab57bf49aa276a22d35a473592d4c34b5abc3eff
975 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
975 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
976 labels:
976 labels:
977 local: working copy
977 local: working copy
978 other: destination
978 other: destination
979 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
979 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
980 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
980 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
981 local path: file1 (flags "")
981 local path: file1 (flags "")
982 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
982 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
983 other path: file1 (node null)
983 other path: file1 (node null)
984 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
984 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
985 file: file2 (record type "C", state "u", hash null)
985 file: file2 (record type "C", state "u", hash null)
986 local path: file2 (flags "")
986 local path: file2 (flags "")
987 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
987 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
988 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
988 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
989 --- file1 ---
989 --- file1 ---
990 1
990 1
991 changed
991 changed
992 --- file2 ---
992 --- file2 ---
993 2
993 2
994 changed
994 changed
995 --- file3 ---
995 --- file3 ---
996 3
996 3
997 changed1
997 changed1
998 $ cmp $TESTTMP/fail.status $TESTTMP/prompt.status || diff -U8 $TESTTMP/fail.status $TESTTMP/prompt.status
998 $ cmp $TESTTMP/fail.status $TESTTMP/prompt.status || diff -U8 $TESTTMP/fail.status $TESTTMP/prompt.status
999
999
1000 Choose to merge all files
1000 Choose to merge all files
1001
1001
1002 $ hg co -C 0
1002 $ hg co -C 0
1003 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1003 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1004 $ echo changed >> file1
1004 $ echo changed >> file1
1005 $ hg rm file2
1005 $ hg rm file2
1006 $ hg update 1 --tool :merge3
1006 $ hg update 1 --tool :merge3
1007 file 'file1' was deleted in local [working copy] but was modified in other [destination].
1007 file 'file1' was deleted in other [destination] but was modified in local [working copy].
1008 What do you want to do?
1008 What do you want to do?
1009 use (c)hanged version, (d)elete, or leave (u)nresolved? u
1009 use (c)hanged version, (d)elete, or leave (u)nresolved? u
1010 file 'file2' was deleted in other [destination] but was modified in local [working copy].
1010 file 'file2' was deleted in local [working copy] but was modified in other [destination].
1011 What do you want to do?
1011 What do you want to do?
1012 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
1012 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
1013 1 files updated, 0 files merged, 0 files removed, 2 files unresolved
1013 1 files updated, 0 files merged, 0 files removed, 2 files unresolved
1014 use 'hg resolve' to retry unresolved file merges
1014 use 'hg resolve' to retry unresolved file merges
1015 [1]
1015 [1]
1016 $ status
1016 $ status
1017 --- status ---
1017 --- status ---
1018 A file1
1018 A file1
1019 C file2
1019 C file2
1020 C file3
1020 C file3
1021 --- resolve --list ---
1021 --- resolve --list ---
1022 U file1
1022 U file1
1023 U file2
1023 U file2
1024 --- debugmergestate ---
1024 --- debugmergestate ---
1025 * version 2 records
1025 * version 2 records
1026 local: ab57bf49aa276a22d35a473592d4c34b5abc3eff
1026 local: ab57bf49aa276a22d35a473592d4c34b5abc3eff
1027 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
1027 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
1028 labels:
1028 labels:
1029 local: working copy
1029 local: working copy
1030 other: destination
1030 other: destination
1031 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
1031 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
1032 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
1032 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
1033 local path: file1 (flags "")
1033 local path: file1 (flags "")
1034 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
1034 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
1035 other path: file1 (node null)
1035 other path: file1 (node null)
1036 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
1036 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
1037 file: file2 (record type "C", state "u", hash null)
1037 file: file2 (record type "C", state "u", hash null)
1038 local path: file2 (flags "")
1038 local path: file2 (flags "")
1039 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
1039 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
1040 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
1040 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
1041 --- file1 ---
1041 --- file1 ---
1042 1
1042 1
1043 changed
1043 changed
1044 --- file2 ---
1044 --- file2 ---
1045 2
1045 2
1046 changed
1046 changed
1047 --- file3 ---
1047 --- file3 ---
1048 3
1048 3
1049 changed1
1049 changed1
1050
1050
1051 Test transitions between different merge tools
1051 Test transitions between different merge tools
1052
1052
1053 $ testtransitions
1053 $ testtransitions
1054 === :merge3 -> :local ===
1054 === :merge3 -> :local ===
1055 (no more unresolved files)
1055 (no more unresolved files)
1056 --- diff of status ---
1056 --- diff of status ---
1057 (status identical)
1057 (status identical)
1058
1058
1059 === :local -> :other ===
1059 === :local -> :other ===
1060 (no more unresolved files)
1060 (no more unresolved files)
1061 --- diff of status ---
1061 --- diff of status ---
1062 (status identical)
1062 (status identical)
1063
1063
1064 === :other -> :prompt ===
1064 === :other -> :prompt ===
1065 file 'file1' was deleted in local [working copy] but was modified in other [destination].
1065 file 'file1' was deleted in other [destination] but was modified in local [working copy].
1066 What do you want to do?
1066 What do you want to do?
1067 use (c)hanged version, (d)elete, or leave (u)nresolved?
1067 use (c)hanged version, (d)elete, or leave (u)nresolved?
1068 file 'file2' was deleted in other [destination] but was modified in local [working copy].
1068 file 'file2' was deleted in local [working copy] but was modified in other [destination].
1069 What do you want to do?
1069 What do you want to do?
1070 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
1070 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
1071 --- diff of status ---
1071 --- diff of status ---
1072 (status identical)
1072 (status identical)
1073
1073
1074 === :prompt -> :local ===
1074 === :prompt -> :local ===
1075 (no more unresolved files)
1075 (no more unresolved files)
1076 --- diff of status ---
1076 --- diff of status ---
1077 (status identical)
1077 (status identical)
1078
1078
1079 === :local -> :fail ===
1079 === :local -> :fail ===
1080 --- diff of status ---
1080 --- diff of status ---
1081 (status identical)
1081 (status identical)
1082
1082
1083 === :fail -> :other ===
1083 === :fail -> :other ===
1084 (no more unresolved files)
1084 (no more unresolved files)
1085 --- diff of status ---
1085 --- diff of status ---
1086 (status identical)
1086 (status identical)
1087
1087
1088 === :other -> :local ===
1088 === :other -> :local ===
1089 (no more unresolved files)
1089 (no more unresolved files)
1090 --- diff of status ---
1090 --- diff of status ---
1091 (status identical)
1091 (status identical)
1092
1092
1093 === :local -> :prompt ===
1093 === :local -> :prompt ===
1094 file 'file1' was deleted in local [working copy] but was modified in other [destination].
1094 file 'file1' was deleted in other [destination] but was modified in local [working copy].
1095 What do you want to do?
1095 What do you want to do?
1096 use (c)hanged version, (d)elete, or leave (u)nresolved?
1096 use (c)hanged version, (d)elete, or leave (u)nresolved?
1097 file 'file2' was deleted in other [destination] but was modified in local [working copy].
1097 file 'file2' was deleted in local [working copy] but was modified in other [destination].
1098 What do you want to do?
1098 What do you want to do?
1099 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
1099 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
1100 --- diff of status ---
1100 --- diff of status ---
1101 (status identical)
1101 (status identical)
1102
1102
1103 === :prompt -> :other ===
1103 === :prompt -> :other ===
1104 (no more unresolved files)
1104 (no more unresolved files)
1105 --- diff of status ---
1105 --- diff of status ---
1106 (status identical)
1106 (status identical)
1107
1107
1108 === :other -> :fail ===
1108 === :other -> :fail ===
1109 --- diff of status ---
1109 --- diff of status ---
1110 (status identical)
1110 (status identical)
1111
1111
1112 === :fail -> :prompt ===
1112 === :fail -> :prompt ===
1113 file 'file1' was deleted in local [working copy] but was modified in other [destination].
1113 file 'file1' was deleted in other [destination] but was modified in local [working copy].
1114 What do you want to do?
1114 What do you want to do?
1115 use (c)hanged version, (d)elete, or leave (u)nresolved?
1115 use (c)hanged version, (d)elete, or leave (u)nresolved?
1116 file 'file2' was deleted in other [destination] but was modified in local [working copy].
1116 file 'file2' was deleted in local [working copy] but was modified in other [destination].
1117 What do you want to do?
1117 What do you want to do?
1118 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
1118 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
1119 --- diff of status ---
1119 --- diff of status ---
1120 (status identical)
1120 (status identical)
1121
1121
1122 === :prompt -> :fail ===
1122 === :prompt -> :fail ===
1123 --- diff of status ---
1123 --- diff of status ---
1124 (status identical)
1124 (status identical)
1125
1125
1126 === :fail -> :local ===
1126 === :fail -> :local ===
1127 (no more unresolved files)
1127 (no more unresolved files)
1128 --- diff of status ---
1128 --- diff of status ---
1129 (status identical)
1129 (status identical)
1130
1130
@@ -1,845 +1,845 b''
1 Set up a base, local, and remote changeset, as well as the working copy state.
1 Set up a base, local, and remote changeset, as well as the working copy state.
2 Files names are of the form base_remote_local_working-copy. For example,
2 Files names are of the form base_remote_local_working-copy. For example,
3 content1_content2_content1_content2-untracked represents a
3 content1_content2_content1_content2-untracked represents a
4 file that was modified in the remote changeset, left untouched in the
4 file that was modified in the remote changeset, left untouched in the
5 local changeset, and then modified in the working copy to match the
5 local changeset, and then modified in the working copy to match the
6 remote content, then finally forgotten.
6 remote content, then finally forgotten.
7
7
8 $ hg init repo
8 $ hg init repo
9 $ cd repo
9 $ cd repo
10
10
11 Create base changeset
11 Create base changeset
12
12
13 $ $PYTHON $TESTDIR/generate-working-copy-states.py state 3 1
13 $ $PYTHON $TESTDIR/generate-working-copy-states.py state 3 1
14 $ hg addremove -q --similarity 0
14 $ hg addremove -q --similarity 0
15 $ hg commit -qm 'base'
15 $ hg commit -qm 'base'
16
16
17 Create remote changeset
17 Create remote changeset
18
18
19 $ $PYTHON $TESTDIR/generate-working-copy-states.py state 3 2
19 $ $PYTHON $TESTDIR/generate-working-copy-states.py state 3 2
20 $ hg addremove -q --similarity 0
20 $ hg addremove -q --similarity 0
21 $ hg commit -qm 'remote'
21 $ hg commit -qm 'remote'
22
22
23 Create local changeset
23 Create local changeset
24
24
25 $ hg update -q 0
25 $ hg update -q 0
26 $ $PYTHON $TESTDIR/generate-working-copy-states.py state 3 3
26 $ $PYTHON $TESTDIR/generate-working-copy-states.py state 3 3
27 $ hg addremove -q --similarity 0
27 $ hg addremove -q --similarity 0
28 $ hg commit -qm 'local'
28 $ hg commit -qm 'local'
29
29
30 Set up working directory
30 Set up working directory
31
31
32 $ $PYTHON $TESTDIR/generate-working-copy-states.py state 3 wc
32 $ $PYTHON $TESTDIR/generate-working-copy-states.py state 3 wc
33 $ hg addremove -q --similarity 0
33 $ hg addremove -q --similarity 0
34 $ hg forget *_*_*_*-untracked
34 $ hg forget *_*_*_*-untracked
35 $ rm *_*_*_missing-*
35 $ rm *_*_*_missing-*
36
36
37 $ hg status -A
37 $ hg status -A
38 M content1_content1_content1_content4-tracked
38 M content1_content1_content1_content4-tracked
39 M content1_content1_content3_content1-tracked
39 M content1_content1_content3_content1-tracked
40 M content1_content1_content3_content4-tracked
40 M content1_content1_content3_content4-tracked
41 M content1_content2_content1_content2-tracked
41 M content1_content2_content1_content2-tracked
42 M content1_content2_content1_content4-tracked
42 M content1_content2_content1_content4-tracked
43 M content1_content2_content2_content1-tracked
43 M content1_content2_content2_content1-tracked
44 M content1_content2_content2_content4-tracked
44 M content1_content2_content2_content4-tracked
45 M content1_content2_content3_content1-tracked
45 M content1_content2_content3_content1-tracked
46 M content1_content2_content3_content2-tracked
46 M content1_content2_content3_content2-tracked
47 M content1_content2_content3_content4-tracked
47 M content1_content2_content3_content4-tracked
48 M content1_missing_content1_content4-tracked
48 M content1_missing_content1_content4-tracked
49 M content1_missing_content3_content1-tracked
49 M content1_missing_content3_content1-tracked
50 M content1_missing_content3_content4-tracked
50 M content1_missing_content3_content4-tracked
51 M missing_content2_content2_content4-tracked
51 M missing_content2_content2_content4-tracked
52 M missing_content2_content3_content2-tracked
52 M missing_content2_content3_content2-tracked
53 M missing_content2_content3_content4-tracked
53 M missing_content2_content3_content4-tracked
54 M missing_missing_content3_content4-tracked
54 M missing_missing_content3_content4-tracked
55 A content1_content1_missing_content1-tracked
55 A content1_content1_missing_content1-tracked
56 A content1_content1_missing_content4-tracked
56 A content1_content1_missing_content4-tracked
57 A content1_content2_missing_content1-tracked
57 A content1_content2_missing_content1-tracked
58 A content1_content2_missing_content2-tracked
58 A content1_content2_missing_content2-tracked
59 A content1_content2_missing_content4-tracked
59 A content1_content2_missing_content4-tracked
60 A content1_missing_missing_content1-tracked
60 A content1_missing_missing_content1-tracked
61 A content1_missing_missing_content4-tracked
61 A content1_missing_missing_content4-tracked
62 A missing_content2_missing_content2-tracked
62 A missing_content2_missing_content2-tracked
63 A missing_content2_missing_content4-tracked
63 A missing_content2_missing_content4-tracked
64 A missing_missing_missing_content4-tracked
64 A missing_missing_missing_content4-tracked
65 R content1_content1_content1_content1-untracked
65 R content1_content1_content1_content1-untracked
66 R content1_content1_content1_content4-untracked
66 R content1_content1_content1_content4-untracked
67 R content1_content1_content1_missing-untracked
67 R content1_content1_content1_missing-untracked
68 R content1_content1_content3_content1-untracked
68 R content1_content1_content3_content1-untracked
69 R content1_content1_content3_content3-untracked
69 R content1_content1_content3_content3-untracked
70 R content1_content1_content3_content4-untracked
70 R content1_content1_content3_content4-untracked
71 R content1_content1_content3_missing-untracked
71 R content1_content1_content3_missing-untracked
72 R content1_content2_content1_content1-untracked
72 R content1_content2_content1_content1-untracked
73 R content1_content2_content1_content2-untracked
73 R content1_content2_content1_content2-untracked
74 R content1_content2_content1_content4-untracked
74 R content1_content2_content1_content4-untracked
75 R content1_content2_content1_missing-untracked
75 R content1_content2_content1_missing-untracked
76 R content1_content2_content2_content1-untracked
76 R content1_content2_content2_content1-untracked
77 R content1_content2_content2_content2-untracked
77 R content1_content2_content2_content2-untracked
78 R content1_content2_content2_content4-untracked
78 R content1_content2_content2_content4-untracked
79 R content1_content2_content2_missing-untracked
79 R content1_content2_content2_missing-untracked
80 R content1_content2_content3_content1-untracked
80 R content1_content2_content3_content1-untracked
81 R content1_content2_content3_content2-untracked
81 R content1_content2_content3_content2-untracked
82 R content1_content2_content3_content3-untracked
82 R content1_content2_content3_content3-untracked
83 R content1_content2_content3_content4-untracked
83 R content1_content2_content3_content4-untracked
84 R content1_content2_content3_missing-untracked
84 R content1_content2_content3_missing-untracked
85 R content1_missing_content1_content1-untracked
85 R content1_missing_content1_content1-untracked
86 R content1_missing_content1_content4-untracked
86 R content1_missing_content1_content4-untracked
87 R content1_missing_content1_missing-untracked
87 R content1_missing_content1_missing-untracked
88 R content1_missing_content3_content1-untracked
88 R content1_missing_content3_content1-untracked
89 R content1_missing_content3_content3-untracked
89 R content1_missing_content3_content3-untracked
90 R content1_missing_content3_content4-untracked
90 R content1_missing_content3_content4-untracked
91 R content1_missing_content3_missing-untracked
91 R content1_missing_content3_missing-untracked
92 R missing_content2_content2_content2-untracked
92 R missing_content2_content2_content2-untracked
93 R missing_content2_content2_content4-untracked
93 R missing_content2_content2_content4-untracked
94 R missing_content2_content2_missing-untracked
94 R missing_content2_content2_missing-untracked
95 R missing_content2_content3_content2-untracked
95 R missing_content2_content3_content2-untracked
96 R missing_content2_content3_content3-untracked
96 R missing_content2_content3_content3-untracked
97 R missing_content2_content3_content4-untracked
97 R missing_content2_content3_content4-untracked
98 R missing_content2_content3_missing-untracked
98 R missing_content2_content3_missing-untracked
99 R missing_missing_content3_content3-untracked
99 R missing_missing_content3_content3-untracked
100 R missing_missing_content3_content4-untracked
100 R missing_missing_content3_content4-untracked
101 R missing_missing_content3_missing-untracked
101 R missing_missing_content3_missing-untracked
102 ! content1_content1_content1_missing-tracked
102 ! content1_content1_content1_missing-tracked
103 ! content1_content1_content3_missing-tracked
103 ! content1_content1_content3_missing-tracked
104 ! content1_content1_missing_missing-tracked
104 ! content1_content1_missing_missing-tracked
105 ! content1_content2_content1_missing-tracked
105 ! content1_content2_content1_missing-tracked
106 ! content1_content2_content2_missing-tracked
106 ! content1_content2_content2_missing-tracked
107 ! content1_content2_content3_missing-tracked
107 ! content1_content2_content3_missing-tracked
108 ! content1_content2_missing_missing-tracked
108 ! content1_content2_missing_missing-tracked
109 ! content1_missing_content1_missing-tracked
109 ! content1_missing_content1_missing-tracked
110 ! content1_missing_content3_missing-tracked
110 ! content1_missing_content3_missing-tracked
111 ! content1_missing_missing_missing-tracked
111 ! content1_missing_missing_missing-tracked
112 ! missing_content2_content2_missing-tracked
112 ! missing_content2_content2_missing-tracked
113 ! missing_content2_content3_missing-tracked
113 ! missing_content2_content3_missing-tracked
114 ! missing_content2_missing_missing-tracked
114 ! missing_content2_missing_missing-tracked
115 ! missing_missing_content3_missing-tracked
115 ! missing_missing_content3_missing-tracked
116 ! missing_missing_missing_missing-tracked
116 ! missing_missing_missing_missing-tracked
117 ? content1_content1_missing_content1-untracked
117 ? content1_content1_missing_content1-untracked
118 ? content1_content1_missing_content4-untracked
118 ? content1_content1_missing_content4-untracked
119 ? content1_content2_missing_content1-untracked
119 ? content1_content2_missing_content1-untracked
120 ? content1_content2_missing_content2-untracked
120 ? content1_content2_missing_content2-untracked
121 ? content1_content2_missing_content4-untracked
121 ? content1_content2_missing_content4-untracked
122 ? content1_missing_missing_content1-untracked
122 ? content1_missing_missing_content1-untracked
123 ? content1_missing_missing_content4-untracked
123 ? content1_missing_missing_content4-untracked
124 ? missing_content2_missing_content2-untracked
124 ? missing_content2_missing_content2-untracked
125 ? missing_content2_missing_content4-untracked
125 ? missing_content2_missing_content4-untracked
126 ? missing_missing_missing_content4-untracked
126 ? missing_missing_missing_content4-untracked
127 C content1_content1_content1_content1-tracked
127 C content1_content1_content1_content1-tracked
128 C content1_content1_content3_content3-tracked
128 C content1_content1_content3_content3-tracked
129 C content1_content2_content1_content1-tracked
129 C content1_content2_content1_content1-tracked
130 C content1_content2_content2_content2-tracked
130 C content1_content2_content2_content2-tracked
131 C content1_content2_content3_content3-tracked
131 C content1_content2_content3_content3-tracked
132 C content1_missing_content1_content1-tracked
132 C content1_missing_content1_content1-tracked
133 C content1_missing_content3_content3-tracked
133 C content1_missing_content3_content3-tracked
134 C missing_content2_content2_content2-tracked
134 C missing_content2_content2_content2-tracked
135 C missing_content2_content3_content3-tracked
135 C missing_content2_content3_content3-tracked
136 C missing_missing_content3_content3-tracked
136 C missing_missing_content3_content3-tracked
137
137
138 Merge with remote
138 Merge with remote
139
139
140 # Notes:
140 # Notes:
141 # - local and remote changed content1_content2_*_content2-untracked
141 # - local and remote changed content1_content2_*_content2-untracked
142 # in the same way, so it could potentially be left alone
142 # in the same way, so it could potentially be left alone
143
143
144 $ hg merge -f --tool internal:merge3 'desc("remote")' 2>&1 | tee $TESTTMP/merge-output-1
144 $ hg merge -f --tool internal:merge3 'desc("remote")' 2>&1 | tee $TESTTMP/merge-output-1
145 file 'content1_missing_content1_content4-tracked' was deleted in local [working copy] but was modified in other [merge rev].
145 file 'content1_missing_content1_content4-tracked' was deleted in other [merge rev] but was modified in local [working copy].
146 What do you want to do?
146 What do you want to do?
147 use (c)hanged version, (d)elete, or leave (u)nresolved? u
147 use (c)hanged version, (d)elete, or leave (u)nresolved? u
148 file 'content1_missing_content3_content3-tracked' was deleted in local [working copy] but was modified in other [merge rev].
148 file 'content1_missing_content3_content3-tracked' was deleted in other [merge rev] but was modified in local [working copy].
149 What do you want to do?
149 What do you want to do?
150 use (c)hanged version, (d)elete, or leave (u)nresolved? u
150 use (c)hanged version, (d)elete, or leave (u)nresolved? u
151 file 'content1_missing_content3_content4-tracked' was deleted in local [working copy] but was modified in other [merge rev].
151 file 'content1_missing_content3_content4-tracked' was deleted in other [merge rev] but was modified in local [working copy].
152 What do you want to do?
152 What do you want to do?
153 use (c)hanged version, (d)elete, or leave (u)nresolved? u
153 use (c)hanged version, (d)elete, or leave (u)nresolved? u
154 file 'content1_missing_missing_content4-tracked' was deleted in local [working copy] but was modified in other [merge rev].
154 file 'content1_missing_missing_content4-tracked' was deleted in other [merge rev] but was modified in local [working copy].
155 What do you want to do?
155 What do you want to do?
156 use (c)hanged version, (d)elete, or leave (u)nresolved? u
156 use (c)hanged version, (d)elete, or leave (u)nresolved? u
157 file 'content1_content2_content1_content1-untracked' was deleted in other [merge rev] but was modified in local [working copy].
157 file 'content1_content2_content1_content1-untracked' was deleted in local [working copy] but was modified in other [merge rev].
158 What do you want to do?
158 What do you want to do?
159 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
159 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
160 file 'content1_content2_content1_content2-untracked' was deleted in other [merge rev] but was modified in local [working copy].
160 file 'content1_content2_content1_content2-untracked' was deleted in local [working copy] but was modified in other [merge rev].
161 What do you want to do?
161 What do you want to do?
162 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
162 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
163 file 'content1_content2_content1_content4-untracked' was deleted in other [merge rev] but was modified in local [working copy].
163 file 'content1_content2_content1_content4-untracked' was deleted in local [working copy] but was modified in other [merge rev].
164 What do you want to do?
164 What do you want to do?
165 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
165 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
166 file 'content1_content2_content1_missing-tracked' was deleted in other [merge rev] but was modified in local [working copy].
166 file 'content1_content2_content1_missing-tracked' was deleted in local [working copy] but was modified in other [merge rev].
167 What do you want to do?
167 What do you want to do?
168 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
168 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
169 file 'content1_content2_content1_missing-untracked' was deleted in other [merge rev] but was modified in local [working copy].
169 file 'content1_content2_content1_missing-untracked' was deleted in local [working copy] but was modified in other [merge rev].
170 What do you want to do?
170 What do you want to do?
171 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
171 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
172 file 'content1_content2_content2_content1-untracked' was deleted in other [merge rev] but was modified in local [working copy].
172 file 'content1_content2_content2_content1-untracked' was deleted in local [working copy] but was modified in other [merge rev].
173 What do you want to do?
173 What do you want to do?
174 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
174 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
175 file 'content1_content2_content2_content2-untracked' was deleted in other [merge rev] but was modified in local [working copy].
175 file 'content1_content2_content2_content2-untracked' was deleted in local [working copy] but was modified in other [merge rev].
176 What do you want to do?
176 What do you want to do?
177 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
177 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
178 file 'content1_content2_content2_content4-untracked' was deleted in other [merge rev] but was modified in local [working copy].
178 file 'content1_content2_content2_content4-untracked' was deleted in local [working copy] but was modified in other [merge rev].
179 What do you want to do?
179 What do you want to do?
180 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
180 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
181 file 'content1_content2_content2_missing-tracked' was deleted in other [merge rev] but was modified in local [working copy].
181 file 'content1_content2_content2_missing-tracked' was deleted in local [working copy] but was modified in other [merge rev].
182 What do you want to do?
182 What do you want to do?
183 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
183 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
184 file 'content1_content2_content2_missing-untracked' was deleted in other [merge rev] but was modified in local [working copy].
184 file 'content1_content2_content2_missing-untracked' was deleted in local [working copy] but was modified in other [merge rev].
185 What do you want to do?
185 What do you want to do?
186 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
186 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
187 file 'content1_content2_content3_content1-untracked' was deleted in other [merge rev] but was modified in local [working copy].
187 file 'content1_content2_content3_content1-untracked' was deleted in local [working copy] but was modified in other [merge rev].
188 What do you want to do?
188 What do you want to do?
189 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
189 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
190 file 'content1_content2_content3_content2-untracked' was deleted in other [merge rev] but was modified in local [working copy].
190 file 'content1_content2_content3_content2-untracked' was deleted in local [working copy] but was modified in other [merge rev].
191 What do you want to do?
191 What do you want to do?
192 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
192 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
193 file 'content1_content2_content3_content3-untracked' was deleted in other [merge rev] but was modified in local [working copy].
193 file 'content1_content2_content3_content3-untracked' was deleted in local [working copy] but was modified in other [merge rev].
194 What do you want to do?
194 What do you want to do?
195 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
195 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
196 file 'content1_content2_content3_content4-untracked' was deleted in other [merge rev] but was modified in local [working copy].
196 file 'content1_content2_content3_content4-untracked' was deleted in local [working copy] but was modified in other [merge rev].
197 What do you want to do?
197 What do you want to do?
198 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
198 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
199 file 'content1_content2_content3_missing-tracked' was deleted in other [merge rev] but was modified in local [working copy].
199 file 'content1_content2_content3_missing-tracked' was deleted in local [working copy] but was modified in other [merge rev].
200 What do you want to do?
200 What do you want to do?
201 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
201 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
202 file 'content1_content2_content3_missing-untracked' was deleted in other [merge rev] but was modified in local [working copy].
202 file 'content1_content2_content3_missing-untracked' was deleted in local [working copy] but was modified in other [merge rev].
203 What do you want to do?
203 What do you want to do?
204 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
204 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
205 file 'content1_content2_missing_content1-untracked' was deleted in other [merge rev] but was modified in local [working copy].
205 file 'content1_content2_missing_content1-untracked' was deleted in local [working copy] but was modified in other [merge rev].
206 What do you want to do?
206 What do you want to do?
207 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
207 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
208 file 'content1_content2_missing_content2-untracked' was deleted in other [merge rev] but was modified in local [working copy].
208 file 'content1_content2_missing_content2-untracked' was deleted in local [working copy] but was modified in other [merge rev].
209 What do you want to do?
209 What do you want to do?
210 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
210 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
211 file 'content1_content2_missing_content4-untracked' was deleted in other [merge rev] but was modified in local [working copy].
211 file 'content1_content2_missing_content4-untracked' was deleted in local [working copy] but was modified in other [merge rev].
212 What do you want to do?
212 What do you want to do?
213 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
213 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
214 file 'content1_content2_missing_missing-tracked' was deleted in other [merge rev] but was modified in local [working copy].
214 file 'content1_content2_missing_missing-tracked' was deleted in local [working copy] but was modified in other [merge rev].
215 What do you want to do?
215 What do you want to do?
216 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
216 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
217 file 'content1_content2_missing_missing-untracked' was deleted in other [merge rev] but was modified in local [working copy].
217 file 'content1_content2_missing_missing-untracked' was deleted in local [working copy] but was modified in other [merge rev].
218 What do you want to do?
218 What do you want to do?
219 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
219 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
220 merging content1_content2_content1_content4-tracked
220 merging content1_content2_content1_content4-tracked
221 merging content1_content2_content2_content1-tracked
221 merging content1_content2_content2_content1-tracked
222 merging content1_content2_content2_content4-tracked
222 merging content1_content2_content2_content4-tracked
223 merging content1_content2_content3_content1-tracked
223 merging content1_content2_content3_content1-tracked
224 merging content1_content2_content3_content3-tracked
224 merging content1_content2_content3_content3-tracked
225 merging content1_content2_content3_content4-tracked
225 merging content1_content2_content3_content4-tracked
226 merging content1_content2_missing_content1-tracked
226 merging content1_content2_missing_content1-tracked
227 merging content1_content2_missing_content4-tracked
227 merging content1_content2_missing_content4-tracked
228 merging missing_content2_content2_content4-tracked
228 merging missing_content2_content2_content4-tracked
229 merging missing_content2_content3_content3-tracked
229 merging missing_content2_content3_content3-tracked
230 merging missing_content2_content3_content4-tracked
230 merging missing_content2_content3_content4-tracked
231 merging missing_content2_missing_content4-tracked
231 merging missing_content2_missing_content4-tracked
232 merging missing_content2_missing_content4-untracked
232 merging missing_content2_missing_content4-untracked
233 warning: conflicts while merging content1_content2_content1_content4-tracked! (edit, then use 'hg resolve --mark')
233 warning: conflicts while merging content1_content2_content1_content4-tracked! (edit, then use 'hg resolve --mark')
234 warning: conflicts while merging content1_content2_content2_content4-tracked! (edit, then use 'hg resolve --mark')
234 warning: conflicts while merging content1_content2_content2_content4-tracked! (edit, then use 'hg resolve --mark')
235 warning: conflicts while merging content1_content2_content3_content3-tracked! (edit, then use 'hg resolve --mark')
235 warning: conflicts while merging content1_content2_content3_content3-tracked! (edit, then use 'hg resolve --mark')
236 warning: conflicts while merging content1_content2_content3_content4-tracked! (edit, then use 'hg resolve --mark')
236 warning: conflicts while merging content1_content2_content3_content4-tracked! (edit, then use 'hg resolve --mark')
237 warning: conflicts while merging content1_content2_missing_content4-tracked! (edit, then use 'hg resolve --mark')
237 warning: conflicts while merging content1_content2_missing_content4-tracked! (edit, then use 'hg resolve --mark')
238 warning: conflicts while merging missing_content2_content2_content4-tracked! (edit, then use 'hg resolve --mark')
238 warning: conflicts while merging missing_content2_content2_content4-tracked! (edit, then use 'hg resolve --mark')
239 warning: conflicts while merging missing_content2_content3_content3-tracked! (edit, then use 'hg resolve --mark')
239 warning: conflicts while merging missing_content2_content3_content3-tracked! (edit, then use 'hg resolve --mark')
240 warning: conflicts while merging missing_content2_content3_content4-tracked! (edit, then use 'hg resolve --mark')
240 warning: conflicts while merging missing_content2_content3_content4-tracked! (edit, then use 'hg resolve --mark')
241 warning: conflicts while merging missing_content2_missing_content4-tracked! (edit, then use 'hg resolve --mark')
241 warning: conflicts while merging missing_content2_missing_content4-tracked! (edit, then use 'hg resolve --mark')
242 warning: conflicts while merging missing_content2_missing_content4-untracked! (edit, then use 'hg resolve --mark')
242 warning: conflicts while merging missing_content2_missing_content4-untracked! (edit, then use 'hg resolve --mark')
243 18 files updated, 3 files merged, 8 files removed, 35 files unresolved
243 18 files updated, 3 files merged, 8 files removed, 35 files unresolved
244 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
244 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
245
245
246 Check which files need to be resolved (should correspond to the output above).
246 Check which files need to be resolved (should correspond to the output above).
247 This should be the files for which the base (1st filename segment), the remote
247 This should be the files for which the base (1st filename segment), the remote
248 (2nd segment) and the working copy (4th segment) are all different.
248 (2nd segment) and the working copy (4th segment) are all different.
249
249
250 Interestingly, one untracked file got merged and added, which corresponds to the
250 Interestingly, one untracked file got merged and added, which corresponds to the
251 odd 'if force and branchmerge and different' case in manifestmerge().
251 odd 'if force and branchmerge and different' case in manifestmerge().
252
252
253 $ hg resolve -l
253 $ hg resolve -l
254 U content1_content2_content1_content1-untracked
254 U content1_content2_content1_content1-untracked
255 U content1_content2_content1_content2-untracked
255 U content1_content2_content1_content2-untracked
256 U content1_content2_content1_content4-tracked
256 U content1_content2_content1_content4-tracked
257 U content1_content2_content1_content4-untracked
257 U content1_content2_content1_content4-untracked
258 U content1_content2_content1_missing-tracked
258 U content1_content2_content1_missing-tracked
259 U content1_content2_content1_missing-untracked
259 U content1_content2_content1_missing-untracked
260 R content1_content2_content2_content1-tracked
260 R content1_content2_content2_content1-tracked
261 U content1_content2_content2_content1-untracked
261 U content1_content2_content2_content1-untracked
262 U content1_content2_content2_content2-untracked
262 U content1_content2_content2_content2-untracked
263 U content1_content2_content2_content4-tracked
263 U content1_content2_content2_content4-tracked
264 U content1_content2_content2_content4-untracked
264 U content1_content2_content2_content4-untracked
265 U content1_content2_content2_missing-tracked
265 U content1_content2_content2_missing-tracked
266 U content1_content2_content2_missing-untracked
266 U content1_content2_content2_missing-untracked
267 R content1_content2_content3_content1-tracked
267 R content1_content2_content3_content1-tracked
268 U content1_content2_content3_content1-untracked
268 U content1_content2_content3_content1-untracked
269 U content1_content2_content3_content2-untracked
269 U content1_content2_content3_content2-untracked
270 U content1_content2_content3_content3-tracked
270 U content1_content2_content3_content3-tracked
271 U content1_content2_content3_content3-untracked
271 U content1_content2_content3_content3-untracked
272 U content1_content2_content3_content4-tracked
272 U content1_content2_content3_content4-tracked
273 U content1_content2_content3_content4-untracked
273 U content1_content2_content3_content4-untracked
274 U content1_content2_content3_missing-tracked
274 U content1_content2_content3_missing-tracked
275 U content1_content2_content3_missing-untracked
275 U content1_content2_content3_missing-untracked
276 R content1_content2_missing_content1-tracked
276 R content1_content2_missing_content1-tracked
277 U content1_content2_missing_content1-untracked
277 U content1_content2_missing_content1-untracked
278 U content1_content2_missing_content2-untracked
278 U content1_content2_missing_content2-untracked
279 U content1_content2_missing_content4-tracked
279 U content1_content2_missing_content4-tracked
280 U content1_content2_missing_content4-untracked
280 U content1_content2_missing_content4-untracked
281 U content1_content2_missing_missing-tracked
281 U content1_content2_missing_missing-tracked
282 U content1_content2_missing_missing-untracked
282 U content1_content2_missing_missing-untracked
283 U content1_missing_content1_content4-tracked
283 U content1_missing_content1_content4-tracked
284 U content1_missing_content3_content3-tracked
284 U content1_missing_content3_content3-tracked
285 U content1_missing_content3_content4-tracked
285 U content1_missing_content3_content4-tracked
286 U content1_missing_missing_content4-tracked
286 U content1_missing_missing_content4-tracked
287 U missing_content2_content2_content4-tracked
287 U missing_content2_content2_content4-tracked
288 U missing_content2_content3_content3-tracked
288 U missing_content2_content3_content3-tracked
289 U missing_content2_content3_content4-tracked
289 U missing_content2_content3_content4-tracked
290 U missing_content2_missing_content4-tracked
290 U missing_content2_missing_content4-tracked
291 U missing_content2_missing_content4-untracked
291 U missing_content2_missing_content4-untracked
292
292
293 Check status and file content
293 Check status and file content
294
294
295 Some files get added (e.g. content1_content2_content1_content1-untracked)
295 Some files get added (e.g. content1_content2_content1_content1-untracked)
296
296
297 It is not intuitive that content1_content2_content1_content4-tracked gets
297 It is not intuitive that content1_content2_content1_content4-tracked gets
298 merged while content1_content2_content1_content4-untracked gets overwritten.
298 merged while content1_content2_content1_content4-untracked gets overwritten.
299 Any *_content2_*-untracked triggers the modified/deleted prompt and then gets
299 Any *_content2_*-untracked triggers the modified/deleted prompt and then gets
300 overwritten.
300 overwritten.
301
301
302 A lot of untracked files become tracked, for example
302 A lot of untracked files become tracked, for example
303 content1_content2_content2_content2-untracked.
303 content1_content2_content2_content2-untracked.
304
304
305 *_missing_missing_missing-tracked is reported as removed ('R'), which
305 *_missing_missing_missing-tracked is reported as removed ('R'), which
306 doesn't make sense since the file did not exist in the parent, but on the
306 doesn't make sense since the file did not exist in the parent, but on the
307 other hand, merged-in additions are reported as modifications, which is
307 other hand, merged-in additions are reported as modifications, which is
308 almost as strange.
308 almost as strange.
309
309
310 missing_missing_content3_missing-tracked becomes removed ('R'), even though
310 missing_missing_content3_missing-tracked becomes removed ('R'), even though
311 the remote side did not touch the file
311 the remote side did not touch the file
312
312
313 $ checkstatus() {
313 $ checkstatus() {
314 > for f in `$PYTHON $TESTDIR/generate-working-copy-states.py filelist 3`
314 > for f in `$PYTHON $TESTDIR/generate-working-copy-states.py filelist 3`
315 > do
315 > do
316 > echo
316 > echo
317 > hg status -A $f
317 > hg status -A $f
318 > if test -f $f
318 > if test -f $f
319 > then
319 > then
320 > cat $f
320 > cat $f
321 > else
321 > else
322 > echo '<missing>'
322 > echo '<missing>'
323 > fi
323 > fi
324 > done
324 > done
325 > }
325 > }
326 $ checkstatus 2>&1 | tee $TESTTMP/status1
326 $ checkstatus 2>&1 | tee $TESTTMP/status1
327
327
328 C content1_content1_content1_content1-tracked
328 C content1_content1_content1_content1-tracked
329 content1
329 content1
330
330
331 R content1_content1_content1_content1-untracked
331 R content1_content1_content1_content1-untracked
332 content1
332 content1
333
333
334 M content1_content1_content1_content4-tracked
334 M content1_content1_content1_content4-tracked
335 content4
335 content4
336
336
337 R content1_content1_content1_content4-untracked
337 R content1_content1_content1_content4-untracked
338 content4
338 content4
339
339
340 ! content1_content1_content1_missing-tracked
340 ! content1_content1_content1_missing-tracked
341 <missing>
341 <missing>
342
342
343 R content1_content1_content1_missing-untracked
343 R content1_content1_content1_missing-untracked
344 <missing>
344 <missing>
345
345
346 M content1_content1_content3_content1-tracked
346 M content1_content1_content3_content1-tracked
347 content1
347 content1
348
348
349 R content1_content1_content3_content1-untracked
349 R content1_content1_content3_content1-untracked
350 content1
350 content1
351
351
352 C content1_content1_content3_content3-tracked
352 C content1_content1_content3_content3-tracked
353 content3
353 content3
354
354
355 R content1_content1_content3_content3-untracked
355 R content1_content1_content3_content3-untracked
356 content3
356 content3
357
357
358 M content1_content1_content3_content4-tracked
358 M content1_content1_content3_content4-tracked
359 content4
359 content4
360
360
361 R content1_content1_content3_content4-untracked
361 R content1_content1_content3_content4-untracked
362 content4
362 content4
363
363
364 ! content1_content1_content3_missing-tracked
364 ! content1_content1_content3_missing-tracked
365 <missing>
365 <missing>
366
366
367 R content1_content1_content3_missing-untracked
367 R content1_content1_content3_missing-untracked
368 <missing>
368 <missing>
369
369
370 A content1_content1_missing_content1-tracked
370 A content1_content1_missing_content1-tracked
371 content1
371 content1
372
372
373 ? content1_content1_missing_content1-untracked
373 ? content1_content1_missing_content1-untracked
374 content1
374 content1
375
375
376 A content1_content1_missing_content4-tracked
376 A content1_content1_missing_content4-tracked
377 content4
377 content4
378
378
379 ? content1_content1_missing_content4-untracked
379 ? content1_content1_missing_content4-untracked
380 content4
380 content4
381
381
382 ! content1_content1_missing_missing-tracked
382 ! content1_content1_missing_missing-tracked
383 <missing>
383 <missing>
384
384
385 content1_content1_missing_missing-untracked: * (glob)
385 content1_content1_missing_missing-untracked: * (glob)
386 <missing>
386 <missing>
387
387
388 M content1_content2_content1_content1-tracked
388 M content1_content2_content1_content1-tracked
389 content2
389 content2
390
390
391 M content1_content2_content1_content1-untracked
391 M content1_content2_content1_content1-untracked
392 content2
392 content2
393
393
394 M content1_content2_content1_content2-tracked
394 M content1_content2_content1_content2-tracked
395 content2
395 content2
396
396
397 M content1_content2_content1_content2-untracked
397 M content1_content2_content1_content2-untracked
398 content2
398 content2
399
399
400 M content1_content2_content1_content4-tracked
400 M content1_content2_content1_content4-tracked
401 <<<<<<< working copy: 0447570f1af6 - test: local
401 <<<<<<< working copy: 0447570f1af6 - test: local
402 content4
402 content4
403 ||||||| base
403 ||||||| base
404 content1
404 content1
405 =======
405 =======
406 content2
406 content2
407 >>>>>>> merge rev: 85100b8c675b - test: remote
407 >>>>>>> merge rev: 85100b8c675b - test: remote
408
408
409 M content1_content2_content1_content4-untracked
409 M content1_content2_content1_content4-untracked
410 content2
410 content2
411
411
412 M content1_content2_content1_missing-tracked
412 M content1_content2_content1_missing-tracked
413 content2
413 content2
414
414
415 M content1_content2_content1_missing-untracked
415 M content1_content2_content1_missing-untracked
416 content2
416 content2
417
417
418 M content1_content2_content2_content1-tracked
418 M content1_content2_content2_content1-tracked
419 content2
419 content2
420
420
421 M content1_content2_content2_content1-untracked
421 M content1_content2_content2_content1-untracked
422 content2
422 content2
423
423
424 C content1_content2_content2_content2-tracked
424 C content1_content2_content2_content2-tracked
425 content2
425 content2
426
426
427 M content1_content2_content2_content2-untracked
427 M content1_content2_content2_content2-untracked
428 content2
428 content2
429
429
430 M content1_content2_content2_content4-tracked
430 M content1_content2_content2_content4-tracked
431 <<<<<<< working copy: 0447570f1af6 - test: local
431 <<<<<<< working copy: 0447570f1af6 - test: local
432 content4
432 content4
433 ||||||| base
433 ||||||| base
434 content1
434 content1
435 =======
435 =======
436 content2
436 content2
437 >>>>>>> merge rev: 85100b8c675b - test: remote
437 >>>>>>> merge rev: 85100b8c675b - test: remote
438
438
439 M content1_content2_content2_content4-untracked
439 M content1_content2_content2_content4-untracked
440 content2
440 content2
441
441
442 M content1_content2_content2_missing-tracked
442 M content1_content2_content2_missing-tracked
443 content2
443 content2
444
444
445 M content1_content2_content2_missing-untracked
445 M content1_content2_content2_missing-untracked
446 content2
446 content2
447
447
448 M content1_content2_content3_content1-tracked
448 M content1_content2_content3_content1-tracked
449 content2
449 content2
450
450
451 M content1_content2_content3_content1-untracked
451 M content1_content2_content3_content1-untracked
452 content2
452 content2
453
453
454 M content1_content2_content3_content2-tracked
454 M content1_content2_content3_content2-tracked
455 content2
455 content2
456
456
457 M content1_content2_content3_content2-untracked
457 M content1_content2_content3_content2-untracked
458 content2
458 content2
459
459
460 M content1_content2_content3_content3-tracked
460 M content1_content2_content3_content3-tracked
461 <<<<<<< working copy: 0447570f1af6 - test: local
461 <<<<<<< working copy: 0447570f1af6 - test: local
462 content3
462 content3
463 ||||||| base
463 ||||||| base
464 content1
464 content1
465 =======
465 =======
466 content2
466 content2
467 >>>>>>> merge rev: 85100b8c675b - test: remote
467 >>>>>>> merge rev: 85100b8c675b - test: remote
468
468
469 M content1_content2_content3_content3-untracked
469 M content1_content2_content3_content3-untracked
470 content2
470 content2
471
471
472 M content1_content2_content3_content4-tracked
472 M content1_content2_content3_content4-tracked
473 <<<<<<< working copy: 0447570f1af6 - test: local
473 <<<<<<< working copy: 0447570f1af6 - test: local
474 content4
474 content4
475 ||||||| base
475 ||||||| base
476 content1
476 content1
477 =======
477 =======
478 content2
478 content2
479 >>>>>>> merge rev: 85100b8c675b - test: remote
479 >>>>>>> merge rev: 85100b8c675b - test: remote
480
480
481 M content1_content2_content3_content4-untracked
481 M content1_content2_content3_content4-untracked
482 content2
482 content2
483
483
484 M content1_content2_content3_missing-tracked
484 M content1_content2_content3_missing-tracked
485 content2
485 content2
486
486
487 M content1_content2_content3_missing-untracked
487 M content1_content2_content3_missing-untracked
488 content2
488 content2
489
489
490 M content1_content2_missing_content1-tracked
490 M content1_content2_missing_content1-tracked
491 content2
491 content2
492
492
493 M content1_content2_missing_content1-untracked
493 M content1_content2_missing_content1-untracked
494 content2
494 content2
495
495
496 M content1_content2_missing_content2-tracked
496 M content1_content2_missing_content2-tracked
497 content2
497 content2
498
498
499 M content1_content2_missing_content2-untracked
499 M content1_content2_missing_content2-untracked
500 content2
500 content2
501
501
502 M content1_content2_missing_content4-tracked
502 M content1_content2_missing_content4-tracked
503 <<<<<<< working copy: 0447570f1af6 - test: local
503 <<<<<<< working copy: 0447570f1af6 - test: local
504 content4
504 content4
505 ||||||| base
505 ||||||| base
506 content1
506 content1
507 =======
507 =======
508 content2
508 content2
509 >>>>>>> merge rev: 85100b8c675b - test: remote
509 >>>>>>> merge rev: 85100b8c675b - test: remote
510
510
511 M content1_content2_missing_content4-untracked
511 M content1_content2_missing_content4-untracked
512 content2
512 content2
513
513
514 M content1_content2_missing_missing-tracked
514 M content1_content2_missing_missing-tracked
515 content2
515 content2
516
516
517 M content1_content2_missing_missing-untracked
517 M content1_content2_missing_missing-untracked
518 content2
518 content2
519
519
520 R content1_missing_content1_content1-tracked
520 R content1_missing_content1_content1-tracked
521 <missing>
521 <missing>
522
522
523 R content1_missing_content1_content1-untracked
523 R content1_missing_content1_content1-untracked
524 content1
524 content1
525
525
526 M content1_missing_content1_content4-tracked
526 M content1_missing_content1_content4-tracked
527 content4
527 content4
528
528
529 R content1_missing_content1_content4-untracked
529 R content1_missing_content1_content4-untracked
530 content4
530 content4
531
531
532 R content1_missing_content1_missing-tracked
532 R content1_missing_content1_missing-tracked
533 <missing>
533 <missing>
534
534
535 R content1_missing_content1_missing-untracked
535 R content1_missing_content1_missing-untracked
536 <missing>
536 <missing>
537
537
538 R content1_missing_content3_content1-tracked
538 R content1_missing_content3_content1-tracked
539 <missing>
539 <missing>
540
540
541 R content1_missing_content3_content1-untracked
541 R content1_missing_content3_content1-untracked
542 content1
542 content1
543
543
544 C content1_missing_content3_content3-tracked
544 C content1_missing_content3_content3-tracked
545 content3
545 content3
546
546
547 R content1_missing_content3_content3-untracked
547 R content1_missing_content3_content3-untracked
548 content3
548 content3
549
549
550 M content1_missing_content3_content4-tracked
550 M content1_missing_content3_content4-tracked
551 content4
551 content4
552
552
553 R content1_missing_content3_content4-untracked
553 R content1_missing_content3_content4-untracked
554 content4
554 content4
555
555
556 R content1_missing_content3_missing-tracked
556 R content1_missing_content3_missing-tracked
557 <missing>
557 <missing>
558
558
559 R content1_missing_content3_missing-untracked
559 R content1_missing_content3_missing-untracked
560 <missing>
560 <missing>
561
561
562 R content1_missing_missing_content1-tracked
562 R content1_missing_missing_content1-tracked
563 <missing>
563 <missing>
564
564
565 ? content1_missing_missing_content1-untracked
565 ? content1_missing_missing_content1-untracked
566 content1
566 content1
567
567
568 A content1_missing_missing_content4-tracked
568 A content1_missing_missing_content4-tracked
569 content4
569 content4
570
570
571 ? content1_missing_missing_content4-untracked
571 ? content1_missing_missing_content4-untracked
572 content4
572 content4
573
573
574 R content1_missing_missing_missing-tracked
574 R content1_missing_missing_missing-tracked
575 <missing>
575 <missing>
576
576
577 content1_missing_missing_missing-untracked: * (glob)
577 content1_missing_missing_missing-untracked: * (glob)
578 <missing>
578 <missing>
579
579
580 C missing_content2_content2_content2-tracked
580 C missing_content2_content2_content2-tracked
581 content2
581 content2
582
582
583 M missing_content2_content2_content2-untracked
583 M missing_content2_content2_content2-untracked
584 content2
584 content2
585
585
586 M missing_content2_content2_content4-tracked
586 M missing_content2_content2_content4-tracked
587 <<<<<<< working copy: 0447570f1af6 - test: local
587 <<<<<<< working copy: 0447570f1af6 - test: local
588 content4
588 content4
589 ||||||| base
589 ||||||| base
590 =======
590 =======
591 content2
591 content2
592 >>>>>>> merge rev: 85100b8c675b - test: remote
592 >>>>>>> merge rev: 85100b8c675b - test: remote
593
593
594 M missing_content2_content2_content4-untracked
594 M missing_content2_content2_content4-untracked
595 content2
595 content2
596
596
597 M missing_content2_content2_missing-tracked
597 M missing_content2_content2_missing-tracked
598 content2
598 content2
599
599
600 M missing_content2_content2_missing-untracked
600 M missing_content2_content2_missing-untracked
601 content2
601 content2
602
602
603 M missing_content2_content3_content2-tracked
603 M missing_content2_content3_content2-tracked
604 content2
604 content2
605
605
606 M missing_content2_content3_content2-untracked
606 M missing_content2_content3_content2-untracked
607 content2
607 content2
608
608
609 M missing_content2_content3_content3-tracked
609 M missing_content2_content3_content3-tracked
610 <<<<<<< working copy: 0447570f1af6 - test: local
610 <<<<<<< working copy: 0447570f1af6 - test: local
611 content3
611 content3
612 ||||||| base
612 ||||||| base
613 =======
613 =======
614 content2
614 content2
615 >>>>>>> merge rev: 85100b8c675b - test: remote
615 >>>>>>> merge rev: 85100b8c675b - test: remote
616
616
617 M missing_content2_content3_content3-untracked
617 M missing_content2_content3_content3-untracked
618 content2
618 content2
619
619
620 M missing_content2_content3_content4-tracked
620 M missing_content2_content3_content4-tracked
621 <<<<<<< working copy: 0447570f1af6 - test: local
621 <<<<<<< working copy: 0447570f1af6 - test: local
622 content4
622 content4
623 ||||||| base
623 ||||||| base
624 =======
624 =======
625 content2
625 content2
626 >>>>>>> merge rev: 85100b8c675b - test: remote
626 >>>>>>> merge rev: 85100b8c675b - test: remote
627
627
628 M missing_content2_content3_content4-untracked
628 M missing_content2_content3_content4-untracked
629 content2
629 content2
630
630
631 M missing_content2_content3_missing-tracked
631 M missing_content2_content3_missing-tracked
632 content2
632 content2
633
633
634 M missing_content2_content3_missing-untracked
634 M missing_content2_content3_missing-untracked
635 content2
635 content2
636
636
637 M missing_content2_missing_content2-tracked
637 M missing_content2_missing_content2-tracked
638 content2
638 content2
639
639
640 M missing_content2_missing_content2-untracked
640 M missing_content2_missing_content2-untracked
641 content2
641 content2
642
642
643 M missing_content2_missing_content4-tracked
643 M missing_content2_missing_content4-tracked
644 <<<<<<< working copy: 0447570f1af6 - test: local
644 <<<<<<< working copy: 0447570f1af6 - test: local
645 content4
645 content4
646 ||||||| base
646 ||||||| base
647 =======
647 =======
648 content2
648 content2
649 >>>>>>> merge rev: 85100b8c675b - test: remote
649 >>>>>>> merge rev: 85100b8c675b - test: remote
650
650
651 M missing_content2_missing_content4-untracked
651 M missing_content2_missing_content4-untracked
652 <<<<<<< working copy: 0447570f1af6 - test: local
652 <<<<<<< working copy: 0447570f1af6 - test: local
653 content4
653 content4
654 ||||||| base
654 ||||||| base
655 =======
655 =======
656 content2
656 content2
657 >>>>>>> merge rev: 85100b8c675b - test: remote
657 >>>>>>> merge rev: 85100b8c675b - test: remote
658
658
659 M missing_content2_missing_missing-tracked
659 M missing_content2_missing_missing-tracked
660 content2
660 content2
661
661
662 M missing_content2_missing_missing-untracked
662 M missing_content2_missing_missing-untracked
663 content2
663 content2
664
664
665 C missing_missing_content3_content3-tracked
665 C missing_missing_content3_content3-tracked
666 content3
666 content3
667
667
668 R missing_missing_content3_content3-untracked
668 R missing_missing_content3_content3-untracked
669 content3
669 content3
670
670
671 M missing_missing_content3_content4-tracked
671 M missing_missing_content3_content4-tracked
672 content4
672 content4
673
673
674 R missing_missing_content3_content4-untracked
674 R missing_missing_content3_content4-untracked
675 content4
675 content4
676
676
677 R missing_missing_content3_missing-tracked
677 R missing_missing_content3_missing-tracked
678 <missing>
678 <missing>
679
679
680 R missing_missing_content3_missing-untracked
680 R missing_missing_content3_missing-untracked
681 <missing>
681 <missing>
682
682
683 A missing_missing_missing_content4-tracked
683 A missing_missing_missing_content4-tracked
684 content4
684 content4
685
685
686 ? missing_missing_missing_content4-untracked
686 ? missing_missing_missing_content4-untracked
687 content4
687 content4
688
688
689 R missing_missing_missing_missing-tracked
689 R missing_missing_missing_missing-tracked
690 <missing>
690 <missing>
691
691
692 missing_missing_missing_missing-untracked: * (glob)
692 missing_missing_missing_missing-untracked: * (glob)
693 <missing>
693 <missing>
694
694
695 $ for f in `$PYTHON $TESTDIR/generate-working-copy-states.py filelist 3`
695 $ for f in `$PYTHON $TESTDIR/generate-working-copy-states.py filelist 3`
696 > do
696 > do
697 > if test -f ${f}.orig
697 > if test -f ${f}.orig
698 > then
698 > then
699 > echo ${f}.orig:
699 > echo ${f}.orig:
700 > cat ${f}.orig
700 > cat ${f}.orig
701 > fi
701 > fi
702 > done
702 > done
703 content1_content2_content1_content4-tracked.orig:
703 content1_content2_content1_content4-tracked.orig:
704 content4
704 content4
705 content1_content2_content2_content4-tracked.orig:
705 content1_content2_content2_content4-tracked.orig:
706 content4
706 content4
707 content1_content2_content3_content3-tracked.orig:
707 content1_content2_content3_content3-tracked.orig:
708 content3
708 content3
709 content1_content2_content3_content4-tracked.orig:
709 content1_content2_content3_content4-tracked.orig:
710 content4
710 content4
711 content1_content2_missing_content4-tracked.orig:
711 content1_content2_missing_content4-tracked.orig:
712 content4
712 content4
713 missing_content2_content2_content4-tracked.orig:
713 missing_content2_content2_content4-tracked.orig:
714 content4
714 content4
715 missing_content2_content3_content3-tracked.orig:
715 missing_content2_content3_content3-tracked.orig:
716 content3
716 content3
717 missing_content2_content3_content4-tracked.orig:
717 missing_content2_content3_content4-tracked.orig:
718 content4
718 content4
719 missing_content2_missing_content4-tracked.orig:
719 missing_content2_missing_content4-tracked.orig:
720 content4
720 content4
721 missing_content2_missing_content4-untracked.orig:
721 missing_content2_missing_content4-untracked.orig:
722 content4
722 content4
723
723
724 Re-resolve and check status
724 Re-resolve and check status
725
725
726 $ hg resolve --unmark --all
726 $ hg resolve --unmark --all
727 $ hg resolve --all --tool :local
727 $ hg resolve --all --tool :local
728 (no more unresolved files)
728 (no more unresolved files)
729 $ hg resolve --unmark --all
729 $ hg resolve --unmark --all
730 $ hg resolve --all --tool internal:merge3
730 $ hg resolve --all --tool internal:merge3
731 file 'content1_content2_content1_content1-untracked' was deleted in other [merge rev] but was modified in local [working copy].
731 file 'content1_content2_content1_content1-untracked' was deleted in local [working copy] but was modified in other [merge rev].
732 What do you want to do?
732 What do you want to do?
733 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
733 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
734 file 'content1_content2_content1_content2-untracked' was deleted in other [merge rev] but was modified in local [working copy].
734 file 'content1_content2_content1_content2-untracked' was deleted in local [working copy] but was modified in other [merge rev].
735 What do you want to do?
735 What do you want to do?
736 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
736 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
737 merging content1_content2_content1_content4-tracked
737 merging content1_content2_content1_content4-tracked
738 file 'content1_content2_content1_content4-untracked' was deleted in other [merge rev] but was modified in local [working copy].
738 file 'content1_content2_content1_content4-untracked' was deleted in local [working copy] but was modified in other [merge rev].
739 What do you want to do?
739 What do you want to do?
740 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
740 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
741 file 'content1_content2_content1_missing-tracked' was deleted in other [merge rev] but was modified in local [working copy].
741 file 'content1_content2_content1_missing-tracked' was deleted in local [working copy] but was modified in other [merge rev].
742 What do you want to do?
742 What do you want to do?
743 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
743 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
744 file 'content1_content2_content1_missing-untracked' was deleted in other [merge rev] but was modified in local [working copy].
744 file 'content1_content2_content1_missing-untracked' was deleted in local [working copy] but was modified in other [merge rev].
745 What do you want to do?
745 What do you want to do?
746 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
746 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
747 merging content1_content2_content2_content1-tracked
747 merging content1_content2_content2_content1-tracked
748 file 'content1_content2_content2_content1-untracked' was deleted in other [merge rev] but was modified in local [working copy].
748 file 'content1_content2_content2_content1-untracked' was deleted in local [working copy] but was modified in other [merge rev].
749 What do you want to do?
749 What do you want to do?
750 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
750 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
751 file 'content1_content2_content2_content2-untracked' was deleted in other [merge rev] but was modified in local [working copy].
751 file 'content1_content2_content2_content2-untracked' was deleted in local [working copy] but was modified in other [merge rev].
752 What do you want to do?
752 What do you want to do?
753 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
753 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
754 merging content1_content2_content2_content4-tracked
754 merging content1_content2_content2_content4-tracked
755 file 'content1_content2_content2_content4-untracked' was deleted in other [merge rev] but was modified in local [working copy].
755 file 'content1_content2_content2_content4-untracked' was deleted in local [working copy] but was modified in other [merge rev].
756 What do you want to do?
756 What do you want to do?
757 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
757 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
758 file 'content1_content2_content2_missing-tracked' was deleted in other [merge rev] but was modified in local [working copy].
758 file 'content1_content2_content2_missing-tracked' was deleted in local [working copy] but was modified in other [merge rev].
759 What do you want to do?
759 What do you want to do?
760 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
760 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
761 file 'content1_content2_content2_missing-untracked' was deleted in other [merge rev] but was modified in local [working copy].
761 file 'content1_content2_content2_missing-untracked' was deleted in local [working copy] but was modified in other [merge rev].
762 What do you want to do?
762 What do you want to do?
763 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
763 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
764 merging content1_content2_content3_content1-tracked
764 merging content1_content2_content3_content1-tracked
765 file 'content1_content2_content3_content1-untracked' was deleted in other [merge rev] but was modified in local [working copy].
765 file 'content1_content2_content3_content1-untracked' was deleted in local [working copy] but was modified in other [merge rev].
766 What do you want to do?
766 What do you want to do?
767 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
767 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
768 file 'content1_content2_content3_content2-untracked' was deleted in other [merge rev] but was modified in local [working copy].
768 file 'content1_content2_content3_content2-untracked' was deleted in local [working copy] but was modified in other [merge rev].
769 What do you want to do?
769 What do you want to do?
770 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
770 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
771 merging content1_content2_content3_content3-tracked
771 merging content1_content2_content3_content3-tracked
772 file 'content1_content2_content3_content3-untracked' was deleted in other [merge rev] but was modified in local [working copy].
772 file 'content1_content2_content3_content3-untracked' was deleted in local [working copy] but was modified in other [merge rev].
773 What do you want to do?
773 What do you want to do?
774 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
774 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
775 merging content1_content2_content3_content4-tracked
775 merging content1_content2_content3_content4-tracked
776 file 'content1_content2_content3_content4-untracked' was deleted in other [merge rev] but was modified in local [working copy].
776 file 'content1_content2_content3_content4-untracked' was deleted in local [working copy] but was modified in other [merge rev].
777 What do you want to do?
777 What do you want to do?
778 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
778 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
779 file 'content1_content2_content3_missing-tracked' was deleted in other [merge rev] but was modified in local [working copy].
779 file 'content1_content2_content3_missing-tracked' was deleted in local [working copy] but was modified in other [merge rev].
780 What do you want to do?
780 What do you want to do?
781 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
781 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
782 file 'content1_content2_content3_missing-untracked' was deleted in other [merge rev] but was modified in local [working copy].
782 file 'content1_content2_content3_missing-untracked' was deleted in local [working copy] but was modified in other [merge rev].
783 What do you want to do?
783 What do you want to do?
784 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
784 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
785 merging content1_content2_missing_content1-tracked
785 merging content1_content2_missing_content1-tracked
786 file 'content1_content2_missing_content1-untracked' was deleted in other [merge rev] but was modified in local [working copy].
786 file 'content1_content2_missing_content1-untracked' was deleted in local [working copy] but was modified in other [merge rev].
787 What do you want to do?
787 What do you want to do?
788 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
788 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
789 file 'content1_content2_missing_content2-untracked' was deleted in other [merge rev] but was modified in local [working copy].
789 file 'content1_content2_missing_content2-untracked' was deleted in local [working copy] but was modified in other [merge rev].
790 What do you want to do?
790 What do you want to do?
791 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
791 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
792 merging content1_content2_missing_content4-tracked
792 merging content1_content2_missing_content4-tracked
793 file 'content1_content2_missing_content4-untracked' was deleted in other [merge rev] but was modified in local [working copy].
793 file 'content1_content2_missing_content4-untracked' was deleted in local [working copy] but was modified in other [merge rev].
794 What do you want to do?
794 What do you want to do?
795 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
795 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
796 file 'content1_content2_missing_missing-tracked' was deleted in other [merge rev] but was modified in local [working copy].
796 file 'content1_content2_missing_missing-tracked' was deleted in local [working copy] but was modified in other [merge rev].
797 What do you want to do?
797 What do you want to do?
798 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
798 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
799 file 'content1_content2_missing_missing-untracked' was deleted in other [merge rev] but was modified in local [working copy].
799 file 'content1_content2_missing_missing-untracked' was deleted in local [working copy] but was modified in other [merge rev].
800 What do you want to do?
800 What do you want to do?
801 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
801 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
802 file 'content1_missing_content1_content4-tracked' was deleted in local [working copy] but was modified in other [merge rev].
802 file 'content1_missing_content1_content4-tracked' was deleted in other [merge rev] but was modified in local [working copy].
803 What do you want to do?
803 What do you want to do?
804 use (c)hanged version, (d)elete, or leave (u)nresolved? u
804 use (c)hanged version, (d)elete, or leave (u)nresolved? u
805 file 'content1_missing_content3_content3-tracked' was deleted in local [working copy] but was modified in other [merge rev].
805 file 'content1_missing_content3_content3-tracked' was deleted in other [merge rev] but was modified in local [working copy].
806 What do you want to do?
806 What do you want to do?
807 use (c)hanged version, (d)elete, or leave (u)nresolved? u
807 use (c)hanged version, (d)elete, or leave (u)nresolved? u
808 file 'content1_missing_content3_content4-tracked' was deleted in local [working copy] but was modified in other [merge rev].
808 file 'content1_missing_content3_content4-tracked' was deleted in other [merge rev] but was modified in local [working copy].
809 What do you want to do?
809 What do you want to do?
810 use (c)hanged version, (d)elete, or leave (u)nresolved? u
810 use (c)hanged version, (d)elete, or leave (u)nresolved? u
811 file 'content1_missing_missing_content4-tracked' was deleted in local [working copy] but was modified in other [merge rev].
811 file 'content1_missing_missing_content4-tracked' was deleted in other [merge rev] but was modified in local [working copy].
812 What do you want to do?
812 What do you want to do?
813 use (c)hanged version, (d)elete, or leave (u)nresolved? u
813 use (c)hanged version, (d)elete, or leave (u)nresolved? u
814 merging missing_content2_content2_content4-tracked
814 merging missing_content2_content2_content4-tracked
815 merging missing_content2_content3_content3-tracked
815 merging missing_content2_content3_content3-tracked
816 merging missing_content2_content3_content4-tracked
816 merging missing_content2_content3_content4-tracked
817 merging missing_content2_missing_content4-tracked
817 merging missing_content2_missing_content4-tracked
818 merging missing_content2_missing_content4-untracked
818 merging missing_content2_missing_content4-untracked
819 warning: conflicts while merging content1_content2_content1_content4-tracked! (edit, then use 'hg resolve --mark')
819 warning: conflicts while merging content1_content2_content1_content4-tracked! (edit, then use 'hg resolve --mark')
820 warning: conflicts while merging content1_content2_content2_content4-tracked! (edit, then use 'hg resolve --mark')
820 warning: conflicts while merging content1_content2_content2_content4-tracked! (edit, then use 'hg resolve --mark')
821 warning: conflicts while merging content1_content2_content3_content3-tracked! (edit, then use 'hg resolve --mark')
821 warning: conflicts while merging content1_content2_content3_content3-tracked! (edit, then use 'hg resolve --mark')
822 warning: conflicts while merging content1_content2_content3_content4-tracked! (edit, then use 'hg resolve --mark')
822 warning: conflicts while merging content1_content2_content3_content4-tracked! (edit, then use 'hg resolve --mark')
823 warning: conflicts while merging content1_content2_missing_content4-tracked! (edit, then use 'hg resolve --mark')
823 warning: conflicts while merging content1_content2_missing_content4-tracked! (edit, then use 'hg resolve --mark')
824 warning: conflicts while merging missing_content2_content2_content4-tracked! (edit, then use 'hg resolve --mark')
824 warning: conflicts while merging missing_content2_content2_content4-tracked! (edit, then use 'hg resolve --mark')
825 warning: conflicts while merging missing_content2_content3_content3-tracked! (edit, then use 'hg resolve --mark')
825 warning: conflicts while merging missing_content2_content3_content3-tracked! (edit, then use 'hg resolve --mark')
826 warning: conflicts while merging missing_content2_content3_content4-tracked! (edit, then use 'hg resolve --mark')
826 warning: conflicts while merging missing_content2_content3_content4-tracked! (edit, then use 'hg resolve --mark')
827 warning: conflicts while merging missing_content2_missing_content4-tracked! (edit, then use 'hg resolve --mark')
827 warning: conflicts while merging missing_content2_missing_content4-tracked! (edit, then use 'hg resolve --mark')
828 warning: conflicts while merging missing_content2_missing_content4-untracked! (edit, then use 'hg resolve --mark')
828 warning: conflicts while merging missing_content2_missing_content4-untracked! (edit, then use 'hg resolve --mark')
829 [1]
829 [1]
830 $ checkstatus > $TESTTMP/status2 2>&1
830 $ checkstatus > $TESTTMP/status2 2>&1
831 $ cmp $TESTTMP/status1 $TESTTMP/status2 || diff -U8 $TESTTMP/status1 $TESTTMP/status2
831 $ cmp $TESTTMP/status1 $TESTTMP/status2 || diff -U8 $TESTTMP/status1 $TESTTMP/status2
832
832
833 Set up working directory again
833 Set up working directory again
834
834
835 $ hg -q update --clean 2
835 $ hg -q update --clean 2
836 $ hg --config extensions.purge= purge
836 $ hg --config extensions.purge= purge
837 $ $PYTHON $TESTDIR/generate-working-copy-states.py state 3 wc
837 $ $PYTHON $TESTDIR/generate-working-copy-states.py state 3 wc
838 $ hg addremove -q --similarity 0
838 $ hg addremove -q --similarity 0
839 $ hg forget *_*_*_*-untracked
839 $ hg forget *_*_*_*-untracked
840 $ rm *_*_*_missing-*
840 $ rm *_*_*_missing-*
841
841
842 Merge with checkunknown = warn, see that behavior is the same as before
842 Merge with checkunknown = warn, see that behavior is the same as before
843 $ hg merge -f --tool internal:merge3 'desc("remote")' --config merge.checkunknown=warn > $TESTTMP/merge-output-2 2>&1
843 $ hg merge -f --tool internal:merge3 'desc("remote")' --config merge.checkunknown=warn > $TESTTMP/merge-output-2 2>&1
844 [1]
844 [1]
845 $ cmp $TESTTMP/merge-output-1 $TESTTMP/merge-output-2 || diff -U8 $TESTTMP/merge-output-1 $TESTTMP/merge-output-2
845 $ cmp $TESTTMP/merge-output-1 $TESTTMP/merge-output-2 || diff -U8 $TESTTMP/merge-output-1 $TESTTMP/merge-output-2
@@ -1,116 +1,116 b''
1 $ hg init
1 $ hg init
2
2
3 $ echo foo > foo
3 $ echo foo > foo
4 $ echo bar > bar
4 $ echo bar > bar
5 $ hg ci -qAm 'add foo bar'
5 $ hg ci -qAm 'add foo bar'
6
6
7 $ echo foo2 >> foo
7 $ echo foo2 >> foo
8 $ echo bleh > bar
8 $ echo bleh > bar
9 $ hg ci -m 'change foo bar'
9 $ hg ci -m 'change foo bar'
10
10
11 $ hg up -qC 0
11 $ hg up -qC 0
12 $ hg mv foo foo1
12 $ hg mv foo foo1
13 $ echo foo1 > foo1
13 $ echo foo1 > foo1
14 $ hg cat foo >> foo1
14 $ hg cat foo >> foo1
15 $ hg ci -m 'mv foo foo1'
15 $ hg ci -m 'mv foo foo1'
16 created new head
16 created new head
17
17
18 $ hg merge
18 $ hg merge
19 merging foo1 and foo to foo1
19 merging foo1 and foo to foo1
20 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
20 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
21 (branch merge, don't forget to commit)
21 (branch merge, don't forget to commit)
22
22
23 $ hg debugstate --nodates
23 $ hg debugstate --nodates
24 m 0 -2 unset bar
24 m 0 -2 unset bar
25 m 0 -2 unset foo1
25 m 0 -2 unset foo1
26 copy: foo -> foo1
26 copy: foo -> foo1
27
27
28 $ hg st -q
28 $ hg st -q
29 M bar
29 M bar
30 M foo1
30 M foo1
31
31
32
32
33 Removing foo1 and bar:
33 Removing foo1 and bar:
34
34
35 $ cp foo1 F
35 $ cp foo1 F
36 $ cp bar B
36 $ cp bar B
37 $ hg rm -f foo1 bar
37 $ hg rm -f foo1 bar
38
38
39 $ hg debugstate --nodates
39 $ hg debugstate --nodates
40 r 0 -1 set bar
40 r 0 -1 set bar
41 r 0 -1 set foo1
41 r 0 -1 set foo1
42 copy: foo -> foo1
42 copy: foo -> foo1
43
43
44 $ hg st -qC
44 $ hg st -qC
45 R bar
45 R bar
46 R foo1
46 R foo1
47
47
48
48
49 Re-adding foo1 and bar:
49 Re-adding foo1 and bar:
50
50
51 $ cp F foo1
51 $ cp F foo1
52 $ cp B bar
52 $ cp B bar
53 $ hg add -v foo1 bar
53 $ hg add -v foo1 bar
54 adding bar
54 adding bar
55 adding foo1
55 adding foo1
56
56
57 $ hg debugstate --nodates
57 $ hg debugstate --nodates
58 n 0 -2 unset bar
58 n 0 -2 unset bar
59 n 0 -2 unset foo1
59 n 0 -2 unset foo1
60 copy: foo -> foo1
60 copy: foo -> foo1
61
61
62 $ hg st -qC
62 $ hg st -qC
63 M bar
63 M bar
64 M foo1
64 M foo1
65 foo
65 foo
66
66
67
67
68 Reverting foo1 and bar:
68 Reverting foo1 and bar:
69
69
70 $ hg revert -vr . foo1 bar
70 $ hg revert -vr . foo1 bar
71 saving current version of bar as bar.orig
71 saving current version of bar as bar.orig
72 reverting bar
72 reverting bar
73 saving current version of foo1 as foo1.orig
73 saving current version of foo1 as foo1.orig
74 reverting foo1
74 reverting foo1
75
75
76 $ hg debugstate --nodates
76 $ hg debugstate --nodates
77 n 0 -2 unset bar
77 n 0 -2 unset bar
78 n 0 -2 unset foo1
78 n 0 -2 unset foo1
79 copy: foo -> foo1
79 copy: foo -> foo1
80
80
81 $ hg st -qC
81 $ hg st -qC
82 M bar
82 M bar
83 M foo1
83 M foo1
84 foo
84 foo
85
85
86 $ hg diff
86 $ hg diff
87
87
88 Merge should not overwrite local file that is untracked after remove
88 Merge should not overwrite local file that is untracked after remove
89
89
90 $ rm *
90 $ rm *
91 $ hg up -qC
91 $ hg up -qC
92 $ hg rm bar
92 $ hg rm bar
93 $ hg ci -m 'remove bar'
93 $ hg ci -m 'remove bar'
94 $ echo 'memories of buried pirate treasure' > bar
94 $ echo 'memories of buried pirate treasure' > bar
95 $ hg merge
95 $ hg merge
96 bar: untracked file differs
96 bar: untracked file differs
97 abort: untracked files in working directory differ from files in requested revision
97 abort: untracked files in working directory differ from files in requested revision
98 [255]
98 [255]
99 $ cat bar
99 $ cat bar
100 memories of buried pirate treasure
100 memories of buried pirate treasure
101
101
102 Those who use force will lose
102 Those who use force will lose
103
103
104 $ hg merge -f
104 $ hg merge -f
105 file 'bar' was deleted in other [merge rev] but was modified in local [working copy].
105 file 'bar' was deleted in local [working copy] but was modified in other [merge rev].
106 What do you want to do?
106 What do you want to do?
107 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
107 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
108 merging foo1 and foo to foo1
108 merging foo1 and foo to foo1
109 0 files updated, 1 files merged, 0 files removed, 1 files unresolved
109 0 files updated, 1 files merged, 0 files removed, 1 files unresolved
110 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
110 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
111 [1]
111 [1]
112 $ cat bar
112 $ cat bar
113 bleh
113 bleh
114 $ hg st
114 $ hg st
115 M bar
115 M bar
116 M foo1
116 M foo1
@@ -1,140 +1,140 b''
1 $ hg init
1 $ hg init
2
2
3 $ echo a > a
3 $ echo a > a
4 $ hg ci -qAm 'add a'
4 $ hg ci -qAm 'add a'
5
5
6 $ hg init subrepo
6 $ hg init subrepo
7 $ echo 'subrepo = http://example.net/libfoo' > .hgsub
7 $ echo 'subrepo = http://example.net/libfoo' > .hgsub
8 $ hg ci -qAm 'added subrepo'
8 $ hg ci -qAm 'added subrepo'
9
9
10 $ hg up -qC 0
10 $ hg up -qC 0
11 $ echo ax > a
11 $ echo ax > a
12 $ hg ci -m 'changed a'
12 $ hg ci -m 'changed a'
13 created new head
13 created new head
14
14
15 $ hg up -qC 1
15 $ hg up -qC 1
16 $ cd subrepo
16 $ cd subrepo
17 $ echo b > b
17 $ echo b > b
18 $ hg add b
18 $ hg add b
19 $ cd ..
19 $ cd ..
20
20
21 Should fail, since there are added files to subrepo:
21 Should fail, since there are added files to subrepo:
22
22
23 $ hg merge
23 $ hg merge
24 abort: uncommitted changes in subrepository "subrepo"
24 abort: uncommitted changes in subrepository "subrepo"
25 [255]
25 [255]
26
26
27 Deleted files trigger a '+' marker in top level repos. Deleted files are also
27 Deleted files trigger a '+' marker in top level repos. Deleted files are also
28 noticed by `update --check` in the top level repo.
28 noticed by `update --check` in the top level repo.
29
29
30 $ hg ci -Sqm 'add b'
30 $ hg ci -Sqm 'add b'
31 $ echo change > subrepo/b
31 $ echo change > subrepo/b
32
32
33 $ hg ci -Sm 'change b'
33 $ hg ci -Sm 'change b'
34 committing subrepository subrepo
34 committing subrepository subrepo
35
35
36 $ rm a
36 $ rm a
37 $ hg id
37 $ hg id
38 9bfe45a197d7+ tip
38 9bfe45a197d7+ tip
39 $ hg sum
39 $ hg sum
40 parent: 4:9bfe45a197d7 tip
40 parent: 4:9bfe45a197d7 tip
41 change b
41 change b
42 branch: default
42 branch: default
43 commit: 1 deleted (clean)
43 commit: 1 deleted (clean)
44 update: 1 new changesets, 2 branch heads (merge)
44 update: 1 new changesets, 2 branch heads (merge)
45 phases: 5 draft
45 phases: 5 draft
46
46
47 $ hg up --check -r '.^'
47 $ hg up --check -r '.^'
48 abort: uncommitted changes
48 abort: uncommitted changes
49 [255]
49 [255]
50 $ hg st -S
50 $ hg st -S
51 ! a
51 ! a
52 $ hg up -Cq .
52 $ hg up -Cq .
53
53
54 Test that dirty is consistent through subrepos
54 Test that dirty is consistent through subrepos
55
55
56 $ rm subrepo/b
56 $ rm subrepo/b
57
57
58 A deleted subrepo file is flagged as dirty, like the top level repo
58 A deleted subrepo file is flagged as dirty, like the top level repo
59
59
60 $ hg id --config extensions.blackbox= --config blackbox.dirty=True
60 $ hg id --config extensions.blackbox= --config blackbox.dirty=True
61 9bfe45a197d7+ tip
61 9bfe45a197d7+ tip
62 $ cat .hg/blackbox.log
62 $ cat .hg/blackbox.log
63 * @9bfe45a197d7b0ab09bf287729dd57e9619c9da5+ (*)> serve --cmdserver chgunix * (glob) (chg !)
63 * @9bfe45a197d7b0ab09bf287729dd57e9619c9da5+ (*)> serve --cmdserver chgunix * (glob) (chg !)
64 * @9bfe45a197d7b0ab09bf287729dd57e9619c9da5+ (*)> id --config *extensions.blackbox=* --config *blackbox.dirty=True* (glob)
64 * @9bfe45a197d7b0ab09bf287729dd57e9619c9da5+ (*)> id --config *extensions.blackbox=* --config *blackbox.dirty=True* (glob)
65 * @9bfe45a197d7b0ab09bf287729dd57e9619c9da5+ (*)> id --config *extensions.blackbox=* --config *blackbox.dirty=True* exited 0 * (glob)
65 * @9bfe45a197d7b0ab09bf287729dd57e9619c9da5+ (*)> id --config *extensions.blackbox=* --config *blackbox.dirty=True* exited 0 * (glob)
66
66
67 TODO: a deleted file should be listed as such, like the top level repo
67 TODO: a deleted file should be listed as such, like the top level repo
68
68
69 $ hg sum
69 $ hg sum
70 parent: 4:9bfe45a197d7 tip
70 parent: 4:9bfe45a197d7 tip
71 change b
71 change b
72 branch: default
72 branch: default
73 commit: (clean)
73 commit: (clean)
74 update: 1 new changesets, 2 branch heads (merge)
74 update: 1 new changesets, 2 branch heads (merge)
75 phases: 5 draft
75 phases: 5 draft
76
76
77 Modified subrepo files are noticed by `update --check` and `summary`
77 Modified subrepo files are noticed by `update --check` and `summary`
78
78
79 $ echo mod > subrepo/b
79 $ echo mod > subrepo/b
80 $ hg st -S
80 $ hg st -S
81 M subrepo/b
81 M subrepo/b
82
82
83 $ hg up -r '.^' --check
83 $ hg up -r '.^' --check
84 abort: uncommitted changes in subrepository "subrepo"
84 abort: uncommitted changes in subrepository "subrepo"
85 [255]
85 [255]
86
86
87 $ hg sum
87 $ hg sum
88 parent: 4:9bfe45a197d7 tip
88 parent: 4:9bfe45a197d7 tip
89 change b
89 change b
90 branch: default
90 branch: default
91 commit: 1 subrepos
91 commit: 1 subrepos
92 update: 1 new changesets, 2 branch heads (merge)
92 update: 1 new changesets, 2 branch heads (merge)
93 phases: 5 draft
93 phases: 5 draft
94
94
95 TODO: why is -R needed here? If it's because the subrepo is treated as a
95 TODO: why is -R needed here? If it's because the subrepo is treated as a
96 discrete unit, then this should probably warn or something.
96 discrete unit, then this should probably warn or something.
97 $ hg revert -R subrepo --no-backup subrepo/b -r .
97 $ hg revert -R subrepo --no-backup subrepo/b -r .
98
98
99 $ rm subrepo/b
99 $ rm subrepo/b
100 $ hg st -S
100 $ hg st -S
101 ! subrepo/b
101 ! subrepo/b
102
102
103 `hg update --check` notices a subrepo with a missing file, like it notices a
103 `hg update --check` notices a subrepo with a missing file, like it notices a
104 missing file in the top level repo.
104 missing file in the top level repo.
105
105
106 $ hg up -r '.^' --check
106 $ hg up -r '.^' --check
107 abort: uncommitted changes in subrepository "subrepo"
107 abort: uncommitted changes in subrepository "subrepo"
108 [255]
108 [255]
109
109
110 $ hg up -r '.^' --config ui.interactive=True << EOF
110 $ hg up -r '.^' --config ui.interactive=True << EOF
111 > d
111 > d
112 > EOF
112 > EOF
113 file 'b' was deleted in other [destination] but was modified in local [working copy].
113 file 'b' was deleted in local [working copy] but was modified in other [destination].
114 What do you want to do?
114 What do you want to do?
115 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? d
115 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? d
116 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
116 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
117
117
118 XXX: There's a difference between wdir() and '.', so there should be a status.
118 XXX: There's a difference between wdir() and '.', so there should be a status.
119 `hg files -S` from the top is also missing 'subrepo/b'.
119 `hg files -S` from the top is also missing 'subrepo/b'.
120
120
121 $ hg st -S
121 $ hg st -S
122 $ hg st -R subrepo
122 $ hg st -R subrepo
123 $ hg files -R subrepo
123 $ hg files -R subrepo
124 [1]
124 [1]
125 $ hg files -R subrepo -r '.'
125 $ hg files -R subrepo -r '.'
126 subrepo/b
126 subrepo/b
127
127
128 $ hg bookmark -r tip @other
128 $ hg bookmark -r tip @other
129 $ echo xyz > subrepo/c
129 $ echo xyz > subrepo/c
130 $ hg ci -SAm 'add c'
130 $ hg ci -SAm 'add c'
131 adding subrepo/c
131 adding subrepo/c
132 committing subrepository subrepo
132 committing subrepository subrepo
133 created new head
133 created new head
134 $ rm subrepo/c
134 $ rm subrepo/c
135
135
136 Merge sees deleted subrepo files as an uncommitted change
136 Merge sees deleted subrepo files as an uncommitted change
137
137
138 $ hg merge @other
138 $ hg merge @other
139 abort: uncommitted changes in subrepository "subrepo"
139 abort: uncommitted changes in subrepository "subrepo"
140 [255]
140 [255]
@@ -1,426 +1,426 b''
1 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
2 > [extensions]
2 > [extensions]
3 > rebase=
3 > rebase=
4 > drawdag=$TESTDIR/drawdag.py
4 > drawdag=$TESTDIR/drawdag.py
5 > [alias]
5 > [alias]
6 > tglog = log -G --template "{rev}: {node|short} '{desc}' {branches}\n"
6 > tglog = log -G --template "{rev}: {node|short} '{desc}' {branches}\n"
7 > EOF
7 > EOF
8
8
9 $ hg init repo
9 $ hg init repo
10 $ cd repo
10 $ cd repo
11
11
12 $ echo A > a
12 $ echo A > a
13 $ echo >> a
13 $ echo >> a
14 $ hg ci -Am A
14 $ hg ci -Am A
15 adding a
15 adding a
16
16
17 $ echo B > a
17 $ echo B > a
18 $ echo >> a
18 $ echo >> a
19 $ hg ci -m B
19 $ hg ci -m B
20
20
21 $ echo C > a
21 $ echo C > a
22 $ echo >> a
22 $ echo >> a
23 $ hg ci -m C
23 $ hg ci -m C
24
24
25 $ hg up -q -C 0
25 $ hg up -q -C 0
26
26
27 $ echo D >> a
27 $ echo D >> a
28 $ hg ci -Am AD
28 $ hg ci -Am AD
29 created new head
29 created new head
30
30
31 $ hg tglog
31 $ hg tglog
32 @ 3: 3878212183bd 'AD'
32 @ 3: 3878212183bd 'AD'
33 |
33 |
34 | o 2: 30ae917c0e4f 'C'
34 | o 2: 30ae917c0e4f 'C'
35 | |
35 | |
36 | o 1: 0f4f7cb4f549 'B'
36 | o 1: 0f4f7cb4f549 'B'
37 |/
37 |/
38 o 0: 1e635d440a73 'A'
38 o 0: 1e635d440a73 'A'
39
39
40 $ hg rebase -s 1 -d 3
40 $ hg rebase -s 1 -d 3
41 rebasing 1:0f4f7cb4f549 "B"
41 rebasing 1:0f4f7cb4f549 "B"
42 merging a
42 merging a
43 rebasing 2:30ae917c0e4f "C"
43 rebasing 2:30ae917c0e4f "C"
44 merging a
44 merging a
45 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/0f4f7cb4f549-82b3b163-rebase.hg
45 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/0f4f7cb4f549-82b3b163-rebase.hg
46
46
47 $ hg tglog
47 $ hg tglog
48 o 3: 25773bc4b4b0 'C'
48 o 3: 25773bc4b4b0 'C'
49 |
49 |
50 o 2: c09015405f75 'B'
50 o 2: c09015405f75 'B'
51 |
51 |
52 @ 1: 3878212183bd 'AD'
52 @ 1: 3878212183bd 'AD'
53 |
53 |
54 o 0: 1e635d440a73 'A'
54 o 0: 1e635d440a73 'A'
55
55
56
56
57 $ cd ..
57 $ cd ..
58
58
59
59
60 Test rebasing of merges with ancestors of the rebase destination - a situation
60 Test rebasing of merges with ancestors of the rebase destination - a situation
61 that often happens when trying to recover from repeated merging with a mainline
61 that often happens when trying to recover from repeated merging with a mainline
62 branch.
62 branch.
63
63
64 The test case creates a dev branch that contains a couple of merges from the
64 The test case creates a dev branch that contains a couple of merges from the
65 default branch. When rebasing to the default branch, these merges would be
65 default branch. When rebasing to the default branch, these merges would be
66 merges with ancestors on the same branch. The merges _could_ contain some
66 merges with ancestors on the same branch. The merges _could_ contain some
67 interesting conflict resolutions or additional changes in the merge commit, but
67 interesting conflict resolutions or additional changes in the merge commit, but
68 that is mixed up with the actual merge stuff and there is in general no way to
68 that is mixed up with the actual merge stuff and there is in general no way to
69 separate them.
69 separate them.
70
70
71 Note: The dev branch contains _no_ changes to f-default. It might be unclear
71 Note: The dev branch contains _no_ changes to f-default. It might be unclear
72 how rebasing of ancestor merges should be handled, but the current behavior
72 how rebasing of ancestor merges should be handled, but the current behavior
73 with spurious prompts for conflicts in files that didn't change seems very
73 with spurious prompts for conflicts in files that didn't change seems very
74 wrong.
74 wrong.
75
75
76 $ hg init ancestor-merge
76 $ hg init ancestor-merge
77 $ cd ancestor-merge
77 $ cd ancestor-merge
78
78
79 $ touch f-default
79 $ touch f-default
80 $ hg ci -Aqm 'default: create f-default'
80 $ hg ci -Aqm 'default: create f-default'
81
81
82 $ hg branch -q dev
82 $ hg branch -q dev
83 $ hg ci -qm 'dev: create branch'
83 $ hg ci -qm 'dev: create branch'
84
84
85 $ echo stuff > f-dev
85 $ echo stuff > f-dev
86 $ hg ci -Aqm 'dev: f-dev stuff'
86 $ hg ci -Aqm 'dev: f-dev stuff'
87
87
88 $ hg up -q default
88 $ hg up -q default
89 $ echo stuff > f-default
89 $ echo stuff > f-default
90 $ hg ci -m 'default: f-default stuff'
90 $ hg ci -m 'default: f-default stuff'
91
91
92 $ hg up -q dev
92 $ hg up -q dev
93 $ hg merge -q default
93 $ hg merge -q default
94 $ hg ci -m 'dev: merge default'
94 $ hg ci -m 'dev: merge default'
95
95
96 $ hg up -q default
96 $ hg up -q default
97 $ hg rm f-default
97 $ hg rm f-default
98 $ hg ci -m 'default: remove f-default'
98 $ hg ci -m 'default: remove f-default'
99
99
100 $ hg up -q dev
100 $ hg up -q dev
101 $ hg merge -q default
101 $ hg merge -q default
102 $ hg ci -m 'dev: merge default'
102 $ hg ci -m 'dev: merge default'
103
103
104 $ hg up -q default
104 $ hg up -q default
105 $ echo stuff > f-other
105 $ echo stuff > f-other
106 $ hg ci -Aqm 'default: f-other stuff'
106 $ hg ci -Aqm 'default: f-other stuff'
107
107
108 $ hg tglog
108 $ hg tglog
109 @ 7: e08089805d82 'default: f-other stuff'
109 @ 7: e08089805d82 'default: f-other stuff'
110 |
110 |
111 | o 6: 9455ee510502 'dev: merge default' dev
111 | o 6: 9455ee510502 'dev: merge default' dev
112 |/|
112 |/|
113 o | 5: 462860db70a1 'default: remove f-default'
113 o | 5: 462860db70a1 'default: remove f-default'
114 | |
114 | |
115 | o 4: 4b019212aaf6 'dev: merge default' dev
115 | o 4: 4b019212aaf6 'dev: merge default' dev
116 |/|
116 |/|
117 o | 3: f157ecfd2b6b 'default: f-default stuff'
117 o | 3: f157ecfd2b6b 'default: f-default stuff'
118 | |
118 | |
119 | o 2: ec2c14fb2984 'dev: f-dev stuff' dev
119 | o 2: ec2c14fb2984 'dev: f-dev stuff' dev
120 | |
120 | |
121 | o 1: 1d1a643d390e 'dev: create branch' dev
121 | o 1: 1d1a643d390e 'dev: create branch' dev
122 |/
122 |/
123 o 0: e90e8eb90b6f 'default: create f-default'
123 o 0: e90e8eb90b6f 'default: create f-default'
124
124
125 $ hg clone -qU . ../ancestor-merge-2
125 $ hg clone -qU . ../ancestor-merge-2
126
126
127 Full rebase all the way back from branching point:
127 Full rebase all the way back from branching point:
128
128
129 $ hg rebase -r 'only(dev,default)' -d default --config ui.interactive=True << EOF
129 $ hg rebase -r 'only(dev,default)' -d default --config ui.interactive=True << EOF
130 > c
130 > c
131 > EOF
131 > EOF
132 rebasing 1:1d1a643d390e "dev: create branch"
132 rebasing 1:1d1a643d390e "dev: create branch"
133 note: rebase of 1:1d1a643d390e created no changes to commit
133 note: rebase of 1:1d1a643d390e created no changes to commit
134 rebasing 2:ec2c14fb2984 "dev: f-dev stuff"
134 rebasing 2:ec2c14fb2984 "dev: f-dev stuff"
135 rebasing 4:4b019212aaf6 "dev: merge default"
135 rebasing 4:4b019212aaf6 "dev: merge default"
136 file 'f-default' was deleted in other [source] but was modified in local [dest].
136 file 'f-default' was deleted in local [dest] but was modified in other [source].
137 What do you want to do?
137 What do you want to do?
138 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? c
138 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? c
139 rebasing 6:9455ee510502 "dev: merge default"
139 rebasing 6:9455ee510502 "dev: merge default"
140 saved backup bundle to $TESTTMP/ancestor-merge/.hg/strip-backup/1d1a643d390e-43e9e04b-rebase.hg
140 saved backup bundle to $TESTTMP/ancestor-merge/.hg/strip-backup/1d1a643d390e-43e9e04b-rebase.hg
141 $ hg tglog
141 $ hg tglog
142 o 6: fbc098e72227 'dev: merge default'
142 o 6: fbc098e72227 'dev: merge default'
143 |
143 |
144 o 5: eda7b7f46f5d 'dev: merge default'
144 o 5: eda7b7f46f5d 'dev: merge default'
145 |
145 |
146 o 4: 3e075b1c0a40 'dev: f-dev stuff'
146 o 4: 3e075b1c0a40 'dev: f-dev stuff'
147 |
147 |
148 @ 3: e08089805d82 'default: f-other stuff'
148 @ 3: e08089805d82 'default: f-other stuff'
149 |
149 |
150 o 2: 462860db70a1 'default: remove f-default'
150 o 2: 462860db70a1 'default: remove f-default'
151 |
151 |
152 o 1: f157ecfd2b6b 'default: f-default stuff'
152 o 1: f157ecfd2b6b 'default: f-default stuff'
153 |
153 |
154 o 0: e90e8eb90b6f 'default: create f-default'
154 o 0: e90e8eb90b6f 'default: create f-default'
155
155
156 Grafty cherry picking rebasing:
156 Grafty cherry picking rebasing:
157
157
158 $ cd ../ancestor-merge-2
158 $ cd ../ancestor-merge-2
159
159
160 $ hg phase -fdr0:
160 $ hg phase -fdr0:
161 $ hg rebase -r 'children(only(dev,default))' -d default --config ui.interactive=True << EOF
161 $ hg rebase -r 'children(only(dev,default))' -d default --config ui.interactive=True << EOF
162 > c
162 > c
163 > EOF
163 > EOF
164 rebasing 2:ec2c14fb2984 "dev: f-dev stuff"
164 rebasing 2:ec2c14fb2984 "dev: f-dev stuff"
165 rebasing 4:4b019212aaf6 "dev: merge default"
165 rebasing 4:4b019212aaf6 "dev: merge default"
166 file 'f-default' was deleted in other [source] but was modified in local [dest].
166 file 'f-default' was deleted in local [dest] but was modified in other [source].
167 What do you want to do?
167 What do you want to do?
168 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? c
168 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? c
169 rebasing 6:9455ee510502 "dev: merge default"
169 rebasing 6:9455ee510502 "dev: merge default"
170 saved backup bundle to $TESTTMP/ancestor-merge-2/.hg/strip-backup/ec2c14fb2984-62d0b222-rebase.hg
170 saved backup bundle to $TESTTMP/ancestor-merge-2/.hg/strip-backup/ec2c14fb2984-62d0b222-rebase.hg
171 $ hg tglog
171 $ hg tglog
172 o 7: fbc098e72227 'dev: merge default'
172 o 7: fbc098e72227 'dev: merge default'
173 |
173 |
174 o 6: eda7b7f46f5d 'dev: merge default'
174 o 6: eda7b7f46f5d 'dev: merge default'
175 |
175 |
176 o 5: 3e075b1c0a40 'dev: f-dev stuff'
176 o 5: 3e075b1c0a40 'dev: f-dev stuff'
177 |
177 |
178 o 4: e08089805d82 'default: f-other stuff'
178 o 4: e08089805d82 'default: f-other stuff'
179 |
179 |
180 o 3: 462860db70a1 'default: remove f-default'
180 o 3: 462860db70a1 'default: remove f-default'
181 |
181 |
182 o 2: f157ecfd2b6b 'default: f-default stuff'
182 o 2: f157ecfd2b6b 'default: f-default stuff'
183 |
183 |
184 | o 1: 1d1a643d390e 'dev: create branch' dev
184 | o 1: 1d1a643d390e 'dev: create branch' dev
185 |/
185 |/
186 o 0: e90e8eb90b6f 'default: create f-default'
186 o 0: e90e8eb90b6f 'default: create f-default'
187
187
188 $ cd ..
188 $ cd ..
189
189
190
190
191 Test order of parents of rebased merged with un-rebased changes as p1.
191 Test order of parents of rebased merged with un-rebased changes as p1.
192
192
193 $ hg init parentorder
193 $ hg init parentorder
194 $ cd parentorder
194 $ cd parentorder
195 $ touch f
195 $ touch f
196 $ hg ci -Aqm common
196 $ hg ci -Aqm common
197 $ touch change
197 $ touch change
198 $ hg ci -Aqm change
198 $ hg ci -Aqm change
199 $ touch target
199 $ touch target
200 $ hg ci -Aqm target
200 $ hg ci -Aqm target
201 $ hg up -qr 0
201 $ hg up -qr 0
202 $ touch outside
202 $ touch outside
203 $ hg ci -Aqm outside
203 $ hg ci -Aqm outside
204 $ hg merge -qr 1
204 $ hg merge -qr 1
205 $ hg ci -m 'merge p1 3=outside p2 1=ancestor'
205 $ hg ci -m 'merge p1 3=outside p2 1=ancestor'
206 $ hg par
206 $ hg par
207 changeset: 4:6990226659be
207 changeset: 4:6990226659be
208 tag: tip
208 tag: tip
209 parent: 3:f59da8fc0fcf
209 parent: 3:f59da8fc0fcf
210 parent: 1:dd40c13f7a6f
210 parent: 1:dd40c13f7a6f
211 user: test
211 user: test
212 date: Thu Jan 01 00:00:00 1970 +0000
212 date: Thu Jan 01 00:00:00 1970 +0000
213 summary: merge p1 3=outside p2 1=ancestor
213 summary: merge p1 3=outside p2 1=ancestor
214
214
215 $ hg up -qr 1
215 $ hg up -qr 1
216 $ hg merge -qr 3
216 $ hg merge -qr 3
217 $ hg ci -qm 'merge p1 1=ancestor p2 3=outside'
217 $ hg ci -qm 'merge p1 1=ancestor p2 3=outside'
218 $ hg par
218 $ hg par
219 changeset: 5:a57575f79074
219 changeset: 5:a57575f79074
220 tag: tip
220 tag: tip
221 parent: 1:dd40c13f7a6f
221 parent: 1:dd40c13f7a6f
222 parent: 3:f59da8fc0fcf
222 parent: 3:f59da8fc0fcf
223 user: test
223 user: test
224 date: Thu Jan 01 00:00:00 1970 +0000
224 date: Thu Jan 01 00:00:00 1970 +0000
225 summary: merge p1 1=ancestor p2 3=outside
225 summary: merge p1 1=ancestor p2 3=outside
226
226
227 $ hg tglog
227 $ hg tglog
228 @ 5: a57575f79074 'merge p1 1=ancestor p2 3=outside'
228 @ 5: a57575f79074 'merge p1 1=ancestor p2 3=outside'
229 |\
229 |\
230 +---o 4: 6990226659be 'merge p1 3=outside p2 1=ancestor'
230 +---o 4: 6990226659be 'merge p1 3=outside p2 1=ancestor'
231 | |/
231 | |/
232 | o 3: f59da8fc0fcf 'outside'
232 | o 3: f59da8fc0fcf 'outside'
233 | |
233 | |
234 +---o 2: a60552eb93fb 'target'
234 +---o 2: a60552eb93fb 'target'
235 | |
235 | |
236 o | 1: dd40c13f7a6f 'change'
236 o | 1: dd40c13f7a6f 'change'
237 |/
237 |/
238 o 0: 02f0f58d5300 'common'
238 o 0: 02f0f58d5300 'common'
239
239
240 $ hg rebase -r 4 -d 2
240 $ hg rebase -r 4 -d 2
241 rebasing 4:6990226659be "merge p1 3=outside p2 1=ancestor"
241 rebasing 4:6990226659be "merge p1 3=outside p2 1=ancestor"
242 saved backup bundle to $TESTTMP/parentorder/.hg/strip-backup/6990226659be-4d67a0d3-rebase.hg
242 saved backup bundle to $TESTTMP/parentorder/.hg/strip-backup/6990226659be-4d67a0d3-rebase.hg
243 $ hg tip
243 $ hg tip
244 changeset: 5:cca50676b1c5
244 changeset: 5:cca50676b1c5
245 tag: tip
245 tag: tip
246 parent: 2:a60552eb93fb
246 parent: 2:a60552eb93fb
247 parent: 3:f59da8fc0fcf
247 parent: 3:f59da8fc0fcf
248 user: test
248 user: test
249 date: Thu Jan 01 00:00:00 1970 +0000
249 date: Thu Jan 01 00:00:00 1970 +0000
250 summary: merge p1 3=outside p2 1=ancestor
250 summary: merge p1 3=outside p2 1=ancestor
251
251
252 $ hg rebase -r 4 -d 2
252 $ hg rebase -r 4 -d 2
253 rebasing 4:a57575f79074 "merge p1 1=ancestor p2 3=outside"
253 rebasing 4:a57575f79074 "merge p1 1=ancestor p2 3=outside"
254 saved backup bundle to $TESTTMP/parentorder/.hg/strip-backup/a57575f79074-385426e5-rebase.hg
254 saved backup bundle to $TESTTMP/parentorder/.hg/strip-backup/a57575f79074-385426e5-rebase.hg
255 $ hg tip
255 $ hg tip
256 changeset: 5:f9daf77ffe76
256 changeset: 5:f9daf77ffe76
257 tag: tip
257 tag: tip
258 parent: 2:a60552eb93fb
258 parent: 2:a60552eb93fb
259 parent: 3:f59da8fc0fcf
259 parent: 3:f59da8fc0fcf
260 user: test
260 user: test
261 date: Thu Jan 01 00:00:00 1970 +0000
261 date: Thu Jan 01 00:00:00 1970 +0000
262 summary: merge p1 1=ancestor p2 3=outside
262 summary: merge p1 1=ancestor p2 3=outside
263
263
264 $ hg tglog
264 $ hg tglog
265 @ 5: f9daf77ffe76 'merge p1 1=ancestor p2 3=outside'
265 @ 5: f9daf77ffe76 'merge p1 1=ancestor p2 3=outside'
266 |\
266 |\
267 +---o 4: cca50676b1c5 'merge p1 3=outside p2 1=ancestor'
267 +---o 4: cca50676b1c5 'merge p1 3=outside p2 1=ancestor'
268 | |/
268 | |/
269 | o 3: f59da8fc0fcf 'outside'
269 | o 3: f59da8fc0fcf 'outside'
270 | |
270 | |
271 o | 2: a60552eb93fb 'target'
271 o | 2: a60552eb93fb 'target'
272 | |
272 | |
273 o | 1: dd40c13f7a6f 'change'
273 o | 1: dd40c13f7a6f 'change'
274 |/
274 |/
275 o 0: 02f0f58d5300 'common'
275 o 0: 02f0f58d5300 'common'
276
276
277 rebase of merge of ancestors
277 rebase of merge of ancestors
278
278
279 $ hg up -qr 2
279 $ hg up -qr 2
280 $ hg merge -qr 3
280 $ hg merge -qr 3
281 $ echo 'other change while merging future "rebase ancestors"' > other
281 $ echo 'other change while merging future "rebase ancestors"' > other
282 $ hg ci -Aqm 'merge rebase ancestors'
282 $ hg ci -Aqm 'merge rebase ancestors'
283 $ hg rebase -d 5 -v
283 $ hg rebase -d 5 -v
284 rebasing 6:4c5f12f25ebe "merge rebase ancestors" (tip)
284 rebasing 6:4c5f12f25ebe "merge rebase ancestors" (tip)
285 resolving manifests
285 resolving manifests
286 removing other
286 removing other
287 note: merging f9daf77ffe76+ and 4c5f12f25ebe using bids from ancestors a60552eb93fb and f59da8fc0fcf
287 note: merging f9daf77ffe76+ and 4c5f12f25ebe using bids from ancestors a60552eb93fb and f59da8fc0fcf
288
288
289 calculating bids for ancestor a60552eb93fb
289 calculating bids for ancestor a60552eb93fb
290 resolving manifests
290 resolving manifests
291
291
292 calculating bids for ancestor f59da8fc0fcf
292 calculating bids for ancestor f59da8fc0fcf
293 resolving manifests
293 resolving manifests
294
294
295 auction for merging merge bids
295 auction for merging merge bids
296 other: consensus for g
296 other: consensus for g
297 end of auction
297 end of auction
298
298
299 getting other
299 getting other
300 committing files:
300 committing files:
301 other
301 other
302 committing manifest
302 committing manifest
303 committing changelog
303 committing changelog
304 rebase merging completed
304 rebase merging completed
305 1 changesets found
305 1 changesets found
306 uncompressed size of bundle content:
306 uncompressed size of bundle content:
307 199 (changelog)
307 199 (changelog)
308 216 (manifests)
308 216 (manifests)
309 182 other
309 182 other
310 saved backup bundle to $TESTTMP/parentorder/.hg/strip-backup/4c5f12f25ebe-f46990e5-rebase.hg
310 saved backup bundle to $TESTTMP/parentorder/.hg/strip-backup/4c5f12f25ebe-f46990e5-rebase.hg
311 1 changesets found
311 1 changesets found
312 uncompressed size of bundle content:
312 uncompressed size of bundle content:
313 254 (changelog)
313 254 (changelog)
314 167 (manifests)
314 167 (manifests)
315 182 other
315 182 other
316 adding branch
316 adding branch
317 adding changesets
317 adding changesets
318 adding manifests
318 adding manifests
319 adding file changes
319 adding file changes
320 added 1 changesets with 1 changes to 1 files
320 added 1 changesets with 1 changes to 1 files
321 rebase completed
321 rebase completed
322 $ hg tglog
322 $ hg tglog
323 @ 6: 113755df812b 'merge rebase ancestors'
323 @ 6: 113755df812b 'merge rebase ancestors'
324 |
324 |
325 o 5: f9daf77ffe76 'merge p1 1=ancestor p2 3=outside'
325 o 5: f9daf77ffe76 'merge p1 1=ancestor p2 3=outside'
326 |\
326 |\
327 +---o 4: cca50676b1c5 'merge p1 3=outside p2 1=ancestor'
327 +---o 4: cca50676b1c5 'merge p1 3=outside p2 1=ancestor'
328 | |/
328 | |/
329 | o 3: f59da8fc0fcf 'outside'
329 | o 3: f59da8fc0fcf 'outside'
330 | |
330 | |
331 o | 2: a60552eb93fb 'target'
331 o | 2: a60552eb93fb 'target'
332 | |
332 | |
333 o | 1: dd40c13f7a6f 'change'
333 o | 1: dd40c13f7a6f 'change'
334 |/
334 |/
335 o 0: 02f0f58d5300 'common'
335 o 0: 02f0f58d5300 'common'
336
336
337 Due to the limitation of 3-way merge algorithm (1 merge base), rebasing a merge
337 Due to the limitation of 3-way merge algorithm (1 merge base), rebasing a merge
338 may include unwanted content:
338 may include unwanted content:
339
339
340 $ hg init $TESTTMP/dual-merge-base1
340 $ hg init $TESTTMP/dual-merge-base1
341 $ cd $TESTTMP/dual-merge-base1
341 $ cd $TESTTMP/dual-merge-base1
342 $ hg debugdrawdag <<'EOS'
342 $ hg debugdrawdag <<'EOS'
343 > F
343 > F
344 > /|
344 > /|
345 > D E
345 > D E
346 > | |
346 > | |
347 > B C
347 > B C
348 > |/
348 > |/
349 > A Z
349 > A Z
350 > |/
350 > |/
351 > R
351 > R
352 > EOS
352 > EOS
353 $ hg rebase -r D+E+F -d Z
353 $ hg rebase -r D+E+F -d Z
354 rebasing 5:5f2c926dfecf "D" (D)
354 rebasing 5:5f2c926dfecf "D" (D)
355 rebasing 6:b296604d9846 "E" (E)
355 rebasing 6:b296604d9846 "E" (E)
356 rebasing 7:caa9781e507d "F" (F tip)
356 rebasing 7:caa9781e507d "F" (F tip)
357 abort: rebasing 7:caa9781e507d will include unwanted changes from 4:d6003a550c2c or 3:c1e6b162678d
357 abort: rebasing 7:caa9781e507d will include unwanted changes from 4:d6003a550c2c or 3:c1e6b162678d
358 [255]
358 [255]
359
359
360 The warning does not get printed if there is no unwanted change detected:
360 The warning does not get printed if there is no unwanted change detected:
361
361
362 $ hg init $TESTTMP/dual-merge-base2
362 $ hg init $TESTTMP/dual-merge-base2
363 $ cd $TESTTMP/dual-merge-base2
363 $ cd $TESTTMP/dual-merge-base2
364 $ hg debugdrawdag <<'EOS'
364 $ hg debugdrawdag <<'EOS'
365 > D
365 > D
366 > /|
366 > /|
367 > B C
367 > B C
368 > |/
368 > |/
369 > A Z
369 > A Z
370 > |/
370 > |/
371 > R
371 > R
372 > EOS
372 > EOS
373 $ hg rebase -r B+C+D -d Z
373 $ hg rebase -r B+C+D -d Z
374 rebasing 3:c1e6b162678d "B" (B)
374 rebasing 3:c1e6b162678d "B" (B)
375 rebasing 4:d6003a550c2c "C" (C)
375 rebasing 4:d6003a550c2c "C" (C)
376 rebasing 5:c8f78076273e "D" (D tip)
376 rebasing 5:c8f78076273e "D" (D tip)
377 saved backup bundle to $TESTTMP/dual-merge-base2/.hg/strip-backup/d6003a550c2c-6f1424b6-rebase.hg
377 saved backup bundle to $TESTTMP/dual-merge-base2/.hg/strip-backup/d6003a550c2c-6f1424b6-rebase.hg
378 $ hg manifest -r 'desc(D)'
378 $ hg manifest -r 'desc(D)'
379 B
379 B
380 C
380 C
381 R
381 R
382 Z
382 Z
383
383
384 The merge base could be different from old p1 (changed parent becomes new p1):
384 The merge base could be different from old p1 (changed parent becomes new p1):
385
385
386 $ hg init $TESTTMP/chosen-merge-base1
386 $ hg init $TESTTMP/chosen-merge-base1
387 $ cd $TESTTMP/chosen-merge-base1
387 $ cd $TESTTMP/chosen-merge-base1
388 $ hg debugdrawdag <<'EOS'
388 $ hg debugdrawdag <<'EOS'
389 > F
389 > F
390 > /|
390 > /|
391 > D E
391 > D E
392 > | |
392 > | |
393 > B C Z
393 > B C Z
394 > EOS
394 > EOS
395 $ hg rebase -r D+F -d Z
395 $ hg rebase -r D+F -d Z
396 rebasing 3:004dc1679908 "D" (D)
396 rebasing 3:004dc1679908 "D" (D)
397 rebasing 5:4be4cbf6f206 "F" (F tip)
397 rebasing 5:4be4cbf6f206 "F" (F tip)
398 saved backup bundle to $TESTTMP/chosen-merge-base1/.hg/strip-backup/004dc1679908-06a66a3c-rebase.hg
398 saved backup bundle to $TESTTMP/chosen-merge-base1/.hg/strip-backup/004dc1679908-06a66a3c-rebase.hg
399 $ hg manifest -r 'desc(F)'
399 $ hg manifest -r 'desc(F)'
400 C
400 C
401 D
401 D
402 E
402 E
403 Z
403 Z
404 $ hg log -r `hg log -r 'desc(F)' -T '{p1node}'` -T '{desc}\n'
404 $ hg log -r `hg log -r 'desc(F)' -T '{p1node}'` -T '{desc}\n'
405 D
405 D
406
406
407 $ hg init $TESTTMP/chosen-merge-base2
407 $ hg init $TESTTMP/chosen-merge-base2
408 $ cd $TESTTMP/chosen-merge-base2
408 $ cd $TESTTMP/chosen-merge-base2
409 $ hg debugdrawdag <<'EOS'
409 $ hg debugdrawdag <<'EOS'
410 > F
410 > F
411 > /|
411 > /|
412 > D E
412 > D E
413 > | |
413 > | |
414 > B C Z
414 > B C Z
415 > EOS
415 > EOS
416 $ hg rebase -r E+F -d Z
416 $ hg rebase -r E+F -d Z
417 rebasing 4:974e4943c210 "E" (E)
417 rebasing 4:974e4943c210 "E" (E)
418 rebasing 5:4be4cbf6f206 "F" (F tip)
418 rebasing 5:4be4cbf6f206 "F" (F tip)
419 saved backup bundle to $TESTTMP/chosen-merge-base2/.hg/strip-backup/974e4943c210-b2874da5-rebase.hg
419 saved backup bundle to $TESTTMP/chosen-merge-base2/.hg/strip-backup/974e4943c210-b2874da5-rebase.hg
420 $ hg manifest -r 'desc(F)'
420 $ hg manifest -r 'desc(F)'
421 B
421 B
422 D
422 D
423 E
423 E
424 Z
424 Z
425 $ hg log -r `hg log -r 'desc(F)' -T '{p1node}'` -T '{desc}\n'
425 $ hg log -r `hg log -r 'desc(F)' -T '{p1node}'` -T '{desc}\n'
426 E
426 E
@@ -1,1071 +1,1071 b''
1
1
2 $ mkdir -p t
2 $ mkdir -p t
3 $ cd t
3 $ cd t
4 $ cat <<EOF > merge
4 $ cat <<EOF > merge
5 > import sys, os
5 > import sys, os
6 > f = open(sys.argv[1], "wb")
6 > f = open(sys.argv[1], "wb")
7 > f.write("merge %s %s %s" % (sys.argv[1], sys.argv[2], sys.argv[3]))
7 > f.write("merge %s %s %s" % (sys.argv[1], sys.argv[2], sys.argv[3]))
8 > f.close()
8 > f.close()
9 > EOF
9 > EOF
10
10
11 perform a test merge with possible renaming
11 perform a test merge with possible renaming
12 args:
12 args:
13 $1 = action in local branch
13 $1 = action in local branch
14 $2 = action in remote branch
14 $2 = action in remote branch
15 $3 = action in working dir
15 $3 = action in working dir
16 $4 = expected result
16 $4 = expected result
17
17
18 $ tm()
18 $ tm()
19 > {
19 > {
20 > hg init t
20 > hg init t
21 > cd t
21 > cd t
22 > echo "[merge]" >> .hg/hgrc
22 > echo "[merge]" >> .hg/hgrc
23 > echo "followcopies = 1" >> .hg/hgrc
23 > echo "followcopies = 1" >> .hg/hgrc
24 >
24 >
25 > # base
25 > # base
26 > echo base > a
26 > echo base > a
27 > echo base > rev # used to force commits
27 > echo base > rev # used to force commits
28 > hg add a rev
28 > hg add a rev
29 > hg ci -m "base"
29 > hg ci -m "base"
30 >
30 >
31 > # remote
31 > # remote
32 > echo remote > rev
32 > echo remote > rev
33 > if [ "$2" != "" ] ; then $2 ; fi
33 > if [ "$2" != "" ] ; then $2 ; fi
34 > hg ci -m "remote"
34 > hg ci -m "remote"
35 >
35 >
36 > # local
36 > # local
37 > hg co -q 0
37 > hg co -q 0
38 > echo local > rev
38 > echo local > rev
39 > if [ "$1" != "" ] ; then $1 ; fi
39 > if [ "$1" != "" ] ; then $1 ; fi
40 > hg ci -m "local"
40 > hg ci -m "local"
41 >
41 >
42 > # working dir
42 > # working dir
43 > echo local > rev
43 > echo local > rev
44 > if [ "$3" != "" ] ; then $3 ; fi
44 > if [ "$3" != "" ] ; then $3 ; fi
45 >
45 >
46 > # merge
46 > # merge
47 > echo "--------------"
47 > echo "--------------"
48 > echo "test L:$1 R:$2 W:$3 - $4"
48 > echo "test L:$1 R:$2 W:$3 - $4"
49 > echo "--------------"
49 > echo "--------------"
50 > hg merge -y --debug --traceback --tool="$PYTHON ../merge"
50 > hg merge -y --debug --traceback --tool="$PYTHON ../merge"
51 >
51 >
52 > echo "--------------"
52 > echo "--------------"
53 > hg status -camC -X rev
53 > hg status -camC -X rev
54 >
54 >
55 > hg ci -m "merge"
55 > hg ci -m "merge"
56 >
56 >
57 > echo "--------------"
57 > echo "--------------"
58 > echo
58 > echo
59 >
59 >
60 > cd ..
60 > cd ..
61 > rm -r t
61 > rm -r t
62 > }
62 > }
63 $ up() {
63 $ up() {
64 > cp rev $1
64 > cp rev $1
65 > hg add $1 2> /dev/null
65 > hg add $1 2> /dev/null
66 > if [ "$2" != "" ] ; then
66 > if [ "$2" != "" ] ; then
67 > cp rev $2
67 > cp rev $2
68 > hg add $2 2> /dev/null
68 > hg add $2 2> /dev/null
69 > fi
69 > fi
70 > }
70 > }
71 $ uc() { up $1; hg cp $1 $2; } # update + copy
71 $ uc() { up $1; hg cp $1 $2; } # update + copy
72 $ um() { up $1; hg mv $1 $2; }
72 $ um() { up $1; hg mv $1 $2; }
73 $ nc() { hg cp $1 $2; } # just copy
73 $ nc() { hg cp $1 $2; } # just copy
74 $ nm() { hg mv $1 $2; } # just move
74 $ nm() { hg mv $1 $2; } # just move
75 $ tm "up a " "nc a b" " " "1 get local a to b"
75 $ tm "up a " "nc a b" " " "1 get local a to b"
76 created new head
76 created new head
77 --------------
77 --------------
78 test L:up a R:nc a b W: - 1 get local a to b
78 test L:up a R:nc a b W: - 1 get local a to b
79 --------------
79 --------------
80 searching for copies back to rev 1
80 searching for copies back to rev 1
81 unmatched files in other:
81 unmatched files in other:
82 b
82 b
83 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
83 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
84 src: 'a' -> dst: 'b' *
84 src: 'a' -> dst: 'b' *
85 checking for directory renames
85 checking for directory renames
86 resolving manifests
86 resolving manifests
87 branchmerge: True, force: False, partial: False
87 branchmerge: True, force: False, partial: False
88 ancestor: 924404dff337, local: e300d1c794ec+, remote: 4ce40f5aca24
88 ancestor: 924404dff337, local: e300d1c794ec+, remote: 4ce40f5aca24
89 preserving a for resolve of b
89 preserving a for resolve of b
90 preserving rev for resolve of rev
90 preserving rev for resolve of rev
91 starting 4 threads for background file closing (?)
91 starting 4 threads for background file closing (?)
92 b: remote copied from a -> m (premerge)
92 b: remote copied from a -> m (premerge)
93 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
93 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
94 merging a and b to b
94 merging a and b to b
95 my b@e300d1c794ec+ other b@4ce40f5aca24 ancestor a@924404dff337
95 my b@e300d1c794ec+ other b@4ce40f5aca24 ancestor a@924404dff337
96 premerge successful
96 premerge successful
97 rev: versions differ -> m (premerge)
97 rev: versions differ -> m (premerge)
98 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
98 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
99 merging rev
99 merging rev
100 my rev@e300d1c794ec+ other rev@4ce40f5aca24 ancestor rev@924404dff337
100 my rev@e300d1c794ec+ other rev@4ce40f5aca24 ancestor rev@924404dff337
101 rev: versions differ -> m (merge)
101 rev: versions differ -> m (merge)
102 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
102 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
103 my rev@e300d1c794ec+ other rev@4ce40f5aca24 ancestor rev@924404dff337
103 my rev@e300d1c794ec+ other rev@4ce40f5aca24 ancestor rev@924404dff337
104 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
104 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
105 merge tool returned: 0
105 merge tool returned: 0
106 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
106 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
107 (branch merge, don't forget to commit)
107 (branch merge, don't forget to commit)
108 --------------
108 --------------
109 M b
109 M b
110 a
110 a
111 C a
111 C a
112 --------------
112 --------------
113
113
114 $ tm "nc a b" "up a " " " "2 get rem change to a and b"
114 $ tm "nc a b" "up a " " " "2 get rem change to a and b"
115 created new head
115 created new head
116 --------------
116 --------------
117 test L:nc a b R:up a W: - 2 get rem change to a and b
117 test L:nc a b R:up a W: - 2 get rem change to a and b
118 --------------
118 --------------
119 searching for copies back to rev 1
119 searching for copies back to rev 1
120 unmatched files in local:
120 unmatched files in local:
121 b
121 b
122 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
122 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
123 src: 'a' -> dst: 'b' *
123 src: 'a' -> dst: 'b' *
124 checking for directory renames
124 checking for directory renames
125 resolving manifests
125 resolving manifests
126 branchmerge: True, force: False, partial: False
126 branchmerge: True, force: False, partial: False
127 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: f4db7e329e71
127 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: f4db7e329e71
128 preserving b for resolve of b
128 preserving b for resolve of b
129 preserving rev for resolve of rev
129 preserving rev for resolve of rev
130 a: remote is newer -> g
130 a: remote is newer -> g
131 getting a
131 getting a
132 b: local copied/moved from a -> m (premerge)
132 b: local copied/moved from a -> m (premerge)
133 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
133 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
134 merging b and a to b
134 merging b and a to b
135 my b@86a2aa42fc76+ other a@f4db7e329e71 ancestor a@924404dff337
135 my b@86a2aa42fc76+ other a@f4db7e329e71 ancestor a@924404dff337
136 premerge successful
136 premerge successful
137 rev: versions differ -> m (premerge)
137 rev: versions differ -> m (premerge)
138 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
138 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
139 merging rev
139 merging rev
140 my rev@86a2aa42fc76+ other rev@f4db7e329e71 ancestor rev@924404dff337
140 my rev@86a2aa42fc76+ other rev@f4db7e329e71 ancestor rev@924404dff337
141 rev: versions differ -> m (merge)
141 rev: versions differ -> m (merge)
142 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
142 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
143 my rev@86a2aa42fc76+ other rev@f4db7e329e71 ancestor rev@924404dff337
143 my rev@86a2aa42fc76+ other rev@f4db7e329e71 ancestor rev@924404dff337
144 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
144 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
145 merge tool returned: 0
145 merge tool returned: 0
146 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
146 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
147 (branch merge, don't forget to commit)
147 (branch merge, don't forget to commit)
148 --------------
148 --------------
149 M a
149 M a
150 M b
150 M b
151 a
151 a
152 --------------
152 --------------
153
153
154 $ tm "up a " "nm a b" " " "3 get local a change to b, remove a"
154 $ tm "up a " "nm a b" " " "3 get local a change to b, remove a"
155 created new head
155 created new head
156 --------------
156 --------------
157 test L:up a R:nm a b W: - 3 get local a change to b, remove a
157 test L:up a R:nm a b W: - 3 get local a change to b, remove a
158 --------------
158 --------------
159 searching for copies back to rev 1
159 searching for copies back to rev 1
160 unmatched files in other:
160 unmatched files in other:
161 b
161 b
162 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
162 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
163 src: 'a' -> dst: 'b' *
163 src: 'a' -> dst: 'b' *
164 checking for directory renames
164 checking for directory renames
165 resolving manifests
165 resolving manifests
166 branchmerge: True, force: False, partial: False
166 branchmerge: True, force: False, partial: False
167 ancestor: 924404dff337, local: e300d1c794ec+, remote: bdb19105162a
167 ancestor: 924404dff337, local: e300d1c794ec+, remote: bdb19105162a
168 preserving a for resolve of b
168 preserving a for resolve of b
169 preserving rev for resolve of rev
169 preserving rev for resolve of rev
170 removing a
170 removing a
171 starting 4 threads for background file closing (?)
171 starting 4 threads for background file closing (?)
172 b: remote moved from a -> m (premerge)
172 b: remote moved from a -> m (premerge)
173 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
173 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
174 merging a and b to b
174 merging a and b to b
175 my b@e300d1c794ec+ other b@bdb19105162a ancestor a@924404dff337
175 my b@e300d1c794ec+ other b@bdb19105162a ancestor a@924404dff337
176 premerge successful
176 premerge successful
177 rev: versions differ -> m (premerge)
177 rev: versions differ -> m (premerge)
178 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
178 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
179 merging rev
179 merging rev
180 my rev@e300d1c794ec+ other rev@bdb19105162a ancestor rev@924404dff337
180 my rev@e300d1c794ec+ other rev@bdb19105162a ancestor rev@924404dff337
181 rev: versions differ -> m (merge)
181 rev: versions differ -> m (merge)
182 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
182 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
183 my rev@e300d1c794ec+ other rev@bdb19105162a ancestor rev@924404dff337
183 my rev@e300d1c794ec+ other rev@bdb19105162a ancestor rev@924404dff337
184 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
184 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
185 merge tool returned: 0
185 merge tool returned: 0
186 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
186 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
187 (branch merge, don't forget to commit)
187 (branch merge, don't forget to commit)
188 --------------
188 --------------
189 M b
189 M b
190 a
190 a
191 --------------
191 --------------
192
192
193 $ tm "nm a b" "up a " " " "4 get remote change to b"
193 $ tm "nm a b" "up a " " " "4 get remote change to b"
194 created new head
194 created new head
195 --------------
195 --------------
196 test L:nm a b R:up a W: - 4 get remote change to b
196 test L:nm a b R:up a W: - 4 get remote change to b
197 --------------
197 --------------
198 searching for copies back to rev 1
198 searching for copies back to rev 1
199 unmatched files in local:
199 unmatched files in local:
200 b
200 b
201 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
201 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
202 src: 'a' -> dst: 'b' *
202 src: 'a' -> dst: 'b' *
203 checking for directory renames
203 checking for directory renames
204 resolving manifests
204 resolving manifests
205 branchmerge: True, force: False, partial: False
205 branchmerge: True, force: False, partial: False
206 ancestor: 924404dff337, local: 02963e448370+, remote: f4db7e329e71
206 ancestor: 924404dff337, local: 02963e448370+, remote: f4db7e329e71
207 preserving b for resolve of b
207 preserving b for resolve of b
208 preserving rev for resolve of rev
208 preserving rev for resolve of rev
209 starting 4 threads for background file closing (?)
209 starting 4 threads for background file closing (?)
210 b: local copied/moved from a -> m (premerge)
210 b: local copied/moved from a -> m (premerge)
211 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
211 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
212 merging b and a to b
212 merging b and a to b
213 my b@02963e448370+ other a@f4db7e329e71 ancestor a@924404dff337
213 my b@02963e448370+ other a@f4db7e329e71 ancestor a@924404dff337
214 premerge successful
214 premerge successful
215 rev: versions differ -> m (premerge)
215 rev: versions differ -> m (premerge)
216 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
216 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
217 merging rev
217 merging rev
218 my rev@02963e448370+ other rev@f4db7e329e71 ancestor rev@924404dff337
218 my rev@02963e448370+ other rev@f4db7e329e71 ancestor rev@924404dff337
219 rev: versions differ -> m (merge)
219 rev: versions differ -> m (merge)
220 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
220 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
221 my rev@02963e448370+ other rev@f4db7e329e71 ancestor rev@924404dff337
221 my rev@02963e448370+ other rev@f4db7e329e71 ancestor rev@924404dff337
222 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
222 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
223 merge tool returned: 0
223 merge tool returned: 0
224 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
224 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
225 (branch merge, don't forget to commit)
225 (branch merge, don't forget to commit)
226 --------------
226 --------------
227 M b
227 M b
228 a
228 a
229 --------------
229 --------------
230
230
231 $ tm " " "nc a b" " " "5 get b"
231 $ tm " " "nc a b" " " "5 get b"
232 created new head
232 created new head
233 --------------
233 --------------
234 test L: R:nc a b W: - 5 get b
234 test L: R:nc a b W: - 5 get b
235 --------------
235 --------------
236 searching for copies back to rev 1
236 searching for copies back to rev 1
237 unmatched files in other:
237 unmatched files in other:
238 b
238 b
239 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
239 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
240 src: 'a' -> dst: 'b'
240 src: 'a' -> dst: 'b'
241 checking for directory renames
241 checking for directory renames
242 resolving manifests
242 resolving manifests
243 branchmerge: True, force: False, partial: False
243 branchmerge: True, force: False, partial: False
244 ancestor: 924404dff337, local: 94b33a1b7f2d+, remote: 4ce40f5aca24
244 ancestor: 924404dff337, local: 94b33a1b7f2d+, remote: 4ce40f5aca24
245 preserving rev for resolve of rev
245 preserving rev for resolve of rev
246 b: remote created -> g
246 b: remote created -> g
247 getting b
247 getting b
248 rev: versions differ -> m (premerge)
248 rev: versions differ -> m (premerge)
249 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
249 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
250 merging rev
250 merging rev
251 my rev@94b33a1b7f2d+ other rev@4ce40f5aca24 ancestor rev@924404dff337
251 my rev@94b33a1b7f2d+ other rev@4ce40f5aca24 ancestor rev@924404dff337
252 rev: versions differ -> m (merge)
252 rev: versions differ -> m (merge)
253 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
253 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
254 my rev@94b33a1b7f2d+ other rev@4ce40f5aca24 ancestor rev@924404dff337
254 my rev@94b33a1b7f2d+ other rev@4ce40f5aca24 ancestor rev@924404dff337
255 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
255 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
256 merge tool returned: 0
256 merge tool returned: 0
257 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
257 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
258 (branch merge, don't forget to commit)
258 (branch merge, don't forget to commit)
259 --------------
259 --------------
260 M b
260 M b
261 C a
261 C a
262 --------------
262 --------------
263
263
264 $ tm "nc a b" " " " " "6 nothing"
264 $ tm "nc a b" " " " " "6 nothing"
265 created new head
265 created new head
266 --------------
266 --------------
267 test L:nc a b R: W: - 6 nothing
267 test L:nc a b R: W: - 6 nothing
268 --------------
268 --------------
269 searching for copies back to rev 1
269 searching for copies back to rev 1
270 unmatched files in local:
270 unmatched files in local:
271 b
271 b
272 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
272 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
273 src: 'a' -> dst: 'b'
273 src: 'a' -> dst: 'b'
274 checking for directory renames
274 checking for directory renames
275 resolving manifests
275 resolving manifests
276 branchmerge: True, force: False, partial: False
276 branchmerge: True, force: False, partial: False
277 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 97c705ade336
277 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 97c705ade336
278 preserving rev for resolve of rev
278 preserving rev for resolve of rev
279 starting 4 threads for background file closing (?)
279 starting 4 threads for background file closing (?)
280 rev: versions differ -> m (premerge)
280 rev: versions differ -> m (premerge)
281 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
281 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
282 merging rev
282 merging rev
283 my rev@86a2aa42fc76+ other rev@97c705ade336 ancestor rev@924404dff337
283 my rev@86a2aa42fc76+ other rev@97c705ade336 ancestor rev@924404dff337
284 rev: versions differ -> m (merge)
284 rev: versions differ -> m (merge)
285 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
285 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
286 my rev@86a2aa42fc76+ other rev@97c705ade336 ancestor rev@924404dff337
286 my rev@86a2aa42fc76+ other rev@97c705ade336 ancestor rev@924404dff337
287 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
287 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
288 merge tool returned: 0
288 merge tool returned: 0
289 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
289 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
290 (branch merge, don't forget to commit)
290 (branch merge, don't forget to commit)
291 --------------
291 --------------
292 C a
292 C a
293 C b
293 C b
294 --------------
294 --------------
295
295
296 $ tm " " "nm a b" " " "7 get b"
296 $ tm " " "nm a b" " " "7 get b"
297 created new head
297 created new head
298 --------------
298 --------------
299 test L: R:nm a b W: - 7 get b
299 test L: R:nm a b W: - 7 get b
300 --------------
300 --------------
301 searching for copies back to rev 1
301 searching for copies back to rev 1
302 unmatched files in other:
302 unmatched files in other:
303 b
303 b
304 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
304 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
305 src: 'a' -> dst: 'b'
305 src: 'a' -> dst: 'b'
306 checking for directory renames
306 checking for directory renames
307 resolving manifests
307 resolving manifests
308 branchmerge: True, force: False, partial: False
308 branchmerge: True, force: False, partial: False
309 ancestor: 924404dff337, local: 94b33a1b7f2d+, remote: bdb19105162a
309 ancestor: 924404dff337, local: 94b33a1b7f2d+, remote: bdb19105162a
310 preserving rev for resolve of rev
310 preserving rev for resolve of rev
311 a: other deleted -> r
311 a: other deleted -> r
312 removing a
312 removing a
313 b: remote created -> g
313 b: remote created -> g
314 getting b
314 getting b
315 rev: versions differ -> m (premerge)
315 rev: versions differ -> m (premerge)
316 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
316 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
317 merging rev
317 merging rev
318 my rev@94b33a1b7f2d+ other rev@bdb19105162a ancestor rev@924404dff337
318 my rev@94b33a1b7f2d+ other rev@bdb19105162a ancestor rev@924404dff337
319 rev: versions differ -> m (merge)
319 rev: versions differ -> m (merge)
320 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
320 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
321 my rev@94b33a1b7f2d+ other rev@bdb19105162a ancestor rev@924404dff337
321 my rev@94b33a1b7f2d+ other rev@bdb19105162a ancestor rev@924404dff337
322 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
322 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
323 merge tool returned: 0
323 merge tool returned: 0
324 1 files updated, 1 files merged, 1 files removed, 0 files unresolved
324 1 files updated, 1 files merged, 1 files removed, 0 files unresolved
325 (branch merge, don't forget to commit)
325 (branch merge, don't forget to commit)
326 --------------
326 --------------
327 M b
327 M b
328 --------------
328 --------------
329
329
330 $ tm "nm a b" " " " " "8 nothing"
330 $ tm "nm a b" " " " " "8 nothing"
331 created new head
331 created new head
332 --------------
332 --------------
333 test L:nm a b R: W: - 8 nothing
333 test L:nm a b R: W: - 8 nothing
334 --------------
334 --------------
335 searching for copies back to rev 1
335 searching for copies back to rev 1
336 unmatched files in local:
336 unmatched files in local:
337 b
337 b
338 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
338 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
339 src: 'a' -> dst: 'b'
339 src: 'a' -> dst: 'b'
340 checking for directory renames
340 checking for directory renames
341 resolving manifests
341 resolving manifests
342 branchmerge: True, force: False, partial: False
342 branchmerge: True, force: False, partial: False
343 ancestor: 924404dff337, local: 02963e448370+, remote: 97c705ade336
343 ancestor: 924404dff337, local: 02963e448370+, remote: 97c705ade336
344 preserving rev for resolve of rev
344 preserving rev for resolve of rev
345 starting 4 threads for background file closing (?)
345 starting 4 threads for background file closing (?)
346 rev: versions differ -> m (premerge)
346 rev: versions differ -> m (premerge)
347 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
347 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
348 merging rev
348 merging rev
349 my rev@02963e448370+ other rev@97c705ade336 ancestor rev@924404dff337
349 my rev@02963e448370+ other rev@97c705ade336 ancestor rev@924404dff337
350 rev: versions differ -> m (merge)
350 rev: versions differ -> m (merge)
351 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
351 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
352 my rev@02963e448370+ other rev@97c705ade336 ancestor rev@924404dff337
352 my rev@02963e448370+ other rev@97c705ade336 ancestor rev@924404dff337
353 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
353 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
354 merge tool returned: 0
354 merge tool returned: 0
355 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
355 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
356 (branch merge, don't forget to commit)
356 (branch merge, don't forget to commit)
357 --------------
357 --------------
358 C b
358 C b
359 --------------
359 --------------
360
360
361 $ tm "um a b" "um a b" " " "9 do merge with ancestor in a"
361 $ tm "um a b" "um a b" " " "9 do merge with ancestor in a"
362 created new head
362 created new head
363 --------------
363 --------------
364 test L:um a b R:um a b W: - 9 do merge with ancestor in a
364 test L:um a b R:um a b W: - 9 do merge with ancestor in a
365 --------------
365 --------------
366 searching for copies back to rev 1
366 searching for copies back to rev 1
367 unmatched files new in both:
367 unmatched files new in both:
368 b
368 b
369 resolving manifests
369 resolving manifests
370 branchmerge: True, force: False, partial: False
370 branchmerge: True, force: False, partial: False
371 ancestor: 924404dff337, local: 62e7bf090eba+, remote: 49b6d8032493
371 ancestor: 924404dff337, local: 62e7bf090eba+, remote: 49b6d8032493
372 preserving b for resolve of b
372 preserving b for resolve of b
373 preserving rev for resolve of rev
373 preserving rev for resolve of rev
374 starting 4 threads for background file closing (?)
374 starting 4 threads for background file closing (?)
375 b: both renamed from a -> m (premerge)
375 b: both renamed from a -> m (premerge)
376 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
376 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
377 merging b
377 merging b
378 my b@62e7bf090eba+ other b@49b6d8032493 ancestor a@924404dff337
378 my b@62e7bf090eba+ other b@49b6d8032493 ancestor a@924404dff337
379 rev: versions differ -> m (premerge)
379 rev: versions differ -> m (premerge)
380 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
380 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
381 merging rev
381 merging rev
382 my rev@62e7bf090eba+ other rev@49b6d8032493 ancestor rev@924404dff337
382 my rev@62e7bf090eba+ other rev@49b6d8032493 ancestor rev@924404dff337
383 b: both renamed from a -> m (merge)
383 b: both renamed from a -> m (merge)
384 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
384 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
385 my b@62e7bf090eba+ other b@49b6d8032493 ancestor a@924404dff337
385 my b@62e7bf090eba+ other b@49b6d8032493 ancestor a@924404dff337
386 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
386 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
387 merge tool returned: 0
387 merge tool returned: 0
388 rev: versions differ -> m (merge)
388 rev: versions differ -> m (merge)
389 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
389 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
390 my rev@62e7bf090eba+ other rev@49b6d8032493 ancestor rev@924404dff337
390 my rev@62e7bf090eba+ other rev@49b6d8032493 ancestor rev@924404dff337
391 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
391 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
392 merge tool returned: 0
392 merge tool returned: 0
393 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
393 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
394 (branch merge, don't forget to commit)
394 (branch merge, don't forget to commit)
395 --------------
395 --------------
396 M b
396 M b
397 --------------
397 --------------
398
398
399
399
400 m "um a c" "um x c" " " "10 do merge with no ancestor"
400 m "um a c" "um x c" " " "10 do merge with no ancestor"
401
401
402 $ tm "nm a b" "nm a c" " " "11 get c, keep b"
402 $ tm "nm a b" "nm a c" " " "11 get c, keep b"
403 created new head
403 created new head
404 --------------
404 --------------
405 test L:nm a b R:nm a c W: - 11 get c, keep b
405 test L:nm a b R:nm a c W: - 11 get c, keep b
406 --------------
406 --------------
407 searching for copies back to rev 1
407 searching for copies back to rev 1
408 unmatched files in local:
408 unmatched files in local:
409 b
409 b
410 unmatched files in other:
410 unmatched files in other:
411 c
411 c
412 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
412 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
413 src: 'a' -> dst: 'b' !
413 src: 'a' -> dst: 'b' !
414 src: 'a' -> dst: 'c' !
414 src: 'a' -> dst: 'c' !
415 checking for directory renames
415 checking for directory renames
416 resolving manifests
416 resolving manifests
417 branchmerge: True, force: False, partial: False
417 branchmerge: True, force: False, partial: False
418 ancestor: 924404dff337, local: 02963e448370+, remote: fe905ef2c33e
418 ancestor: 924404dff337, local: 02963e448370+, remote: fe905ef2c33e
419 note: possible conflict - a was renamed multiple times to:
419 note: possible conflict - a was renamed multiple times to:
420 b
420 b
421 c
421 c
422 preserving rev for resolve of rev
422 preserving rev for resolve of rev
423 c: remote created -> g
423 c: remote created -> g
424 getting c
424 getting c
425 rev: versions differ -> m (premerge)
425 rev: versions differ -> m (premerge)
426 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
426 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
427 merging rev
427 merging rev
428 my rev@02963e448370+ other rev@fe905ef2c33e ancestor rev@924404dff337
428 my rev@02963e448370+ other rev@fe905ef2c33e ancestor rev@924404dff337
429 rev: versions differ -> m (merge)
429 rev: versions differ -> m (merge)
430 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
430 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
431 my rev@02963e448370+ other rev@fe905ef2c33e ancestor rev@924404dff337
431 my rev@02963e448370+ other rev@fe905ef2c33e ancestor rev@924404dff337
432 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
432 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
433 merge tool returned: 0
433 merge tool returned: 0
434 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
434 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
435 (branch merge, don't forget to commit)
435 (branch merge, don't forget to commit)
436 --------------
436 --------------
437 M c
437 M c
438 C b
438 C b
439 --------------
439 --------------
440
440
441 $ tm "nc a b" "up b " " " "12 merge b no ancestor"
441 $ tm "nc a b" "up b " " " "12 merge b no ancestor"
442 created new head
442 created new head
443 --------------
443 --------------
444 test L:nc a b R:up b W: - 12 merge b no ancestor
444 test L:nc a b R:up b W: - 12 merge b no ancestor
445 --------------
445 --------------
446 searching for copies back to rev 1
446 searching for copies back to rev 1
447 unmatched files new in both:
447 unmatched files new in both:
448 b
448 b
449 resolving manifests
449 resolving manifests
450 branchmerge: True, force: False, partial: False
450 branchmerge: True, force: False, partial: False
451 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: af30c7647fc7
451 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: af30c7647fc7
452 preserving b for resolve of b
452 preserving b for resolve of b
453 preserving rev for resolve of rev
453 preserving rev for resolve of rev
454 starting 4 threads for background file closing (?)
454 starting 4 threads for background file closing (?)
455 b: both created -> m (premerge)
455 b: both created -> m (premerge)
456 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
456 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
457 merging b
457 merging b
458 my b@86a2aa42fc76+ other b@af30c7647fc7 ancestor b@000000000000
458 my b@86a2aa42fc76+ other b@af30c7647fc7 ancestor b@000000000000
459 rev: versions differ -> m (premerge)
459 rev: versions differ -> m (premerge)
460 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
460 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
461 merging rev
461 merging rev
462 my rev@86a2aa42fc76+ other rev@af30c7647fc7 ancestor rev@924404dff337
462 my rev@86a2aa42fc76+ other rev@af30c7647fc7 ancestor rev@924404dff337
463 b: both created -> m (merge)
463 b: both created -> m (merge)
464 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
464 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
465 my b@86a2aa42fc76+ other b@af30c7647fc7 ancestor b@000000000000
465 my b@86a2aa42fc76+ other b@af30c7647fc7 ancestor b@000000000000
466 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
466 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
467 merge tool returned: 0
467 merge tool returned: 0
468 rev: versions differ -> m (merge)
468 rev: versions differ -> m (merge)
469 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
469 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
470 my rev@86a2aa42fc76+ other rev@af30c7647fc7 ancestor rev@924404dff337
470 my rev@86a2aa42fc76+ other rev@af30c7647fc7 ancestor rev@924404dff337
471 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
471 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
472 merge tool returned: 0
472 merge tool returned: 0
473 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
473 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
474 (branch merge, don't forget to commit)
474 (branch merge, don't forget to commit)
475 --------------
475 --------------
476 M b
476 M b
477 C a
477 C a
478 --------------
478 --------------
479
479
480 $ tm "up b " "nm a b" " " "13 merge b no ancestor"
480 $ tm "up b " "nm a b" " " "13 merge b no ancestor"
481 created new head
481 created new head
482 --------------
482 --------------
483 test L:up b R:nm a b W: - 13 merge b no ancestor
483 test L:up b R:nm a b W: - 13 merge b no ancestor
484 --------------
484 --------------
485 searching for copies back to rev 1
485 searching for copies back to rev 1
486 unmatched files new in both:
486 unmatched files new in both:
487 b
487 b
488 resolving manifests
488 resolving manifests
489 branchmerge: True, force: False, partial: False
489 branchmerge: True, force: False, partial: False
490 ancestor: 924404dff337, local: 59318016310c+, remote: bdb19105162a
490 ancestor: 924404dff337, local: 59318016310c+, remote: bdb19105162a
491 preserving b for resolve of b
491 preserving b for resolve of b
492 preserving rev for resolve of rev
492 preserving rev for resolve of rev
493 a: other deleted -> r
493 a: other deleted -> r
494 removing a
494 removing a
495 starting 4 threads for background file closing (?)
495 starting 4 threads for background file closing (?)
496 b: both created -> m (premerge)
496 b: both created -> m (premerge)
497 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
497 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
498 merging b
498 merging b
499 my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
499 my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
500 rev: versions differ -> m (premerge)
500 rev: versions differ -> m (premerge)
501 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
501 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
502 merging rev
502 merging rev
503 my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
503 my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
504 b: both created -> m (merge)
504 b: both created -> m (merge)
505 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
505 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
506 my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
506 my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
507 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
507 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
508 merge tool returned: 0
508 merge tool returned: 0
509 rev: versions differ -> m (merge)
509 rev: versions differ -> m (merge)
510 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
510 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
511 my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
511 my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
512 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
512 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
513 merge tool returned: 0
513 merge tool returned: 0
514 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
514 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
515 (branch merge, don't forget to commit)
515 (branch merge, don't forget to commit)
516 --------------
516 --------------
517 M b
517 M b
518 --------------
518 --------------
519
519
520 $ tm "nc a b" "up a b" " " "14 merge b no ancestor"
520 $ tm "nc a b" "up a b" " " "14 merge b no ancestor"
521 created new head
521 created new head
522 --------------
522 --------------
523 test L:nc a b R:up a b W: - 14 merge b no ancestor
523 test L:nc a b R:up a b W: - 14 merge b no ancestor
524 --------------
524 --------------
525 searching for copies back to rev 1
525 searching for copies back to rev 1
526 unmatched files new in both:
526 unmatched files new in both:
527 b
527 b
528 resolving manifests
528 resolving manifests
529 branchmerge: True, force: False, partial: False
529 branchmerge: True, force: False, partial: False
530 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 8dbce441892a
530 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 8dbce441892a
531 preserving b for resolve of b
531 preserving b for resolve of b
532 preserving rev for resolve of rev
532 preserving rev for resolve of rev
533 a: remote is newer -> g
533 a: remote is newer -> g
534 getting a
534 getting a
535 b: both created -> m (premerge)
535 b: both created -> m (premerge)
536 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
536 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
537 merging b
537 merging b
538 my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
538 my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
539 rev: versions differ -> m (premerge)
539 rev: versions differ -> m (premerge)
540 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
540 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
541 merging rev
541 merging rev
542 my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
542 my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
543 b: both created -> m (merge)
543 b: both created -> m (merge)
544 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
544 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
545 my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
545 my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
546 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
546 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
547 merge tool returned: 0
547 merge tool returned: 0
548 rev: versions differ -> m (merge)
548 rev: versions differ -> m (merge)
549 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
549 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
550 my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
550 my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
551 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
551 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
552 merge tool returned: 0
552 merge tool returned: 0
553 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
553 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
554 (branch merge, don't forget to commit)
554 (branch merge, don't forget to commit)
555 --------------
555 --------------
556 M a
556 M a
557 M b
557 M b
558 --------------
558 --------------
559
559
560 $ tm "up b " "nm a b" " " "15 merge b no ancestor, remove a"
560 $ tm "up b " "nm a b" " " "15 merge b no ancestor, remove a"
561 created new head
561 created new head
562 --------------
562 --------------
563 test L:up b R:nm a b W: - 15 merge b no ancestor, remove a
563 test L:up b R:nm a b W: - 15 merge b no ancestor, remove a
564 --------------
564 --------------
565 searching for copies back to rev 1
565 searching for copies back to rev 1
566 unmatched files new in both:
566 unmatched files new in both:
567 b
567 b
568 resolving manifests
568 resolving manifests
569 branchmerge: True, force: False, partial: False
569 branchmerge: True, force: False, partial: False
570 ancestor: 924404dff337, local: 59318016310c+, remote: bdb19105162a
570 ancestor: 924404dff337, local: 59318016310c+, remote: bdb19105162a
571 preserving b for resolve of b
571 preserving b for resolve of b
572 preserving rev for resolve of rev
572 preserving rev for resolve of rev
573 a: other deleted -> r
573 a: other deleted -> r
574 removing a
574 removing a
575 starting 4 threads for background file closing (?)
575 starting 4 threads for background file closing (?)
576 b: both created -> m (premerge)
576 b: both created -> m (premerge)
577 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
577 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
578 merging b
578 merging b
579 my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
579 my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
580 rev: versions differ -> m (premerge)
580 rev: versions differ -> m (premerge)
581 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
581 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
582 merging rev
582 merging rev
583 my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
583 my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
584 b: both created -> m (merge)
584 b: both created -> m (merge)
585 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
585 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
586 my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
586 my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
587 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
587 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
588 merge tool returned: 0
588 merge tool returned: 0
589 rev: versions differ -> m (merge)
589 rev: versions differ -> m (merge)
590 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
590 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
591 my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
591 my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
592 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
592 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
593 merge tool returned: 0
593 merge tool returned: 0
594 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
594 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
595 (branch merge, don't forget to commit)
595 (branch merge, don't forget to commit)
596 --------------
596 --------------
597 M b
597 M b
598 --------------
598 --------------
599
599
600 $ tm "nc a b" "up a b" " " "16 get a, merge b no ancestor"
600 $ tm "nc a b" "up a b" " " "16 get a, merge b no ancestor"
601 created new head
601 created new head
602 --------------
602 --------------
603 test L:nc a b R:up a b W: - 16 get a, merge b no ancestor
603 test L:nc a b R:up a b W: - 16 get a, merge b no ancestor
604 --------------
604 --------------
605 searching for copies back to rev 1
605 searching for copies back to rev 1
606 unmatched files new in both:
606 unmatched files new in both:
607 b
607 b
608 resolving manifests
608 resolving manifests
609 branchmerge: True, force: False, partial: False
609 branchmerge: True, force: False, partial: False
610 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 8dbce441892a
610 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 8dbce441892a
611 preserving b for resolve of b
611 preserving b for resolve of b
612 preserving rev for resolve of rev
612 preserving rev for resolve of rev
613 a: remote is newer -> g
613 a: remote is newer -> g
614 getting a
614 getting a
615 b: both created -> m (premerge)
615 b: both created -> m (premerge)
616 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
616 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
617 merging b
617 merging b
618 my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
618 my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
619 rev: versions differ -> m (premerge)
619 rev: versions differ -> m (premerge)
620 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
620 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
621 merging rev
621 merging rev
622 my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
622 my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
623 b: both created -> m (merge)
623 b: both created -> m (merge)
624 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
624 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
625 my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
625 my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
626 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
626 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
627 merge tool returned: 0
627 merge tool returned: 0
628 rev: versions differ -> m (merge)
628 rev: versions differ -> m (merge)
629 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
629 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
630 my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
630 my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
631 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
631 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
632 merge tool returned: 0
632 merge tool returned: 0
633 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
633 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
634 (branch merge, don't forget to commit)
634 (branch merge, don't forget to commit)
635 --------------
635 --------------
636 M a
636 M a
637 M b
637 M b
638 --------------
638 --------------
639
639
640 $ tm "up a b" "nc a b" " " "17 keep a, merge b no ancestor"
640 $ tm "up a b" "nc a b" " " "17 keep a, merge b no ancestor"
641 created new head
641 created new head
642 --------------
642 --------------
643 test L:up a b R:nc a b W: - 17 keep a, merge b no ancestor
643 test L:up a b R:nc a b W: - 17 keep a, merge b no ancestor
644 --------------
644 --------------
645 searching for copies back to rev 1
645 searching for copies back to rev 1
646 unmatched files new in both:
646 unmatched files new in both:
647 b
647 b
648 resolving manifests
648 resolving manifests
649 branchmerge: True, force: False, partial: False
649 branchmerge: True, force: False, partial: False
650 ancestor: 924404dff337, local: 0b76e65c8289+, remote: 4ce40f5aca24
650 ancestor: 924404dff337, local: 0b76e65c8289+, remote: 4ce40f5aca24
651 preserving b for resolve of b
651 preserving b for resolve of b
652 preserving rev for resolve of rev
652 preserving rev for resolve of rev
653 starting 4 threads for background file closing (?)
653 starting 4 threads for background file closing (?)
654 b: both created -> m (premerge)
654 b: both created -> m (premerge)
655 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
655 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
656 merging b
656 merging b
657 my b@0b76e65c8289+ other b@4ce40f5aca24 ancestor b@000000000000
657 my b@0b76e65c8289+ other b@4ce40f5aca24 ancestor b@000000000000
658 rev: versions differ -> m (premerge)
658 rev: versions differ -> m (premerge)
659 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
659 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
660 merging rev
660 merging rev
661 my rev@0b76e65c8289+ other rev@4ce40f5aca24 ancestor rev@924404dff337
661 my rev@0b76e65c8289+ other rev@4ce40f5aca24 ancestor rev@924404dff337
662 b: both created -> m (merge)
662 b: both created -> m (merge)
663 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
663 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
664 my b@0b76e65c8289+ other b@4ce40f5aca24 ancestor b@000000000000
664 my b@0b76e65c8289+ other b@4ce40f5aca24 ancestor b@000000000000
665 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
665 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
666 merge tool returned: 0
666 merge tool returned: 0
667 rev: versions differ -> m (merge)
667 rev: versions differ -> m (merge)
668 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
668 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
669 my rev@0b76e65c8289+ other rev@4ce40f5aca24 ancestor rev@924404dff337
669 my rev@0b76e65c8289+ other rev@4ce40f5aca24 ancestor rev@924404dff337
670 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
670 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
671 merge tool returned: 0
671 merge tool returned: 0
672 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
672 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
673 (branch merge, don't forget to commit)
673 (branch merge, don't forget to commit)
674 --------------
674 --------------
675 M b
675 M b
676 C a
676 C a
677 --------------
677 --------------
678
678
679 $ tm "nm a b" "up a b" " " "18 merge b no ancestor"
679 $ tm "nm a b" "up a b" " " "18 merge b no ancestor"
680 created new head
680 created new head
681 --------------
681 --------------
682 test L:nm a b R:up a b W: - 18 merge b no ancestor
682 test L:nm a b R:up a b W: - 18 merge b no ancestor
683 --------------
683 --------------
684 searching for copies back to rev 1
684 searching for copies back to rev 1
685 unmatched files new in both:
685 unmatched files new in both:
686 b
686 b
687 resolving manifests
687 resolving manifests
688 branchmerge: True, force: False, partial: False
688 branchmerge: True, force: False, partial: False
689 ancestor: 924404dff337, local: 02963e448370+, remote: 8dbce441892a
689 ancestor: 924404dff337, local: 02963e448370+, remote: 8dbce441892a
690 preserving b for resolve of b
690 preserving b for resolve of b
691 preserving rev for resolve of rev
691 preserving rev for resolve of rev
692 starting 4 threads for background file closing (?)
692 starting 4 threads for background file closing (?)
693 a: prompt deleted/changed -> m (premerge)
693 a: prompt deleted/changed -> m (premerge)
694 picked tool ':prompt' for a (binary False symlink False changedelete True)
694 picked tool ':prompt' for a (binary False symlink False changedelete True)
695 file 'a' was deleted in other [merge rev] but was modified in local [working copy].
695 file 'a' was deleted in local [working copy] but was modified in other [merge rev].
696 What do you want to do?
696 What do you want to do?
697 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
697 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
698 b: both created -> m (premerge)
698 b: both created -> m (premerge)
699 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
699 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
700 merging b
700 merging b
701 my b@02963e448370+ other b@8dbce441892a ancestor b@000000000000
701 my b@02963e448370+ other b@8dbce441892a ancestor b@000000000000
702 rev: versions differ -> m (premerge)
702 rev: versions differ -> m (premerge)
703 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
703 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
704 merging rev
704 merging rev
705 my rev@02963e448370+ other rev@8dbce441892a ancestor rev@924404dff337
705 my rev@02963e448370+ other rev@8dbce441892a ancestor rev@924404dff337
706 b: both created -> m (merge)
706 b: both created -> m (merge)
707 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
707 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
708 my b@02963e448370+ other b@8dbce441892a ancestor b@000000000000
708 my b@02963e448370+ other b@8dbce441892a ancestor b@000000000000
709 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
709 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
710 merge tool returned: 0
710 merge tool returned: 0
711 rev: versions differ -> m (merge)
711 rev: versions differ -> m (merge)
712 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
712 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
713 my rev@02963e448370+ other rev@8dbce441892a ancestor rev@924404dff337
713 my rev@02963e448370+ other rev@8dbce441892a ancestor rev@924404dff337
714 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
714 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
715 merge tool returned: 0
715 merge tool returned: 0
716 0 files updated, 2 files merged, 0 files removed, 1 files unresolved
716 0 files updated, 2 files merged, 0 files removed, 1 files unresolved
717 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
717 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
718 --------------
718 --------------
719 M a
719 M a
720 M b
720 M b
721 abort: unresolved merge conflicts (see 'hg help resolve')
721 abort: unresolved merge conflicts (see 'hg help resolve')
722 --------------
722 --------------
723
723
724 $ tm "up a b" "nm a b" " " "19 merge b no ancestor, prompt remove a"
724 $ tm "up a b" "nm a b" " " "19 merge b no ancestor, prompt remove a"
725 created new head
725 created new head
726 --------------
726 --------------
727 test L:up a b R:nm a b W: - 19 merge b no ancestor, prompt remove a
727 test L:up a b R:nm a b W: - 19 merge b no ancestor, prompt remove a
728 --------------
728 --------------
729 searching for copies back to rev 1
729 searching for copies back to rev 1
730 unmatched files new in both:
730 unmatched files new in both:
731 b
731 b
732 resolving manifests
732 resolving manifests
733 branchmerge: True, force: False, partial: False
733 branchmerge: True, force: False, partial: False
734 ancestor: 924404dff337, local: 0b76e65c8289+, remote: bdb19105162a
734 ancestor: 924404dff337, local: 0b76e65c8289+, remote: bdb19105162a
735 preserving a for resolve of a
735 preserving a for resolve of a
736 preserving b for resolve of b
736 preserving b for resolve of b
737 preserving rev for resolve of rev
737 preserving rev for resolve of rev
738 starting 4 threads for background file closing (?)
738 starting 4 threads for background file closing (?)
739 a: prompt changed/deleted -> m (premerge)
739 a: prompt changed/deleted -> m (premerge)
740 picked tool ':prompt' for a (binary False symlink False changedelete True)
740 picked tool ':prompt' for a (binary False symlink False changedelete True)
741 file 'a' was deleted in local [working copy] but was modified in other [merge rev].
741 file 'a' was deleted in other [merge rev] but was modified in local [working copy].
742 What do you want to do?
742 What do you want to do?
743 use (c)hanged version, (d)elete, or leave (u)nresolved? u
743 use (c)hanged version, (d)elete, or leave (u)nresolved? u
744 b: both created -> m (premerge)
744 b: both created -> m (premerge)
745 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
745 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
746 merging b
746 merging b
747 my b@0b76e65c8289+ other b@bdb19105162a ancestor b@000000000000
747 my b@0b76e65c8289+ other b@bdb19105162a ancestor b@000000000000
748 rev: versions differ -> m (premerge)
748 rev: versions differ -> m (premerge)
749 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
749 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
750 merging rev
750 merging rev
751 my rev@0b76e65c8289+ other rev@bdb19105162a ancestor rev@924404dff337
751 my rev@0b76e65c8289+ other rev@bdb19105162a ancestor rev@924404dff337
752 b: both created -> m (merge)
752 b: both created -> m (merge)
753 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
753 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
754 my b@0b76e65c8289+ other b@bdb19105162a ancestor b@000000000000
754 my b@0b76e65c8289+ other b@bdb19105162a ancestor b@000000000000
755 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
755 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
756 merge tool returned: 0
756 merge tool returned: 0
757 rev: versions differ -> m (merge)
757 rev: versions differ -> m (merge)
758 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
758 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
759 my rev@0b76e65c8289+ other rev@bdb19105162a ancestor rev@924404dff337
759 my rev@0b76e65c8289+ other rev@bdb19105162a ancestor rev@924404dff337
760 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
760 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
761 merge tool returned: 0
761 merge tool returned: 0
762 0 files updated, 2 files merged, 0 files removed, 1 files unresolved
762 0 files updated, 2 files merged, 0 files removed, 1 files unresolved
763 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
763 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
764 --------------
764 --------------
765 M b
765 M b
766 C a
766 C a
767 abort: unresolved merge conflicts (see 'hg help resolve')
767 abort: unresolved merge conflicts (see 'hg help resolve')
768 --------------
768 --------------
769
769
770 $ tm "up a " "um a b" " " "20 merge a and b to b, remove a"
770 $ tm "up a " "um a b" " " "20 merge a and b to b, remove a"
771 created new head
771 created new head
772 --------------
772 --------------
773 test L:up a R:um a b W: - 20 merge a and b to b, remove a
773 test L:up a R:um a b W: - 20 merge a and b to b, remove a
774 --------------
774 --------------
775 searching for copies back to rev 1
775 searching for copies back to rev 1
776 unmatched files in other:
776 unmatched files in other:
777 b
777 b
778 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
778 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
779 src: 'a' -> dst: 'b' *
779 src: 'a' -> dst: 'b' *
780 checking for directory renames
780 checking for directory renames
781 resolving manifests
781 resolving manifests
782 branchmerge: True, force: False, partial: False
782 branchmerge: True, force: False, partial: False
783 ancestor: 924404dff337, local: e300d1c794ec+, remote: 49b6d8032493
783 ancestor: 924404dff337, local: e300d1c794ec+, remote: 49b6d8032493
784 preserving a for resolve of b
784 preserving a for resolve of b
785 preserving rev for resolve of rev
785 preserving rev for resolve of rev
786 removing a
786 removing a
787 starting 4 threads for background file closing (?)
787 starting 4 threads for background file closing (?)
788 b: remote moved from a -> m (premerge)
788 b: remote moved from a -> m (premerge)
789 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
789 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
790 merging a and b to b
790 merging a and b to b
791 my b@e300d1c794ec+ other b@49b6d8032493 ancestor a@924404dff337
791 my b@e300d1c794ec+ other b@49b6d8032493 ancestor a@924404dff337
792 rev: versions differ -> m (premerge)
792 rev: versions differ -> m (premerge)
793 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
793 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
794 merging rev
794 merging rev
795 my rev@e300d1c794ec+ other rev@49b6d8032493 ancestor rev@924404dff337
795 my rev@e300d1c794ec+ other rev@49b6d8032493 ancestor rev@924404dff337
796 b: remote moved from a -> m (merge)
796 b: remote moved from a -> m (merge)
797 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
797 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
798 my b@e300d1c794ec+ other b@49b6d8032493 ancestor a@924404dff337
798 my b@e300d1c794ec+ other b@49b6d8032493 ancestor a@924404dff337
799 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
799 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
800 merge tool returned: 0
800 merge tool returned: 0
801 rev: versions differ -> m (merge)
801 rev: versions differ -> m (merge)
802 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
802 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
803 my rev@e300d1c794ec+ other rev@49b6d8032493 ancestor rev@924404dff337
803 my rev@e300d1c794ec+ other rev@49b6d8032493 ancestor rev@924404dff337
804 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
804 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
805 merge tool returned: 0
805 merge tool returned: 0
806 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
806 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
807 (branch merge, don't forget to commit)
807 (branch merge, don't forget to commit)
808 --------------
808 --------------
809 M b
809 M b
810 a
810 a
811 --------------
811 --------------
812
812
813 $ tm "um a b" "up a " " " "21 merge a and b to b"
813 $ tm "um a b" "up a " " " "21 merge a and b to b"
814 created new head
814 created new head
815 --------------
815 --------------
816 test L:um a b R:up a W: - 21 merge a and b to b
816 test L:um a b R:up a W: - 21 merge a and b to b
817 --------------
817 --------------
818 searching for copies back to rev 1
818 searching for copies back to rev 1
819 unmatched files in local:
819 unmatched files in local:
820 b
820 b
821 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
821 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
822 src: 'a' -> dst: 'b' *
822 src: 'a' -> dst: 'b' *
823 checking for directory renames
823 checking for directory renames
824 resolving manifests
824 resolving manifests
825 branchmerge: True, force: False, partial: False
825 branchmerge: True, force: False, partial: False
826 ancestor: 924404dff337, local: 62e7bf090eba+, remote: f4db7e329e71
826 ancestor: 924404dff337, local: 62e7bf090eba+, remote: f4db7e329e71
827 preserving b for resolve of b
827 preserving b for resolve of b
828 preserving rev for resolve of rev
828 preserving rev for resolve of rev
829 starting 4 threads for background file closing (?)
829 starting 4 threads for background file closing (?)
830 b: local copied/moved from a -> m (premerge)
830 b: local copied/moved from a -> m (premerge)
831 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
831 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
832 merging b and a to b
832 merging b and a to b
833 my b@62e7bf090eba+ other a@f4db7e329e71 ancestor a@924404dff337
833 my b@62e7bf090eba+ other a@f4db7e329e71 ancestor a@924404dff337
834 rev: versions differ -> m (premerge)
834 rev: versions differ -> m (premerge)
835 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
835 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
836 merging rev
836 merging rev
837 my rev@62e7bf090eba+ other rev@f4db7e329e71 ancestor rev@924404dff337
837 my rev@62e7bf090eba+ other rev@f4db7e329e71 ancestor rev@924404dff337
838 b: local copied/moved from a -> m (merge)
838 b: local copied/moved from a -> m (merge)
839 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
839 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
840 my b@62e7bf090eba+ other a@f4db7e329e71 ancestor a@924404dff337
840 my b@62e7bf090eba+ other a@f4db7e329e71 ancestor a@924404dff337
841 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
841 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
842 merge tool returned: 0
842 merge tool returned: 0
843 rev: versions differ -> m (merge)
843 rev: versions differ -> m (merge)
844 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
844 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
845 my rev@62e7bf090eba+ other rev@f4db7e329e71 ancestor rev@924404dff337
845 my rev@62e7bf090eba+ other rev@f4db7e329e71 ancestor rev@924404dff337
846 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
846 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
847 merge tool returned: 0
847 merge tool returned: 0
848 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
848 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
849 (branch merge, don't forget to commit)
849 (branch merge, don't forget to commit)
850 --------------
850 --------------
851 M b
851 M b
852 a
852 a
853 --------------
853 --------------
854
854
855
855
856 m "nm a b" "um x a" " " "22 get a, keep b"
856 m "nm a b" "um x a" " " "22 get a, keep b"
857
857
858 $ tm "nm a b" "up a c" " " "23 get c, keep b"
858 $ tm "nm a b" "up a c" " " "23 get c, keep b"
859 created new head
859 created new head
860 --------------
860 --------------
861 test L:nm a b R:up a c W: - 23 get c, keep b
861 test L:nm a b R:up a c W: - 23 get c, keep b
862 --------------
862 --------------
863 searching for copies back to rev 1
863 searching for copies back to rev 1
864 unmatched files in local:
864 unmatched files in local:
865 b
865 b
866 unmatched files in other:
866 unmatched files in other:
867 c
867 c
868 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
868 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
869 src: 'a' -> dst: 'b' *
869 src: 'a' -> dst: 'b' *
870 checking for directory renames
870 checking for directory renames
871 resolving manifests
871 resolving manifests
872 branchmerge: True, force: False, partial: False
872 branchmerge: True, force: False, partial: False
873 ancestor: 924404dff337, local: 02963e448370+, remote: 2b958612230f
873 ancestor: 924404dff337, local: 02963e448370+, remote: 2b958612230f
874 preserving b for resolve of b
874 preserving b for resolve of b
875 preserving rev for resolve of rev
875 preserving rev for resolve of rev
876 c: remote created -> g
876 c: remote created -> g
877 getting c
877 getting c
878 b: local copied/moved from a -> m (premerge)
878 b: local copied/moved from a -> m (premerge)
879 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
879 picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
880 merging b and a to b
880 merging b and a to b
881 my b@02963e448370+ other a@2b958612230f ancestor a@924404dff337
881 my b@02963e448370+ other a@2b958612230f ancestor a@924404dff337
882 premerge successful
882 premerge successful
883 rev: versions differ -> m (premerge)
883 rev: versions differ -> m (premerge)
884 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
884 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
885 merging rev
885 merging rev
886 my rev@02963e448370+ other rev@2b958612230f ancestor rev@924404dff337
886 my rev@02963e448370+ other rev@2b958612230f ancestor rev@924404dff337
887 rev: versions differ -> m (merge)
887 rev: versions differ -> m (merge)
888 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
888 picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
889 my rev@02963e448370+ other rev@2b958612230f ancestor rev@924404dff337
889 my rev@02963e448370+ other rev@2b958612230f ancestor rev@924404dff337
890 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
890 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
891 merge tool returned: 0
891 merge tool returned: 0
892 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
892 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
893 (branch merge, don't forget to commit)
893 (branch merge, don't forget to commit)
894 --------------
894 --------------
895 M b
895 M b
896 a
896 a
897 M c
897 M c
898 --------------
898 --------------
899
899
900
900
901 $ cd ..
901 $ cd ..
902
902
903
903
904 Systematic and terse testing of merge merges and ancestor calculation:
904 Systematic and terse testing of merge merges and ancestor calculation:
905
905
906 Expected result:
906 Expected result:
907
907
908 \ a m1 m2 dst
908 \ a m1 m2 dst
909 0 - f f f "versions differ"
909 0 - f f f "versions differ"
910 1 f g g g "versions differ"
910 1 f g g g "versions differ"
911 2 f f f f "versions differ"
911 2 f f f f "versions differ"
912 3 f f g f+g "remote copied to " + f
912 3 f f g f+g "remote copied to " + f
913 4 f f g g "remote moved to " + f
913 4 f f g g "remote moved to " + f
914 5 f g f f+g "local copied to " + f2
914 5 f g f f+g "local copied to " + f2
915 6 f g f g "local moved to " + f2
915 6 f g f g "local moved to " + f2
916 7 - (f) f f "remote differs from untracked local"
916 7 - (f) f f "remote differs from untracked local"
917 8 f (f) f f "remote differs from untracked local"
917 8 f (f) f f "remote differs from untracked local"
918
918
919 $ hg init ancestortest
919 $ hg init ancestortest
920 $ cd ancestortest
920 $ cd ancestortest
921 $ for x in 1 2 3 4 5 6 8; do mkdir $x; echo a > $x/f; done
921 $ for x in 1 2 3 4 5 6 8; do mkdir $x; echo a > $x/f; done
922 $ hg ci -Aqm "a"
922 $ hg ci -Aqm "a"
923 $ mkdir 0
923 $ mkdir 0
924 $ touch 0/f
924 $ touch 0/f
925 $ hg mv 1/f 1/g
925 $ hg mv 1/f 1/g
926 $ hg cp 5/f 5/g
926 $ hg cp 5/f 5/g
927 $ hg mv 6/f 6/g
927 $ hg mv 6/f 6/g
928 $ hg rm 8/f
928 $ hg rm 8/f
929 $ for x in */*; do echo m1 > $x; done
929 $ for x in */*; do echo m1 > $x; done
930 $ hg ci -Aqm "m1"
930 $ hg ci -Aqm "m1"
931 $ hg up -qr0
931 $ hg up -qr0
932 $ mkdir 0 7
932 $ mkdir 0 7
933 $ touch 0/f 7/f
933 $ touch 0/f 7/f
934 $ hg mv 1/f 1/g
934 $ hg mv 1/f 1/g
935 $ hg cp 3/f 3/g
935 $ hg cp 3/f 3/g
936 $ hg mv 4/f 4/g
936 $ hg mv 4/f 4/g
937 $ for x in */*; do echo m2 > $x; done
937 $ for x in */*; do echo m2 > $x; done
938 $ hg ci -Aqm "m2"
938 $ hg ci -Aqm "m2"
939 $ hg up -qr1
939 $ hg up -qr1
940 $ mkdir 7 8
940 $ mkdir 7 8
941 $ echo m > 7/f
941 $ echo m > 7/f
942 $ echo m > 8/f
942 $ echo m > 8/f
943 $ hg merge -f --tool internal:dump -v --debug -r2 | sed '/^resolving manifests/,$d' 2> /dev/null
943 $ hg merge -f --tool internal:dump -v --debug -r2 | sed '/^resolving manifests/,$d' 2> /dev/null
944 searching for copies back to rev 1
944 searching for copies back to rev 1
945 unmatched files in local:
945 unmatched files in local:
946 5/g
946 5/g
947 6/g
947 6/g
948 unmatched files in other:
948 unmatched files in other:
949 3/g
949 3/g
950 4/g
950 4/g
951 7/f
951 7/f
952 unmatched files new in both:
952 unmatched files new in both:
953 0/f
953 0/f
954 1/g
954 1/g
955 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
955 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
956 src: '3/f' -> dst: '3/g' *
956 src: '3/f' -> dst: '3/g' *
957 src: '4/f' -> dst: '4/g' *
957 src: '4/f' -> dst: '4/g' *
958 src: '5/f' -> dst: '5/g' *
958 src: '5/f' -> dst: '5/g' *
959 src: '6/f' -> dst: '6/g' *
959 src: '6/f' -> dst: '6/g' *
960 checking for directory renames
960 checking for directory renames
961 $ hg mani
961 $ hg mani
962 0/f
962 0/f
963 1/g
963 1/g
964 2/f
964 2/f
965 3/f
965 3/f
966 4/f
966 4/f
967 5/f
967 5/f
968 5/g
968 5/g
969 6/g
969 6/g
970 $ for f in */*; do echo $f:; cat $f; done
970 $ for f in */*; do echo $f:; cat $f; done
971 0/f:
971 0/f:
972 m1
972 m1
973 0/f.base:
973 0/f.base:
974 0/f.local:
974 0/f.local:
975 m1
975 m1
976 0/f.orig:
976 0/f.orig:
977 m1
977 m1
978 0/f.other:
978 0/f.other:
979 m2
979 m2
980 1/g:
980 1/g:
981 m1
981 m1
982 1/g.base:
982 1/g.base:
983 a
983 a
984 1/g.local:
984 1/g.local:
985 m1
985 m1
986 1/g.orig:
986 1/g.orig:
987 m1
987 m1
988 1/g.other:
988 1/g.other:
989 m2
989 m2
990 2/f:
990 2/f:
991 m1
991 m1
992 2/f.base:
992 2/f.base:
993 a
993 a
994 2/f.local:
994 2/f.local:
995 m1
995 m1
996 2/f.orig:
996 2/f.orig:
997 m1
997 m1
998 2/f.other:
998 2/f.other:
999 m2
999 m2
1000 3/f:
1000 3/f:
1001 m1
1001 m1
1002 3/f.base:
1002 3/f.base:
1003 a
1003 a
1004 3/f.local:
1004 3/f.local:
1005 m1
1005 m1
1006 3/f.orig:
1006 3/f.orig:
1007 m1
1007 m1
1008 3/f.other:
1008 3/f.other:
1009 m2
1009 m2
1010 3/g:
1010 3/g:
1011 m1
1011 m1
1012 3/g.base:
1012 3/g.base:
1013 a
1013 a
1014 3/g.local:
1014 3/g.local:
1015 m1
1015 m1
1016 3/g.orig:
1016 3/g.orig:
1017 m1
1017 m1
1018 3/g.other:
1018 3/g.other:
1019 m2
1019 m2
1020 4/g:
1020 4/g:
1021 m1
1021 m1
1022 4/g.base:
1022 4/g.base:
1023 a
1023 a
1024 4/g.local:
1024 4/g.local:
1025 m1
1025 m1
1026 4/g.orig:
1026 4/g.orig:
1027 m1
1027 m1
1028 4/g.other:
1028 4/g.other:
1029 m2
1029 m2
1030 5/f:
1030 5/f:
1031 m1
1031 m1
1032 5/f.base:
1032 5/f.base:
1033 a
1033 a
1034 5/f.local:
1034 5/f.local:
1035 m1
1035 m1
1036 5/f.orig:
1036 5/f.orig:
1037 m1
1037 m1
1038 5/f.other:
1038 5/f.other:
1039 m2
1039 m2
1040 5/g:
1040 5/g:
1041 m1
1041 m1
1042 5/g.base:
1042 5/g.base:
1043 a
1043 a
1044 5/g.local:
1044 5/g.local:
1045 m1
1045 m1
1046 5/g.orig:
1046 5/g.orig:
1047 m1
1047 m1
1048 5/g.other:
1048 5/g.other:
1049 m2
1049 m2
1050 6/g:
1050 6/g:
1051 m1
1051 m1
1052 6/g.base:
1052 6/g.base:
1053 a
1053 a
1054 6/g.local:
1054 6/g.local:
1055 m1
1055 m1
1056 6/g.orig:
1056 6/g.orig:
1057 m1
1057 m1
1058 6/g.other:
1058 6/g.other:
1059 m2
1059 m2
1060 7/f:
1060 7/f:
1061 m
1061 m
1062 7/f.base:
1062 7/f.base:
1063 7/f.local:
1063 7/f.local:
1064 m
1064 m
1065 7/f.orig:
1065 7/f.orig:
1066 m
1066 m
1067 7/f.other:
1067 7/f.other:
1068 m2
1068 m2
1069 8/f:
1069 8/f:
1070 m2
1070 m2
1071 $ cd ..
1071 $ cd ..
@@ -1,121 +1,121 b''
1 test merging things outside of the sparse checkout
1 test merging things outside of the sparse checkout
2
2
3 $ hg init myrepo
3 $ hg init myrepo
4 $ cd myrepo
4 $ cd myrepo
5 $ cat > .hg/hgrc <<EOF
5 $ cat > .hg/hgrc <<EOF
6 > [extensions]
6 > [extensions]
7 > sparse=
7 > sparse=
8 > EOF
8 > EOF
9
9
10 $ echo foo > foo
10 $ echo foo > foo
11 $ echo bar > bar
11 $ echo bar > bar
12 $ hg add foo bar
12 $ hg add foo bar
13 $ hg commit -m initial
13 $ hg commit -m initial
14
14
15 $ hg branch feature
15 $ hg branch feature
16 marked working directory as branch feature
16 marked working directory as branch feature
17 (branches are permanent and global, did you want a bookmark?)
17 (branches are permanent and global, did you want a bookmark?)
18 $ echo bar2 >> bar
18 $ echo bar2 >> bar
19 $ hg commit -m 'feature - bar2'
19 $ hg commit -m 'feature - bar2'
20
20
21 $ hg update -q default
21 $ hg update -q default
22 $ hg debugsparse --exclude 'bar**'
22 $ hg debugsparse --exclude 'bar**'
23
23
24 $ hg merge feature
24 $ hg merge feature
25 temporarily included 1 file(s) in the sparse checkout for merging
25 temporarily included 1 file(s) in the sparse checkout for merging
26 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
26 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
27 (branch merge, don't forget to commit)
27 (branch merge, don't forget to commit)
28
28
29 Verify bar was merged temporarily
29 Verify bar was merged temporarily
30
30
31 $ ls
31 $ ls
32 bar
32 bar
33 foo
33 foo
34 $ hg status
34 $ hg status
35 M bar
35 M bar
36
36
37 Verify bar disappears automatically when the working copy becomes clean
37 Verify bar disappears automatically when the working copy becomes clean
38
38
39 $ hg commit -m "merged"
39 $ hg commit -m "merged"
40 cleaned up 1 temporarily added file(s) from the sparse checkout
40 cleaned up 1 temporarily added file(s) from the sparse checkout
41 $ hg status
41 $ hg status
42 $ ls
42 $ ls
43 foo
43 foo
44
44
45 $ hg cat -r . bar
45 $ hg cat -r . bar
46 bar
46 bar
47 bar2
47 bar2
48
48
49 Test merging things outside of the sparse checkout that are not in the working
49 Test merging things outside of the sparse checkout that are not in the working
50 copy
50 copy
51
51
52 $ hg strip -q -r . --config extensions.strip=
52 $ hg strip -q -r . --config extensions.strip=
53 $ hg up -q feature
53 $ hg up -q feature
54 $ touch branchonly
54 $ touch branchonly
55 $ hg ci -Aqm 'add branchonly'
55 $ hg ci -Aqm 'add branchonly'
56
56
57 $ hg up -q default
57 $ hg up -q default
58 $ hg debugsparse -X branchonly
58 $ hg debugsparse -X branchonly
59 $ hg merge feature
59 $ hg merge feature
60 temporarily included 2 file(s) in the sparse checkout for merging
60 temporarily included 2 file(s) in the sparse checkout for merging
61 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
61 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
62 (branch merge, don't forget to commit)
62 (branch merge, don't forget to commit)
63
63
64 $ cd ..
64 $ cd ..
65
65
66 Tests merging a file which is modified in one branch and deleted in another and
66 Tests merging a file which is modified in one branch and deleted in another and
67 file is excluded from sparse checkout
67 file is excluded from sparse checkout
68
68
69 $ hg init ytest
69 $ hg init ytest
70 $ cd ytest
70 $ cd ytest
71 $ echo "syntax: glob" >> .hgignore
71 $ echo "syntax: glob" >> .hgignore
72 $ echo "*.orig" >> .hgignore
72 $ echo "*.orig" >> .hgignore
73 $ hg ci -Aqm "added .hgignore"
73 $ hg ci -Aqm "added .hgignore"
74 $ for ch in a d; do echo foo > $ch; hg ci -Aqm "added "$ch; done;
74 $ for ch in a d; do echo foo > $ch; hg ci -Aqm "added "$ch; done;
75 $ cat >> .hg/hgrc <<EOF
75 $ cat >> .hg/hgrc <<EOF
76 > [alias]
76 > [alias]
77 > glog = log -GT "{rev}:{node|short} {desc}"
77 > glog = log -GT "{rev}:{node|short} {desc}"
78 > [extensions]
78 > [extensions]
79 > sparse =
79 > sparse =
80 > EOF
80 > EOF
81
81
82 $ hg glog
82 $ hg glog
83 @ 2:f29feff37cfc added d
83 @ 2:f29feff37cfc added d
84 |
84 |
85 o 1:617125d27d6b added a
85 o 1:617125d27d6b added a
86 |
86 |
87 o 0:53f3774ed939 added .hgignore
87 o 0:53f3774ed939 added .hgignore
88
88
89 $ hg rm d
89 $ hg rm d
90 $ hg ci -m "removed d"
90 $ hg ci -m "removed d"
91
91
92 $ hg up '.^'
92 $ hg up '.^'
93 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
93 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
94 $ hg debugsparse --reset
94 $ hg debugsparse --reset
95 $ echo bar >> d
95 $ echo bar >> d
96 $ hg ci -Am "added bar to d"
96 $ hg ci -Am "added bar to d"
97 created new head
97 created new head
98
98
99 $ hg glog
99 $ hg glog
100 @ 4:6527874a90e4 added bar to d
100 @ 4:6527874a90e4 added bar to d
101 |
101 |
102 | o 3:372c8558de45 removed d
102 | o 3:372c8558de45 removed d
103 |/
103 |/
104 o 2:f29feff37cfc added d
104 o 2:f29feff37cfc added d
105 |
105 |
106 o 1:617125d27d6b added a
106 o 1:617125d27d6b added a
107 |
107 |
108 o 0:53f3774ed939 added .hgignore
108 o 0:53f3774ed939 added .hgignore
109
109
110 $ hg debugsparse --exclude "d"
110 $ hg debugsparse --exclude "d"
111 $ ls
111 $ ls
112 a
112 a
113
113
114 $ hg merge
114 $ hg merge
115 temporarily included 1 file(s) in the sparse checkout for merging
115 temporarily included 1 file(s) in the sparse checkout for merging
116 file 'd' was deleted in local [working copy] but was modified in other [merge rev].
116 file 'd' was deleted in other [merge rev] but was modified in local [working copy].
117 What do you want to do?
117 What do you want to do?
118 use (c)hanged version, (d)elete, or leave (u)nresolved? u
118 use (c)hanged version, (d)elete, or leave (u)nresolved? u
119 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
119 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
120 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
120 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
121 [1]
121 [1]
General Comments 0
You need to be logged in to leave comments. Login now