##// END OF EJS Templates
filemerge: normalize 'internal:foo' names to ':foo'...
Siddharth Agarwal -
r26517:d8463a74 default
parent child Browse files
Show More
@@ -1,563 +1,566
1 # filemerge.py - file-level merge handling for Mercurial
1 # filemerge.py - file-level merge handling for Mercurial
2 #
2 #
3 # Copyright 2006, 2007, 2008 Matt Mackall <mpm@selenic.com>
3 # Copyright 2006, 2007, 2008 Matt Mackall <mpm@selenic.com>
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 from __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 import filecmp
10 import filecmp
11 import os
11 import os
12 import re
12 import re
13 import tempfile
13 import tempfile
14
14
15 from .i18n import _
15 from .i18n import _
16 from .node import short
16 from .node import short
17
17
18 from . import (
18 from . import (
19 error,
19 error,
20 match,
20 match,
21 simplemerge,
21 simplemerge,
22 tagmerge,
22 tagmerge,
23 templatekw,
23 templatekw,
24 templater,
24 templater,
25 util,
25 util,
26 )
26 )
27
27
28 def _toolstr(ui, tool, part, default=""):
28 def _toolstr(ui, tool, part, default=""):
29 return ui.config("merge-tools", tool + "." + part, default)
29 return ui.config("merge-tools", tool + "." + part, default)
30
30
31 def _toolbool(ui, tool, part, default=False):
31 def _toolbool(ui, tool, part, default=False):
32 return ui.configbool("merge-tools", tool + "." + part, default)
32 return ui.configbool("merge-tools", tool + "." + part, default)
33
33
34 def _toollist(ui, tool, part, default=[]):
34 def _toollist(ui, tool, part, default=[]):
35 return ui.configlist("merge-tools", tool + "." + part, default)
35 return ui.configlist("merge-tools", tool + "." + part, default)
36
36
37 internals = {}
37 internals = {}
38 # Merge tools to document.
38 # Merge tools to document.
39 internalsdoc = {}
39 internalsdoc = {}
40
40
41 def internaltool(name, trymerge, onfailure=None, precheck=None):
41 def internaltool(name, trymerge, onfailure=None, precheck=None):
42 '''return a decorator for populating internal merge tool table'''
42 '''return a decorator for populating internal merge tool table'''
43 def decorator(func):
43 def decorator(func):
44 fullname = ':' + name
44 fullname = ':' + name
45 func.__doc__ = "``%s``\n" % fullname + func.__doc__.strip()
45 func.__doc__ = "``%s``\n" % fullname + func.__doc__.strip()
46 internals[fullname] = func
46 internals[fullname] = func
47 internals['internal:' + name] = func
47 internals['internal:' + name] = func
48 internalsdoc[fullname] = func
48 internalsdoc[fullname] = func
49 func.trymerge = trymerge
49 func.trymerge = trymerge
50 func.onfailure = onfailure
50 func.onfailure = onfailure
51 func.precheck = precheck
51 func.precheck = precheck
52 return func
52 return func
53 return decorator
53 return decorator
54
54
55 def _findtool(ui, tool):
55 def _findtool(ui, tool):
56 if tool in internals:
56 if tool in internals:
57 return tool
57 return tool
58 return findexternaltool(ui, tool)
58 return findexternaltool(ui, tool)
59
59
60 def findexternaltool(ui, tool):
60 def findexternaltool(ui, tool):
61 for kn in ("regkey", "regkeyalt"):
61 for kn in ("regkey", "regkeyalt"):
62 k = _toolstr(ui, tool, kn)
62 k = _toolstr(ui, tool, kn)
63 if not k:
63 if not k:
64 continue
64 continue
65 p = util.lookupreg(k, _toolstr(ui, tool, "regname"))
65 p = util.lookupreg(k, _toolstr(ui, tool, "regname"))
66 if p:
66 if p:
67 p = util.findexe(p + _toolstr(ui, tool, "regappend"))
67 p = util.findexe(p + _toolstr(ui, tool, "regappend"))
68 if p:
68 if p:
69 return p
69 return p
70 exe = _toolstr(ui, tool, "executable", tool)
70 exe = _toolstr(ui, tool, "executable", tool)
71 return util.findexe(util.expandpath(exe))
71 return util.findexe(util.expandpath(exe))
72
72
73 def _picktool(repo, ui, path, binary, symlink):
73 def _picktool(repo, ui, path, binary, symlink):
74 def check(tool, pat, symlink, binary):
74 def check(tool, pat, symlink, binary):
75 tmsg = tool
75 tmsg = tool
76 if pat:
76 if pat:
77 tmsg += " specified for " + pat
77 tmsg += " specified for " + pat
78 if not _findtool(ui, tool):
78 if not _findtool(ui, tool):
79 if pat: # explicitly requested tool deserves a warning
79 if pat: # explicitly requested tool deserves a warning
80 ui.warn(_("couldn't find merge tool %s\n") % tmsg)
80 ui.warn(_("couldn't find merge tool %s\n") % tmsg)
81 else: # configured but non-existing tools are more silent
81 else: # configured but non-existing tools are more silent
82 ui.note(_("couldn't find merge tool %s\n") % tmsg)
82 ui.note(_("couldn't find merge tool %s\n") % tmsg)
83 elif symlink and not _toolbool(ui, tool, "symlink"):
83 elif symlink and not _toolbool(ui, tool, "symlink"):
84 ui.warn(_("tool %s can't handle symlinks\n") % tmsg)
84 ui.warn(_("tool %s can't handle symlinks\n") % tmsg)
85 elif binary and not _toolbool(ui, tool, "binary"):
85 elif binary and not _toolbool(ui, tool, "binary"):
86 ui.warn(_("tool %s can't handle binary\n") % tmsg)
86 ui.warn(_("tool %s can't handle binary\n") % tmsg)
87 elif not util.gui() and _toolbool(ui, tool, "gui"):
87 elif not util.gui() and _toolbool(ui, tool, "gui"):
88 ui.warn(_("tool %s requires a GUI\n") % tmsg)
88 ui.warn(_("tool %s requires a GUI\n") % tmsg)
89 else:
89 else:
90 return True
90 return True
91 return False
91 return False
92
92
93 # internal config: ui.forcemerge
93 # internal config: ui.forcemerge
94 # forcemerge comes from command line arguments, highest priority
94 # forcemerge comes from command line arguments, highest priority
95 force = ui.config('ui', 'forcemerge')
95 force = ui.config('ui', 'forcemerge')
96 if force:
96 if force:
97 toolpath = _findtool(ui, force)
97 toolpath = _findtool(ui, force)
98 if toolpath:
98 if toolpath:
99 return (force, util.shellquote(toolpath))
99 return (force, util.shellquote(toolpath))
100 else:
100 else:
101 # mimic HGMERGE if given tool not found
101 # mimic HGMERGE if given tool not found
102 return (force, force)
102 return (force, force)
103
103
104 # HGMERGE takes next precedence
104 # HGMERGE takes next precedence
105 hgmerge = os.environ.get("HGMERGE")
105 hgmerge = os.environ.get("HGMERGE")
106 if hgmerge:
106 if hgmerge:
107 return (hgmerge, hgmerge)
107 return (hgmerge, hgmerge)
108
108
109 # then patterns
109 # then patterns
110 for pat, tool in ui.configitems("merge-patterns"):
110 for pat, tool in ui.configitems("merge-patterns"):
111 mf = match.match(repo.root, '', [pat])
111 mf = match.match(repo.root, '', [pat])
112 if mf(path) and check(tool, pat, symlink, False):
112 if mf(path) and check(tool, pat, symlink, False):
113 toolpath = _findtool(ui, tool)
113 toolpath = _findtool(ui, tool)
114 return (tool, util.shellquote(toolpath))
114 return (tool, util.shellquote(toolpath))
115
115
116 # then merge tools
116 # then merge tools
117 tools = {}
117 tools = {}
118 for k, v in ui.configitems("merge-tools"):
118 for k, v in ui.configitems("merge-tools"):
119 t = k.split('.')[0]
119 t = k.split('.')[0]
120 if t not in tools:
120 if t not in tools:
121 tools[t] = int(_toolstr(ui, t, "priority", "0"))
121 tools[t] = int(_toolstr(ui, t, "priority", "0"))
122 names = tools.keys()
122 names = tools.keys()
123 tools = sorted([(-p, t) for t, p in tools.items()])
123 tools = sorted([(-p, t) for t, p in tools.items()])
124 uimerge = ui.config("ui", "merge")
124 uimerge = ui.config("ui", "merge")
125 if uimerge:
125 if uimerge:
126 if uimerge not in names:
126 if uimerge not in names:
127 return (uimerge, uimerge)
127 return (uimerge, uimerge)
128 tools.insert(0, (None, uimerge)) # highest priority
128 tools.insert(0, (None, uimerge)) # highest priority
129 tools.append((None, "hgmerge")) # the old default, if found
129 tools.append((None, "hgmerge")) # the old default, if found
130 for p, t in tools:
130 for p, t in tools:
131 if check(t, None, symlink, binary):
131 if check(t, None, symlink, binary):
132 toolpath = _findtool(ui, t)
132 toolpath = _findtool(ui, t)
133 return (t, util.shellquote(toolpath))
133 return (t, util.shellquote(toolpath))
134
134
135 # internal merge or prompt as last resort
135 # internal merge or prompt as last resort
136 if symlink or binary:
136 if symlink or binary:
137 return ":prompt", None
137 return ":prompt", None
138 return ":merge", None
138 return ":merge", None
139
139
140 def _eoltype(data):
140 def _eoltype(data):
141 "Guess the EOL type of a file"
141 "Guess the EOL type of a file"
142 if '\0' in data: # binary
142 if '\0' in data: # binary
143 return None
143 return None
144 if '\r\n' in data: # Windows
144 if '\r\n' in data: # Windows
145 return '\r\n'
145 return '\r\n'
146 if '\r' in data: # Old Mac
146 if '\r' in data: # Old Mac
147 return '\r'
147 return '\r'
148 if '\n' in data: # UNIX
148 if '\n' in data: # UNIX
149 return '\n'
149 return '\n'
150 return None # unknown
150 return None # unknown
151
151
152 def _matcheol(file, origfile):
152 def _matcheol(file, origfile):
153 "Convert EOL markers in a file to match origfile"
153 "Convert EOL markers in a file to match origfile"
154 tostyle = _eoltype(util.readfile(origfile))
154 tostyle = _eoltype(util.readfile(origfile))
155 if tostyle:
155 if tostyle:
156 data = util.readfile(file)
156 data = util.readfile(file)
157 style = _eoltype(data)
157 style = _eoltype(data)
158 if style:
158 if style:
159 newdata = data.replace(style, tostyle)
159 newdata = data.replace(style, tostyle)
160 if newdata != data:
160 if newdata != data:
161 util.writefile(file, newdata)
161 util.writefile(file, newdata)
162
162
163 @internaltool('prompt', False)
163 @internaltool('prompt', False)
164 def _iprompt(repo, mynode, orig, fcd, fco, fca, toolconf):
164 def _iprompt(repo, mynode, orig, fcd, fco, fca, toolconf):
165 """Asks the user which of the local or the other version to keep as
165 """Asks the user which of the local or the other version to keep as
166 the merged version."""
166 the merged version."""
167 ui = repo.ui
167 ui = repo.ui
168 fd = fcd.path()
168 fd = fcd.path()
169
169
170 if ui.promptchoice(_(" no tool found to merge %s\n"
170 if ui.promptchoice(_(" no tool found to merge %s\n"
171 "keep (l)ocal or take (o)ther?"
171 "keep (l)ocal or take (o)ther?"
172 "$$ &Local $$ &Other") % fd, 0):
172 "$$ &Local $$ &Other") % fd, 0):
173 return _iother(repo, mynode, orig, fcd, fco, fca, toolconf)
173 return _iother(repo, mynode, orig, fcd, fco, fca, toolconf)
174 else:
174 else:
175 return _ilocal(repo, mynode, orig, fcd, fco, fca, toolconf)
175 return _ilocal(repo, mynode, orig, fcd, fco, fca, toolconf)
176
176
177 @internaltool('local', False)
177 @internaltool('local', False)
178 def _ilocal(repo, mynode, orig, fcd, fco, fca, toolconf):
178 def _ilocal(repo, mynode, orig, fcd, fco, fca, toolconf):
179 """Uses the local version of files as the merged version."""
179 """Uses the local version of files as the merged version."""
180 return 0
180 return 0
181
181
182 @internaltool('other', False)
182 @internaltool('other', False)
183 def _iother(repo, mynode, orig, fcd, fco, fca, toolconf):
183 def _iother(repo, mynode, orig, fcd, fco, fca, toolconf):
184 """Uses the other version of files as the merged version."""
184 """Uses the other version of files as the merged version."""
185 repo.wwrite(fcd.path(), fco.data(), fco.flags())
185 repo.wwrite(fcd.path(), fco.data(), fco.flags())
186 return 0
186 return 0
187
187
188 @internaltool('fail', False)
188 @internaltool('fail', False)
189 def _ifail(repo, mynode, orig, fcd, fco, fca, toolconf):
189 def _ifail(repo, mynode, orig, fcd, fco, fca, toolconf):
190 """
190 """
191 Rather than attempting to merge files that were modified on both
191 Rather than attempting to merge files that were modified on both
192 branches, it marks them as unresolved. The resolve command must be
192 branches, it marks them as unresolved. The resolve command must be
193 used to resolve these conflicts."""
193 used to resolve these conflicts."""
194 return 1
194 return 1
195
195
196 def _premerge(repo, toolconf, files, labels=None):
196 def _premerge(repo, toolconf, files, labels=None):
197 tool, toolpath, binary, symlink = toolconf
197 tool, toolpath, binary, symlink = toolconf
198 if symlink:
198 if symlink:
199 return 1
199 return 1
200 a, b, c, back = files
200 a, b, c, back = files
201
201
202 ui = repo.ui
202 ui = repo.ui
203
203
204 validkeep = ['keep', 'keep-merge3']
204 validkeep = ['keep', 'keep-merge3']
205
205
206 # do we attempt to simplemerge first?
206 # do we attempt to simplemerge first?
207 try:
207 try:
208 premerge = _toolbool(ui, tool, "premerge", not binary)
208 premerge = _toolbool(ui, tool, "premerge", not binary)
209 except error.ConfigError:
209 except error.ConfigError:
210 premerge = _toolstr(ui, tool, "premerge").lower()
210 premerge = _toolstr(ui, tool, "premerge").lower()
211 if premerge not in validkeep:
211 if premerge not in validkeep:
212 _valid = ', '.join(["'" + v + "'" for v in validkeep])
212 _valid = ', '.join(["'" + v + "'" for v in validkeep])
213 raise error.ConfigError(_("%s.premerge not valid "
213 raise error.ConfigError(_("%s.premerge not valid "
214 "('%s' is neither boolean nor %s)") %
214 "('%s' is neither boolean nor %s)") %
215 (tool, premerge, _valid))
215 (tool, premerge, _valid))
216
216
217 if premerge:
217 if premerge:
218 if premerge == 'keep-merge3':
218 if premerge == 'keep-merge3':
219 if not labels:
219 if not labels:
220 labels = _defaultconflictlabels
220 labels = _defaultconflictlabels
221 if len(labels) < 3:
221 if len(labels) < 3:
222 labels.append('base')
222 labels.append('base')
223 r = simplemerge.simplemerge(ui, a, b, c, quiet=True, label=labels)
223 r = simplemerge.simplemerge(ui, a, b, c, quiet=True, label=labels)
224 if not r:
224 if not r:
225 ui.debug(" premerge successful\n")
225 ui.debug(" premerge successful\n")
226 return 0
226 return 0
227 if premerge not in validkeep:
227 if premerge not in validkeep:
228 util.copyfile(back, a) # restore from backup and try again
228 util.copyfile(back, a) # restore from backup and try again
229 return 1 # continue merging
229 return 1 # continue merging
230
230
231 def _symlinkcheck(repo, mynode, orig, fcd, fco, fca, toolconf):
231 def _symlinkcheck(repo, mynode, orig, fcd, fco, fca, toolconf):
232 tool, toolpath, binary, symlink = toolconf
232 tool, toolpath, binary, symlink = toolconf
233 if symlink:
233 if symlink:
234 repo.ui.warn(_('warning: internal :merge cannot merge symlinks '
234 repo.ui.warn(_('warning: internal :merge cannot merge symlinks '
235 'for %s\n') % fcd.path())
235 'for %s\n') % fcd.path())
236 return False
236 return False
237 return True
237 return True
238
238
239 def _merge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels, mode):
239 def _merge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels, mode):
240 """
240 """
241 Uses the internal non-interactive simple merge algorithm for merging
241 Uses the internal non-interactive simple merge algorithm for merging
242 files. It will fail if there are any conflicts and leave markers in
242 files. It will fail if there are any conflicts and leave markers in
243 the partially merged file. Markers will have two sections, one for each side
243 the partially merged file. Markers will have two sections, one for each side
244 of merge, unless mode equals 'union' which suppresses the markers."""
244 of merge, unless mode equals 'union' which suppresses the markers."""
245 r = _premerge(repo, toolconf, files, labels=labels)
245 r = _premerge(repo, toolconf, files, labels=labels)
246 if r:
246 if r:
247 a, b, c, back = files
247 a, b, c, back = files
248
248
249 ui = repo.ui
249 ui = repo.ui
250
250
251 r = simplemerge.simplemerge(ui, a, b, c, label=labels, mode=mode)
251 r = simplemerge.simplemerge(ui, a, b, c, label=labels, mode=mode)
252 return True, r
252 return True, r
253 return False, 0
253 return False, 0
254
254
255 @internaltool('union', True,
255 @internaltool('union', True,
256 _("merging %s incomplete! "
256 _("merging %s incomplete! "
257 "(edit conflicts, then use 'hg resolve --mark')\n"),
257 "(edit conflicts, then use 'hg resolve --mark')\n"),
258 precheck=_symlinkcheck)
258 precheck=_symlinkcheck)
259 def _iunion(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
259 def _iunion(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
260 """
260 """
261 Uses the internal non-interactive simple merge algorithm for merging
261 Uses the internal non-interactive simple merge algorithm for merging
262 files. It will use both left and right sides for conflict regions.
262 files. It will use both left and right sides for conflict regions.
263 No markers are inserted."""
263 No markers are inserted."""
264 return _merge(repo, mynode, orig, fcd, fco, fca, toolconf,
264 return _merge(repo, mynode, orig, fcd, fco, fca, toolconf,
265 files, labels, 'union')
265 files, labels, 'union')
266
266
267 @internaltool('merge', True,
267 @internaltool('merge', True,
268 _("merging %s incomplete! "
268 _("merging %s incomplete! "
269 "(edit conflicts, then use 'hg resolve --mark')\n"),
269 "(edit conflicts, then use 'hg resolve --mark')\n"),
270 precheck=_symlinkcheck)
270 precheck=_symlinkcheck)
271 def _imerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
271 def _imerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
272 """
272 """
273 Uses the internal non-interactive simple merge algorithm for merging
273 Uses the internal non-interactive simple merge algorithm for merging
274 files. It will fail if there are any conflicts and leave markers in
274 files. It will fail if there are any conflicts and leave markers in
275 the partially merged file. Markers will have two sections, one for each side
275 the partially merged file. Markers will have two sections, one for each side
276 of merge."""
276 of merge."""
277 return _merge(repo, mynode, orig, fcd, fco, fca, toolconf,
277 return _merge(repo, mynode, orig, fcd, fco, fca, toolconf,
278 files, labels, 'merge')
278 files, labels, 'merge')
279
279
280 @internaltool('merge3', True,
280 @internaltool('merge3', True,
281 _("merging %s incomplete! "
281 _("merging %s incomplete! "
282 "(edit conflicts, then use 'hg resolve --mark')\n"))
282 "(edit conflicts, then use 'hg resolve --mark')\n"))
283 def _imerge3(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
283 def _imerge3(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
284 """
284 """
285 Uses the internal non-interactive simple merge algorithm for merging
285 Uses the internal non-interactive simple merge algorithm for merging
286 files. It will fail if there are any conflicts and leave markers in
286 files. It will fail if there are any conflicts and leave markers in
287 the partially merged file. Marker will have three sections, one from each
287 the partially merged file. Marker will have three sections, one from each
288 side of the merge and one for the base content."""
288 side of the merge and one for the base content."""
289 if not labels:
289 if not labels:
290 labels = _defaultconflictlabels
290 labels = _defaultconflictlabels
291 if len(labels) < 3:
291 if len(labels) < 3:
292 labels.append('base')
292 labels.append('base')
293 return _imerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels)
293 return _imerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels)
294
294
295 def _imergeauto(repo, mynode, orig, fcd, fco, fca, toolconf, files,
295 def _imergeauto(repo, mynode, orig, fcd, fco, fca, toolconf, files,
296 labels=None, localorother=None):
296 labels=None, localorother=None):
297 """
297 """
298 Generic driver for _imergelocal and _imergeother
298 Generic driver for _imergelocal and _imergeother
299 """
299 """
300 assert localorother is not None
300 assert localorother is not None
301 tool, toolpath, binary, symlink = toolconf
301 tool, toolpath, binary, symlink = toolconf
302 if symlink:
302 if symlink:
303 repo.ui.warn(_('warning: :merge-%s cannot merge symlinks '
303 repo.ui.warn(_('warning: :merge-%s cannot merge symlinks '
304 'for %s\n') % (localorother, fcd.path()))
304 'for %s\n') % (localorother, fcd.path()))
305 return False, 1
305 return False, 1
306 a, b, c, back = files
306 a, b, c, back = files
307 r = simplemerge.simplemerge(repo.ui, a, b, c, label=labels,
307 r = simplemerge.simplemerge(repo.ui, a, b, c, label=labels,
308 localorother=localorother)
308 localorother=localorother)
309 return True, r
309 return True, r
310
310
311 @internaltool('merge-local', True)
311 @internaltool('merge-local', True)
312 def _imergelocal(*args, **kwargs):
312 def _imergelocal(*args, **kwargs):
313 """
313 """
314 Like :merge, but resolve all conflicts non-interactively in favor
314 Like :merge, but resolve all conflicts non-interactively in favor
315 of the local changes."""
315 of the local changes."""
316 success, status = _imergeauto(localorother='local', *args, **kwargs)
316 success, status = _imergeauto(localorother='local', *args, **kwargs)
317 return success, status
317 return success, status
318
318
319 @internaltool('merge-other', True)
319 @internaltool('merge-other', True)
320 def _imergeother(*args, **kwargs):
320 def _imergeother(*args, **kwargs):
321 """
321 """
322 Like :merge, but resolve all conflicts non-interactively in favor
322 Like :merge, but resolve all conflicts non-interactively in favor
323 of the other changes."""
323 of the other changes."""
324 success, status = _imergeauto(localorother='other', *args, **kwargs)
324 success, status = _imergeauto(localorother='other', *args, **kwargs)
325 return success, status
325 return success, status
326
326
327 @internaltool('tagmerge', True,
327 @internaltool('tagmerge', True,
328 _("automatic tag merging of %s failed! "
328 _("automatic tag merging of %s failed! "
329 "(use 'hg resolve --tool :merge' or another merge "
329 "(use 'hg resolve --tool :merge' or another merge "
330 "tool of your choice)\n"))
330 "tool of your choice)\n"))
331 def _itagmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
331 def _itagmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
332 """
332 """
333 Uses the internal tag merge algorithm (experimental).
333 Uses the internal tag merge algorithm (experimental).
334 """
334 """
335 return tagmerge.merge(repo, fcd, fco, fca)
335 return tagmerge.merge(repo, fcd, fco, fca)
336
336
337 @internaltool('dump', True)
337 @internaltool('dump', True)
338 def _idump(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
338 def _idump(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
339 """
339 """
340 Creates three versions of the files to merge, containing the
340 Creates three versions of the files to merge, containing the
341 contents of local, other and base. These files can then be used to
341 contents of local, other and base. These files can then be used to
342 perform a merge manually. If the file to be merged is named
342 perform a merge manually. If the file to be merged is named
343 ``a.txt``, these files will accordingly be named ``a.txt.local``,
343 ``a.txt``, these files will accordingly be named ``a.txt.local``,
344 ``a.txt.other`` and ``a.txt.base`` and they will be placed in the
344 ``a.txt.other`` and ``a.txt.base`` and they will be placed in the
345 same directory as ``a.txt``."""
345 same directory as ``a.txt``."""
346 r = _premerge(repo, toolconf, files, labels=labels)
346 r = _premerge(repo, toolconf, files, labels=labels)
347 if r:
347 if r:
348 a, b, c, back = files
348 a, b, c, back = files
349
349
350 fd = fcd.path()
350 fd = fcd.path()
351
351
352 util.copyfile(a, a + ".local")
352 util.copyfile(a, a + ".local")
353 repo.wwrite(fd + ".other", fco.data(), fco.flags())
353 repo.wwrite(fd + ".other", fco.data(), fco.flags())
354 repo.wwrite(fd + ".base", fca.data(), fca.flags())
354 repo.wwrite(fd + ".base", fca.data(), fca.flags())
355 return False, r
355 return False, r
356
356
357 def _xmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
357 def _xmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
358 r = _premerge(repo, toolconf, files, labels=labels)
358 r = _premerge(repo, toolconf, files, labels=labels)
359 if r:
359 if r:
360 tool, toolpath, binary, symlink = toolconf
360 tool, toolpath, binary, symlink = toolconf
361 a, b, c, back = files
361 a, b, c, back = files
362 out = ""
362 out = ""
363 env = {'HG_FILE': fcd.path(),
363 env = {'HG_FILE': fcd.path(),
364 'HG_MY_NODE': short(mynode),
364 'HG_MY_NODE': short(mynode),
365 'HG_OTHER_NODE': str(fco.changectx()),
365 'HG_OTHER_NODE': str(fco.changectx()),
366 'HG_BASE_NODE': str(fca.changectx()),
366 'HG_BASE_NODE': str(fca.changectx()),
367 'HG_MY_ISLINK': 'l' in fcd.flags(),
367 'HG_MY_ISLINK': 'l' in fcd.flags(),
368 'HG_OTHER_ISLINK': 'l' in fco.flags(),
368 'HG_OTHER_ISLINK': 'l' in fco.flags(),
369 'HG_BASE_ISLINK': 'l' in fca.flags(),
369 'HG_BASE_ISLINK': 'l' in fca.flags(),
370 }
370 }
371
371
372 ui = repo.ui
372 ui = repo.ui
373
373
374 args = _toolstr(ui, tool, "args", '$local $base $other')
374 args = _toolstr(ui, tool, "args", '$local $base $other')
375 if "$output" in args:
375 if "$output" in args:
376 out, a = a, back # read input from backup, write to original
376 out, a = a, back # read input from backup, write to original
377 replace = {'local': a, 'base': b, 'other': c, 'output': out}
377 replace = {'local': a, 'base': b, 'other': c, 'output': out}
378 args = util.interpolate(r'\$', replace, args,
378 args = util.interpolate(r'\$', replace, args,
379 lambda s: util.shellquote(util.localpath(s)))
379 lambda s: util.shellquote(util.localpath(s)))
380 cmd = toolpath + ' ' + args
380 cmd = toolpath + ' ' + args
381 repo.ui.debug('launching merge tool: %s\n' % cmd)
381 repo.ui.debug('launching merge tool: %s\n' % cmd)
382 r = ui.system(cmd, cwd=repo.root, environ=env)
382 r = ui.system(cmd, cwd=repo.root, environ=env)
383 repo.ui.debug('merge tool returned: %s\n' % r)
383 repo.ui.debug('merge tool returned: %s\n' % r)
384 return True, r
384 return True, r
385 return False, 0
385 return False, 0
386
386
387 def _formatconflictmarker(repo, ctx, template, label, pad):
387 def _formatconflictmarker(repo, ctx, template, label, pad):
388 """Applies the given template to the ctx, prefixed by the label.
388 """Applies the given template to the ctx, prefixed by the label.
389
389
390 Pad is the minimum width of the label prefix, so that multiple markers
390 Pad is the minimum width of the label prefix, so that multiple markers
391 can have aligned templated parts.
391 can have aligned templated parts.
392 """
392 """
393 if ctx.node() is None:
393 if ctx.node() is None:
394 ctx = ctx.p1()
394 ctx = ctx.p1()
395
395
396 props = templatekw.keywords.copy()
396 props = templatekw.keywords.copy()
397 props['templ'] = template
397 props['templ'] = template
398 props['ctx'] = ctx
398 props['ctx'] = ctx
399 props['repo'] = repo
399 props['repo'] = repo
400 templateresult = template('conflictmarker', **props)
400 templateresult = template('conflictmarker', **props)
401
401
402 label = ('%s:' % label).ljust(pad + 1)
402 label = ('%s:' % label).ljust(pad + 1)
403 mark = '%s %s' % (label, templater.stringify(templateresult))
403 mark = '%s %s' % (label, templater.stringify(templateresult))
404
404
405 if mark:
405 if mark:
406 mark = mark.splitlines()[0] # split for safety
406 mark = mark.splitlines()[0] # split for safety
407
407
408 # 8 for the prefix of conflict marker lines (e.g. '<<<<<<< ')
408 # 8 for the prefix of conflict marker lines (e.g. '<<<<<<< ')
409 return util.ellipsis(mark, 80 - 8)
409 return util.ellipsis(mark, 80 - 8)
410
410
411 _defaultconflictmarker = ('{node|short} ' +
411 _defaultconflictmarker = ('{node|short} ' +
412 '{ifeq(tags, "tip", "", "{tags} ")}' +
412 '{ifeq(tags, "tip", "", "{tags} ")}' +
413 '{if(bookmarks, "{bookmarks} ")}' +
413 '{if(bookmarks, "{bookmarks} ")}' +
414 '{ifeq(branch, "default", "", "{branch} ")}' +
414 '{ifeq(branch, "default", "", "{branch} ")}' +
415 '- {author|user}: {desc|firstline}')
415 '- {author|user}: {desc|firstline}')
416
416
417 _defaultconflictlabels = ['local', 'other']
417 _defaultconflictlabels = ['local', 'other']
418
418
419 def _formatlabels(repo, fcd, fco, fca, labels):
419 def _formatlabels(repo, fcd, fco, fca, labels):
420 """Formats the given labels using the conflict marker template.
420 """Formats the given labels using the conflict marker template.
421
421
422 Returns a list of formatted labels.
422 Returns a list of formatted labels.
423 """
423 """
424 cd = fcd.changectx()
424 cd = fcd.changectx()
425 co = fco.changectx()
425 co = fco.changectx()
426 ca = fca.changectx()
426 ca = fca.changectx()
427
427
428 ui = repo.ui
428 ui = repo.ui
429 template = ui.config('ui', 'mergemarkertemplate', _defaultconflictmarker)
429 template = ui.config('ui', 'mergemarkertemplate', _defaultconflictmarker)
430 tmpl = templater.templater(None, cache={'conflictmarker': template})
430 tmpl = templater.templater(None, cache={'conflictmarker': template})
431
431
432 pad = max(len(l) for l in labels)
432 pad = max(len(l) for l in labels)
433
433
434 newlabels = [_formatconflictmarker(repo, cd, tmpl, labels[0], pad),
434 newlabels = [_formatconflictmarker(repo, cd, tmpl, labels[0], pad),
435 _formatconflictmarker(repo, co, tmpl, labels[1], pad)]
435 _formatconflictmarker(repo, co, tmpl, labels[1], pad)]
436 if len(labels) > 2:
436 if len(labels) > 2:
437 newlabels.append(_formatconflictmarker(repo, ca, tmpl, labels[2], pad))
437 newlabels.append(_formatconflictmarker(repo, ca, tmpl, labels[2], pad))
438 return newlabels
438 return newlabels
439
439
440 def filemerge(repo, mynode, orig, fcd, fco, fca, labels=None):
440 def filemerge(repo, mynode, orig, fcd, fco, fca, labels=None):
441 """perform a 3-way merge in the working directory
441 """perform a 3-way merge in the working directory
442
442
443 mynode = parent node before merge
443 mynode = parent node before merge
444 orig = original local filename before merge
444 orig = original local filename before merge
445 fco = other file context
445 fco = other file context
446 fca = ancestor file context
446 fca = ancestor file context
447 fcd = local file context for current/destination file
447 fcd = local file context for current/destination file
448 """
448 """
449
449
450 if True:
450 if True:
451 def temp(prefix, ctx):
451 def temp(prefix, ctx):
452 pre = "%s~%s." % (os.path.basename(ctx.path()), prefix)
452 pre = "%s~%s." % (os.path.basename(ctx.path()), prefix)
453 (fd, name) = tempfile.mkstemp(prefix=pre)
453 (fd, name) = tempfile.mkstemp(prefix=pre)
454 data = repo.wwritedata(ctx.path(), ctx.data())
454 data = repo.wwritedata(ctx.path(), ctx.data())
455 f = os.fdopen(fd, "wb")
455 f = os.fdopen(fd, "wb")
456 f.write(data)
456 f.write(data)
457 f.close()
457 f.close()
458 return name
458 return name
459
459
460 if not fco.cmp(fcd): # files identical?
460 if not fco.cmp(fcd): # files identical?
461 return None
461 return None
462
462
463 ui = repo.ui
463 ui = repo.ui
464 fd = fcd.path()
464 fd = fcd.path()
465 binary = fcd.isbinary() or fco.isbinary() or fca.isbinary()
465 binary = fcd.isbinary() or fco.isbinary() or fca.isbinary()
466 symlink = 'l' in fcd.flags() + fco.flags()
466 symlink = 'l' in fcd.flags() + fco.flags()
467 tool, toolpath = _picktool(repo, ui, fd, binary, symlink)
467 tool, toolpath = _picktool(repo, ui, fd, binary, symlink)
468 if tool in internals and tool.startswith('internal:'):
469 # normalize to new-style names (':merge' etc)
470 tool = tool[len('internal'):]
468 ui.debug("picked tool '%s' for %s (binary %s symlink %s)\n" %
471 ui.debug("picked tool '%s' for %s (binary %s symlink %s)\n" %
469 (tool, fd, binary, symlink))
472 (tool, fd, binary, symlink))
470
473
471 if tool in internals:
474 if tool in internals:
472 func = internals[tool]
475 func = internals[tool]
473 trymerge = func.trymerge
476 trymerge = func.trymerge
474 onfailure = func.onfailure
477 onfailure = func.onfailure
475 precheck = func.precheck
478 precheck = func.precheck
476 else:
479 else:
477 func = _xmerge
480 func = _xmerge
478 trymerge = True
481 trymerge = True
479 onfailure = _("merging %s failed!\n")
482 onfailure = _("merging %s failed!\n")
480 precheck = None
483 precheck = None
481
484
482 toolconf = tool, toolpath, binary, symlink
485 toolconf = tool, toolpath, binary, symlink
483
486
484 if not trymerge:
487 if not trymerge:
485 return func(repo, mynode, orig, fcd, fco, fca, toolconf)
488 return func(repo, mynode, orig, fcd, fco, fca, toolconf)
486
489
487 a = repo.wjoin(fd)
490 a = repo.wjoin(fd)
488 b = temp("base", fca)
491 b = temp("base", fca)
489 c = temp("other", fco)
492 c = temp("other", fco)
490 back = a + ".orig"
493 back = a + ".orig"
491 util.copyfile(a, back)
494 util.copyfile(a, back)
492
495
493 if orig != fco.path():
496 if orig != fco.path():
494 ui.status(_("merging %s and %s to %s\n") % (orig, fco.path(), fd))
497 ui.status(_("merging %s and %s to %s\n") % (orig, fco.path(), fd))
495 else:
498 else:
496 ui.status(_("merging %s\n") % fd)
499 ui.status(_("merging %s\n") % fd)
497
500
498 ui.debug("my %s other %s ancestor %s\n" % (fcd, fco, fca))
501 ui.debug("my %s other %s ancestor %s\n" % (fcd, fco, fca))
499
502
500 r = 0
503 r = 0
501 if precheck and not precheck(repo, mynode, orig, fcd, fco, fca,
504 if precheck and not precheck(repo, mynode, orig, fcd, fco, fca,
502 toolconf):
505 toolconf):
503 r = 1
506 r = 1
504 needcheck = False
507 needcheck = False
505
508
506 if not r: # precheck passed
509 if not r: # precheck passed
507 markerstyle = ui.config('ui', 'mergemarkers', 'basic')
510 markerstyle = ui.config('ui', 'mergemarkers', 'basic')
508 if not labels:
511 if not labels:
509 labels = _defaultconflictlabels
512 labels = _defaultconflictlabels
510 if markerstyle != 'basic':
513 if markerstyle != 'basic':
511 labels = _formatlabels(repo, fcd, fco, fca, labels)
514 labels = _formatlabels(repo, fcd, fco, fca, labels)
512
515
513 needcheck, r = func(repo, mynode, orig, fcd, fco, fca, toolconf,
516 needcheck, r = func(repo, mynode, orig, fcd, fco, fca, toolconf,
514 (a, b, c, back), labels=labels)
517 (a, b, c, back), labels=labels)
515
518
516 if not needcheck:
519 if not needcheck:
517 if r:
520 if r:
518 if onfailure:
521 if onfailure:
519 ui.warn(onfailure % fd)
522 ui.warn(onfailure % fd)
520 else:
523 else:
521 util.unlink(back)
524 util.unlink(back)
522
525
523 util.unlink(b)
526 util.unlink(b)
524 util.unlink(c)
527 util.unlink(c)
525 return r
528 return r
526
529
527 if not r and (_toolbool(ui, tool, "checkconflicts") or
530 if not r and (_toolbool(ui, tool, "checkconflicts") or
528 'conflicts' in _toollist(ui, tool, "check")):
531 'conflicts' in _toollist(ui, tool, "check")):
529 if re.search("^(<<<<<<< .*|=======|>>>>>>> .*)$", fcd.data(),
532 if re.search("^(<<<<<<< .*|=======|>>>>>>> .*)$", fcd.data(),
530 re.MULTILINE):
533 re.MULTILINE):
531 r = 1
534 r = 1
532
535
533 checked = False
536 checked = False
534 if 'prompt' in _toollist(ui, tool, "check"):
537 if 'prompt' in _toollist(ui, tool, "check"):
535 checked = True
538 checked = True
536 if ui.promptchoice(_("was merge of '%s' successful (yn)?"
539 if ui.promptchoice(_("was merge of '%s' successful (yn)?"
537 "$$ &Yes $$ &No") % fd, 1):
540 "$$ &Yes $$ &No") % fd, 1):
538 r = 1
541 r = 1
539
542
540 if not r and not checked and (_toolbool(ui, tool, "checkchanged") or
543 if not r and not checked and (_toolbool(ui, tool, "checkchanged") or
541 'changed' in
544 'changed' in
542 _toollist(ui, tool, "check")):
545 _toollist(ui, tool, "check")):
543 if filecmp.cmp(a, back):
546 if filecmp.cmp(a, back):
544 if ui.promptchoice(_(" output file %s appears unchanged\n"
547 if ui.promptchoice(_(" output file %s appears unchanged\n"
545 "was merge successful (yn)?"
548 "was merge successful (yn)?"
546 "$$ &Yes $$ &No") % fd, 1):
549 "$$ &Yes $$ &No") % fd, 1):
547 r = 1
550 r = 1
548
551
549 if _toolbool(ui, tool, "fixeol"):
552 if _toolbool(ui, tool, "fixeol"):
550 _matcheol(a, back)
553 _matcheol(a, back)
551
554
552 if r:
555 if r:
553 if onfailure:
556 if onfailure:
554 ui.warn(onfailure % fd)
557 ui.warn(onfailure % fd)
555 else:
558 else:
556 util.unlink(back)
559 util.unlink(back)
557
560
558 util.unlink(b)
561 util.unlink(b)
559 util.unlink(c)
562 util.unlink(c)
560 return r
563 return r
561
564
562 # tell hggettext to extract docstrings from these functions:
565 # tell hggettext to extract docstrings from these functions:
563 i18nfunctions = internals.values()
566 i18nfunctions = internals.values()
@@ -1,652 +1,652
1 $ hg init basic
1 $ hg init basic
2 $ cd basic
2 $ cd basic
3
3
4 should complain
4 should complain
5
5
6 $ hg backout
6 $ hg backout
7 abort: please specify a revision to backout
7 abort: please specify a revision to backout
8 [255]
8 [255]
9 $ hg backout -r 0 0
9 $ hg backout -r 0 0
10 abort: please specify just one revision
10 abort: please specify just one revision
11 [255]
11 [255]
12
12
13 basic operation
13 basic operation
14 (this also tests that editor is invoked if the commit message is not
14 (this also tests that editor is invoked if the commit message is not
15 specified explicitly)
15 specified explicitly)
16
16
17 $ echo a > a
17 $ echo a > a
18 $ hg commit -d '0 0' -A -m a
18 $ hg commit -d '0 0' -A -m a
19 adding a
19 adding a
20 $ echo b >> a
20 $ echo b >> a
21 $ hg commit -d '1 0' -m b
21 $ hg commit -d '1 0' -m b
22
22
23 $ hg status --rev tip --rev "tip^1"
23 $ hg status --rev tip --rev "tip^1"
24 M a
24 M a
25 $ HGEDITOR=cat hg backout -d '2 0' tip --tool=true
25 $ HGEDITOR=cat hg backout -d '2 0' tip --tool=true
26 reverting a
26 reverting a
27 Backed out changeset a820f4f40a57
27 Backed out changeset a820f4f40a57
28
28
29
29
30 HG: Enter commit message. Lines beginning with 'HG:' are removed.
30 HG: Enter commit message. Lines beginning with 'HG:' are removed.
31 HG: Leave message empty to abort commit.
31 HG: Leave message empty to abort commit.
32 HG: --
32 HG: --
33 HG: user: test
33 HG: user: test
34 HG: branch 'default'
34 HG: branch 'default'
35 HG: changed a
35 HG: changed a
36 changeset 2:2929462c3dff backs out changeset 1:a820f4f40a57
36 changeset 2:2929462c3dff backs out changeset 1:a820f4f40a57
37 $ cat a
37 $ cat a
38 a
38 a
39 $ hg summary
39 $ hg summary
40 parent: 2:2929462c3dff tip
40 parent: 2:2929462c3dff tip
41 Backed out changeset a820f4f40a57
41 Backed out changeset a820f4f40a57
42 branch: default
42 branch: default
43 commit: (clean)
43 commit: (clean)
44 update: (current)
44 update: (current)
45 phases: 3 draft
45 phases: 3 draft
46
46
47 commit option
47 commit option
48
48
49 $ cd ..
49 $ cd ..
50 $ hg init commit
50 $ hg init commit
51 $ cd commit
51 $ cd commit
52
52
53 $ echo tomatoes > a
53 $ echo tomatoes > a
54 $ hg add a
54 $ hg add a
55 $ hg commit -d '0 0' -m tomatoes
55 $ hg commit -d '0 0' -m tomatoes
56
56
57 $ echo chair > b
57 $ echo chair > b
58 $ hg add b
58 $ hg add b
59 $ hg commit -d '1 0' -m chair
59 $ hg commit -d '1 0' -m chair
60
60
61 $ echo grapes >> a
61 $ echo grapes >> a
62 $ hg commit -d '2 0' -m grapes
62 $ hg commit -d '2 0' -m grapes
63
63
64 $ hg backout --commit -d '4 0' 1 --tool=:fail
64 $ hg backout --commit -d '4 0' 1 --tool=:fail
65 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
65 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
66 changeset 3:1c2161e97c0a backs out changeset 1:22cb4f70d813
66 changeset 3:1c2161e97c0a backs out changeset 1:22cb4f70d813
67 $ hg summary
67 $ hg summary
68 parent: 3:1c2161e97c0a tip
68 parent: 3:1c2161e97c0a tip
69 Backed out changeset 22cb4f70d813
69 Backed out changeset 22cb4f70d813
70 branch: default
70 branch: default
71 commit: (clean)
71 commit: (clean)
72 update: (current)
72 update: (current)
73 phases: 4 draft
73 phases: 4 draft
74
74
75 $ echo ypples > a
75 $ echo ypples > a
76 $ hg commit -d '5 0' -m ypples
76 $ hg commit -d '5 0' -m ypples
77
77
78 $ hg backout --commit -d '6 0' 2 --tool=:fail
78 $ hg backout --commit -d '6 0' 2 --tool=:fail
79 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
79 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
80 use 'hg resolve' to retry unresolved file merges
80 use 'hg resolve' to retry unresolved file merges
81 [1]
81 [1]
82 $ hg summary
82 $ hg summary
83 parent: 4:ed99997b793d tip
83 parent: 4:ed99997b793d tip
84 ypples
84 ypples
85 branch: default
85 branch: default
86 commit: 1 unresolved (clean)
86 commit: 1 unresolved (clean)
87 update: (current)
87 update: (current)
88 phases: 5 draft
88 phases: 5 draft
89
89
90 file that was removed is recreated
90 file that was removed is recreated
91 (this also tests that editor is not invoked if the commit message is
91 (this also tests that editor is not invoked if the commit message is
92 specified explicitly)
92 specified explicitly)
93
93
94 $ cd ..
94 $ cd ..
95 $ hg init remove
95 $ hg init remove
96 $ cd remove
96 $ cd remove
97
97
98 $ echo content > a
98 $ echo content > a
99 $ hg commit -d '0 0' -A -m a
99 $ hg commit -d '0 0' -A -m a
100 adding a
100 adding a
101
101
102 $ hg rm a
102 $ hg rm a
103 $ hg commit -d '1 0' -m b
103 $ hg commit -d '1 0' -m b
104
104
105 $ HGEDITOR=cat hg backout -d '2 0' tip --tool=true -m "Backed out changeset 76862dcce372"
105 $ HGEDITOR=cat hg backout -d '2 0' tip --tool=true -m "Backed out changeset 76862dcce372"
106 adding a
106 adding a
107 changeset 2:de31bdc76c0d backs out changeset 1:76862dcce372
107 changeset 2:de31bdc76c0d backs out changeset 1:76862dcce372
108 $ cat a
108 $ cat a
109 content
109 content
110 $ hg summary
110 $ hg summary
111 parent: 2:de31bdc76c0d tip
111 parent: 2:de31bdc76c0d tip
112 Backed out changeset 76862dcce372
112 Backed out changeset 76862dcce372
113 branch: default
113 branch: default
114 commit: (clean)
114 commit: (clean)
115 update: (current)
115 update: (current)
116 phases: 3 draft
116 phases: 3 draft
117
117
118 backout of backout is as if nothing happened
118 backout of backout is as if nothing happened
119
119
120 $ hg backout -d '3 0' --merge tip --tool=true
120 $ hg backout -d '3 0' --merge tip --tool=true
121 removing a
121 removing a
122 changeset 3:7f6d0f120113 backs out changeset 2:de31bdc76c0d
122 changeset 3:7f6d0f120113 backs out changeset 2:de31bdc76c0d
123 $ test -f a
123 $ test -f a
124 [1]
124 [1]
125 $ hg summary
125 $ hg summary
126 parent: 3:7f6d0f120113 tip
126 parent: 3:7f6d0f120113 tip
127 Backed out changeset de31bdc76c0d
127 Backed out changeset de31bdc76c0d
128 branch: default
128 branch: default
129 commit: (clean)
129 commit: (clean)
130 update: (current)
130 update: (current)
131 phases: 4 draft
131 phases: 4 draft
132
132
133 Test that 'hg rollback' restores dirstate just before opening
133 Test that 'hg rollback' restores dirstate just before opening
134 transaction: in-memory dirstate changes should be written into
134 transaction: in-memory dirstate changes should be written into
135 '.hg/journal.dirstate' as expected.
135 '.hg/journal.dirstate' as expected.
136
136
137 $ echo 'removed soon' > b
137 $ echo 'removed soon' > b
138 $ hg commit -A -d '4 0' -m 'prepare for subsequent removing'
138 $ hg commit -A -d '4 0' -m 'prepare for subsequent removing'
139 adding b
139 adding b
140 $ echo 'newly added' > c
140 $ echo 'newly added' > c
141 $ hg add c
141 $ hg add c
142 $ hg remove b
142 $ hg remove b
143 $ hg commit -d '5 0' -m 'prepare for subsequent backout'
143 $ hg commit -d '5 0' -m 'prepare for subsequent backout'
144 $ touch -t 200001010000 c
144 $ touch -t 200001010000 c
145 $ hg status -A
145 $ hg status -A
146 C c
146 C c
147 $ hg debugstate --nodates
147 $ hg debugstate --nodates
148 n 644 12 set c
148 n 644 12 set c
149 $ hg backout -d '6 0' -m 'to be rollback-ed soon' -r .
149 $ hg backout -d '6 0' -m 'to be rollback-ed soon' -r .
150 adding b
150 adding b
151 removing c
151 removing c
152 changeset 6:4bfec048029d backs out changeset 5:fac0b729a654
152 changeset 6:4bfec048029d backs out changeset 5:fac0b729a654
153 $ hg rollback -q
153 $ hg rollback -q
154 $ hg status -A
154 $ hg status -A
155 A b
155 A b
156 R c
156 R c
157 $ hg debugstate --nodates
157 $ hg debugstate --nodates
158 a 0 -1 unset b
158 a 0 -1 unset b
159 r 0 0 set c
159 r 0 0 set c
160
160
161 across branch
161 across branch
162
162
163 $ cd ..
163 $ cd ..
164 $ hg init branch
164 $ hg init branch
165 $ cd branch
165 $ cd branch
166 $ echo a > a
166 $ echo a > a
167 $ hg ci -Am0
167 $ hg ci -Am0
168 adding a
168 adding a
169 $ echo b > b
169 $ echo b > b
170 $ hg ci -Am1
170 $ hg ci -Am1
171 adding b
171 adding b
172 $ hg co -C 0
172 $ hg co -C 0
173 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
173 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
174 $ hg summary
174 $ hg summary
175 parent: 0:f7b1eb17ad24
175 parent: 0:f7b1eb17ad24
176 0
176 0
177 branch: default
177 branch: default
178 commit: (clean)
178 commit: (clean)
179 update: 1 new changesets (update)
179 update: 1 new changesets (update)
180 phases: 2 draft
180 phases: 2 draft
181
181
182 should fail
182 should fail
183
183
184 $ hg backout 1
184 $ hg backout 1
185 abort: cannot backout change that is not an ancestor
185 abort: cannot backout change that is not an ancestor
186 [255]
186 [255]
187 $ echo c > c
187 $ echo c > c
188 $ hg ci -Am2
188 $ hg ci -Am2
189 adding c
189 adding c
190 created new head
190 created new head
191 $ hg summary
191 $ hg summary
192 parent: 2:db815d6d32e6 tip
192 parent: 2:db815d6d32e6 tip
193 2
193 2
194 branch: default
194 branch: default
195 commit: (clean)
195 commit: (clean)
196 update: 1 new changesets, 2 branch heads (merge)
196 update: 1 new changesets, 2 branch heads (merge)
197 phases: 3 draft
197 phases: 3 draft
198
198
199 should fail
199 should fail
200
200
201 $ hg backout 1
201 $ hg backout 1
202 abort: cannot backout change that is not an ancestor
202 abort: cannot backout change that is not an ancestor
203 [255]
203 [255]
204 $ hg summary
204 $ hg summary
205 parent: 2:db815d6d32e6 tip
205 parent: 2:db815d6d32e6 tip
206 2
206 2
207 branch: default
207 branch: default
208 commit: (clean)
208 commit: (clean)
209 update: 1 new changesets, 2 branch heads (merge)
209 update: 1 new changesets, 2 branch heads (merge)
210 phases: 3 draft
210 phases: 3 draft
211
211
212 backout with merge
212 backout with merge
213
213
214 $ cd ..
214 $ cd ..
215 $ hg init merge
215 $ hg init merge
216 $ cd merge
216 $ cd merge
217
217
218 $ echo line 1 > a
218 $ echo line 1 > a
219 $ echo line 2 >> a
219 $ echo line 2 >> a
220 $ hg commit -d '0 0' -A -m a
220 $ hg commit -d '0 0' -A -m a
221 adding a
221 adding a
222 $ hg summary
222 $ hg summary
223 parent: 0:59395513a13a tip
223 parent: 0:59395513a13a tip
224 a
224 a
225 branch: default
225 branch: default
226 commit: (clean)
226 commit: (clean)
227 update: (current)
227 update: (current)
228 phases: 1 draft
228 phases: 1 draft
229
229
230 remove line 1
230 remove line 1
231
231
232 $ echo line 2 > a
232 $ echo line 2 > a
233 $ hg commit -d '1 0' -m b
233 $ hg commit -d '1 0' -m b
234
234
235 $ echo line 3 >> a
235 $ echo line 3 >> a
236 $ hg commit -d '2 0' -m c
236 $ hg commit -d '2 0' -m c
237
237
238 $ hg backout --merge -d '3 0' 1 --tool=true
238 $ hg backout --merge -d '3 0' 1 --tool=true
239 reverting a
239 reverting a
240 created new head
240 created new head
241 changeset 3:26b8ccb9ad91 backs out changeset 1:5a50a024c182
241 changeset 3:26b8ccb9ad91 backs out changeset 1:5a50a024c182
242 merging with changeset 3:26b8ccb9ad91
242 merging with changeset 3:26b8ccb9ad91
243 merging a
243 merging a
244 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
244 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
245 (branch merge, don't forget to commit)
245 (branch merge, don't forget to commit)
246 $ hg commit -d '4 0' -m d
246 $ hg commit -d '4 0' -m d
247 $ hg summary
247 $ hg summary
248 parent: 4:c7df5e0b9c09 tip
248 parent: 4:c7df5e0b9c09 tip
249 d
249 d
250 branch: default
250 branch: default
251 commit: (clean)
251 commit: (clean)
252 update: (current)
252 update: (current)
253 phases: 5 draft
253 phases: 5 draft
254
254
255 check line 1 is back
255 check line 1 is back
256
256
257 $ cat a
257 $ cat a
258 line 1
258 line 1
259 line 2
259 line 2
260 line 3
260 line 3
261
261
262 $ cd ..
262 $ cd ..
263
263
264 backout should not back out subsequent changesets
264 backout should not back out subsequent changesets
265
265
266 $ hg init onecs
266 $ hg init onecs
267 $ cd onecs
267 $ cd onecs
268 $ echo 1 > a
268 $ echo 1 > a
269 $ hg commit -d '0 0' -A -m a
269 $ hg commit -d '0 0' -A -m a
270 adding a
270 adding a
271 $ echo 2 >> a
271 $ echo 2 >> a
272 $ hg commit -d '1 0' -m b
272 $ hg commit -d '1 0' -m b
273 $ echo 1 > b
273 $ echo 1 > b
274 $ hg commit -d '2 0' -A -m c
274 $ hg commit -d '2 0' -A -m c
275 adding b
275 adding b
276 $ hg summary
276 $ hg summary
277 parent: 2:882396649954 tip
277 parent: 2:882396649954 tip
278 c
278 c
279 branch: default
279 branch: default
280 commit: (clean)
280 commit: (clean)
281 update: (current)
281 update: (current)
282 phases: 3 draft
282 phases: 3 draft
283
283
284 without --merge
284 without --merge
285 $ hg backout -d '3 0' 1 --tool=true
285 $ hg backout -d '3 0' 1 --tool=true
286 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
286 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
287 changeset 22bca4c721e5 backed out, don't forget to commit.
287 changeset 22bca4c721e5 backed out, don't forget to commit.
288 $ hg locate b
288 $ hg locate b
289 b
289 b
290 $ hg update -C tip
290 $ hg update -C tip
291 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
291 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
292 $ hg locate b
292 $ hg locate b
293 b
293 b
294 $ hg summary
294 $ hg summary
295 parent: 2:882396649954 tip
295 parent: 2:882396649954 tip
296 c
296 c
297 branch: default
297 branch: default
298 commit: (clean)
298 commit: (clean)
299 update: (current)
299 update: (current)
300 phases: 3 draft
300 phases: 3 draft
301
301
302 with --merge
302 with --merge
303 $ hg backout --merge -d '3 0' 1 --tool=true
303 $ hg backout --merge -d '3 0' 1 --tool=true
304 reverting a
304 reverting a
305 created new head
305 created new head
306 changeset 3:3202beb76721 backs out changeset 1:22bca4c721e5
306 changeset 3:3202beb76721 backs out changeset 1:22bca4c721e5
307 merging with changeset 3:3202beb76721
307 merging with changeset 3:3202beb76721
308 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
308 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
309 (branch merge, don't forget to commit)
309 (branch merge, don't forget to commit)
310 $ hg locate b
310 $ hg locate b
311 b
311 b
312 $ hg update -C tip
312 $ hg update -C tip
313 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
313 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
314 $ hg locate b
314 $ hg locate b
315 [1]
315 [1]
316
316
317 $ cd ..
317 $ cd ..
318 $ hg init m
318 $ hg init m
319 $ cd m
319 $ cd m
320 $ echo a > a
320 $ echo a > a
321 $ hg commit -d '0 0' -A -m a
321 $ hg commit -d '0 0' -A -m a
322 adding a
322 adding a
323 $ echo b > b
323 $ echo b > b
324 $ hg commit -d '1 0' -A -m b
324 $ hg commit -d '1 0' -A -m b
325 adding b
325 adding b
326 $ echo c > c
326 $ echo c > c
327 $ hg commit -d '2 0' -A -m b
327 $ hg commit -d '2 0' -A -m b
328 adding c
328 adding c
329 $ hg update 1
329 $ hg update 1
330 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
330 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
331 $ echo d > d
331 $ echo d > d
332 $ hg commit -d '3 0' -A -m c
332 $ hg commit -d '3 0' -A -m c
333 adding d
333 adding d
334 created new head
334 created new head
335 $ hg merge 2
335 $ hg merge 2
336 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
336 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
337 (branch merge, don't forget to commit)
337 (branch merge, don't forget to commit)
338 $ hg commit -d '4 0' -A -m d
338 $ hg commit -d '4 0' -A -m d
339 $ hg summary
339 $ hg summary
340 parent: 4:b2f3bb92043e tip
340 parent: 4:b2f3bb92043e tip
341 d
341 d
342 branch: default
342 branch: default
343 commit: (clean)
343 commit: (clean)
344 update: (current)
344 update: (current)
345 phases: 5 draft
345 phases: 5 draft
346
346
347 backout of merge should fail
347 backout of merge should fail
348
348
349 $ hg backout 4
349 $ hg backout 4
350 abort: cannot backout a merge changeset
350 abort: cannot backout a merge changeset
351 [255]
351 [255]
352
352
353 backout of merge with bad parent should fail
353 backout of merge with bad parent should fail
354
354
355 $ hg backout --parent 0 4
355 $ hg backout --parent 0 4
356 abort: cb9a9f314b8b is not a parent of b2f3bb92043e
356 abort: cb9a9f314b8b is not a parent of b2f3bb92043e
357 [255]
357 [255]
358
358
359 backout of non-merge with parent should fail
359 backout of non-merge with parent should fail
360
360
361 $ hg backout --parent 0 3
361 $ hg backout --parent 0 3
362 abort: cannot use --parent on non-merge changeset
362 abort: cannot use --parent on non-merge changeset
363 [255]
363 [255]
364
364
365 backout with valid parent should be ok
365 backout with valid parent should be ok
366
366
367 $ hg backout -d '5 0' --parent 2 4 --tool=true
367 $ hg backout -d '5 0' --parent 2 4 --tool=true
368 removing d
368 removing d
369 changeset 5:10e5328c8435 backs out changeset 4:b2f3bb92043e
369 changeset 5:10e5328c8435 backs out changeset 4:b2f3bb92043e
370 $ hg summary
370 $ hg summary
371 parent: 5:10e5328c8435 tip
371 parent: 5:10e5328c8435 tip
372 Backed out changeset b2f3bb92043e
372 Backed out changeset b2f3bb92043e
373 branch: default
373 branch: default
374 commit: (clean)
374 commit: (clean)
375 update: (current)
375 update: (current)
376 phases: 6 draft
376 phases: 6 draft
377
377
378 $ hg rollback
378 $ hg rollback
379 repository tip rolled back to revision 4 (undo commit)
379 repository tip rolled back to revision 4 (undo commit)
380 working directory now based on revision 4
380 working directory now based on revision 4
381 $ hg update -C
381 $ hg update -C
382 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
382 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
383 $ hg summary
383 $ hg summary
384 parent: 4:b2f3bb92043e tip
384 parent: 4:b2f3bb92043e tip
385 d
385 d
386 branch: default
386 branch: default
387 commit: (clean)
387 commit: (clean)
388 update: (current)
388 update: (current)
389 phases: 5 draft
389 phases: 5 draft
390
390
391 $ hg backout -d '6 0' --parent 3 4 --tool=true
391 $ hg backout -d '6 0' --parent 3 4 --tool=true
392 removing c
392 removing c
393 changeset 5:033590168430 backs out changeset 4:b2f3bb92043e
393 changeset 5:033590168430 backs out changeset 4:b2f3bb92043e
394 $ hg summary
394 $ hg summary
395 parent: 5:033590168430 tip
395 parent: 5:033590168430 tip
396 Backed out changeset b2f3bb92043e
396 Backed out changeset b2f3bb92043e
397 branch: default
397 branch: default
398 commit: (clean)
398 commit: (clean)
399 update: (current)
399 update: (current)
400 phases: 6 draft
400 phases: 6 draft
401
401
402 $ cd ..
402 $ cd ..
403
403
404 named branches
404 named branches
405
405
406 $ hg init named_branches
406 $ hg init named_branches
407 $ cd named_branches
407 $ cd named_branches
408
408
409 $ echo default > default
409 $ echo default > default
410 $ hg ci -d '0 0' -Am default
410 $ hg ci -d '0 0' -Am default
411 adding default
411 adding default
412 $ hg branch branch1
412 $ hg branch branch1
413 marked working directory as branch branch1
413 marked working directory as branch branch1
414 (branches are permanent and global, did you want a bookmark?)
414 (branches are permanent and global, did you want a bookmark?)
415 $ echo branch1 > file1
415 $ echo branch1 > file1
416 $ hg ci -d '1 0' -Am file1
416 $ hg ci -d '1 0' -Am file1
417 adding file1
417 adding file1
418 $ hg branch branch2
418 $ hg branch branch2
419 marked working directory as branch branch2
419 marked working directory as branch branch2
420 $ echo branch2 > file2
420 $ echo branch2 > file2
421 $ hg ci -d '2 0' -Am file2
421 $ hg ci -d '2 0' -Am file2
422 adding file2
422 adding file2
423
423
424 without --merge
424 without --merge
425 $ hg backout -r 1 --tool=true
425 $ hg backout -r 1 --tool=true
426 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
426 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
427 changeset bf1602f437f3 backed out, don't forget to commit.
427 changeset bf1602f437f3 backed out, don't forget to commit.
428 $ hg branch
428 $ hg branch
429 branch2
429 branch2
430 $ hg status -A
430 $ hg status -A
431 R file1
431 R file1
432 C default
432 C default
433 C file2
433 C file2
434 $ hg summary
434 $ hg summary
435 parent: 2:45bbcd363bf0 tip
435 parent: 2:45bbcd363bf0 tip
436 file2
436 file2
437 branch: branch2
437 branch: branch2
438 commit: 1 removed
438 commit: 1 removed
439 update: (current)
439 update: (current)
440 phases: 3 draft
440 phases: 3 draft
441
441
442 with --merge
442 with --merge
443 (this also tests that editor is invoked if '--edit' is specified
443 (this also tests that editor is invoked if '--edit' is specified
444 explicitly regardless of '--message')
444 explicitly regardless of '--message')
445
445
446 $ hg update -qC
446 $ hg update -qC
447 $ HGEDITOR=cat hg backout --merge -d '3 0' -r 1 -m 'backout on branch1' --tool=true --edit
447 $ HGEDITOR=cat hg backout --merge -d '3 0' -r 1 -m 'backout on branch1' --tool=true --edit
448 removing file1
448 removing file1
449 backout on branch1
449 backout on branch1
450
450
451
451
452 HG: Enter commit message. Lines beginning with 'HG:' are removed.
452 HG: Enter commit message. Lines beginning with 'HG:' are removed.
453 HG: Leave message empty to abort commit.
453 HG: Leave message empty to abort commit.
454 HG: --
454 HG: --
455 HG: user: test
455 HG: user: test
456 HG: branch 'branch2'
456 HG: branch 'branch2'
457 HG: removed file1
457 HG: removed file1
458 created new head
458 created new head
459 changeset 3:d4e8f6db59fb backs out changeset 1:bf1602f437f3
459 changeset 3:d4e8f6db59fb backs out changeset 1:bf1602f437f3
460 merging with changeset 3:d4e8f6db59fb
460 merging with changeset 3:d4e8f6db59fb
461 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
461 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
462 (branch merge, don't forget to commit)
462 (branch merge, don't forget to commit)
463 $ hg summary
463 $ hg summary
464 parent: 2:45bbcd363bf0
464 parent: 2:45bbcd363bf0
465 file2
465 file2
466 parent: 3:d4e8f6db59fb tip
466 parent: 3:d4e8f6db59fb tip
467 backout on branch1
467 backout on branch1
468 branch: branch2
468 branch: branch2
469 commit: 1 removed (merge)
469 commit: 1 removed (merge)
470 update: (current)
470 update: (current)
471 phases: 4 draft
471 phases: 4 draft
472 $ hg update -q -C 2
472 $ hg update -q -C 2
473
473
474 on branch2 with branch1 not merged, so file1 should still exist:
474 on branch2 with branch1 not merged, so file1 should still exist:
475
475
476 $ hg id
476 $ hg id
477 45bbcd363bf0 (branch2)
477 45bbcd363bf0 (branch2)
478 $ hg st -A
478 $ hg st -A
479 C default
479 C default
480 C file1
480 C file1
481 C file2
481 C file2
482 $ hg summary
482 $ hg summary
483 parent: 2:45bbcd363bf0
483 parent: 2:45bbcd363bf0
484 file2
484 file2
485 branch: branch2
485 branch: branch2
486 commit: (clean)
486 commit: (clean)
487 update: 1 new changesets, 2 branch heads (merge)
487 update: 1 new changesets, 2 branch heads (merge)
488 phases: 4 draft
488 phases: 4 draft
489
489
490 on branch2 with branch1 merged, so file1 should be gone:
490 on branch2 with branch1 merged, so file1 should be gone:
491
491
492 $ hg merge
492 $ hg merge
493 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
493 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
494 (branch merge, don't forget to commit)
494 (branch merge, don't forget to commit)
495 $ hg ci -d '4 0' -m 'merge backout of branch1'
495 $ hg ci -d '4 0' -m 'merge backout of branch1'
496 $ hg id
496 $ hg id
497 22149cdde76d (branch2) tip
497 22149cdde76d (branch2) tip
498 $ hg st -A
498 $ hg st -A
499 C default
499 C default
500 C file2
500 C file2
501 $ hg summary
501 $ hg summary
502 parent: 4:22149cdde76d tip
502 parent: 4:22149cdde76d tip
503 merge backout of branch1
503 merge backout of branch1
504 branch: branch2
504 branch: branch2
505 commit: (clean)
505 commit: (clean)
506 update: (current)
506 update: (current)
507 phases: 5 draft
507 phases: 5 draft
508
508
509 on branch1, so no file1 and file2:
509 on branch1, so no file1 and file2:
510
510
511 $ hg co -C branch1
511 $ hg co -C branch1
512 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
512 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
513 $ hg id
513 $ hg id
514 bf1602f437f3 (branch1)
514 bf1602f437f3 (branch1)
515 $ hg st -A
515 $ hg st -A
516 C default
516 C default
517 C file1
517 C file1
518 $ hg summary
518 $ hg summary
519 parent: 1:bf1602f437f3
519 parent: 1:bf1602f437f3
520 file1
520 file1
521 branch: branch1
521 branch: branch1
522 commit: (clean)
522 commit: (clean)
523 update: (current)
523 update: (current)
524 phases: 5 draft
524 phases: 5 draft
525
525
526 $ cd ..
526 $ cd ..
527
527
528 backout of empty changeset (issue4190)
528 backout of empty changeset (issue4190)
529
529
530 $ hg init emptycommit
530 $ hg init emptycommit
531 $ cd emptycommit
531 $ cd emptycommit
532
532
533 $ touch file1
533 $ touch file1
534 $ hg ci -Aqm file1
534 $ hg ci -Aqm file1
535 $ hg branch -q branch1
535 $ hg branch -q branch1
536 $ hg ci -qm branch1
536 $ hg ci -qm branch1
537 $ hg backout -v 1
537 $ hg backout -v 1
538 resolving manifests
538 resolving manifests
539 nothing changed
539 nothing changed
540 [1]
540 [1]
541
541
542 $ cd ..
542 $ cd ..
543
543
544
544
545 Test usage of `hg resolve` in case of conflict
545 Test usage of `hg resolve` in case of conflict
546 (issue4163)
546 (issue4163)
547
547
548 $ hg init issue4163
548 $ hg init issue4163
549 $ cd issue4163
549 $ cd issue4163
550 $ touch foo
550 $ touch foo
551 $ hg add foo
551 $ hg add foo
552 $ cat > foo << EOF
552 $ cat > foo << EOF
553 > one
553 > one
554 > two
554 > two
555 > three
555 > three
556 > four
556 > four
557 > five
557 > five
558 > six
558 > six
559 > seven
559 > seven
560 > height
560 > height
561 > nine
561 > nine
562 > ten
562 > ten
563 > EOF
563 > EOF
564 $ hg ci -m 'initial'
564 $ hg ci -m 'initial'
565 $ cat > foo << EOF
565 $ cat > foo << EOF
566 > one
566 > one
567 > two
567 > two
568 > THREE
568 > THREE
569 > four
569 > four
570 > five
570 > five
571 > six
571 > six
572 > seven
572 > seven
573 > height
573 > height
574 > nine
574 > nine
575 > ten
575 > ten
576 > EOF
576 > EOF
577 $ hg ci -m 'capital three'
577 $ hg ci -m 'capital three'
578 $ cat > foo << EOF
578 $ cat > foo << EOF
579 > one
579 > one
580 > two
580 > two
581 > THREE
581 > THREE
582 > four
582 > four
583 > five
583 > five
584 > six
584 > six
585 > seven
585 > seven
586 > height
586 > height
587 > nine
587 > nine
588 > TEN
588 > TEN
589 > EOF
589 > EOF
590 $ hg ci -m 'capital ten'
590 $ hg ci -m 'capital ten'
591 $ hg backout -r 'desc("capital three")' --tool internal:fail
591 $ hg backout -r 'desc("capital three")' --tool internal:fail
592 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
592 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
593 use 'hg resolve' to retry unresolved file merges
593 use 'hg resolve' to retry unresolved file merges
594 [1]
594 [1]
595 $ hg status
595 $ hg status
596 $ hg debugmergestate
596 $ hg debugmergestate
597 * version 2 records
597 * version 2 records
598 local: b71750c4b0fdf719734971e3ef90dbeab5919a2d
598 local: b71750c4b0fdf719734971e3ef90dbeab5919a2d
599 other: a30dd8addae3ce71b8667868478542bc417439e6
599 other: a30dd8addae3ce71b8667868478542bc417439e6
600 file: foo (state "u", hash 0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33)
600 file: foo (state "u", hash 0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33)
601 local path: foo (flags "")
601 local path: foo (flags "")
602 ancestor path: foo (node f89532f44c247a0e993d63e3a734dd781ab04708)
602 ancestor path: foo (node f89532f44c247a0e993d63e3a734dd781ab04708)
603 other path: foo (node f50039b486d6fa1a90ae51778388cad161f425ee)
603 other path: foo (node f50039b486d6fa1a90ae51778388cad161f425ee)
604 $ mv .hg/merge/state2 .hg/merge/state2-moved
604 $ mv .hg/merge/state2 .hg/merge/state2-moved
605 $ hg debugmergestate
605 $ hg debugmergestate
606 * version 1 records
606 * version 1 records
607 local: b71750c4b0fdf719734971e3ef90dbeab5919a2d
607 local: b71750c4b0fdf719734971e3ef90dbeab5919a2d
608 file: foo (state "u", hash 0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33)
608 file: foo (state "u", hash 0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33)
609 local path: foo (flags "")
609 local path: foo (flags "")
610 ancestor path: foo (node f89532f44c247a0e993d63e3a734dd781ab04708)
610 ancestor path: foo (node f89532f44c247a0e993d63e3a734dd781ab04708)
611 other path: foo (node not stored in v1 format)
611 other path: foo (node not stored in v1 format)
612 $ mv .hg/merge/state2-moved .hg/merge/state2
612 $ mv .hg/merge/state2-moved .hg/merge/state2
613 $ hg resolve -l # still unresolved
613 $ hg resolve -l # still unresolved
614 U foo
614 U foo
615 $ hg summary
615 $ hg summary
616 parent: 2:b71750c4b0fd tip
616 parent: 2:b71750c4b0fd tip
617 capital ten
617 capital ten
618 branch: default
618 branch: default
619 commit: 1 unresolved (clean)
619 commit: 1 unresolved (clean)
620 update: (current)
620 update: (current)
621 phases: 3 draft
621 phases: 3 draft
622 $ hg resolve --all --debug
622 $ hg resolve --all --debug
623 picked tool 'internal:merge' for foo (binary False symlink False)
623 picked tool ':merge' for foo (binary False symlink False)
624 merging foo
624 merging foo
625 my foo@b71750c4b0fd+ other foo@a30dd8addae3 ancestor foo@913609522437
625 my foo@b71750c4b0fd+ other foo@a30dd8addae3 ancestor foo@913609522437
626 premerge successful
626 premerge successful
627 (no more unresolved files)
627 (no more unresolved files)
628 $ hg status
628 $ hg status
629 M foo
629 M foo
630 ? foo.orig
630 ? foo.orig
631 $ hg resolve -l
631 $ hg resolve -l
632 R foo
632 R foo
633 $ hg summary
633 $ hg summary
634 parent: 2:b71750c4b0fd tip
634 parent: 2:b71750c4b0fd tip
635 capital ten
635 capital ten
636 branch: default
636 branch: default
637 commit: 1 modified, 1 unknown
637 commit: 1 modified, 1 unknown
638 update: (current)
638 update: (current)
639 phases: 3 draft
639 phases: 3 draft
640 $ cat foo
640 $ cat foo
641 one
641 one
642 two
642 two
643 three
643 three
644 four
644 four
645 five
645 five
646 six
646 six
647 seven
647 seven
648 height
648 height
649 nine
649 nine
650 TEN
650 TEN
651
651
652
652
@@ -1,165 +1,165
1 $ hg init t
1 $ hg init t
2 $ cd t
2 $ cd t
3
3
4 $ echo 1 > a
4 $ echo 1 > a
5 $ hg ci -qAm "first"
5 $ hg ci -qAm "first"
6
6
7 $ hg cp a b
7 $ hg cp a b
8 $ hg mv a c
8 $ hg mv a c
9 $ echo 2 >> b
9 $ echo 2 >> b
10 $ echo 2 >> c
10 $ echo 2 >> c
11
11
12 $ hg ci -qAm "second"
12 $ hg ci -qAm "second"
13
13
14 $ hg co -C 0
14 $ hg co -C 0
15 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
15 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
16
16
17 $ echo 0 > a
17 $ echo 0 > a
18 $ echo 1 >> a
18 $ echo 1 >> a
19
19
20 $ hg ci -qAm "other"
20 $ hg ci -qAm "other"
21
21
22 $ hg merge --debug
22 $ hg merge --debug
23 searching for copies back to rev 1
23 searching for copies back to rev 1
24 unmatched files in other:
24 unmatched files in other:
25 b
25 b
26 c
26 c
27 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
27 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
28 src: 'a' -> dst: 'b' *
28 src: 'a' -> dst: 'b' *
29 src: 'a' -> dst: 'c' *
29 src: 'a' -> dst: 'c' *
30 checking for directory renames
30 checking for directory renames
31 resolving manifests
31 resolving manifests
32 branchmerge: True, force: False, partial: False
32 branchmerge: True, force: False, partial: False
33 ancestor: b8bf91eeebbc, local: add3f11052fa+, remote: 17c05bb7fcb6
33 ancestor: b8bf91eeebbc, local: add3f11052fa+, remote: 17c05bb7fcb6
34 preserving a for resolve of b
34 preserving a for resolve of b
35 preserving a for resolve of c
35 preserving a for resolve of c
36 removing a
36 removing a
37 b: remote moved from a -> m
37 b: remote moved from a -> m
38 picked tool 'internal:merge' for b (binary False symlink False)
38 picked tool ':merge' for b (binary False symlink False)
39 merging a and b to b
39 merging a and b to b
40 my b@add3f11052fa+ other b@17c05bb7fcb6 ancestor a@b8bf91eeebbc
40 my b@add3f11052fa+ other b@17c05bb7fcb6 ancestor a@b8bf91eeebbc
41 premerge successful
41 premerge successful
42 c: remote moved from a -> m
42 c: remote moved from a -> m
43 picked tool 'internal:merge' for c (binary False symlink False)
43 picked tool ':merge' for c (binary False symlink False)
44 merging a and c to c
44 merging a and c to c
45 my c@add3f11052fa+ other c@17c05bb7fcb6 ancestor a@b8bf91eeebbc
45 my c@add3f11052fa+ other c@17c05bb7fcb6 ancestor a@b8bf91eeebbc
46 premerge successful
46 premerge successful
47 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
47 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
48 (branch merge, don't forget to commit)
48 (branch merge, don't forget to commit)
49
49
50 file b
50 file b
51 $ cat b
51 $ cat b
52 0
52 0
53 1
53 1
54 2
54 2
55
55
56 file c
56 file c
57 $ cat c
57 $ cat c
58 0
58 0
59 1
59 1
60 2
60 2
61
61
62 Test disabling copy tracing
62 Test disabling copy tracing
63
63
64 - first verify copy metadata was kept
64 - first verify copy metadata was kept
65
65
66 $ hg up -qC 2
66 $ hg up -qC 2
67 $ hg rebase --keep -d 1 -b 2 --config extensions.rebase=
67 $ hg rebase --keep -d 1 -b 2 --config extensions.rebase=
68 rebasing 2:add3f11052fa "other" (tip)
68 rebasing 2:add3f11052fa "other" (tip)
69 merging b and a to b
69 merging b and a to b
70 merging c and a to c
70 merging c and a to c
71
71
72 $ cat b
72 $ cat b
73 0
73 0
74 1
74 1
75 2
75 2
76
76
77 - next verify copy metadata is lost when disabled
77 - next verify copy metadata is lost when disabled
78
78
79 $ hg strip -r . --config extensions.strip=
79 $ hg strip -r . --config extensions.strip=
80 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
80 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
81 saved backup bundle to $TESTTMP/t/.hg/strip-backup/550bd84c0cd3-fc575957-backup.hg (glob)
81 saved backup bundle to $TESTTMP/t/.hg/strip-backup/550bd84c0cd3-fc575957-backup.hg (glob)
82 $ hg up -qC 2
82 $ hg up -qC 2
83 $ hg rebase --keep -d 1 -b 2 --config extensions.rebase= --config experimental.disablecopytrace=True
83 $ hg rebase --keep -d 1 -b 2 --config extensions.rebase= --config experimental.disablecopytrace=True
84 rebasing 2:add3f11052fa "other" (tip)
84 rebasing 2:add3f11052fa "other" (tip)
85 remote changed a which local deleted
85 remote changed a which local deleted
86 use (c)hanged version or leave (d)eleted? c
86 use (c)hanged version or leave (d)eleted? c
87
87
88 $ cat b
88 $ cat b
89 1
89 1
90 2
90 2
91
91
92 $ cd ..
92 $ cd ..
93
93
94 Verify disabling copy tracing still keeps copies from rebase source
94 Verify disabling copy tracing still keeps copies from rebase source
95
95
96 $ hg init copydisable
96 $ hg init copydisable
97 $ cd copydisable
97 $ cd copydisable
98 $ touch a
98 $ touch a
99 $ hg ci -Aqm 'add a'
99 $ hg ci -Aqm 'add a'
100 $ touch b
100 $ touch b
101 $ hg ci -Aqm 'add b, c'
101 $ hg ci -Aqm 'add b, c'
102 $ hg cp b x
102 $ hg cp b x
103 $ echo x >> x
103 $ echo x >> x
104 $ hg ci -qm 'copy b->x'
104 $ hg ci -qm 'copy b->x'
105 $ hg up -q 1
105 $ hg up -q 1
106 $ touch z
106 $ touch z
107 $ hg ci -Aqm 'add z'
107 $ hg ci -Aqm 'add z'
108 $ hg log -G -T '{rev} {desc}\n'
108 $ hg log -G -T '{rev} {desc}\n'
109 @ 3 add z
109 @ 3 add z
110 |
110 |
111 | o 2 copy b->x
111 | o 2 copy b->x
112 |/
112 |/
113 o 1 add b, c
113 o 1 add b, c
114 |
114 |
115 o 0 add a
115 o 0 add a
116
116
117 $ hg rebase -d . -b 2 --config extensions.rebase= --config experimental.disablecopytrace=True
117 $ hg rebase -d . -b 2 --config extensions.rebase= --config experimental.disablecopytrace=True
118 rebasing 2:6adcf8c12e7d "copy b->x"
118 rebasing 2:6adcf8c12e7d "copy b->x"
119 saved backup bundle to $TESTTMP/copydisable/.hg/strip-backup/6adcf8c12e7d-ce4b3e75-backup.hg (glob)
119 saved backup bundle to $TESTTMP/copydisable/.hg/strip-backup/6adcf8c12e7d-ce4b3e75-backup.hg (glob)
120 $ hg up -q 3
120 $ hg up -q 3
121 $ hg log -f x -T '{rev} {desc}\n'
121 $ hg log -f x -T '{rev} {desc}\n'
122 3 copy b->x
122 3 copy b->x
123 1 add b, c
123 1 add b, c
124
124
125 $ cd ../
125 $ cd ../
126
126
127 Verify we duplicate existing copies, instead of detecting them
127 Verify we duplicate existing copies, instead of detecting them
128
128
129 $ hg init copydisable3
129 $ hg init copydisable3
130 $ cd copydisable3
130 $ cd copydisable3
131 $ touch a
131 $ touch a
132 $ hg ci -Aqm 'add a'
132 $ hg ci -Aqm 'add a'
133 $ hg cp a b
133 $ hg cp a b
134 $ hg ci -Aqm 'copy a->b'
134 $ hg ci -Aqm 'copy a->b'
135 $ hg mv b c
135 $ hg mv b c
136 $ hg ci -Aqm 'move b->c'
136 $ hg ci -Aqm 'move b->c'
137 $ hg up -q 0
137 $ hg up -q 0
138 $ hg cp a b
138 $ hg cp a b
139 $ echo b >> b
139 $ echo b >> b
140 $ hg ci -Aqm 'copy a->b (2)'
140 $ hg ci -Aqm 'copy a->b (2)'
141 $ hg log -G -T '{rev} {desc}\n'
141 $ hg log -G -T '{rev} {desc}\n'
142 @ 3 copy a->b (2)
142 @ 3 copy a->b (2)
143 |
143 |
144 | o 2 move b->c
144 | o 2 move b->c
145 | |
145 | |
146 | o 1 copy a->b
146 | o 1 copy a->b
147 |/
147 |/
148 o 0 add a
148 o 0 add a
149
149
150 $ hg rebase -d 2 -s 3 --config extensions.rebase= --config experimental.disablecopytrace=True
150 $ hg rebase -d 2 -s 3 --config extensions.rebase= --config experimental.disablecopytrace=True
151 rebasing 3:47e1a9e6273b "copy a->b (2)" (tip)
151 rebasing 3:47e1a9e6273b "copy a->b (2)" (tip)
152 saved backup bundle to $TESTTMP/copydisable3/.hg/strip-backup/47e1a9e6273b-2d099c59-backup.hg (glob)
152 saved backup bundle to $TESTTMP/copydisable3/.hg/strip-backup/47e1a9e6273b-2d099c59-backup.hg (glob)
153
153
154 $ hg log -G -f b
154 $ hg log -G -f b
155 @ changeset: 3:76024fb4b05b
155 @ changeset: 3:76024fb4b05b
156 | tag: tip
156 | tag: tip
157 | user: test
157 | user: test
158 | date: Thu Jan 01 00:00:00 1970 +0000
158 | date: Thu Jan 01 00:00:00 1970 +0000
159 | summary: copy a->b (2)
159 | summary: copy a->b (2)
160 |
160 |
161 o changeset: 0:ac82d8b1f7c4
161 o changeset: 0:ac82d8b1f7c4
162 user: test
162 user: test
163 date: Thu Jan 01 00:00:00 1970 +0000
163 date: Thu Jan 01 00:00:00 1970 +0000
164 summary: add a
164 summary: add a
165
165
@@ -1,65 +1,65
1 $ hg init repo
1 $ hg init repo
2 $ cd repo
2 $ cd repo
3
3
4 $ echo line 1 > foo
4 $ echo line 1 > foo
5 $ hg ci -qAm 'add foo'
5 $ hg ci -qAm 'add foo'
6
6
7 copy foo to bar and change both files
7 copy foo to bar and change both files
8 $ hg cp foo bar
8 $ hg cp foo bar
9 $ echo line 2-1 >> foo
9 $ echo line 2-1 >> foo
10 $ echo line 2-2 >> bar
10 $ echo line 2-2 >> bar
11 $ hg ci -m 'cp foo bar; change both'
11 $ hg ci -m 'cp foo bar; change both'
12
12
13 in another branch, change foo in a way that doesn't conflict with
13 in another branch, change foo in a way that doesn't conflict with
14 the other changes
14 the other changes
15 $ hg up -qC 0
15 $ hg up -qC 0
16 $ echo line 0 > foo
16 $ echo line 0 > foo
17 $ hg cat foo >> foo
17 $ hg cat foo >> foo
18 $ hg ci -m 'change foo'
18 $ hg ci -m 'change foo'
19 created new head
19 created new head
20
20
21 we get conflicts that shouldn't be there
21 we get conflicts that shouldn't be there
22 $ hg merge -P
22 $ hg merge -P
23 changeset: 1:484bf6903104
23 changeset: 1:484bf6903104
24 user: test
24 user: test
25 date: Thu Jan 01 00:00:00 1970 +0000
25 date: Thu Jan 01 00:00:00 1970 +0000
26 summary: cp foo bar; change both
26 summary: cp foo bar; change both
27
27
28 $ hg merge --debug
28 $ hg merge --debug
29 searching for copies back to rev 1
29 searching for copies back to rev 1
30 unmatched files in other:
30 unmatched files in other:
31 bar
31 bar
32 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
32 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
33 src: 'foo' -> dst: 'bar' *
33 src: 'foo' -> dst: 'bar' *
34 checking for directory renames
34 checking for directory renames
35 resolving manifests
35 resolving manifests
36 branchmerge: True, force: False, partial: False
36 branchmerge: True, force: False, partial: False
37 ancestor: e6dc8efe11cc, local: 6a0df1dad128+, remote: 484bf6903104
37 ancestor: e6dc8efe11cc, local: 6a0df1dad128+, remote: 484bf6903104
38 preserving foo for resolve of bar
38 preserving foo for resolve of bar
39 preserving foo for resolve of foo
39 preserving foo for resolve of foo
40 bar: remote copied from foo -> m
40 bar: remote copied from foo -> m
41 picked tool 'internal:merge' for bar (binary False symlink False)
41 picked tool ':merge' for bar (binary False symlink False)
42 merging foo and bar to bar
42 merging foo and bar to bar
43 my bar@6a0df1dad128+ other bar@484bf6903104 ancestor foo@e6dc8efe11cc
43 my bar@6a0df1dad128+ other bar@484bf6903104 ancestor foo@e6dc8efe11cc
44 premerge successful
44 premerge successful
45 foo: versions differ -> m
45 foo: versions differ -> m
46 picked tool 'internal:merge' for foo (binary False symlink False)
46 picked tool ':merge' for foo (binary False symlink False)
47 merging foo
47 merging foo
48 my foo@6a0df1dad128+ other foo@484bf6903104 ancestor foo@e6dc8efe11cc
48 my foo@6a0df1dad128+ other foo@484bf6903104 ancestor foo@e6dc8efe11cc
49 premerge successful
49 premerge successful
50 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
50 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
51 (branch merge, don't forget to commit)
51 (branch merge, don't forget to commit)
52
52
53 contents of foo
53 contents of foo
54 $ cat foo
54 $ cat foo
55 line 0
55 line 0
56 line 1
56 line 1
57 line 2-1
57 line 2-1
58
58
59 contents of bar
59 contents of bar
60 $ cat bar
60 $ cat bar
61 line 0
61 line 0
62 line 1
62 line 1
63 line 2-2
63 line 2-2
64
64
65 $ cd ..
65 $ cd ..
@@ -1,819 +1,819
1 Create a repo with some stuff in it:
1 Create a repo with some stuff in it:
2
2
3 $ hg init a
3 $ hg init a
4 $ cd a
4 $ cd a
5 $ echo a > a
5 $ echo a > a
6 $ echo a > d
6 $ echo a > d
7 $ echo a > e
7 $ echo a > e
8 $ hg ci -qAm0
8 $ hg ci -qAm0
9 $ echo b > a
9 $ echo b > a
10 $ hg ci -m1 -u bar
10 $ hg ci -m1 -u bar
11 $ hg mv a b
11 $ hg mv a b
12 $ hg ci -m2
12 $ hg ci -m2
13 $ hg cp b c
13 $ hg cp b c
14 $ hg ci -m3 -u baz
14 $ hg ci -m3 -u baz
15 $ echo b > d
15 $ echo b > d
16 $ echo f > e
16 $ echo f > e
17 $ hg ci -m4
17 $ hg ci -m4
18 $ hg up -q 3
18 $ hg up -q 3
19 $ echo b > e
19 $ echo b > e
20 $ hg branch -q stable
20 $ hg branch -q stable
21 $ hg ci -m5
21 $ hg ci -m5
22 $ hg merge -q default --tool internal:local
22 $ hg merge -q default --tool internal:local
23 $ hg branch -q default
23 $ hg branch -q default
24 $ hg ci -m6
24 $ hg ci -m6
25 $ hg phase --public 3
25 $ hg phase --public 3
26 $ hg phase --force --secret 6
26 $ hg phase --force --secret 6
27
27
28 $ hg log -G --template '{author}@{rev}.{phase}: {desc}\n'
28 $ hg log -G --template '{author}@{rev}.{phase}: {desc}\n'
29 @ test@6.secret: 6
29 @ test@6.secret: 6
30 |\
30 |\
31 | o test@5.draft: 5
31 | o test@5.draft: 5
32 | |
32 | |
33 o | test@4.draft: 4
33 o | test@4.draft: 4
34 |/
34 |/
35 o baz@3.public: 3
35 o baz@3.public: 3
36 |
36 |
37 o test@2.public: 2
37 o test@2.public: 2
38 |
38 |
39 o bar@1.public: 1
39 o bar@1.public: 1
40 |
40 |
41 o test@0.public: 0
41 o test@0.public: 0
42
42
43
43
44 Need to specify a rev:
44 Need to specify a rev:
45
45
46 $ hg graft
46 $ hg graft
47 abort: no revisions specified
47 abort: no revisions specified
48 [255]
48 [255]
49
49
50 Can't graft ancestor:
50 Can't graft ancestor:
51
51
52 $ hg graft 1 2
52 $ hg graft 1 2
53 skipping ancestor revision 1:5d205f8b35b6
53 skipping ancestor revision 1:5d205f8b35b6
54 skipping ancestor revision 2:5c095ad7e90f
54 skipping ancestor revision 2:5c095ad7e90f
55 [255]
55 [255]
56
56
57 Specify revisions with -r:
57 Specify revisions with -r:
58
58
59 $ hg graft -r 1 -r 2
59 $ hg graft -r 1 -r 2
60 skipping ancestor revision 1:5d205f8b35b6
60 skipping ancestor revision 1:5d205f8b35b6
61 skipping ancestor revision 2:5c095ad7e90f
61 skipping ancestor revision 2:5c095ad7e90f
62 [255]
62 [255]
63
63
64 $ hg graft -r 1 2
64 $ hg graft -r 1 2
65 skipping ancestor revision 2:5c095ad7e90f
65 skipping ancestor revision 2:5c095ad7e90f
66 skipping ancestor revision 1:5d205f8b35b6
66 skipping ancestor revision 1:5d205f8b35b6
67 [255]
67 [255]
68
68
69 Can't graft with dirty wd:
69 Can't graft with dirty wd:
70
70
71 $ hg up -q 0
71 $ hg up -q 0
72 $ echo foo > a
72 $ echo foo > a
73 $ hg graft 1
73 $ hg graft 1
74 abort: uncommitted changes
74 abort: uncommitted changes
75 [255]
75 [255]
76 $ hg revert a
76 $ hg revert a
77
77
78 Graft a rename:
78 Graft a rename:
79 (this also tests that editor is invoked if '--edit' is specified)
79 (this also tests that editor is invoked if '--edit' is specified)
80
80
81 $ hg status --rev "2^1" --rev 2
81 $ hg status --rev "2^1" --rev 2
82 A b
82 A b
83 R a
83 R a
84 $ HGEDITOR=cat hg graft 2 -u foo --edit
84 $ HGEDITOR=cat hg graft 2 -u foo --edit
85 grafting 2:5c095ad7e90f "2"
85 grafting 2:5c095ad7e90f "2"
86 merging a and b to b
86 merging a and b to b
87 2
87 2
88
88
89
89
90 HG: Enter commit message. Lines beginning with 'HG:' are removed.
90 HG: Enter commit message. Lines beginning with 'HG:' are removed.
91 HG: Leave message empty to abort commit.
91 HG: Leave message empty to abort commit.
92 HG: --
92 HG: --
93 HG: user: foo
93 HG: user: foo
94 HG: branch 'default'
94 HG: branch 'default'
95 HG: added b
95 HG: added b
96 HG: removed a
96 HG: removed a
97 $ hg export tip --git
97 $ hg export tip --git
98 # HG changeset patch
98 # HG changeset patch
99 # User foo
99 # User foo
100 # Date 0 0
100 # Date 0 0
101 # Thu Jan 01 00:00:00 1970 +0000
101 # Thu Jan 01 00:00:00 1970 +0000
102 # Node ID ef0ef43d49e79e81ddafdc7997401ba0041efc82
102 # Node ID ef0ef43d49e79e81ddafdc7997401ba0041efc82
103 # Parent 68795b066622ca79a25816a662041d8f78f3cd9e
103 # Parent 68795b066622ca79a25816a662041d8f78f3cd9e
104 2
104 2
105
105
106 diff --git a/a b/b
106 diff --git a/a b/b
107 rename from a
107 rename from a
108 rename to b
108 rename to b
109
109
110 Look for extra:source
110 Look for extra:source
111
111
112 $ hg log --debug -r tip
112 $ hg log --debug -r tip
113 changeset: 7:ef0ef43d49e79e81ddafdc7997401ba0041efc82
113 changeset: 7:ef0ef43d49e79e81ddafdc7997401ba0041efc82
114 tag: tip
114 tag: tip
115 phase: draft
115 phase: draft
116 parent: 0:68795b066622ca79a25816a662041d8f78f3cd9e
116 parent: 0:68795b066622ca79a25816a662041d8f78f3cd9e
117 parent: -1:0000000000000000000000000000000000000000
117 parent: -1:0000000000000000000000000000000000000000
118 manifest: 7:e59b6b228f9cbf9903d5e9abf996e083a1f533eb
118 manifest: 7:e59b6b228f9cbf9903d5e9abf996e083a1f533eb
119 user: foo
119 user: foo
120 date: Thu Jan 01 00:00:00 1970 +0000
120 date: Thu Jan 01 00:00:00 1970 +0000
121 files+: b
121 files+: b
122 files-: a
122 files-: a
123 extra: branch=default
123 extra: branch=default
124 extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4
124 extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4
125 description:
125 description:
126 2
126 2
127
127
128
128
129
129
130 Graft out of order, skipping a merge and a duplicate
130 Graft out of order, skipping a merge and a duplicate
131 (this also tests that editor is not invoked if '--edit' is not specified)
131 (this also tests that editor is not invoked if '--edit' is not specified)
132
132
133 $ hg graft 1 5 4 3 'merge()' 2 -n
133 $ hg graft 1 5 4 3 'merge()' 2 -n
134 skipping ungraftable merge revision 6
134 skipping ungraftable merge revision 6
135 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
135 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
136 grafting 1:5d205f8b35b6 "1"
136 grafting 1:5d205f8b35b6 "1"
137 grafting 5:97f8bfe72746 "5"
137 grafting 5:97f8bfe72746 "5"
138 grafting 4:9c233e8e184d "4"
138 grafting 4:9c233e8e184d "4"
139 grafting 3:4c60f11aa304 "3"
139 grafting 3:4c60f11aa304 "3"
140
140
141 $ HGEDITOR=cat hg graft 1 5 4 3 'merge()' 2 --debug
141 $ HGEDITOR=cat hg graft 1 5 4 3 'merge()' 2 --debug
142 skipping ungraftable merge revision 6
142 skipping ungraftable merge revision 6
143 scanning for duplicate grafts
143 scanning for duplicate grafts
144 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
144 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
145 grafting 1:5d205f8b35b6 "1"
145 grafting 1:5d205f8b35b6 "1"
146 searching for copies back to rev 1
146 searching for copies back to rev 1
147 unmatched files in local:
147 unmatched files in local:
148 b
148 b
149 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
149 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
150 src: 'a' -> dst: 'b' *
150 src: 'a' -> dst: 'b' *
151 checking for directory renames
151 checking for directory renames
152 resolving manifests
152 resolving manifests
153 branchmerge: True, force: True, partial: False
153 branchmerge: True, force: True, partial: False
154 ancestor: 68795b066622, local: ef0ef43d49e7+, remote: 5d205f8b35b6
154 ancestor: 68795b066622, local: ef0ef43d49e7+, remote: 5d205f8b35b6
155 preserving b for resolve of b
155 preserving b for resolve of b
156 b: local copied/moved from a -> m
156 b: local copied/moved from a -> m
157 picked tool 'internal:merge' for b (binary False symlink False)
157 picked tool ':merge' for b (binary False symlink False)
158 merging b and a to b
158 merging b and a to b
159 my b@ef0ef43d49e7+ other a@5d205f8b35b6 ancestor a@68795b066622
159 my b@ef0ef43d49e7+ other a@5d205f8b35b6 ancestor a@68795b066622
160 premerge successful
160 premerge successful
161 committing files:
161 committing files:
162 b
162 b
163 committing manifest
163 committing manifest
164 committing changelog
164 committing changelog
165 grafting 5:97f8bfe72746 "5"
165 grafting 5:97f8bfe72746 "5"
166 searching for copies back to rev 1
166 searching for copies back to rev 1
167 resolving manifests
167 resolving manifests
168 branchmerge: True, force: True, partial: False
168 branchmerge: True, force: True, partial: False
169 ancestor: 4c60f11aa304, local: 6b9e5368ca4e+, remote: 97f8bfe72746
169 ancestor: 4c60f11aa304, local: 6b9e5368ca4e+, remote: 97f8bfe72746
170 e: remote is newer -> g
170 e: remote is newer -> g
171 getting e
171 getting e
172 b: remote unchanged -> k
172 b: remote unchanged -> k
173 committing files:
173 committing files:
174 e
174 e
175 committing manifest
175 committing manifest
176 committing changelog
176 committing changelog
177 grafting 4:9c233e8e184d "4"
177 grafting 4:9c233e8e184d "4"
178 searching for copies back to rev 1
178 searching for copies back to rev 1
179 resolving manifests
179 resolving manifests
180 branchmerge: True, force: True, partial: False
180 branchmerge: True, force: True, partial: False
181 ancestor: 4c60f11aa304, local: 1905859650ec+, remote: 9c233e8e184d
181 ancestor: 4c60f11aa304, local: 1905859650ec+, remote: 9c233e8e184d
182 preserving e for resolve of e
182 preserving e for resolve of e
183 d: remote is newer -> g
183 d: remote is newer -> g
184 getting d
184 getting d
185 b: remote unchanged -> k
185 b: remote unchanged -> k
186 e: versions differ -> m
186 e: versions differ -> m
187 picked tool 'internal:merge' for e (binary False symlink False)
187 picked tool ':merge' for e (binary False symlink False)
188 merging e
188 merging e
189 my e@1905859650ec+ other e@9c233e8e184d ancestor e@68795b066622
189 my e@1905859650ec+ other e@9c233e8e184d ancestor e@68795b066622
190 warning: conflicts during merge.
190 warning: conflicts during merge.
191 merging e incomplete! (edit conflicts, then use 'hg resolve --mark')
191 merging e incomplete! (edit conflicts, then use 'hg resolve --mark')
192 abort: unresolved conflicts, can't continue
192 abort: unresolved conflicts, can't continue
193 (use hg resolve and hg graft --continue)
193 (use hg resolve and hg graft --continue)
194 [255]
194 [255]
195
195
196 Commit while interrupted should fail:
196 Commit while interrupted should fail:
197
197
198 $ hg ci -m 'commit interrupted graft'
198 $ hg ci -m 'commit interrupted graft'
199 abort: graft in progress
199 abort: graft in progress
200 (use 'hg graft --continue' or 'hg update' to abort)
200 (use 'hg graft --continue' or 'hg update' to abort)
201 [255]
201 [255]
202
202
203 Abort the graft and try committing:
203 Abort the graft and try committing:
204
204
205 $ hg up -C .
205 $ hg up -C .
206 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
206 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
207 $ echo c >> e
207 $ echo c >> e
208 $ hg ci -mtest
208 $ hg ci -mtest
209
209
210 $ hg strip . --config extensions.strip=
210 $ hg strip . --config extensions.strip=
211 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
211 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
212 saved backup bundle to $TESTTMP/a/.hg/strip-backup/*-backup.hg (glob)
212 saved backup bundle to $TESTTMP/a/.hg/strip-backup/*-backup.hg (glob)
213
213
214 Graft again:
214 Graft again:
215
215
216 $ hg graft 1 5 4 3 'merge()' 2
216 $ hg graft 1 5 4 3 'merge()' 2
217 skipping ungraftable merge revision 6
217 skipping ungraftable merge revision 6
218 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
218 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
219 skipping revision 1:5d205f8b35b6 (already grafted to 8:6b9e5368ca4e)
219 skipping revision 1:5d205f8b35b6 (already grafted to 8:6b9e5368ca4e)
220 skipping revision 5:97f8bfe72746 (already grafted to 9:1905859650ec)
220 skipping revision 5:97f8bfe72746 (already grafted to 9:1905859650ec)
221 grafting 4:9c233e8e184d "4"
221 grafting 4:9c233e8e184d "4"
222 merging e
222 merging e
223 warning: conflicts during merge.
223 warning: conflicts during merge.
224 merging e incomplete! (edit conflicts, then use 'hg resolve --mark')
224 merging e incomplete! (edit conflicts, then use 'hg resolve --mark')
225 abort: unresolved conflicts, can't continue
225 abort: unresolved conflicts, can't continue
226 (use hg resolve and hg graft --continue)
226 (use hg resolve and hg graft --continue)
227 [255]
227 [255]
228
228
229 Continue without resolve should fail:
229 Continue without resolve should fail:
230
230
231 $ hg graft -c
231 $ hg graft -c
232 grafting 4:9c233e8e184d "4"
232 grafting 4:9c233e8e184d "4"
233 abort: unresolved merge conflicts (see "hg help resolve")
233 abort: unresolved merge conflicts (see "hg help resolve")
234 [255]
234 [255]
235
235
236 Fix up:
236 Fix up:
237
237
238 $ echo b > e
238 $ echo b > e
239 $ hg resolve -m e
239 $ hg resolve -m e
240 (no more unresolved files)
240 (no more unresolved files)
241
241
242 Continue with a revision should fail:
242 Continue with a revision should fail:
243
243
244 $ hg graft -c 6
244 $ hg graft -c 6
245 abort: can't specify --continue and revisions
245 abort: can't specify --continue and revisions
246 [255]
246 [255]
247
247
248 $ hg graft -c -r 6
248 $ hg graft -c -r 6
249 abort: can't specify --continue and revisions
249 abort: can't specify --continue and revisions
250 [255]
250 [255]
251
251
252 Continue for real, clobber usernames
252 Continue for real, clobber usernames
253
253
254 $ hg graft -c -U
254 $ hg graft -c -U
255 grafting 4:9c233e8e184d "4"
255 grafting 4:9c233e8e184d "4"
256 grafting 3:4c60f11aa304 "3"
256 grafting 3:4c60f11aa304 "3"
257
257
258 Compare with original:
258 Compare with original:
259
259
260 $ hg diff -r 6
260 $ hg diff -r 6
261 $ hg status --rev 0:. -C
261 $ hg status --rev 0:. -C
262 M d
262 M d
263 M e
263 M e
264 A b
264 A b
265 a
265 a
266 A c
266 A c
267 a
267 a
268 R a
268 R a
269
269
270 View graph:
270 View graph:
271
271
272 $ hg log -G --template '{author}@{rev}.{phase}: {desc}\n'
272 $ hg log -G --template '{author}@{rev}.{phase}: {desc}\n'
273 @ test@11.draft: 3
273 @ test@11.draft: 3
274 |
274 |
275 o test@10.draft: 4
275 o test@10.draft: 4
276 |
276 |
277 o test@9.draft: 5
277 o test@9.draft: 5
278 |
278 |
279 o bar@8.draft: 1
279 o bar@8.draft: 1
280 |
280 |
281 o foo@7.draft: 2
281 o foo@7.draft: 2
282 |
282 |
283 | o test@6.secret: 6
283 | o test@6.secret: 6
284 | |\
284 | |\
285 | | o test@5.draft: 5
285 | | o test@5.draft: 5
286 | | |
286 | | |
287 | o | test@4.draft: 4
287 | o | test@4.draft: 4
288 | |/
288 | |/
289 | o baz@3.public: 3
289 | o baz@3.public: 3
290 | |
290 | |
291 | o test@2.public: 2
291 | o test@2.public: 2
292 | |
292 | |
293 | o bar@1.public: 1
293 | o bar@1.public: 1
294 |/
294 |/
295 o test@0.public: 0
295 o test@0.public: 0
296
296
297 Graft again onto another branch should preserve the original source
297 Graft again onto another branch should preserve the original source
298 $ hg up -q 0
298 $ hg up -q 0
299 $ echo 'g'>g
299 $ echo 'g'>g
300 $ hg add g
300 $ hg add g
301 $ hg ci -m 7
301 $ hg ci -m 7
302 created new head
302 created new head
303 $ hg graft 7
303 $ hg graft 7
304 grafting 7:ef0ef43d49e7 "2"
304 grafting 7:ef0ef43d49e7 "2"
305
305
306 $ hg log -r 7 --template '{rev}:{node}\n'
306 $ hg log -r 7 --template '{rev}:{node}\n'
307 7:ef0ef43d49e79e81ddafdc7997401ba0041efc82
307 7:ef0ef43d49e79e81ddafdc7997401ba0041efc82
308 $ hg log -r 2 --template '{rev}:{node}\n'
308 $ hg log -r 2 --template '{rev}:{node}\n'
309 2:5c095ad7e90f871700f02dd1fa5012cb4498a2d4
309 2:5c095ad7e90f871700f02dd1fa5012cb4498a2d4
310
310
311 $ hg log --debug -r tip
311 $ hg log --debug -r tip
312 changeset: 13:7a4785234d87ec1aa420ed6b11afe40fa73e12a9
312 changeset: 13:7a4785234d87ec1aa420ed6b11afe40fa73e12a9
313 tag: tip
313 tag: tip
314 phase: draft
314 phase: draft
315 parent: 12:b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
315 parent: 12:b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
316 parent: -1:0000000000000000000000000000000000000000
316 parent: -1:0000000000000000000000000000000000000000
317 manifest: 13:dc313617b8c32457c0d589e0dbbedfe71f3cd637
317 manifest: 13:dc313617b8c32457c0d589e0dbbedfe71f3cd637
318 user: foo
318 user: foo
319 date: Thu Jan 01 00:00:00 1970 +0000
319 date: Thu Jan 01 00:00:00 1970 +0000
320 files+: b
320 files+: b
321 files-: a
321 files-: a
322 extra: branch=default
322 extra: branch=default
323 extra: intermediate-source=ef0ef43d49e79e81ddafdc7997401ba0041efc82
323 extra: intermediate-source=ef0ef43d49e79e81ddafdc7997401ba0041efc82
324 extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4
324 extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4
325 description:
325 description:
326 2
326 2
327
327
328
328
329 Disallow grafting an already grafted cset onto its original branch
329 Disallow grafting an already grafted cset onto its original branch
330 $ hg up -q 6
330 $ hg up -q 6
331 $ hg graft 7
331 $ hg graft 7
332 skipping already grafted revision 7:ef0ef43d49e7 (was grafted from 2:5c095ad7e90f)
332 skipping already grafted revision 7:ef0ef43d49e7 (was grafted from 2:5c095ad7e90f)
333 [255]
333 [255]
334
334
335 $ hg extdiff --config extensions.extdiff= --patch -r 2 -r 13
335 $ hg extdiff --config extensions.extdiff= --patch -r 2 -r 13
336 --- */hg-5c095ad7e90f.patch * +0000 (glob)
336 --- */hg-5c095ad7e90f.patch * +0000 (glob)
337 +++ */hg-7a4785234d87.patch * +0000 (glob)
337 +++ */hg-7a4785234d87.patch * +0000 (glob)
338 @@ -1,18 +1,18 @@
338 @@ -1,18 +1,18 @@
339 # HG changeset patch
339 # HG changeset patch
340 -# User test
340 -# User test
341 +# User foo
341 +# User foo
342 # Date 0 0
342 # Date 0 0
343 # Thu Jan 01 00:00:00 1970 +0000
343 # Thu Jan 01 00:00:00 1970 +0000
344 -# Node ID 5c095ad7e90f871700f02dd1fa5012cb4498a2d4
344 -# Node ID 5c095ad7e90f871700f02dd1fa5012cb4498a2d4
345 -# Parent 5d205f8b35b66bc36375c9534ffd3237730e8f04
345 -# Parent 5d205f8b35b66bc36375c9534ffd3237730e8f04
346 +# Node ID 7a4785234d87ec1aa420ed6b11afe40fa73e12a9
346 +# Node ID 7a4785234d87ec1aa420ed6b11afe40fa73e12a9
347 +# Parent b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
347 +# Parent b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
348 2
348 2
349
349
350 -diff -r 5d205f8b35b6 -r 5c095ad7e90f a
350 -diff -r 5d205f8b35b6 -r 5c095ad7e90f a
351 +diff -r b592ea63bb0c -r 7a4785234d87 a
351 +diff -r b592ea63bb0c -r 7a4785234d87 a
352 --- a/a Thu Jan 01 00:00:00 1970 +0000
352 --- a/a Thu Jan 01 00:00:00 1970 +0000
353 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
353 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
354 @@ -1,1 +0,0 @@
354 @@ -1,1 +0,0 @@
355 --b
355 --b
356 -diff -r 5d205f8b35b6 -r 5c095ad7e90f b
356 -diff -r 5d205f8b35b6 -r 5c095ad7e90f b
357 +-a
357 +-a
358 +diff -r b592ea63bb0c -r 7a4785234d87 b
358 +diff -r b592ea63bb0c -r 7a4785234d87 b
359 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
359 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
360 +++ b/b Thu Jan 01 00:00:00 1970 +0000
360 +++ b/b Thu Jan 01 00:00:00 1970 +0000
361 @@ -0,0 +1,1 @@
361 @@ -0,0 +1,1 @@
362 -+b
362 -+b
363 ++a
363 ++a
364 [1]
364 [1]
365
365
366 $ hg extdiff --config extensions.extdiff= --patch -r 2 -r 13 -X .
366 $ hg extdiff --config extensions.extdiff= --patch -r 2 -r 13 -X .
367 --- */hg-5c095ad7e90f.patch * +0000 (glob)
367 --- */hg-5c095ad7e90f.patch * +0000 (glob)
368 +++ */hg-7a4785234d87.patch * +0000 (glob)
368 +++ */hg-7a4785234d87.patch * +0000 (glob)
369 @@ -1,8 +1,8 @@
369 @@ -1,8 +1,8 @@
370 # HG changeset patch
370 # HG changeset patch
371 -# User test
371 -# User test
372 +# User foo
372 +# User foo
373 # Date 0 0
373 # Date 0 0
374 # Thu Jan 01 00:00:00 1970 +0000
374 # Thu Jan 01 00:00:00 1970 +0000
375 -# Node ID 5c095ad7e90f871700f02dd1fa5012cb4498a2d4
375 -# Node ID 5c095ad7e90f871700f02dd1fa5012cb4498a2d4
376 -# Parent 5d205f8b35b66bc36375c9534ffd3237730e8f04
376 -# Parent 5d205f8b35b66bc36375c9534ffd3237730e8f04
377 +# Node ID 7a4785234d87ec1aa420ed6b11afe40fa73e12a9
377 +# Node ID 7a4785234d87ec1aa420ed6b11afe40fa73e12a9
378 +# Parent b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
378 +# Parent b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
379 2
379 2
380
380
381 [1]
381 [1]
382
382
383 Disallow grafting already grafted csets with the same origin onto each other
383 Disallow grafting already grafted csets with the same origin onto each other
384 $ hg up -q 13
384 $ hg up -q 13
385 $ hg graft 2
385 $ hg graft 2
386 skipping revision 2:5c095ad7e90f (already grafted to 13:7a4785234d87)
386 skipping revision 2:5c095ad7e90f (already grafted to 13:7a4785234d87)
387 [255]
387 [255]
388 $ hg graft 7
388 $ hg graft 7
389 skipping already grafted revision 7:ef0ef43d49e7 (13:7a4785234d87 also has origin 2:5c095ad7e90f)
389 skipping already grafted revision 7:ef0ef43d49e7 (13:7a4785234d87 also has origin 2:5c095ad7e90f)
390 [255]
390 [255]
391
391
392 $ hg up -q 7
392 $ hg up -q 7
393 $ hg graft 2
393 $ hg graft 2
394 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
394 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
395 [255]
395 [255]
396 $ hg graft tip
396 $ hg graft tip
397 skipping already grafted revision 13:7a4785234d87 (7:ef0ef43d49e7 also has origin 2:5c095ad7e90f)
397 skipping already grafted revision 13:7a4785234d87 (7:ef0ef43d49e7 also has origin 2:5c095ad7e90f)
398 [255]
398 [255]
399
399
400 Graft with --log
400 Graft with --log
401
401
402 $ hg up -Cq 1
402 $ hg up -Cq 1
403 $ hg graft 3 --log -u foo
403 $ hg graft 3 --log -u foo
404 grafting 3:4c60f11aa304 "3"
404 grafting 3:4c60f11aa304 "3"
405 warning: can't find ancestor for 'c' copied from 'b'!
405 warning: can't find ancestor for 'c' copied from 'b'!
406 $ hg log --template '{rev} {parents} {desc}\n' -r tip
406 $ hg log --template '{rev} {parents} {desc}\n' -r tip
407 14 1:5d205f8b35b6 3
407 14 1:5d205f8b35b6 3
408 (grafted from 4c60f11aa304a54ae1c199feb94e7fc771e51ed8)
408 (grafted from 4c60f11aa304a54ae1c199feb94e7fc771e51ed8)
409
409
410 Resolve conflicted graft
410 Resolve conflicted graft
411 $ hg up -q 0
411 $ hg up -q 0
412 $ echo b > a
412 $ echo b > a
413 $ hg ci -m 8
413 $ hg ci -m 8
414 created new head
414 created new head
415 $ echo c > a
415 $ echo c > a
416 $ hg ci -m 9
416 $ hg ci -m 9
417 $ hg graft 1 --tool internal:fail
417 $ hg graft 1 --tool internal:fail
418 grafting 1:5d205f8b35b6 "1"
418 grafting 1:5d205f8b35b6 "1"
419 abort: unresolved conflicts, can't continue
419 abort: unresolved conflicts, can't continue
420 (use hg resolve and hg graft --continue)
420 (use hg resolve and hg graft --continue)
421 [255]
421 [255]
422 $ hg resolve --all
422 $ hg resolve --all
423 merging a
423 merging a
424 warning: conflicts during merge.
424 warning: conflicts during merge.
425 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
425 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
426 [1]
426 [1]
427 $ cat a
427 $ cat a
428 <<<<<<< local: aaa4406d4f0a - test: 9
428 <<<<<<< local: aaa4406d4f0a - test: 9
429 c
429 c
430 =======
430 =======
431 b
431 b
432 >>>>>>> other: 5d205f8b35b6 - bar: 1
432 >>>>>>> other: 5d205f8b35b6 - bar: 1
433 $ echo b > a
433 $ echo b > a
434 $ hg resolve -m a
434 $ hg resolve -m a
435 (no more unresolved files)
435 (no more unresolved files)
436 $ hg graft -c
436 $ hg graft -c
437 grafting 1:5d205f8b35b6 "1"
437 grafting 1:5d205f8b35b6 "1"
438 $ hg export tip --git
438 $ hg export tip --git
439 # HG changeset patch
439 # HG changeset patch
440 # User bar
440 # User bar
441 # Date 0 0
441 # Date 0 0
442 # Thu Jan 01 00:00:00 1970 +0000
442 # Thu Jan 01 00:00:00 1970 +0000
443 # Node ID f67661df0c4804d301f064f332b57e7d5ddaf2be
443 # Node ID f67661df0c4804d301f064f332b57e7d5ddaf2be
444 # Parent aaa4406d4f0ae9befd6e58c82ec63706460cbca6
444 # Parent aaa4406d4f0ae9befd6e58c82ec63706460cbca6
445 1
445 1
446
446
447 diff --git a/a b/a
447 diff --git a/a b/a
448 --- a/a
448 --- a/a
449 +++ b/a
449 +++ b/a
450 @@ -1,1 +1,1 @@
450 @@ -1,1 +1,1 @@
451 -c
451 -c
452 +b
452 +b
453
453
454 Resolve conflicted graft with rename
454 Resolve conflicted graft with rename
455 $ echo c > a
455 $ echo c > a
456 $ hg ci -m 10
456 $ hg ci -m 10
457 $ hg graft 2 --tool internal:fail
457 $ hg graft 2 --tool internal:fail
458 grafting 2:5c095ad7e90f "2"
458 grafting 2:5c095ad7e90f "2"
459 abort: unresolved conflicts, can't continue
459 abort: unresolved conflicts, can't continue
460 (use hg resolve and hg graft --continue)
460 (use hg resolve and hg graft --continue)
461 [255]
461 [255]
462 $ hg resolve --all
462 $ hg resolve --all
463 merging a and b to b
463 merging a and b to b
464 (no more unresolved files)
464 (no more unresolved files)
465 $ hg graft -c
465 $ hg graft -c
466 grafting 2:5c095ad7e90f "2"
466 grafting 2:5c095ad7e90f "2"
467 $ hg export tip --git
467 $ hg export tip --git
468 # HG changeset patch
468 # HG changeset patch
469 # User test
469 # User test
470 # Date 0 0
470 # Date 0 0
471 # Thu Jan 01 00:00:00 1970 +0000
471 # Thu Jan 01 00:00:00 1970 +0000
472 # Node ID 9627f653b421c61fc1ea4c4e366745070fa3d2bc
472 # Node ID 9627f653b421c61fc1ea4c4e366745070fa3d2bc
473 # Parent ee295f490a40b97f3d18dd4c4f1c8936c233b612
473 # Parent ee295f490a40b97f3d18dd4c4f1c8936c233b612
474 2
474 2
475
475
476 diff --git a/a b/b
476 diff --git a/a b/b
477 rename from a
477 rename from a
478 rename to b
478 rename to b
479
479
480 Test simple origin(), with and without args
480 Test simple origin(), with and without args
481 $ hg log -r 'origin()'
481 $ hg log -r 'origin()'
482 changeset: 1:5d205f8b35b6
482 changeset: 1:5d205f8b35b6
483 user: bar
483 user: bar
484 date: Thu Jan 01 00:00:00 1970 +0000
484 date: Thu Jan 01 00:00:00 1970 +0000
485 summary: 1
485 summary: 1
486
486
487 changeset: 2:5c095ad7e90f
487 changeset: 2:5c095ad7e90f
488 user: test
488 user: test
489 date: Thu Jan 01 00:00:00 1970 +0000
489 date: Thu Jan 01 00:00:00 1970 +0000
490 summary: 2
490 summary: 2
491
491
492 changeset: 3:4c60f11aa304
492 changeset: 3:4c60f11aa304
493 user: baz
493 user: baz
494 date: Thu Jan 01 00:00:00 1970 +0000
494 date: Thu Jan 01 00:00:00 1970 +0000
495 summary: 3
495 summary: 3
496
496
497 changeset: 4:9c233e8e184d
497 changeset: 4:9c233e8e184d
498 user: test
498 user: test
499 date: Thu Jan 01 00:00:00 1970 +0000
499 date: Thu Jan 01 00:00:00 1970 +0000
500 summary: 4
500 summary: 4
501
501
502 changeset: 5:97f8bfe72746
502 changeset: 5:97f8bfe72746
503 branch: stable
503 branch: stable
504 parent: 3:4c60f11aa304
504 parent: 3:4c60f11aa304
505 user: test
505 user: test
506 date: Thu Jan 01 00:00:00 1970 +0000
506 date: Thu Jan 01 00:00:00 1970 +0000
507 summary: 5
507 summary: 5
508
508
509 $ hg log -r 'origin(7)'
509 $ hg log -r 'origin(7)'
510 changeset: 2:5c095ad7e90f
510 changeset: 2:5c095ad7e90f
511 user: test
511 user: test
512 date: Thu Jan 01 00:00:00 1970 +0000
512 date: Thu Jan 01 00:00:00 1970 +0000
513 summary: 2
513 summary: 2
514
514
515 Now transplant a graft to test following through copies
515 Now transplant a graft to test following through copies
516 $ hg up -q 0
516 $ hg up -q 0
517 $ hg branch -q dev
517 $ hg branch -q dev
518 $ hg ci -qm "dev branch"
518 $ hg ci -qm "dev branch"
519 $ hg --config extensions.transplant= transplant -q 7
519 $ hg --config extensions.transplant= transplant -q 7
520 $ hg log -r 'origin(.)'
520 $ hg log -r 'origin(.)'
521 changeset: 2:5c095ad7e90f
521 changeset: 2:5c095ad7e90f
522 user: test
522 user: test
523 date: Thu Jan 01 00:00:00 1970 +0000
523 date: Thu Jan 01 00:00:00 1970 +0000
524 summary: 2
524 summary: 2
525
525
526 Test that the graft and transplant markers in extra are converted, allowing
526 Test that the graft and transplant markers in extra are converted, allowing
527 origin() to still work. Note that these recheck the immediately preceeding two
527 origin() to still work. Note that these recheck the immediately preceeding two
528 tests.
528 tests.
529 $ hg --quiet --config extensions.convert= --config convert.hg.saverev=True convert . ../converted
529 $ hg --quiet --config extensions.convert= --config convert.hg.saverev=True convert . ../converted
530
530
531 The graft case
531 The graft case
532 $ hg -R ../converted log -r 7 --template "{rev}: {node}\n{join(extras, '\n')}\n"
532 $ hg -R ../converted log -r 7 --template "{rev}: {node}\n{join(extras, '\n')}\n"
533 7: 7ae846e9111fc8f57745634250c7b9ac0a60689b
533 7: 7ae846e9111fc8f57745634250c7b9ac0a60689b
534 branch=default
534 branch=default
535 convert_revision=ef0ef43d49e79e81ddafdc7997401ba0041efc82
535 convert_revision=ef0ef43d49e79e81ddafdc7997401ba0041efc82
536 source=e0213322b2c1a5d5d236c74e79666441bee67a7d
536 source=e0213322b2c1a5d5d236c74e79666441bee67a7d
537 $ hg -R ../converted log -r 'origin(7)'
537 $ hg -R ../converted log -r 'origin(7)'
538 changeset: 2:e0213322b2c1
538 changeset: 2:e0213322b2c1
539 user: test
539 user: test
540 date: Thu Jan 01 00:00:00 1970 +0000
540 date: Thu Jan 01 00:00:00 1970 +0000
541 summary: 2
541 summary: 2
542
542
543 Test that template correctly expands more than one 'extra' (issue4362), and that
543 Test that template correctly expands more than one 'extra' (issue4362), and that
544 'intermediate-source' is converted.
544 'intermediate-source' is converted.
545 $ hg -R ../converted log -r 13 --template "{extras % ' Extra: {extra}\n'}"
545 $ hg -R ../converted log -r 13 --template "{extras % ' Extra: {extra}\n'}"
546 Extra: branch=default
546 Extra: branch=default
547 Extra: convert_revision=7a4785234d87ec1aa420ed6b11afe40fa73e12a9
547 Extra: convert_revision=7a4785234d87ec1aa420ed6b11afe40fa73e12a9
548 Extra: intermediate-source=7ae846e9111fc8f57745634250c7b9ac0a60689b
548 Extra: intermediate-source=7ae846e9111fc8f57745634250c7b9ac0a60689b
549 Extra: source=e0213322b2c1a5d5d236c74e79666441bee67a7d
549 Extra: source=e0213322b2c1a5d5d236c74e79666441bee67a7d
550
550
551 The transplant case
551 The transplant case
552 $ hg -R ../converted log -r tip --template "{rev}: {node}\n{join(extras, '\n')}\n"
552 $ hg -R ../converted log -r tip --template "{rev}: {node}\n{join(extras, '\n')}\n"
553 21: fbb6c5cc81002f2b4b49c9d731404688bcae5ade
553 21: fbb6c5cc81002f2b4b49c9d731404688bcae5ade
554 branch=dev
554 branch=dev
555 convert_revision=7e61b508e709a11d28194a5359bc3532d910af21
555 convert_revision=7e61b508e709a11d28194a5359bc3532d910af21
556 transplant_source=z\xe8F\xe9\x11\x1f\xc8\xf5wEcBP\xc7\xb9\xac (esc)
556 transplant_source=z\xe8F\xe9\x11\x1f\xc8\xf5wEcBP\xc7\xb9\xac (esc)
557 `h\x9b (esc)
557 `h\x9b (esc)
558 $ hg -R ../converted log -r 'origin(tip)'
558 $ hg -R ../converted log -r 'origin(tip)'
559 changeset: 2:e0213322b2c1
559 changeset: 2:e0213322b2c1
560 user: test
560 user: test
561 date: Thu Jan 01 00:00:00 1970 +0000
561 date: Thu Jan 01 00:00:00 1970 +0000
562 summary: 2
562 summary: 2
563
563
564
564
565 Test simple destination
565 Test simple destination
566 $ hg log -r 'destination()'
566 $ hg log -r 'destination()'
567 changeset: 7:ef0ef43d49e7
567 changeset: 7:ef0ef43d49e7
568 parent: 0:68795b066622
568 parent: 0:68795b066622
569 user: foo
569 user: foo
570 date: Thu Jan 01 00:00:00 1970 +0000
570 date: Thu Jan 01 00:00:00 1970 +0000
571 summary: 2
571 summary: 2
572
572
573 changeset: 8:6b9e5368ca4e
573 changeset: 8:6b9e5368ca4e
574 user: bar
574 user: bar
575 date: Thu Jan 01 00:00:00 1970 +0000
575 date: Thu Jan 01 00:00:00 1970 +0000
576 summary: 1
576 summary: 1
577
577
578 changeset: 9:1905859650ec
578 changeset: 9:1905859650ec
579 user: test
579 user: test
580 date: Thu Jan 01 00:00:00 1970 +0000
580 date: Thu Jan 01 00:00:00 1970 +0000
581 summary: 5
581 summary: 5
582
582
583 changeset: 10:52dc0b4c6907
583 changeset: 10:52dc0b4c6907
584 user: test
584 user: test
585 date: Thu Jan 01 00:00:00 1970 +0000
585 date: Thu Jan 01 00:00:00 1970 +0000
586 summary: 4
586 summary: 4
587
587
588 changeset: 11:882b35362a6b
588 changeset: 11:882b35362a6b
589 user: test
589 user: test
590 date: Thu Jan 01 00:00:00 1970 +0000
590 date: Thu Jan 01 00:00:00 1970 +0000
591 summary: 3
591 summary: 3
592
592
593 changeset: 13:7a4785234d87
593 changeset: 13:7a4785234d87
594 user: foo
594 user: foo
595 date: Thu Jan 01 00:00:00 1970 +0000
595 date: Thu Jan 01 00:00:00 1970 +0000
596 summary: 2
596 summary: 2
597
597
598 changeset: 14:f64defefacee
598 changeset: 14:f64defefacee
599 parent: 1:5d205f8b35b6
599 parent: 1:5d205f8b35b6
600 user: foo
600 user: foo
601 date: Thu Jan 01 00:00:00 1970 +0000
601 date: Thu Jan 01 00:00:00 1970 +0000
602 summary: 3
602 summary: 3
603
603
604 changeset: 17:f67661df0c48
604 changeset: 17:f67661df0c48
605 user: bar
605 user: bar
606 date: Thu Jan 01 00:00:00 1970 +0000
606 date: Thu Jan 01 00:00:00 1970 +0000
607 summary: 1
607 summary: 1
608
608
609 changeset: 19:9627f653b421
609 changeset: 19:9627f653b421
610 user: test
610 user: test
611 date: Thu Jan 01 00:00:00 1970 +0000
611 date: Thu Jan 01 00:00:00 1970 +0000
612 summary: 2
612 summary: 2
613
613
614 changeset: 21:7e61b508e709
614 changeset: 21:7e61b508e709
615 branch: dev
615 branch: dev
616 tag: tip
616 tag: tip
617 user: foo
617 user: foo
618 date: Thu Jan 01 00:00:00 1970 +0000
618 date: Thu Jan 01 00:00:00 1970 +0000
619 summary: 2
619 summary: 2
620
620
621 $ hg log -r 'destination(2)'
621 $ hg log -r 'destination(2)'
622 changeset: 7:ef0ef43d49e7
622 changeset: 7:ef0ef43d49e7
623 parent: 0:68795b066622
623 parent: 0:68795b066622
624 user: foo
624 user: foo
625 date: Thu Jan 01 00:00:00 1970 +0000
625 date: Thu Jan 01 00:00:00 1970 +0000
626 summary: 2
626 summary: 2
627
627
628 changeset: 13:7a4785234d87
628 changeset: 13:7a4785234d87
629 user: foo
629 user: foo
630 date: Thu Jan 01 00:00:00 1970 +0000
630 date: Thu Jan 01 00:00:00 1970 +0000
631 summary: 2
631 summary: 2
632
632
633 changeset: 19:9627f653b421
633 changeset: 19:9627f653b421
634 user: test
634 user: test
635 date: Thu Jan 01 00:00:00 1970 +0000
635 date: Thu Jan 01 00:00:00 1970 +0000
636 summary: 2
636 summary: 2
637
637
638 changeset: 21:7e61b508e709
638 changeset: 21:7e61b508e709
639 branch: dev
639 branch: dev
640 tag: tip
640 tag: tip
641 user: foo
641 user: foo
642 date: Thu Jan 01 00:00:00 1970 +0000
642 date: Thu Jan 01 00:00:00 1970 +0000
643 summary: 2
643 summary: 2
644
644
645 Transplants of grafts can find a destination...
645 Transplants of grafts can find a destination...
646 $ hg log -r 'destination(7)'
646 $ hg log -r 'destination(7)'
647 changeset: 21:7e61b508e709
647 changeset: 21:7e61b508e709
648 branch: dev
648 branch: dev
649 tag: tip
649 tag: tip
650 user: foo
650 user: foo
651 date: Thu Jan 01 00:00:00 1970 +0000
651 date: Thu Jan 01 00:00:00 1970 +0000
652 summary: 2
652 summary: 2
653
653
654 ... grafts of grafts unfortunately can't
654 ... grafts of grafts unfortunately can't
655 $ hg graft -q 13
655 $ hg graft -q 13
656 warning: can't find ancestor for 'b' copied from 'a'!
656 warning: can't find ancestor for 'b' copied from 'a'!
657 $ hg log -r 'destination(13)'
657 $ hg log -r 'destination(13)'
658 All copies of a cset
658 All copies of a cset
659 $ hg log -r 'origin(13) or destination(origin(13))'
659 $ hg log -r 'origin(13) or destination(origin(13))'
660 changeset: 2:5c095ad7e90f
660 changeset: 2:5c095ad7e90f
661 user: test
661 user: test
662 date: Thu Jan 01 00:00:00 1970 +0000
662 date: Thu Jan 01 00:00:00 1970 +0000
663 summary: 2
663 summary: 2
664
664
665 changeset: 7:ef0ef43d49e7
665 changeset: 7:ef0ef43d49e7
666 parent: 0:68795b066622
666 parent: 0:68795b066622
667 user: foo
667 user: foo
668 date: Thu Jan 01 00:00:00 1970 +0000
668 date: Thu Jan 01 00:00:00 1970 +0000
669 summary: 2
669 summary: 2
670
670
671 changeset: 13:7a4785234d87
671 changeset: 13:7a4785234d87
672 user: foo
672 user: foo
673 date: Thu Jan 01 00:00:00 1970 +0000
673 date: Thu Jan 01 00:00:00 1970 +0000
674 summary: 2
674 summary: 2
675
675
676 changeset: 19:9627f653b421
676 changeset: 19:9627f653b421
677 user: test
677 user: test
678 date: Thu Jan 01 00:00:00 1970 +0000
678 date: Thu Jan 01 00:00:00 1970 +0000
679 summary: 2
679 summary: 2
680
680
681 changeset: 21:7e61b508e709
681 changeset: 21:7e61b508e709
682 branch: dev
682 branch: dev
683 user: foo
683 user: foo
684 date: Thu Jan 01 00:00:00 1970 +0000
684 date: Thu Jan 01 00:00:00 1970 +0000
685 summary: 2
685 summary: 2
686
686
687 changeset: 22:d1cb6591fa4b
687 changeset: 22:d1cb6591fa4b
688 branch: dev
688 branch: dev
689 tag: tip
689 tag: tip
690 user: foo
690 user: foo
691 date: Thu Jan 01 00:00:00 1970 +0000
691 date: Thu Jan 01 00:00:00 1970 +0000
692 summary: 2
692 summary: 2
693
693
694
694
695 graft works on complex revset
695 graft works on complex revset
696
696
697 $ hg graft 'origin(13) or destination(origin(13))'
697 $ hg graft 'origin(13) or destination(origin(13))'
698 skipping ancestor revision 21:7e61b508e709
698 skipping ancestor revision 21:7e61b508e709
699 skipping ancestor revision 22:d1cb6591fa4b
699 skipping ancestor revision 22:d1cb6591fa4b
700 skipping revision 2:5c095ad7e90f (already grafted to 22:d1cb6591fa4b)
700 skipping revision 2:5c095ad7e90f (already grafted to 22:d1cb6591fa4b)
701 grafting 7:ef0ef43d49e7 "2"
701 grafting 7:ef0ef43d49e7 "2"
702 warning: can't find ancestor for 'b' copied from 'a'!
702 warning: can't find ancestor for 'b' copied from 'a'!
703 grafting 13:7a4785234d87 "2"
703 grafting 13:7a4785234d87 "2"
704 warning: can't find ancestor for 'b' copied from 'a'!
704 warning: can't find ancestor for 'b' copied from 'a'!
705 grafting 19:9627f653b421 "2"
705 grafting 19:9627f653b421 "2"
706 merging b
706 merging b
707 warning: can't find ancestor for 'b' copied from 'a'!
707 warning: can't find ancestor for 'b' copied from 'a'!
708
708
709 graft with --force (still doesn't graft merges)
709 graft with --force (still doesn't graft merges)
710
710
711 $ hg graft 19 0 6
711 $ hg graft 19 0 6
712 skipping ungraftable merge revision 6
712 skipping ungraftable merge revision 6
713 skipping ancestor revision 0:68795b066622
713 skipping ancestor revision 0:68795b066622
714 skipping already grafted revision 19:9627f653b421 (22:d1cb6591fa4b also has origin 2:5c095ad7e90f)
714 skipping already grafted revision 19:9627f653b421 (22:d1cb6591fa4b also has origin 2:5c095ad7e90f)
715 [255]
715 [255]
716 $ hg graft 19 0 6 --force
716 $ hg graft 19 0 6 --force
717 skipping ungraftable merge revision 6
717 skipping ungraftable merge revision 6
718 grafting 19:9627f653b421 "2"
718 grafting 19:9627f653b421 "2"
719 merging b
719 merging b
720 warning: can't find ancestor for 'b' copied from 'a'!
720 warning: can't find ancestor for 'b' copied from 'a'!
721 grafting 0:68795b066622 "0"
721 grafting 0:68795b066622 "0"
722
722
723 graft --force after backout
723 graft --force after backout
724
724
725 $ echo abc > a
725 $ echo abc > a
726 $ hg ci -m 28
726 $ hg ci -m 28
727 $ hg backout 28
727 $ hg backout 28
728 reverting a
728 reverting a
729 changeset 29:53177ba928f6 backs out changeset 28:50a516bb8b57
729 changeset 29:53177ba928f6 backs out changeset 28:50a516bb8b57
730 $ hg graft 28
730 $ hg graft 28
731 skipping ancestor revision 28:50a516bb8b57
731 skipping ancestor revision 28:50a516bb8b57
732 [255]
732 [255]
733 $ hg graft 28 --force
733 $ hg graft 28 --force
734 grafting 28:50a516bb8b57 "28"
734 grafting 28:50a516bb8b57 "28"
735 merging a
735 merging a
736 $ cat a
736 $ cat a
737 abc
737 abc
738
738
739 graft --continue after --force
739 graft --continue after --force
740
740
741 $ echo def > a
741 $ echo def > a
742 $ hg ci -m 31
742 $ hg ci -m 31
743 $ hg graft 28 --force --tool internal:fail
743 $ hg graft 28 --force --tool internal:fail
744 grafting 28:50a516bb8b57 "28"
744 grafting 28:50a516bb8b57 "28"
745 abort: unresolved conflicts, can't continue
745 abort: unresolved conflicts, can't continue
746 (use hg resolve and hg graft --continue)
746 (use hg resolve and hg graft --continue)
747 [255]
747 [255]
748 $ hg resolve --all
748 $ hg resolve --all
749 merging a
749 merging a
750 warning: conflicts during merge.
750 warning: conflicts during merge.
751 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
751 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
752 [1]
752 [1]
753 $ echo abc > a
753 $ echo abc > a
754 $ hg resolve -m a
754 $ hg resolve -m a
755 (no more unresolved files)
755 (no more unresolved files)
756 $ hg graft -c
756 $ hg graft -c
757 grafting 28:50a516bb8b57 "28"
757 grafting 28:50a516bb8b57 "28"
758 $ cat a
758 $ cat a
759 abc
759 abc
760
760
761 Continue testing same origin policy, using revision numbers from test above
761 Continue testing same origin policy, using revision numbers from test above
762 but do some destructive editing of the repo:
762 but do some destructive editing of the repo:
763
763
764 $ hg up -qC 7
764 $ hg up -qC 7
765 $ hg tag -l -r 13 tmp
765 $ hg tag -l -r 13 tmp
766 $ hg --config extensions.strip= strip 2
766 $ hg --config extensions.strip= strip 2
767 saved backup bundle to $TESTTMP/a/.hg/strip-backup/5c095ad7e90f-d323a1e4-backup.hg (glob)
767 saved backup bundle to $TESTTMP/a/.hg/strip-backup/5c095ad7e90f-d323a1e4-backup.hg (glob)
768 $ hg graft tmp
768 $ hg graft tmp
769 skipping already grafted revision 8:7a4785234d87 (2:ef0ef43d49e7 also has unknown origin 5c095ad7e90f)
769 skipping already grafted revision 8:7a4785234d87 (2:ef0ef43d49e7 also has unknown origin 5c095ad7e90f)
770 [255]
770 [255]
771
771
772 Empty graft
772 Empty graft
773
773
774 $ hg up -qr 26
774 $ hg up -qr 26
775 $ hg tag -f something
775 $ hg tag -f something
776 $ hg graft -qr 27
776 $ hg graft -qr 27
777 $ hg graft -f 27
777 $ hg graft -f 27
778 grafting 27:ed6c7e54e319 "28"
778 grafting 27:ed6c7e54e319 "28"
779 note: graft of 27:ed6c7e54e319 created no changes to commit
779 note: graft of 27:ed6c7e54e319 created no changes to commit
780
780
781 $ cd ..
781 $ cd ..
782
782
783 Graft to duplicate a commit
783 Graft to duplicate a commit
784
784
785 $ hg init graftsibling
785 $ hg init graftsibling
786 $ cd graftsibling
786 $ cd graftsibling
787 $ touch a
787 $ touch a
788 $ hg commit -qAm a
788 $ hg commit -qAm a
789 $ touch b
789 $ touch b
790 $ hg commit -qAm b
790 $ hg commit -qAm b
791 $ hg log -G -T '{rev}\n'
791 $ hg log -G -T '{rev}\n'
792 @ 1
792 @ 1
793 |
793 |
794 o 0
794 o 0
795
795
796 $ hg up -q 0
796 $ hg up -q 0
797 $ hg graft -r 1
797 $ hg graft -r 1
798 grafting 1:0e067c57feba "b" (tip)
798 grafting 1:0e067c57feba "b" (tip)
799 $ hg log -G -T '{rev}\n'
799 $ hg log -G -T '{rev}\n'
800 @ 2
800 @ 2
801 |
801 |
802 | o 1
802 | o 1
803 |/
803 |/
804 o 0
804 o 0
805
805
806 Graft to duplicate a commit twice
806 Graft to duplicate a commit twice
807
807
808 $ hg up -q 0
808 $ hg up -q 0
809 $ hg graft -r 2
809 $ hg graft -r 2
810 grafting 2:044ec77f6389 "b" (tip)
810 grafting 2:044ec77f6389 "b" (tip)
811 $ hg log -G -T '{rev}\n'
811 $ hg log -G -T '{rev}\n'
812 @ 3
812 @ 3
813 |
813 |
814 | o 2
814 | o 2
815 |/
815 |/
816 | o 1
816 | o 1
817 |/
817 |/
818 o 0
818 o 0
819
819
@@ -1,98 +1,98
1 https://bz.mercurial-scm.org/672
1 https://bz.mercurial-scm.org/672
2
2
3 # 0-2-4
3 # 0-2-4
4 # \ \ \
4 # \ \ \
5 # 1-3-5
5 # 1-3-5
6 #
6 #
7 # rename in #1, content change in #4.
7 # rename in #1, content change in #4.
8
8
9 $ hg init
9 $ hg init
10
10
11 $ touch 1
11 $ touch 1
12 $ touch 2
12 $ touch 2
13 $ hg commit -Am init # 0
13 $ hg commit -Am init # 0
14 adding 1
14 adding 1
15 adding 2
15 adding 2
16
16
17 $ hg rename 1 1a
17 $ hg rename 1 1a
18 $ hg commit -m rename # 1
18 $ hg commit -m rename # 1
19
19
20 $ hg co -C 0
20 $ hg co -C 0
21 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
21 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
22
22
23 $ echo unrelated >> 2
23 $ echo unrelated >> 2
24 $ hg ci -m unrelated1 # 2
24 $ hg ci -m unrelated1 # 2
25 created new head
25 created new head
26
26
27 $ hg merge --debug 1
27 $ hg merge --debug 1
28 searching for copies back to rev 1
28 searching for copies back to rev 1
29 unmatched files in other:
29 unmatched files in other:
30 1a
30 1a
31 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
31 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
32 src: '1' -> dst: '1a'
32 src: '1' -> dst: '1a'
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: 81f4b099af3d, local: c64f439569a9+, remote: c12dcd37c90a
36 ancestor: 81f4b099af3d, local: c64f439569a9+, remote: c12dcd37c90a
37 1: other deleted -> r
37 1: other deleted -> r
38 removing 1
38 removing 1
39 1a: remote created -> g
39 1a: remote created -> g
40 getting 1a
40 getting 1a
41 2: remote unchanged -> k
41 2: remote unchanged -> k
42 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
42 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
43 (branch merge, don't forget to commit)
43 (branch merge, don't forget to commit)
44
44
45 $ hg ci -m merge1 # 3
45 $ hg ci -m merge1 # 3
46
46
47 $ hg co -C 2
47 $ hg co -C 2
48 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
48 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
49
49
50 $ echo hello >> 1
50 $ echo hello >> 1
51 $ hg ci -m unrelated2 # 4
51 $ hg ci -m unrelated2 # 4
52 created new head
52 created new head
53
53
54 $ hg co -C 3
54 $ hg co -C 3
55 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
55 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
56
56
57 $ hg merge -y --debug 4
57 $ hg merge -y --debug 4
58 searching for copies back to rev 1
58 searching for copies back to rev 1
59 unmatched files in local:
59 unmatched files in local:
60 1a
60 1a
61 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
61 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
62 src: '1' -> dst: '1a' *
62 src: '1' -> dst: '1a' *
63 checking for directory renames
63 checking for directory renames
64 resolving manifests
64 resolving manifests
65 branchmerge: True, force: False, partial: False
65 branchmerge: True, force: False, partial: False
66 ancestor: c64f439569a9, local: e327dca35ac8+, remote: 746e9549ea96
66 ancestor: c64f439569a9, local: e327dca35ac8+, remote: 746e9549ea96
67 preserving 1a for resolve of 1a
67 preserving 1a for resolve of 1a
68 1a: local copied/moved from 1 -> m
68 1a: local copied/moved from 1 -> m
69 picked tool 'internal:merge' for 1a (binary False symlink False)
69 picked tool ':merge' for 1a (binary False symlink False)
70 merging 1a and 1 to 1a
70 merging 1a and 1 to 1a
71 my 1a@e327dca35ac8+ other 1@746e9549ea96 ancestor 1@81f4b099af3d
71 my 1a@e327dca35ac8+ other 1@746e9549ea96 ancestor 1@81f4b099af3d
72 premerge successful
72 premerge successful
73 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
73 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
74 (branch merge, don't forget to commit)
74 (branch merge, don't forget to commit)
75
75
76 $ hg co -C 4
76 $ hg co -C 4
77 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
77 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
78
78
79 $ hg merge -y --debug 3
79 $ hg merge -y --debug 3
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 1a
82 1a
83 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
83 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
84 src: '1' -> dst: '1a' *
84 src: '1' -> dst: '1a' *
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: c64f439569a9, local: 746e9549ea96+, remote: e327dca35ac8
88 ancestor: c64f439569a9, local: 746e9549ea96+, remote: e327dca35ac8
89 preserving 1 for resolve of 1a
89 preserving 1 for resolve of 1a
90 removing 1
90 removing 1
91 1a: remote moved from 1 -> m
91 1a: remote moved from 1 -> m
92 picked tool 'internal:merge' for 1a (binary False symlink False)
92 picked tool ':merge' for 1a (binary False symlink False)
93 merging 1 and 1a to 1a
93 merging 1 and 1a to 1a
94 my 1a@746e9549ea96+ other 1a@e327dca35ac8 ancestor 1@81f4b099af3d
94 my 1a@746e9549ea96+ other 1a@e327dca35ac8 ancestor 1@81f4b099af3d
95 premerge successful
95 premerge successful
96 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
96 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
97 (branch merge, don't forget to commit)
97 (branch merge, don't forget to commit)
98
98
@@ -1,182 +1,182
1 Check that renames are correctly saved by a commit after a merge
1 Check that renames are correctly saved by a commit after a merge
2
2
3 Test with the merge on 3 having the rename on the local parent
3 Test with the merge on 3 having the rename on the local parent
4
4
5 $ hg init a
5 $ hg init a
6 $ cd a
6 $ cd a
7
7
8 $ echo line1 > foo
8 $ echo line1 > foo
9 $ hg add foo
9 $ hg add foo
10 $ hg ci -m '0: add foo'
10 $ hg ci -m '0: add foo'
11
11
12 $ echo line2 >> foo
12 $ echo line2 >> foo
13 $ hg ci -m '1: change foo'
13 $ hg ci -m '1: change foo'
14
14
15 $ hg up -C 0
15 $ hg up -C 0
16 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
16 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
17
17
18 $ hg mv foo bar
18 $ hg mv foo bar
19 $ rm bar
19 $ rm bar
20 $ echo line0 > bar
20 $ echo line0 > bar
21 $ echo line1 >> bar
21 $ echo line1 >> bar
22 $ hg ci -m '2: mv foo bar; change bar'
22 $ hg ci -m '2: mv foo bar; change bar'
23 created new head
23 created new head
24
24
25 $ hg merge 1
25 $ hg merge 1
26 merging bar and foo to bar
26 merging bar and foo to bar
27 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
27 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
28 (branch merge, don't forget to commit)
28 (branch merge, don't forget to commit)
29
29
30 $ cat bar
30 $ cat bar
31 line0
31 line0
32 line1
32 line1
33 line2
33 line2
34
34
35 $ hg ci -m '3: merge with local rename'
35 $ hg ci -m '3: merge with local rename'
36
36
37 $ hg debugindex bar
37 $ hg debugindex bar
38 rev offset length ..... linkrev nodeid p1 p2 (re)
38 rev offset length ..... linkrev nodeid p1 p2 (re)
39 0 0 77 ..... 2 d35118874825 000000000000 000000000000 (re)
39 0 0 77 ..... 2 d35118874825 000000000000 000000000000 (re)
40 1 77 76 ..... 3 5345f5ab8abd 000000000000 d35118874825 (re)
40 1 77 76 ..... 3 5345f5ab8abd 000000000000 d35118874825 (re)
41
41
42 $ hg debugrename bar
42 $ hg debugrename bar
43 bar renamed from foo:9e25c27b87571a1edee5ae4dddee5687746cc8e2
43 bar renamed from foo:9e25c27b87571a1edee5ae4dddee5687746cc8e2
44
44
45 $ hg debugindex foo
45 $ hg debugindex foo
46 rev offset length ..... linkrev nodeid p1 p2 (re)
46 rev offset length ..... linkrev nodeid p1 p2 (re)
47 0 0 7 ..... 0 690b295714ae 000000000000 000000000000 (re)
47 0 0 7 ..... 0 690b295714ae 000000000000 000000000000 (re)
48 1 7 13 ..... 1 9e25c27b8757 690b295714ae 000000000000 (re)
48 1 7 13 ..... 1 9e25c27b8757 690b295714ae 000000000000 (re)
49
49
50
50
51 Revert the content change from rev 2:
51 Revert the content change from rev 2:
52
52
53 $ hg up -C 2
53 $ hg up -C 2
54 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
54 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
55 $ rm bar
55 $ rm bar
56 $ echo line1 > bar
56 $ echo line1 > bar
57 $ hg ci -m '4: revert content change from rev 2'
57 $ hg ci -m '4: revert content change from rev 2'
58 created new head
58 created new head
59
59
60 $ hg log --template '{rev}:{node|short} {parents}\n'
60 $ hg log --template '{rev}:{node|short} {parents}\n'
61 4:2263c1be0967 2:0f2ff26688b9
61 4:2263c1be0967 2:0f2ff26688b9
62 3:0555950ead28 2:0f2ff26688b9 1:5cd961e4045d
62 3:0555950ead28 2:0f2ff26688b9 1:5cd961e4045d
63 2:0f2ff26688b9 0:2665aaee66e9
63 2:0f2ff26688b9 0:2665aaee66e9
64 1:5cd961e4045d
64 1:5cd961e4045d
65 0:2665aaee66e9
65 0:2665aaee66e9
66
66
67 This should use bar@rev2 as the ancestor:
67 This should use bar@rev2 as the ancestor:
68
68
69 $ hg --debug merge 3
69 $ hg --debug merge 3
70 searching for copies back to rev 1
70 searching for copies back to rev 1
71 resolving manifests
71 resolving manifests
72 branchmerge: True, force: False, partial: False
72 branchmerge: True, force: False, partial: False
73 ancestor: 0f2ff26688b9, local: 2263c1be0967+, remote: 0555950ead28
73 ancestor: 0f2ff26688b9, local: 2263c1be0967+, remote: 0555950ead28
74 preserving bar for resolve of bar
74 preserving bar for resolve of bar
75 bar: versions differ -> m
75 bar: versions differ -> m
76 picked tool 'internal:merge' for bar (binary False symlink False)
76 picked tool ':merge' for bar (binary False symlink False)
77 merging bar
77 merging bar
78 my bar@2263c1be0967+ other bar@0555950ead28 ancestor bar@0f2ff26688b9
78 my bar@2263c1be0967+ other bar@0555950ead28 ancestor bar@0f2ff26688b9
79 premerge successful
79 premerge successful
80 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
80 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
81 (branch merge, don't forget to commit)
81 (branch merge, don't forget to commit)
82
82
83 $ cat bar
83 $ cat bar
84 line1
84 line1
85 line2
85 line2
86
86
87 $ hg ci -m '5: merge'
87 $ hg ci -m '5: merge'
88
88
89 $ hg debugindex bar
89 $ hg debugindex bar
90 rev offset length ..... linkrev nodeid p1 p2 (re)
90 rev offset length ..... linkrev nodeid p1 p2 (re)
91 0 0 77 ..... 2 d35118874825 000000000000 000000000000 (re)
91 0 0 77 ..... 2 d35118874825 000000000000 000000000000 (re)
92 1 77 76 ..... 3 5345f5ab8abd 000000000000 d35118874825 (re)
92 1 77 76 ..... 3 5345f5ab8abd 000000000000 d35118874825 (re)
93 2 153 7 ..... 4 ff4b45017382 d35118874825 000000000000 (re)
93 2 153 7 ..... 4 ff4b45017382 d35118874825 000000000000 (re)
94 3 160 13 ..... 5 3701b4893544 ff4b45017382 5345f5ab8abd (re)
94 3 160 13 ..... 5 3701b4893544 ff4b45017382 5345f5ab8abd (re)
95
95
96
96
97 Same thing, but with the merge on 3 having the rename
97 Same thing, but with the merge on 3 having the rename
98 on the remote parent:
98 on the remote parent:
99
99
100 $ cd ..
100 $ cd ..
101 $ hg clone -U -r 1 -r 2 a b
101 $ hg clone -U -r 1 -r 2 a b
102 adding changesets
102 adding changesets
103 adding manifests
103 adding manifests
104 adding file changes
104 adding file changes
105 added 3 changesets with 3 changes to 2 files (+1 heads)
105 added 3 changesets with 3 changes to 2 files (+1 heads)
106 $ cd b
106 $ cd b
107
107
108 $ hg up -C 1
108 $ hg up -C 1
109 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
109 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
110
110
111 $ hg merge 2
111 $ hg merge 2
112 merging foo and bar to bar
112 merging foo and bar to bar
113 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
113 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
114 (branch merge, don't forget to commit)
114 (branch merge, don't forget to commit)
115
115
116 $ cat bar
116 $ cat bar
117 line0
117 line0
118 line1
118 line1
119 line2
119 line2
120
120
121 $ hg ci -m '3: merge with remote rename'
121 $ hg ci -m '3: merge with remote rename'
122
122
123 $ hg debugindex bar
123 $ hg debugindex bar
124 rev offset length ..... linkrev nodeid p1 p2 (re)
124 rev offset length ..... linkrev nodeid p1 p2 (re)
125 0 0 77 ..... 2 d35118874825 000000000000 000000000000 (re)
125 0 0 77 ..... 2 d35118874825 000000000000 000000000000 (re)
126 1 77 76 ..... 3 5345f5ab8abd 000000000000 d35118874825 (re)
126 1 77 76 ..... 3 5345f5ab8abd 000000000000 d35118874825 (re)
127
127
128 $ hg debugrename bar
128 $ hg debugrename bar
129 bar renamed from foo:9e25c27b87571a1edee5ae4dddee5687746cc8e2
129 bar renamed from foo:9e25c27b87571a1edee5ae4dddee5687746cc8e2
130
130
131 $ hg debugindex foo
131 $ hg debugindex foo
132 rev offset length ..... linkrev nodeid p1 p2 (re)
132 rev offset length ..... linkrev nodeid p1 p2 (re)
133 0 0 7 ..... 0 690b295714ae 000000000000 000000000000 (re)
133 0 0 7 ..... 0 690b295714ae 000000000000 000000000000 (re)
134 1 7 13 ..... 1 9e25c27b8757 690b295714ae 000000000000 (re)
134 1 7 13 ..... 1 9e25c27b8757 690b295714ae 000000000000 (re)
135
135
136
136
137 Revert the content change from rev 2:
137 Revert the content change from rev 2:
138
138
139 $ hg up -C 2
139 $ hg up -C 2
140 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
140 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
141 $ rm bar
141 $ rm bar
142 $ echo line1 > bar
142 $ echo line1 > bar
143 $ hg ci -m '4: revert content change from rev 2'
143 $ hg ci -m '4: revert content change from rev 2'
144 created new head
144 created new head
145
145
146 $ hg log --template '{rev}:{node|short} {parents}\n'
146 $ hg log --template '{rev}:{node|short} {parents}\n'
147 4:2263c1be0967 2:0f2ff26688b9
147 4:2263c1be0967 2:0f2ff26688b9
148 3:3ffa6b9e35f0 1:5cd961e4045d 2:0f2ff26688b9
148 3:3ffa6b9e35f0 1:5cd961e4045d 2:0f2ff26688b9
149 2:0f2ff26688b9 0:2665aaee66e9
149 2:0f2ff26688b9 0:2665aaee66e9
150 1:5cd961e4045d
150 1:5cd961e4045d
151 0:2665aaee66e9
151 0:2665aaee66e9
152
152
153 This should use bar@rev2 as the ancestor:
153 This should use bar@rev2 as the ancestor:
154
154
155 $ hg --debug merge 3
155 $ hg --debug merge 3
156 searching for copies back to rev 1
156 searching for copies back to rev 1
157 resolving manifests
157 resolving manifests
158 branchmerge: True, force: False, partial: False
158 branchmerge: True, force: False, partial: False
159 ancestor: 0f2ff26688b9, local: 2263c1be0967+, remote: 3ffa6b9e35f0
159 ancestor: 0f2ff26688b9, local: 2263c1be0967+, remote: 3ffa6b9e35f0
160 preserving bar for resolve of bar
160 preserving bar for resolve of bar
161 bar: versions differ -> m
161 bar: versions differ -> m
162 picked tool 'internal:merge' for bar (binary False symlink False)
162 picked tool ':merge' for bar (binary False symlink False)
163 merging bar
163 merging bar
164 my bar@2263c1be0967+ other bar@3ffa6b9e35f0 ancestor bar@0f2ff26688b9
164 my bar@2263c1be0967+ other bar@3ffa6b9e35f0 ancestor bar@0f2ff26688b9
165 premerge successful
165 premerge successful
166 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
166 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
167 (branch merge, don't forget to commit)
167 (branch merge, don't forget to commit)
168
168
169 $ cat bar
169 $ cat bar
170 line1
170 line1
171 line2
171 line2
172
172
173 $ hg ci -m '5: merge'
173 $ hg ci -m '5: merge'
174
174
175 $ hg debugindex bar
175 $ hg debugindex bar
176 rev offset length ..... linkrev nodeid p1 p2 (re)
176 rev offset length ..... linkrev nodeid p1 p2 (re)
177 0 0 77 ..... 2 d35118874825 000000000000 000000000000 (re)
177 0 0 77 ..... 2 d35118874825 000000000000 000000000000 (re)
178 1 77 76 ..... 3 5345f5ab8abd 000000000000 d35118874825 (re)
178 1 77 76 ..... 3 5345f5ab8abd 000000000000 d35118874825 (re)
179 2 153 7 ..... 4 ff4b45017382 d35118874825 000000000000 (re)
179 2 153 7 ..... 4 ff4b45017382 d35118874825 000000000000 (re)
180 3 160 13 ..... 5 3701b4893544 ff4b45017382 5345f5ab8abd (re)
180 3 160 13 ..... 5 3701b4893544 ff4b45017382 5345f5ab8abd (re)
181
181
182 $ cd ..
182 $ cd ..
@@ -1,349 +1,349
1 Criss cross merging
1 Criss cross merging
2
2
3 $ hg init criss-cross
3 $ hg init criss-cross
4 $ cd criss-cross
4 $ cd criss-cross
5 $ echo '0 base' > f1
5 $ echo '0 base' > f1
6 $ echo '0 base' > f2
6 $ echo '0 base' > f2
7 $ hg ci -Aqm '0 base'
7 $ hg ci -Aqm '0 base'
8
8
9 $ echo '1 first change' > f1
9 $ echo '1 first change' > f1
10 $ hg ci -m '1 first change f1'
10 $ hg ci -m '1 first change f1'
11
11
12 $ hg up -qr0
12 $ hg up -qr0
13 $ echo '2 first change' > f2
13 $ echo '2 first change' > f2
14 $ hg ci -qm '2 first change f2'
14 $ hg ci -qm '2 first change f2'
15
15
16 $ hg merge -qr 1
16 $ hg merge -qr 1
17 $ hg ci -m '3 merge'
17 $ hg ci -m '3 merge'
18
18
19 $ hg up -qr2
19 $ hg up -qr2
20 $ hg merge -qr1
20 $ hg merge -qr1
21 $ hg ci -qm '4 merge'
21 $ hg ci -qm '4 merge'
22
22
23 $ echo '5 second change' > f1
23 $ echo '5 second change' > f1
24 $ hg ci -m '5 second change f1'
24 $ hg ci -m '5 second change f1'
25
25
26 $ hg up -r3
26 $ hg up -r3
27 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
27 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28 $ echo '6 second change' > f2
28 $ echo '6 second change' > f2
29 $ hg ci -m '6 second change f2'
29 $ hg ci -m '6 second change f2'
30
30
31 $ hg log -G
31 $ hg log -G
32 @ changeset: 6:3b08d01b0ab5
32 @ changeset: 6:3b08d01b0ab5
33 | tag: tip
33 | tag: tip
34 | parent: 3:cf89f02107e5
34 | parent: 3:cf89f02107e5
35 | user: test
35 | user: test
36 | date: Thu Jan 01 00:00:00 1970 +0000
36 | date: Thu Jan 01 00:00:00 1970 +0000
37 | summary: 6 second change f2
37 | summary: 6 second change f2
38 |
38 |
39 | o changeset: 5:adfe50279922
39 | o changeset: 5:adfe50279922
40 | | user: test
40 | | user: test
41 | | date: Thu Jan 01 00:00:00 1970 +0000
41 | | date: Thu Jan 01 00:00:00 1970 +0000
42 | | summary: 5 second change f1
42 | | summary: 5 second change f1
43 | |
43 | |
44 | o changeset: 4:7d3e55501ae6
44 | o changeset: 4:7d3e55501ae6
45 | |\ parent: 2:40663881a6dd
45 | |\ parent: 2:40663881a6dd
46 | | | parent: 1:0f6b37dbe527
46 | | | parent: 1:0f6b37dbe527
47 | | | user: test
47 | | | user: test
48 | | | date: Thu Jan 01 00:00:00 1970 +0000
48 | | | date: Thu Jan 01 00:00:00 1970 +0000
49 | | | summary: 4 merge
49 | | | summary: 4 merge
50 | | |
50 | | |
51 o---+ changeset: 3:cf89f02107e5
51 o---+ changeset: 3:cf89f02107e5
52 | | | parent: 2:40663881a6dd
52 | | | parent: 2:40663881a6dd
53 |/ / parent: 1:0f6b37dbe527
53 |/ / parent: 1:0f6b37dbe527
54 | | user: test
54 | | user: test
55 | | date: Thu Jan 01 00:00:00 1970 +0000
55 | | date: Thu Jan 01 00:00:00 1970 +0000
56 | | summary: 3 merge
56 | | summary: 3 merge
57 | |
57 | |
58 | o changeset: 2:40663881a6dd
58 | o changeset: 2:40663881a6dd
59 | | parent: 0:40494bf2444c
59 | | parent: 0:40494bf2444c
60 | | user: test
60 | | user: test
61 | | date: Thu Jan 01 00:00:00 1970 +0000
61 | | date: Thu Jan 01 00:00:00 1970 +0000
62 | | summary: 2 first change f2
62 | | summary: 2 first change f2
63 | |
63 | |
64 o | changeset: 1:0f6b37dbe527
64 o | changeset: 1:0f6b37dbe527
65 |/ user: test
65 |/ user: test
66 | date: Thu Jan 01 00:00:00 1970 +0000
66 | date: Thu Jan 01 00:00:00 1970 +0000
67 | summary: 1 first change f1
67 | summary: 1 first change f1
68 |
68 |
69 o changeset: 0:40494bf2444c
69 o changeset: 0:40494bf2444c
70 user: test
70 user: test
71 date: Thu Jan 01 00:00:00 1970 +0000
71 date: Thu Jan 01 00:00:00 1970 +0000
72 summary: 0 base
72 summary: 0 base
73
73
74
74
75 $ hg merge -v --debug --tool internal:dump 5 --config merge.preferancestor='!'
75 $ hg merge -v --debug --tool internal:dump 5 --config merge.preferancestor='!'
76 note: using 0f6b37dbe527 as ancestor of 3b08d01b0ab5 and adfe50279922
76 note: using 0f6b37dbe527 as ancestor of 3b08d01b0ab5 and adfe50279922
77 alternatively, use --config merge.preferancestor=40663881a6dd
77 alternatively, use --config merge.preferancestor=40663881a6dd
78 searching for copies back to rev 3
78 searching for copies back to rev 3
79 resolving manifests
79 resolving manifests
80 branchmerge: True, force: False, partial: False
80 branchmerge: True, force: False, partial: False
81 ancestor: 0f6b37dbe527, local: 3b08d01b0ab5+, remote: adfe50279922
81 ancestor: 0f6b37dbe527, local: 3b08d01b0ab5+, remote: adfe50279922
82 preserving f2 for resolve of f2
82 preserving f2 for resolve of f2
83 f1: remote is newer -> g
83 f1: remote is newer -> g
84 getting f1
84 getting f1
85 f2: versions differ -> m
85 f2: versions differ -> m
86 picked tool 'internal:dump' for f2 (binary False symlink False)
86 picked tool ':dump' for f2 (binary False symlink False)
87 merging f2
87 merging f2
88 my f2@3b08d01b0ab5+ other f2@adfe50279922 ancestor f2@40494bf2444c
88 my f2@3b08d01b0ab5+ other f2@adfe50279922 ancestor f2@40494bf2444c
89 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
89 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
90 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
90 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
91 [1]
91 [1]
92
92
93 $ head *
93 $ head *
94 ==> f1 <==
94 ==> f1 <==
95 5 second change
95 5 second change
96
96
97 ==> f2 <==
97 ==> f2 <==
98 6 second change
98 6 second change
99
99
100 ==> f2.base <==
100 ==> f2.base <==
101 0 base
101 0 base
102
102
103 ==> f2.local <==
103 ==> f2.local <==
104 6 second change
104 6 second change
105
105
106 ==> f2.orig <==
106 ==> f2.orig <==
107 6 second change
107 6 second change
108
108
109 ==> f2.other <==
109 ==> f2.other <==
110 2 first change
110 2 first change
111
111
112 $ hg up -qC .
112 $ hg up -qC .
113 $ hg merge -v --tool internal:dump 5 --config merge.preferancestor="null 40663881 3b08d"
113 $ hg merge -v --tool internal:dump 5 --config merge.preferancestor="null 40663881 3b08d"
114 note: using 40663881a6dd as ancestor of 3b08d01b0ab5 and adfe50279922
114 note: using 40663881a6dd as ancestor of 3b08d01b0ab5 and adfe50279922
115 alternatively, use --config merge.preferancestor=0f6b37dbe527
115 alternatively, use --config merge.preferancestor=0f6b37dbe527
116 resolving manifests
116 resolving manifests
117 merging f1
117 merging f1
118 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
118 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
119 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
119 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
120 [1]
120 [1]
121
121
122 Redo merge with merge.preferancestor="*" to enable bid merge
122 Redo merge with merge.preferancestor="*" to enable bid merge
123
123
124 $ rm f*
124 $ rm f*
125 $ hg up -qC .
125 $ hg up -qC .
126 $ hg merge -v --debug --tool internal:dump 5 --config merge.preferancestor="*"
126 $ hg merge -v --debug --tool internal:dump 5 --config merge.preferancestor="*"
127 note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
127 note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
128
128
129 calculating bids for ancestor 0f6b37dbe527
129 calculating bids for ancestor 0f6b37dbe527
130 searching for copies back to rev 3
130 searching for copies back to rev 3
131 resolving manifests
131 resolving manifests
132 branchmerge: True, force: False, partial: False
132 branchmerge: True, force: False, partial: False
133 ancestor: 0f6b37dbe527, local: 3b08d01b0ab5+, remote: adfe50279922
133 ancestor: 0f6b37dbe527, local: 3b08d01b0ab5+, remote: adfe50279922
134 f1: remote is newer -> g
134 f1: remote is newer -> g
135 f2: versions differ -> m
135 f2: versions differ -> m
136
136
137 calculating bids for ancestor 40663881a6dd
137 calculating bids for ancestor 40663881a6dd
138 searching for copies back to rev 3
138 searching for copies back to rev 3
139 resolving manifests
139 resolving manifests
140 branchmerge: True, force: False, partial: False
140 branchmerge: True, force: False, partial: False
141 ancestor: 40663881a6dd, local: 3b08d01b0ab5+, remote: adfe50279922
141 ancestor: 40663881a6dd, local: 3b08d01b0ab5+, remote: adfe50279922
142 f1: versions differ -> m
142 f1: versions differ -> m
143 f2: remote unchanged -> k
143 f2: remote unchanged -> k
144
144
145 auction for merging merge bids
145 auction for merging merge bids
146 f1: picking 'get' action
146 f1: picking 'get' action
147 f2: picking 'keep' action
147 f2: picking 'keep' action
148 end of auction
148 end of auction
149
149
150 f1: remote is newer -> g
150 f1: remote is newer -> g
151 getting f1
151 getting f1
152 f2: remote unchanged -> k
152 f2: remote unchanged -> k
153 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
153 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
154 (branch merge, don't forget to commit)
154 (branch merge, don't forget to commit)
155
155
156 $ head *
156 $ head *
157 ==> f1 <==
157 ==> f1 <==
158 5 second change
158 5 second change
159
159
160 ==> f2 <==
160 ==> f2 <==
161 6 second change
161 6 second change
162
162
163
163
164 The other way around:
164 The other way around:
165
165
166 $ hg up -C -r5
166 $ hg up -C -r5
167 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
167 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
168 $ hg merge -v --debug --config merge.preferancestor="*"
168 $ hg merge -v --debug --config merge.preferancestor="*"
169 note: merging adfe50279922+ and 3b08d01b0ab5 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
169 note: merging adfe50279922+ and 3b08d01b0ab5 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
170
170
171 calculating bids for ancestor 0f6b37dbe527
171 calculating bids for ancestor 0f6b37dbe527
172 searching for copies back to rev 3
172 searching for copies back to rev 3
173 resolving manifests
173 resolving manifests
174 branchmerge: True, force: False, partial: False
174 branchmerge: True, force: False, partial: False
175 ancestor: 0f6b37dbe527, local: adfe50279922+, remote: 3b08d01b0ab5
175 ancestor: 0f6b37dbe527, local: adfe50279922+, remote: 3b08d01b0ab5
176 f1: remote unchanged -> k
176 f1: remote unchanged -> k
177 f2: versions differ -> m
177 f2: versions differ -> m
178
178
179 calculating bids for ancestor 40663881a6dd
179 calculating bids for ancestor 40663881a6dd
180 searching for copies back to rev 3
180 searching for copies back to rev 3
181 resolving manifests
181 resolving manifests
182 branchmerge: True, force: False, partial: False
182 branchmerge: True, force: False, partial: False
183 ancestor: 40663881a6dd, local: adfe50279922+, remote: 3b08d01b0ab5
183 ancestor: 40663881a6dd, local: adfe50279922+, remote: 3b08d01b0ab5
184 f1: versions differ -> m
184 f1: versions differ -> m
185 f2: remote is newer -> g
185 f2: remote is newer -> g
186
186
187 auction for merging merge bids
187 auction for merging merge bids
188 f1: picking 'keep' action
188 f1: picking 'keep' action
189 f2: picking 'get' action
189 f2: picking 'get' action
190 end of auction
190 end of auction
191
191
192 f2: remote is newer -> g
192 f2: remote is newer -> g
193 getting f2
193 getting f2
194 f1: remote unchanged -> k
194 f1: remote unchanged -> k
195 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
195 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
196 (branch merge, don't forget to commit)
196 (branch merge, don't forget to commit)
197
197
198 $ head *
198 $ head *
199 ==> f1 <==
199 ==> f1 <==
200 5 second change
200 5 second change
201
201
202 ==> f2 <==
202 ==> f2 <==
203 6 second change
203 6 second change
204
204
205 Verify how the output looks and and how verbose it is:
205 Verify how the output looks and and how verbose it is:
206
206
207 $ hg up -qC
207 $ hg up -qC
208 $ hg merge
208 $ hg merge
209 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
209 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
210 (branch merge, don't forget to commit)
210 (branch merge, don't forget to commit)
211
211
212 $ hg up -qC
212 $ hg up -qC
213 $ hg merge -v
213 $ hg merge -v
214 note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
214 note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
215
215
216 calculating bids for ancestor 0f6b37dbe527
216 calculating bids for ancestor 0f6b37dbe527
217 resolving manifests
217 resolving manifests
218
218
219 calculating bids for ancestor 40663881a6dd
219 calculating bids for ancestor 40663881a6dd
220 resolving manifests
220 resolving manifests
221
221
222 auction for merging merge bids
222 auction for merging merge bids
223 f1: picking 'get' action
223 f1: picking 'get' action
224 f2: picking 'keep' action
224 f2: picking 'keep' action
225 end of auction
225 end of auction
226
226
227 getting f1
227 getting f1
228 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
228 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
229 (branch merge, don't forget to commit)
229 (branch merge, don't forget to commit)
230
230
231 $ hg up -qC
231 $ hg up -qC
232 $ hg merge -v --debug --config merge.preferancestor="*"
232 $ hg merge -v --debug --config merge.preferancestor="*"
233 note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
233 note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
234
234
235 calculating bids for ancestor 0f6b37dbe527
235 calculating bids for ancestor 0f6b37dbe527
236 searching for copies back to rev 3
236 searching for copies back to rev 3
237 resolving manifests
237 resolving manifests
238 branchmerge: True, force: False, partial: False
238 branchmerge: True, force: False, partial: False
239 ancestor: 0f6b37dbe527, local: 3b08d01b0ab5+, remote: adfe50279922
239 ancestor: 0f6b37dbe527, local: 3b08d01b0ab5+, remote: adfe50279922
240 f1: remote is newer -> g
240 f1: remote is newer -> g
241 f2: versions differ -> m
241 f2: versions differ -> m
242
242
243 calculating bids for ancestor 40663881a6dd
243 calculating bids for ancestor 40663881a6dd
244 searching for copies back to rev 3
244 searching for copies back to rev 3
245 resolving manifests
245 resolving manifests
246 branchmerge: True, force: False, partial: False
246 branchmerge: True, force: False, partial: False
247 ancestor: 40663881a6dd, local: 3b08d01b0ab5+, remote: adfe50279922
247 ancestor: 40663881a6dd, local: 3b08d01b0ab5+, remote: adfe50279922
248 f1: versions differ -> m
248 f1: versions differ -> m
249 f2: remote unchanged -> k
249 f2: remote unchanged -> k
250
250
251 auction for merging merge bids
251 auction for merging merge bids
252 f1: picking 'get' action
252 f1: picking 'get' action
253 f2: picking 'keep' action
253 f2: picking 'keep' action
254 end of auction
254 end of auction
255
255
256 f1: remote is newer -> g
256 f1: remote is newer -> g
257 getting f1
257 getting f1
258 f2: remote unchanged -> k
258 f2: remote unchanged -> k
259 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
259 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
260 (branch merge, don't forget to commit)
260 (branch merge, don't forget to commit)
261
261
262 $ cd ..
262 $ cd ..
263
263
264 http://stackoverflow.com/questions/9350005/how-do-i-specify-a-merge-base-to-use-in-a-hg-merge/9430810
264 http://stackoverflow.com/questions/9350005/how-do-i-specify-a-merge-base-to-use-in-a-hg-merge/9430810
265
265
266 $ hg init ancestor-merging
266 $ hg init ancestor-merging
267 $ cd ancestor-merging
267 $ cd ancestor-merging
268 $ echo a > x
268 $ echo a > x
269 $ hg commit -A -m a x
269 $ hg commit -A -m a x
270 $ hg update -q 0
270 $ hg update -q 0
271 $ echo b >> x
271 $ echo b >> x
272 $ hg commit -m b
272 $ hg commit -m b
273 $ hg update -q 0
273 $ hg update -q 0
274 $ echo c >> x
274 $ echo c >> x
275 $ hg commit -qm c
275 $ hg commit -qm c
276 $ hg update -q 1
276 $ hg update -q 1
277 $ hg merge -q --tool internal:local 2
277 $ hg merge -q --tool internal:local 2
278 $ echo c >> x
278 $ echo c >> x
279 $ hg commit -m bc
279 $ hg commit -m bc
280 $ hg update -q 2
280 $ hg update -q 2
281 $ hg merge -q --tool internal:local 1
281 $ hg merge -q --tool internal:local 1
282 $ echo b >> x
282 $ echo b >> x
283 $ hg commit -qm cb
283 $ hg commit -qm cb
284
284
285 $ hg merge --config merge.preferancestor='!'
285 $ hg merge --config merge.preferancestor='!'
286 note: using 70008a2163f6 as ancestor of 0d355fdef312 and 4b8b546a3eef
286 note: using 70008a2163f6 as ancestor of 0d355fdef312 and 4b8b546a3eef
287 alternatively, use --config merge.preferancestor=b211bbc6eb3c
287 alternatively, use --config merge.preferancestor=b211bbc6eb3c
288 merging x
288 merging x
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 $ cat x
291 $ cat x
292 a
292 a
293 c
293 c
294 b
294 b
295 c
295 c
296
296
297 $ hg up -qC .
297 $ hg up -qC .
298
298
299 $ hg merge --config merge.preferancestor=b211bbc6eb3c
299 $ hg merge --config merge.preferancestor=b211bbc6eb3c
300 note: using b211bbc6eb3c as ancestor of 0d355fdef312 and 4b8b546a3eef
300 note: using b211bbc6eb3c as ancestor of 0d355fdef312 and 4b8b546a3eef
301 alternatively, use --config merge.preferancestor=70008a2163f6
301 alternatively, use --config merge.preferancestor=70008a2163f6
302 merging x
302 merging x
303 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
303 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
304 (branch merge, don't forget to commit)
304 (branch merge, don't forget to commit)
305 $ cat x
305 $ cat x
306 a
306 a
307 b
307 b
308 c
308 c
309 b
309 b
310
310
311 $ hg up -qC .
311 $ hg up -qC .
312
312
313 $ hg merge -v --config merge.preferancestor="*"
313 $ hg merge -v --config merge.preferancestor="*"
314 note: merging 0d355fdef312+ and 4b8b546a3eef using bids from ancestors 70008a2163f6 and b211bbc6eb3c
314 note: merging 0d355fdef312+ and 4b8b546a3eef using bids from ancestors 70008a2163f6 and b211bbc6eb3c
315
315
316 calculating bids for ancestor 70008a2163f6
316 calculating bids for ancestor 70008a2163f6
317 resolving manifests
317 resolving manifests
318
318
319 calculating bids for ancestor b211bbc6eb3c
319 calculating bids for ancestor b211bbc6eb3c
320 resolving manifests
320 resolving manifests
321
321
322 auction for merging merge bids
322 auction for merging merge bids
323 x: multiple bids for merge action:
323 x: multiple bids for merge action:
324 versions differ -> m
324 versions differ -> m
325 versions differ -> m
325 versions differ -> m
326 x: ambiguous merge - picked m action
326 x: ambiguous merge - picked m action
327 end of auction
327 end of auction
328
328
329 merging x
329 merging x
330 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
330 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
331 (branch merge, don't forget to commit)
331 (branch merge, don't forget to commit)
332 $ cat x
332 $ cat x
333 a
333 a
334 c
334 c
335 b
335 b
336 c
336 c
337
337
338 Verify that the old context ancestor works with / despite preferancestor:
338 Verify that the old context ancestor works with / despite preferancestor:
339
339
340 $ hg log -r 'ancestor(head())' --config merge.preferancestor=1 -T '{rev}\n'
340 $ hg log -r 'ancestor(head())' --config merge.preferancestor=1 -T '{rev}\n'
341 1
341 1
342 $ hg log -r 'ancestor(head())' --config merge.preferancestor=2 -T '{rev}\n'
342 $ hg log -r 'ancestor(head())' --config merge.preferancestor=2 -T '{rev}\n'
343 2
343 2
344 $ hg log -r 'ancestor(head())' --config merge.preferancestor=3 -T '{rev}\n'
344 $ hg log -r 'ancestor(head())' --config merge.preferancestor=3 -T '{rev}\n'
345 1
345 1
346 $ hg log -r 'ancestor(head())' --config merge.preferancestor='1337 * - 2' -T '{rev}\n'
346 $ hg log -r 'ancestor(head())' --config merge.preferancestor='1337 * - 2' -T '{rev}\n'
347 2
347 2
348
348
349 $ cd ..
349 $ cd ..
@@ -1,376 +1,376
1 #require symlink execbit
1 #require symlink execbit
2
2
3 $ tellmeabout() {
3 $ tellmeabout() {
4 > if [ -h $1 ]; then
4 > if [ -h $1 ]; then
5 > echo $1 is a symlink:
5 > echo $1 is a symlink:
6 > $TESTDIR/readlink.py $1
6 > $TESTDIR/readlink.py $1
7 > elif [ -x $1 ]; then
7 > elif [ -x $1 ]; then
8 > echo $1 is an executable file with content:
8 > echo $1 is an executable file with content:
9 > cat $1
9 > cat $1
10 > else
10 > else
11 > echo $1 is a plain file with content:
11 > echo $1 is a plain file with content:
12 > cat $1
12 > cat $1
13 > fi
13 > fi
14 > }
14 > }
15
15
16 $ hg init test1
16 $ hg init test1
17 $ cd test1
17 $ cd test1
18
18
19 $ echo a > a
19 $ echo a > a
20 $ hg ci -Aqmadd
20 $ hg ci -Aqmadd
21 $ chmod +x a
21 $ chmod +x a
22 $ hg ci -mexecutable
22 $ hg ci -mexecutable
23
23
24 $ hg up -q 0
24 $ hg up -q 0
25 $ rm a
25 $ rm a
26 $ ln -s symlink a
26 $ ln -s symlink a
27 $ hg ci -msymlink
27 $ hg ci -msymlink
28 created new head
28 created new head
29
29
30 Symlink is local parent, executable is other:
30 Symlink is local parent, executable is other:
31
31
32 $ hg merge --debug
32 $ hg merge --debug
33 searching for copies back to rev 1
33 searching for copies back to rev 1
34 resolving manifests
34 resolving manifests
35 branchmerge: True, force: False, partial: False
35 branchmerge: True, force: False, partial: False
36 ancestor: c334dc3be0da, local: 521a1e40188f+, remote: 3574f3e69b1c
36 ancestor: c334dc3be0da, local: 521a1e40188f+, remote: 3574f3e69b1c
37 preserving a for resolve of a
37 preserving a for resolve of a
38 a: versions differ -> m
38 a: versions differ -> m
39 picked tool 'internal:merge' for a (binary False symlink True)
39 picked tool ':merge' for a (binary False symlink True)
40 merging a
40 merging a
41 my a@521a1e40188f+ other a@3574f3e69b1c ancestor a@c334dc3be0da
41 my a@521a1e40188f+ other a@3574f3e69b1c ancestor a@c334dc3be0da
42 warning: internal :merge cannot merge symlinks for a
42 warning: internal :merge cannot merge symlinks for a
43 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
43 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
44 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
44 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
45 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
45 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
46 [1]
46 [1]
47
47
48 $ tellmeabout a
48 $ tellmeabout a
49 a is a symlink:
49 a is a symlink:
50 a -> symlink
50 a -> symlink
51 $ hg resolve a --tool internal:other
51 $ hg resolve a --tool internal:other
52 (no more unresolved files)
52 (no more unresolved files)
53 $ tellmeabout a
53 $ tellmeabout a
54 a is an executable file with content:
54 a is an executable file with content:
55 a
55 a
56 $ hg st
56 $ hg st
57 M a
57 M a
58 ? a.orig
58 ? a.orig
59
59
60 Symlink is other parent, executable is local:
60 Symlink is other parent, executable is local:
61
61
62 $ hg update -C 1
62 $ hg update -C 1
63 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
63 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
64
64
65 $ hg merge --debug
65 $ hg merge --debug
66 searching for copies back to rev 1
66 searching for copies back to rev 1
67 resolving manifests
67 resolving manifests
68 branchmerge: True, force: False, partial: False
68 branchmerge: True, force: False, partial: False
69 ancestor: c334dc3be0da, local: 3574f3e69b1c+, remote: 521a1e40188f
69 ancestor: c334dc3be0da, local: 3574f3e69b1c+, remote: 521a1e40188f
70 preserving a for resolve of a
70 preserving a for resolve of a
71 a: versions differ -> m
71 a: versions differ -> m
72 picked tool 'internal:merge' for a (binary False symlink True)
72 picked tool ':merge' for a (binary False symlink True)
73 merging a
73 merging a
74 my a@3574f3e69b1c+ other a@521a1e40188f ancestor a@c334dc3be0da
74 my a@3574f3e69b1c+ other a@521a1e40188f ancestor a@c334dc3be0da
75 warning: internal :merge cannot merge symlinks for a
75 warning: internal :merge cannot merge symlinks for a
76 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
76 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
77 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
77 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
78 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
78 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
79 [1]
79 [1]
80
80
81 $ tellmeabout a
81 $ tellmeabout a
82 a is an executable file with content:
82 a is an executable file with content:
83 a
83 a
84
84
85 Update to link without local change should get us a symlink (issue3316):
85 Update to link without local change should get us a symlink (issue3316):
86
86
87 $ hg up -C 0
87 $ hg up -C 0
88 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
88 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
89 $ hg up
89 $ hg up
90 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
90 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
91 $ hg st
91 $ hg st
92 ? a.orig
92 ? a.orig
93
93
94 Update to link with local change should cause a merge prompt (issue3200):
94 Update to link with local change should cause a merge prompt (issue3200):
95
95
96 $ hg up -Cq 0
96 $ hg up -Cq 0
97 $ echo data > a
97 $ echo data > a
98 $ HGMERGE= hg up -y --debug
98 $ HGMERGE= hg up -y --debug
99 searching for copies back to rev 2
99 searching for copies back to rev 2
100 resolving manifests
100 resolving manifests
101 branchmerge: False, force: False, partial: False
101 branchmerge: False, force: False, partial: False
102 ancestor: c334dc3be0da, local: c334dc3be0da+, remote: 521a1e40188f
102 ancestor: c334dc3be0da, local: c334dc3be0da+, remote: 521a1e40188f
103 preserving a for resolve of a
103 preserving a for resolve of a
104 a: versions differ -> m
104 a: versions differ -> m
105 (couldn't find merge tool hgmerge|tool hgmerge can't handle symlinks) (re)
105 (couldn't find merge tool hgmerge|tool hgmerge can't handle symlinks) (re)
106 picked tool ':prompt' for a (binary False symlink True)
106 picked tool ':prompt' for a (binary False symlink True)
107 no tool found to merge a
107 no tool found to merge a
108 keep (l)ocal or take (o)ther? l
108 keep (l)ocal or take (o)ther? l
109 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
109 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
110 $ hg diff --git
110 $ hg diff --git
111 diff --git a/a b/a
111 diff --git a/a b/a
112 old mode 120000
112 old mode 120000
113 new mode 100644
113 new mode 100644
114 --- a/a
114 --- a/a
115 +++ b/a
115 +++ b/a
116 @@ -1,1 +1,1 @@
116 @@ -1,1 +1,1 @@
117 -symlink
117 -symlink
118 \ No newline at end of file
118 \ No newline at end of file
119 +data
119 +data
120
120
121
121
122 Test only 'l' change - happens rarely, except when recovering from situations
122 Test only 'l' change - happens rarely, except when recovering from situations
123 where that was what happened.
123 where that was what happened.
124
124
125 $ hg init test2
125 $ hg init test2
126 $ cd test2
126 $ cd test2
127 $ printf base > f
127 $ printf base > f
128 $ hg ci -Aqm0
128 $ hg ci -Aqm0
129 $ echo file > f
129 $ echo file > f
130 $ echo content >> f
130 $ echo content >> f
131 $ hg ci -qm1
131 $ hg ci -qm1
132 $ hg up -qr0
132 $ hg up -qr0
133 $ rm f
133 $ rm f
134 $ ln -s base f
134 $ ln -s base f
135 $ hg ci -qm2
135 $ hg ci -qm2
136 $ hg merge
136 $ hg merge
137 merging f
137 merging f
138 warning: internal :merge cannot merge symlinks for f
138 warning: internal :merge cannot merge symlinks for f
139 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
139 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
140 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
140 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
141 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
141 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
142 [1]
142 [1]
143 $ tellmeabout f
143 $ tellmeabout f
144 f is a symlink:
144 f is a symlink:
145 f -> base
145 f -> base
146
146
147 $ hg up -Cqr1
147 $ hg up -Cqr1
148 $ hg merge
148 $ hg merge
149 merging f
149 merging f
150 warning: internal :merge cannot merge symlinks for f
150 warning: internal :merge cannot merge symlinks for f
151 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
151 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
152 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
152 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
153 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
153 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
154 [1]
154 [1]
155 $ tellmeabout f
155 $ tellmeabout f
156 f is a plain file with content:
156 f is a plain file with content:
157 file
157 file
158 content
158 content
159
159
160 $ cd ..
160 $ cd ..
161
161
162 Test removed 'x' flag merged with change to symlink
162 Test removed 'x' flag merged with change to symlink
163
163
164 $ hg init test3
164 $ hg init test3
165 $ cd test3
165 $ cd test3
166 $ echo f > f
166 $ echo f > f
167 $ chmod +x f
167 $ chmod +x f
168 $ hg ci -Aqm0
168 $ hg ci -Aqm0
169 $ chmod -x f
169 $ chmod -x f
170 $ hg ci -qm1
170 $ hg ci -qm1
171 $ hg up -qr0
171 $ hg up -qr0
172 $ rm f
172 $ rm f
173 $ ln -s dangling f
173 $ ln -s dangling f
174 $ hg ci -qm2
174 $ hg ci -qm2
175 $ hg merge
175 $ hg merge
176 merging f
176 merging f
177 warning: internal :merge cannot merge symlinks for f
177 warning: internal :merge cannot merge symlinks for f
178 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
178 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
179 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
179 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
180 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
180 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
181 [1]
181 [1]
182 $ tellmeabout f
182 $ tellmeabout f
183 f is a symlink:
183 f is a symlink:
184 f -> dangling
184 f -> dangling
185
185
186 $ hg up -Cqr1
186 $ hg up -Cqr1
187 $ hg merge
187 $ hg merge
188 merging f
188 merging f
189 warning: internal :merge cannot merge symlinks for f
189 warning: internal :merge cannot merge symlinks for f
190 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
190 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
191 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
191 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
192 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
192 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
193 [1]
193 [1]
194 $ tellmeabout f
194 $ tellmeabout f
195 f is a plain file with content:
195 f is a plain file with content:
196 f
196 f
197
197
198 Test removed 'x' flag merged with content change - both ways
198 Test removed 'x' flag merged with content change - both ways
199
199
200 $ hg up -Cqr0
200 $ hg up -Cqr0
201 $ echo change > f
201 $ echo change > f
202 $ hg ci -qm3
202 $ hg ci -qm3
203 $ hg merge -r1
203 $ hg merge -r1
204 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
204 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
205 (branch merge, don't forget to commit)
205 (branch merge, don't forget to commit)
206 $ tellmeabout f
206 $ tellmeabout f
207 f is a plain file with content:
207 f is a plain file with content:
208 change
208 change
209
209
210 $ hg up -qCr1
210 $ hg up -qCr1
211 $ hg merge -r3
211 $ hg merge -r3
212 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
212 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
213 (branch merge, don't forget to commit)
213 (branch merge, don't forget to commit)
214 $ tellmeabout f
214 $ tellmeabout f
215 f is a plain file with content:
215 f is a plain file with content:
216 change
216 change
217
217
218 $ cd ..
218 $ cd ..
219
219
220 Test merge with no common ancestor:
220 Test merge with no common ancestor:
221 a: just different
221 a: just different
222 b: x vs -, different (cannot calculate x, cannot ask merge tool)
222 b: x vs -, different (cannot calculate x, cannot ask merge tool)
223 c: x vs -, same (cannot calculate x, merge tool is no good)
223 c: x vs -, same (cannot calculate x, merge tool is no good)
224 d: x vs l, different
224 d: x vs l, different
225 e: x vs l, same
225 e: x vs l, same
226 f: - vs l, different
226 f: - vs l, different
227 g: - vs l, same
227 g: - vs l, same
228 h: l vs l, different
228 h: l vs l, different
229 (where same means the filelog entry is shared and there thus is an ancestor!)
229 (where same means the filelog entry is shared and there thus is an ancestor!)
230
230
231 $ hg init test4
231 $ hg init test4
232 $ cd test4
232 $ cd test4
233 $ echo 0 > 0
233 $ echo 0 > 0
234 $ hg ci -Aqm0
234 $ hg ci -Aqm0
235
235
236 $ echo 1 > a
236 $ echo 1 > a
237 $ echo 1 > b
237 $ echo 1 > b
238 $ chmod +x b
238 $ chmod +x b
239 $ echo x > c
239 $ echo x > c
240 $ chmod +x c
240 $ chmod +x c
241 $ echo 1 > d
241 $ echo 1 > d
242 $ chmod +x d
242 $ chmod +x d
243 $ printf x > e
243 $ printf x > e
244 $ chmod +x e
244 $ chmod +x e
245 $ echo 1 > f
245 $ echo 1 > f
246 $ printf x > g
246 $ printf x > g
247 $ ln -s 1 h
247 $ ln -s 1 h
248 $ hg ci -qAm1
248 $ hg ci -qAm1
249
249
250 $ hg up -qr0
250 $ hg up -qr0
251 $ echo 2 > a
251 $ echo 2 > a
252 $ echo 2 > b
252 $ echo 2 > b
253 $ echo x > c
253 $ echo x > c
254 $ ln -s 2 d
254 $ ln -s 2 d
255 $ ln -s x e
255 $ ln -s x e
256 $ ln -s 2 f
256 $ ln -s 2 f
257 $ ln -s x g
257 $ ln -s x g
258 $ ln -s 2 h
258 $ ln -s 2 h
259 $ hg ci -Aqm2
259 $ hg ci -Aqm2
260
260
261 $ hg merge
261 $ hg merge
262 merging a
262 merging a
263 warning: conflicts during merge.
263 warning: conflicts during merge.
264 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
264 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
265 warning: cannot merge flags for b
265 warning: cannot merge flags for b
266 merging b
266 merging b
267 warning: conflicts during merge.
267 warning: conflicts during merge.
268 merging b incomplete! (edit conflicts, then use 'hg resolve --mark')
268 merging b incomplete! (edit conflicts, then use 'hg resolve --mark')
269 warning: cannot merge flags for c
269 warning: cannot merge flags for c
270 merging d
270 merging d
271 warning: internal :merge cannot merge symlinks for d
271 warning: internal :merge cannot merge symlinks for d
272 merging d incomplete! (edit conflicts, then use 'hg resolve --mark')
272 merging d incomplete! (edit conflicts, then use 'hg resolve --mark')
273 merging f
273 merging f
274 warning: internal :merge cannot merge symlinks for f
274 warning: internal :merge cannot merge symlinks for f
275 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
275 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
276 merging h
276 merging h
277 warning: internal :merge cannot merge symlinks for h
277 warning: internal :merge cannot merge symlinks for h
278 merging h incomplete! (edit conflicts, then use 'hg resolve --mark')
278 merging h incomplete! (edit conflicts, then use 'hg resolve --mark')
279 3 files updated, 0 files merged, 0 files removed, 5 files unresolved
279 3 files updated, 0 files merged, 0 files removed, 5 files unresolved
280 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
280 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
281 [1]
281 [1]
282 $ hg resolve -l
282 $ hg resolve -l
283 U a
283 U a
284 U b
284 U b
285 U d
285 U d
286 U f
286 U f
287 U h
287 U h
288 $ tellmeabout a
288 $ tellmeabout a
289 a is a plain file with content:
289 a is a plain file with content:
290 <<<<<<< local: 0139c5610547 - test: 2
290 <<<<<<< local: 0139c5610547 - test: 2
291 2
291 2
292 =======
292 =======
293 1
293 1
294 >>>>>>> other: 97e29675e796 - test: 1
294 >>>>>>> other: 97e29675e796 - test: 1
295 $ tellmeabout b
295 $ tellmeabout b
296 b is a plain file with content:
296 b is a plain file with content:
297 <<<<<<< local: 0139c5610547 - test: 2
297 <<<<<<< local: 0139c5610547 - test: 2
298 2
298 2
299 =======
299 =======
300 1
300 1
301 >>>>>>> other: 97e29675e796 - test: 1
301 >>>>>>> other: 97e29675e796 - test: 1
302 $ tellmeabout c
302 $ tellmeabout c
303 c is a plain file with content:
303 c is a plain file with content:
304 x
304 x
305 $ tellmeabout d
305 $ tellmeabout d
306 d is a symlink:
306 d is a symlink:
307 d -> 2
307 d -> 2
308 $ tellmeabout e
308 $ tellmeabout e
309 e is a symlink:
309 e is a symlink:
310 e -> x
310 e -> x
311 $ tellmeabout f
311 $ tellmeabout f
312 f is a symlink:
312 f is a symlink:
313 f -> 2
313 f -> 2
314 $ tellmeabout g
314 $ tellmeabout g
315 g is a symlink:
315 g is a symlink:
316 g -> x
316 g -> x
317 $ tellmeabout h
317 $ tellmeabout h
318 h is a symlink:
318 h is a symlink:
319 h -> 2
319 h -> 2
320
320
321 $ hg up -Cqr1
321 $ hg up -Cqr1
322 $ hg merge
322 $ hg merge
323 merging a
323 merging a
324 warning: conflicts during merge.
324 warning: conflicts during merge.
325 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
325 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
326 warning: cannot merge flags for b
326 warning: cannot merge flags for b
327 merging b
327 merging b
328 warning: conflicts during merge.
328 warning: conflicts during merge.
329 merging b incomplete! (edit conflicts, then use 'hg resolve --mark')
329 merging b incomplete! (edit conflicts, then use 'hg resolve --mark')
330 warning: cannot merge flags for c
330 warning: cannot merge flags for c
331 merging d
331 merging d
332 warning: internal :merge cannot merge symlinks for d
332 warning: internal :merge cannot merge symlinks for d
333 merging d incomplete! (edit conflicts, then use 'hg resolve --mark')
333 merging d incomplete! (edit conflicts, then use 'hg resolve --mark')
334 merging f
334 merging f
335 warning: internal :merge cannot merge symlinks for f
335 warning: internal :merge cannot merge symlinks for f
336 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
336 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
337 merging h
337 merging h
338 warning: internal :merge cannot merge symlinks for h
338 warning: internal :merge cannot merge symlinks for h
339 merging h incomplete! (edit conflicts, then use 'hg resolve --mark')
339 merging h incomplete! (edit conflicts, then use 'hg resolve --mark')
340 3 files updated, 0 files merged, 0 files removed, 5 files unresolved
340 3 files updated, 0 files merged, 0 files removed, 5 files unresolved
341 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
341 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
342 [1]
342 [1]
343 $ tellmeabout a
343 $ tellmeabout a
344 a is a plain file with content:
344 a is a plain file with content:
345 <<<<<<< local: 97e29675e796 - test: 1
345 <<<<<<< local: 97e29675e796 - test: 1
346 1
346 1
347 =======
347 =======
348 2
348 2
349 >>>>>>> other: 0139c5610547 - test: 2
349 >>>>>>> other: 0139c5610547 - test: 2
350 $ tellmeabout b
350 $ tellmeabout b
351 b is an executable file with content:
351 b is an executable file with content:
352 <<<<<<< local: 97e29675e796 - test: 1
352 <<<<<<< local: 97e29675e796 - test: 1
353 1
353 1
354 =======
354 =======
355 2
355 2
356 >>>>>>> other: 0139c5610547 - test: 2
356 >>>>>>> other: 0139c5610547 - test: 2
357 $ tellmeabout c
357 $ tellmeabout c
358 c is an executable file with content:
358 c is an executable file with content:
359 x
359 x
360 $ tellmeabout d
360 $ tellmeabout d
361 d is an executable file with content:
361 d is an executable file with content:
362 1
362 1
363 $ tellmeabout e
363 $ tellmeabout e
364 e is an executable file with content:
364 e is an executable file with content:
365 x (no-eol)
365 x (no-eol)
366 $ tellmeabout f
366 $ tellmeabout f
367 f is a plain file with content:
367 f is a plain file with content:
368 1
368 1
369 $ tellmeabout g
369 $ tellmeabout g
370 g is a plain file with content:
370 g is a plain file with content:
371 x (no-eol)
371 x (no-eol)
372 $ tellmeabout h
372 $ tellmeabout h
373 h is a symlink:
373 h is a symlink:
374 h -> 1
374 h -> 1
375
375
376 $ cd ..
376 $ cd ..
@@ -1,147 +1,147
1 initial
1 initial
2 $ hg init test-a
2 $ hg init test-a
3 $ cd test-a
3 $ cd test-a
4 $ cat >test.txt <<"EOF"
4 $ cat >test.txt <<"EOF"
5 > 1
5 > 1
6 > 2
6 > 2
7 > 3
7 > 3
8 > EOF
8 > EOF
9 $ hg add test.txt
9 $ hg add test.txt
10 $ hg commit -m "Initial"
10 $ hg commit -m "Initial"
11
11
12 clone
12 clone
13 $ cd ..
13 $ cd ..
14 $ hg clone test-a test-b
14 $ hg clone test-a test-b
15 updating to branch default
15 updating to branch default
16 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
16 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
17
17
18 change test-a
18 change test-a
19 $ cd test-a
19 $ cd test-a
20 $ cat >test.txt <<"EOF"
20 $ cat >test.txt <<"EOF"
21 > one
21 > one
22 > two
22 > two
23 > three
23 > three
24 > EOF
24 > EOF
25 $ hg commit -m "Numbers as words"
25 $ hg commit -m "Numbers as words"
26
26
27 change test-b
27 change test-b
28 $ cd ../test-b
28 $ cd ../test-b
29 $ cat >test.txt <<"EOF"
29 $ cat >test.txt <<"EOF"
30 > 1
30 > 1
31 > 2.5
31 > 2.5
32 > 3
32 > 3
33 > EOF
33 > EOF
34 $ hg commit -m "2 -> 2.5"
34 $ hg commit -m "2 -> 2.5"
35
35
36 now pull and merge from test-a
36 now pull and merge from test-a
37 $ hg pull ../test-a
37 $ hg pull ../test-a
38 pulling from ../test-a
38 pulling from ../test-a
39 searching for changes
39 searching for changes
40 adding changesets
40 adding changesets
41 adding manifests
41 adding manifests
42 adding file changes
42 adding file changes
43 added 1 changesets with 1 changes to 1 files (+1 heads)
43 added 1 changesets with 1 changes to 1 files (+1 heads)
44 (run 'hg heads' to see heads, 'hg merge' to merge)
44 (run 'hg heads' to see heads, 'hg merge' to merge)
45 $ hg merge
45 $ hg merge
46 merging test.txt
46 merging test.txt
47 warning: conflicts during merge.
47 warning: conflicts during merge.
48 merging test.txt incomplete! (edit conflicts, then use 'hg resolve --mark')
48 merging test.txt incomplete! (edit conflicts, then use 'hg resolve --mark')
49 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
49 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
50 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
50 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
51 [1]
51 [1]
52 resolve conflict
52 resolve conflict
53 $ cat >test.txt <<"EOF"
53 $ cat >test.txt <<"EOF"
54 > one
54 > one
55 > two-point-five
55 > two-point-five
56 > three
56 > three
57 > EOF
57 > EOF
58 $ rm -f *.orig
58 $ rm -f *.orig
59 $ hg resolve -m test.txt
59 $ hg resolve -m test.txt
60 (no more unresolved files)
60 (no more unresolved files)
61 $ hg commit -m "Merge 1"
61 $ hg commit -m "Merge 1"
62
62
63 change test-a again
63 change test-a again
64 $ cd ../test-a
64 $ cd ../test-a
65 $ cat >test.txt <<"EOF"
65 $ cat >test.txt <<"EOF"
66 > one
66 > one
67 > two-point-one
67 > two-point-one
68 > three
68 > three
69 > EOF
69 > EOF
70 $ hg commit -m "two -> two-point-one"
70 $ hg commit -m "two -> two-point-one"
71
71
72 pull and merge from test-a again
72 pull and merge from test-a again
73 $ cd ../test-b
73 $ cd ../test-b
74 $ hg pull ../test-a
74 $ hg pull ../test-a
75 pulling from ../test-a
75 pulling from ../test-a
76 searching for changes
76 searching for changes
77 adding changesets
77 adding changesets
78 adding manifests
78 adding manifests
79 adding file changes
79 adding file changes
80 added 1 changesets with 1 changes to 1 files (+1 heads)
80 added 1 changesets with 1 changes to 1 files (+1 heads)
81 (run 'hg heads' to see heads, 'hg merge' to merge)
81 (run 'hg heads' to see heads, 'hg merge' to merge)
82 $ hg merge --debug
82 $ hg merge --debug
83 searching for copies back to rev 1
83 searching for copies back to rev 1
84 resolving manifests
84 resolving manifests
85 branchmerge: True, force: False, partial: False
85 branchmerge: True, force: False, partial: False
86 ancestor: 96b70246a118, local: 50c3a7e29886+, remote: 40d11a4173a8
86 ancestor: 96b70246a118, local: 50c3a7e29886+, remote: 40d11a4173a8
87 preserving test.txt for resolve of test.txt
87 preserving test.txt for resolve of test.txt
88 test.txt: versions differ -> m
88 test.txt: versions differ -> m
89 picked tool 'internal:merge' for test.txt (binary False symlink False)
89 picked tool ':merge' for test.txt (binary False symlink False)
90 merging test.txt
90 merging test.txt
91 my test.txt@50c3a7e29886+ other test.txt@40d11a4173a8 ancestor test.txt@96b70246a118
91 my test.txt@50c3a7e29886+ other test.txt@40d11a4173a8 ancestor test.txt@96b70246a118
92 warning: conflicts during merge.
92 warning: conflicts during merge.
93 merging test.txt incomplete! (edit conflicts, then use 'hg resolve --mark')
93 merging test.txt incomplete! (edit conflicts, then use 'hg resolve --mark')
94 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
94 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
95 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
95 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
96 [1]
96 [1]
97
97
98 $ cat test.txt
98 $ cat test.txt
99 one
99 one
100 <<<<<<< local: 50c3a7e29886 - test: Merge 1
100 <<<<<<< local: 50c3a7e29886 - test: Merge 1
101 two-point-five
101 two-point-five
102 =======
102 =======
103 two-point-one
103 two-point-one
104 >>>>>>> other: 40d11a4173a8 - test: two -> two-point-one
104 >>>>>>> other: 40d11a4173a8 - test: two -> two-point-one
105 three
105 three
106
106
107 $ hg debugindex test.txt
107 $ hg debugindex test.txt
108 rev offset length ..... linkrev nodeid p1 p2 (re)
108 rev offset length ..... linkrev nodeid p1 p2 (re)
109 0 0 7 ..... 0 01365c4cca56 000000000000 000000000000 (re)
109 0 0 7 ..... 0 01365c4cca56 000000000000 000000000000 (re)
110 1 7 9 ..... 1 7b013192566a 01365c4cca56 000000000000 (re)
110 1 7 9 ..... 1 7b013192566a 01365c4cca56 000000000000 (re)
111 2 16 15 ..... 2 8fe46a3eb557 01365c4cca56 000000000000 (re)
111 2 16 15 ..... 2 8fe46a3eb557 01365c4cca56 000000000000 (re)
112 3 31 2. ..... 3 fc3148072371 7b013192566a 8fe46a3eb557 (re)
112 3 31 2. ..... 3 fc3148072371 7b013192566a 8fe46a3eb557 (re)
113 4 5. 25 ..... 4 d40249267ae3 8fe46a3eb557 000000000000 (re)
113 4 5. 25 ..... 4 d40249267ae3 8fe46a3eb557 000000000000 (re)
114
114
115 $ hg log
115 $ hg log
116 changeset: 4:40d11a4173a8
116 changeset: 4:40d11a4173a8
117 tag: tip
117 tag: tip
118 parent: 2:96b70246a118
118 parent: 2:96b70246a118
119 user: test
119 user: test
120 date: Thu Jan 01 00:00:00 1970 +0000
120 date: Thu Jan 01 00:00:00 1970 +0000
121 summary: two -> two-point-one
121 summary: two -> two-point-one
122
122
123 changeset: 3:50c3a7e29886
123 changeset: 3:50c3a7e29886
124 parent: 1:d1e159716d41
124 parent: 1:d1e159716d41
125 parent: 2:96b70246a118
125 parent: 2:96b70246a118
126 user: test
126 user: test
127 date: Thu Jan 01 00:00:00 1970 +0000
127 date: Thu Jan 01 00:00:00 1970 +0000
128 summary: Merge 1
128 summary: Merge 1
129
129
130 changeset: 2:96b70246a118
130 changeset: 2:96b70246a118
131 parent: 0:b1832b9d912a
131 parent: 0:b1832b9d912a
132 user: test
132 user: test
133 date: Thu Jan 01 00:00:00 1970 +0000
133 date: Thu Jan 01 00:00:00 1970 +0000
134 summary: Numbers as words
134 summary: Numbers as words
135
135
136 changeset: 1:d1e159716d41
136 changeset: 1:d1e159716d41
137 user: test
137 user: test
138 date: Thu Jan 01 00:00:00 1970 +0000
138 date: Thu Jan 01 00:00:00 1970 +0000
139 summary: 2 -> 2.5
139 summary: 2 -> 2.5
140
140
141 changeset: 0:b1832b9d912a
141 changeset: 0:b1832b9d912a
142 user: test
142 user: test
143 date: Thu Jan 01 00:00:00 1970 +0000
143 date: Thu Jan 01 00:00:00 1970 +0000
144 summary: Initial
144 summary: Initial
145
145
146
146
147 $ cd ..
147 $ cd ..
@@ -1,188 +1,188
1 $ hg init
1 $ hg init
2
2
3 $ echo "[merge]" >> .hg/hgrc
3 $ echo "[merge]" >> .hg/hgrc
4 $ echo "followcopies = 1" >> .hg/hgrc
4 $ echo "followcopies = 1" >> .hg/hgrc
5
5
6 $ echo foo > a
6 $ echo foo > a
7 $ echo foo > a2
7 $ echo foo > a2
8 $ hg add a a2
8 $ hg add a a2
9 $ hg ci -m "start"
9 $ hg ci -m "start"
10
10
11 $ hg mv a b
11 $ hg mv a b
12 $ hg mv a2 b2
12 $ hg mv a2 b2
13 $ hg ci -m "rename"
13 $ hg ci -m "rename"
14
14
15 $ hg co 0
15 $ hg co 0
16 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
16 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
17
17
18 $ echo blahblah > a
18 $ echo blahblah > a
19 $ echo blahblah > a2
19 $ echo blahblah > a2
20 $ hg mv a2 c2
20 $ hg mv a2 c2
21 $ hg ci -m "modify"
21 $ hg ci -m "modify"
22 created new head
22 created new head
23
23
24 $ hg merge -y --debug
24 $ hg merge -y --debug
25 searching for copies back to rev 1
25 searching for copies back to rev 1
26 unmatched files in local:
26 unmatched files in local:
27 c2
27 c2
28 unmatched files in other:
28 unmatched files in other:
29 b
29 b
30 b2
30 b2
31 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
31 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
32 src: 'a' -> dst: 'b' *
32 src: 'a' -> dst: 'b' *
33 src: 'a2' -> dst: 'b2' !
33 src: 'a2' -> dst: 'b2' !
34 src: 'a2' -> dst: 'c2' !
34 src: 'a2' -> dst: 'c2' !
35 checking for directory renames
35 checking for directory renames
36 resolving manifests
36 resolving manifests
37 branchmerge: True, force: False, partial: False
37 branchmerge: True, force: False, partial: False
38 ancestor: af1939970a1c, local: 044f8520aeeb+, remote: 85c198ef2f6c
38 ancestor: af1939970a1c, local: 044f8520aeeb+, remote: 85c198ef2f6c
39 preserving a for resolve of b
39 preserving a for resolve of b
40 removing a
40 removing a
41 b2: remote created -> g
41 b2: remote created -> g
42 getting b2
42 getting b2
43 b: remote moved from a -> m
43 b: remote moved from a -> m
44 picked tool 'internal:merge' for b (binary False symlink False)
44 picked tool ':merge' for b (binary False symlink False)
45 merging a and b to b
45 merging a and b to b
46 my b@044f8520aeeb+ other b@85c198ef2f6c ancestor a@af1939970a1c
46 my b@044f8520aeeb+ other b@85c198ef2f6c ancestor a@af1939970a1c
47 premerge successful
47 premerge successful
48 note: possible conflict - a2 was renamed multiple times to:
48 note: possible conflict - a2 was renamed multiple times to:
49 c2
49 c2
50 b2
50 b2
51 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
51 1 files updated, 1 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 $ hg status -AC
54 $ hg status -AC
55 M b
55 M b
56 a
56 a
57 M b2
57 M b2
58 R a
58 R a
59 C c2
59 C c2
60
60
61 $ cat b
61 $ cat b
62 blahblah
62 blahblah
63
63
64 $ hg ci -m "merge"
64 $ hg ci -m "merge"
65
65
66 $ hg debugindex b
66 $ hg debugindex b
67 rev offset length ..... linkrev nodeid p1 p2 (re)
67 rev offset length ..... linkrev nodeid p1 p2 (re)
68 0 0 67 ..... 1 57eacc201a7f 000000000000 000000000000 (re)
68 0 0 67 ..... 1 57eacc201a7f 000000000000 000000000000 (re)
69 1 67 72 ..... 3 4727ba907962 000000000000 57eacc201a7f (re)
69 1 67 72 ..... 3 4727ba907962 000000000000 57eacc201a7f (re)
70
70
71 $ hg debugrename b
71 $ hg debugrename b
72 b renamed from a:dd03b83622e78778b403775d0d074b9ac7387a66
72 b renamed from a:dd03b83622e78778b403775d0d074b9ac7387a66
73
73
74 This used to trigger a "divergent renames" warning, despite no renames
74 This used to trigger a "divergent renames" warning, despite no renames
75
75
76 $ hg cp b b3
76 $ hg cp b b3
77 $ hg cp b b4
77 $ hg cp b b4
78 $ hg ci -A -m 'copy b twice'
78 $ hg ci -A -m 'copy b twice'
79 $ hg up eb92d88a9712
79 $ hg up eb92d88a9712
80 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
80 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
81 $ hg up
81 $ hg up
82 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
82 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
83 $ hg rm b3 b4
83 $ hg rm b3 b4
84 $ hg ci -m 'clean up a bit of our mess'
84 $ hg ci -m 'clean up a bit of our mess'
85
85
86 We'd rather not warn on divergent renames done in the same changeset (issue2113)
86 We'd rather not warn on divergent renames done in the same changeset (issue2113)
87
87
88 $ hg cp b b3
88 $ hg cp b b3
89 $ hg mv b b4
89 $ hg mv b b4
90 $ hg ci -A -m 'divergent renames in same changeset'
90 $ hg ci -A -m 'divergent renames in same changeset'
91 $ hg up c761c6948de0
91 $ hg up c761c6948de0
92 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
92 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
93 $ hg up
93 $ hg up
94 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
94 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
95
95
96 Check for issue2642
96 Check for issue2642
97
97
98 $ hg init t
98 $ hg init t
99 $ cd t
99 $ cd t
100
100
101 $ echo c0 > f1
101 $ echo c0 > f1
102 $ hg ci -Aqm0
102 $ hg ci -Aqm0
103
103
104 $ hg up null -q
104 $ hg up null -q
105 $ echo c1 > f1 # backport
105 $ echo c1 > f1 # backport
106 $ hg ci -Aqm1
106 $ hg ci -Aqm1
107 $ hg mv f1 f2
107 $ hg mv f1 f2
108 $ hg ci -qm2
108 $ hg ci -qm2
109
109
110 $ hg up 0 -q
110 $ hg up 0 -q
111 $ hg merge 1 -q --tool internal:local
111 $ hg merge 1 -q --tool internal:local
112 $ hg ci -qm3
112 $ hg ci -qm3
113
113
114 $ hg merge 2
114 $ hg merge 2
115 merging f1 and f2 to f2
115 merging f1 and f2 to f2
116 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
116 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
117 (branch merge, don't forget to commit)
117 (branch merge, don't forget to commit)
118
118
119 $ cat f2
119 $ cat f2
120 c0
120 c0
121
121
122 $ cd ..
122 $ cd ..
123
123
124 Check for issue2089
124 Check for issue2089
125
125
126 $ hg init repo2089
126 $ hg init repo2089
127 $ cd repo2089
127 $ cd repo2089
128
128
129 $ echo c0 > f1
129 $ echo c0 > f1
130 $ hg ci -Aqm0
130 $ hg ci -Aqm0
131
131
132 $ hg up null -q
132 $ hg up null -q
133 $ echo c1 > f1
133 $ echo c1 > f1
134 $ hg ci -Aqm1
134 $ hg ci -Aqm1
135
135
136 $ hg up 0 -q
136 $ hg up 0 -q
137 $ hg merge 1 -q --tool internal:local
137 $ hg merge 1 -q --tool internal:local
138 $ echo c2 > f1
138 $ echo c2 > f1
139 $ hg ci -qm2
139 $ hg ci -qm2
140
140
141 $ hg up 1 -q
141 $ hg up 1 -q
142 $ hg mv f1 f2
142 $ hg mv f1 f2
143 $ hg ci -Aqm3
143 $ hg ci -Aqm3
144
144
145 $ hg up 2 -q
145 $ hg up 2 -q
146 $ hg merge 3
146 $ hg merge 3
147 merging f1 and f2 to f2
147 merging f1 and f2 to f2
148 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
148 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
149 (branch merge, don't forget to commit)
149 (branch merge, don't forget to commit)
150
150
151 $ cat f2
151 $ cat f2
152 c2
152 c2
153
153
154 $ cd ..
154 $ cd ..
155
155
156 Check for issue3074
156 Check for issue3074
157
157
158 $ hg init repo3074
158 $ hg init repo3074
159 $ cd repo3074
159 $ cd repo3074
160 $ echo foo > file
160 $ echo foo > file
161 $ hg add file
161 $ hg add file
162 $ hg commit -m "added file"
162 $ hg commit -m "added file"
163 $ hg mv file newfile
163 $ hg mv file newfile
164 $ hg commit -m "renamed file"
164 $ hg commit -m "renamed file"
165 $ hg update 0
165 $ hg update 0
166 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
166 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
167 $ hg rm file
167 $ hg rm file
168 $ hg commit -m "deleted file"
168 $ hg commit -m "deleted file"
169 created new head
169 created new head
170 $ hg merge --debug
170 $ hg merge --debug
171 searching for copies back to rev 1
171 searching for copies back to rev 1
172 unmatched files in other:
172 unmatched files in other:
173 newfile
173 newfile
174 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
174 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
175 src: 'file' -> dst: 'newfile' %
175 src: 'file' -> dst: 'newfile' %
176 checking for directory renames
176 checking for directory renames
177 resolving manifests
177 resolving manifests
178 branchmerge: True, force: False, partial: False
178 branchmerge: True, force: False, partial: False
179 ancestor: 19d7f95df299, local: 0084274f6b67+, remote: 5d32493049f0
179 ancestor: 19d7f95df299, local: 0084274f6b67+, remote: 5d32493049f0
180 newfile: remote created -> g
180 newfile: remote created -> g
181 getting newfile
181 getting newfile
182 note: possible conflict - file was deleted and renamed to:
182 note: possible conflict - file was deleted and renamed to:
183 newfile
183 newfile
184 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
184 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
185 (branch merge, don't forget to commit)
185 (branch merge, don't forget to commit)
186 $ hg status
186 $ hg status
187 M newfile
187 M newfile
188 $ cd ..
188 $ cd ..
@@ -1,1757 +1,1757
1 Let commit recurse into subrepos by default to match pre-2.0 behavior:
1 Let commit recurse into subrepos by default to match pre-2.0 behavior:
2
2
3 $ echo "[ui]" >> $HGRCPATH
3 $ echo "[ui]" >> $HGRCPATH
4 $ echo "commitsubrepos = Yes" >> $HGRCPATH
4 $ echo "commitsubrepos = Yes" >> $HGRCPATH
5
5
6 $ hg init t
6 $ hg init t
7 $ cd t
7 $ cd t
8
8
9 first revision, no sub
9 first revision, no sub
10
10
11 $ echo a > a
11 $ echo a > a
12 $ hg ci -Am0
12 $ hg ci -Am0
13 adding a
13 adding a
14
14
15 add first sub
15 add first sub
16
16
17 $ echo s = s > .hgsub
17 $ echo s = s > .hgsub
18 $ hg add .hgsub
18 $ hg add .hgsub
19 $ hg init s
19 $ hg init s
20 $ echo a > s/a
20 $ echo a > s/a
21
21
22 Issue2232: committing a subrepo without .hgsub
22 Issue2232: committing a subrepo without .hgsub
23
23
24 $ hg ci -mbad s
24 $ hg ci -mbad s
25 abort: can't commit subrepos without .hgsub
25 abort: can't commit subrepos without .hgsub
26 [255]
26 [255]
27
27
28 $ hg -R s add s/a
28 $ hg -R s add s/a
29 $ hg files -S
29 $ hg files -S
30 .hgsub
30 .hgsub
31 a
31 a
32 s/a (glob)
32 s/a (glob)
33
33
34 $ hg -R s ci -Ams0
34 $ hg -R s ci -Ams0
35 $ hg sum
35 $ hg sum
36 parent: 0:f7b1eb17ad24 tip
36 parent: 0:f7b1eb17ad24 tip
37 0
37 0
38 branch: default
38 branch: default
39 commit: 1 added, 1 subrepos
39 commit: 1 added, 1 subrepos
40 update: (current)
40 update: (current)
41 phases: 1 draft
41 phases: 1 draft
42 $ hg ci -m1
42 $ hg ci -m1
43
43
44 test handling .hgsubstate "added" explicitly.
44 test handling .hgsubstate "added" explicitly.
45
45
46 $ hg parents --template '{node}\n{files}\n'
46 $ hg parents --template '{node}\n{files}\n'
47 7cf8cfea66e410e8e3336508dfeec07b3192de51
47 7cf8cfea66e410e8e3336508dfeec07b3192de51
48 .hgsub .hgsubstate
48 .hgsub .hgsubstate
49 $ hg rollback -q
49 $ hg rollback -q
50 $ hg add .hgsubstate
50 $ hg add .hgsubstate
51 $ hg ci -m1
51 $ hg ci -m1
52 $ hg parents --template '{node}\n{files}\n'
52 $ hg parents --template '{node}\n{files}\n'
53 7cf8cfea66e410e8e3336508dfeec07b3192de51
53 7cf8cfea66e410e8e3336508dfeec07b3192de51
54 .hgsub .hgsubstate
54 .hgsub .hgsubstate
55
55
56 Revert subrepo and test subrepo fileset keyword:
56 Revert subrepo and test subrepo fileset keyword:
57
57
58 $ echo b > s/a
58 $ echo b > s/a
59 $ hg revert --dry-run "set:subrepo('glob:s*')"
59 $ hg revert --dry-run "set:subrepo('glob:s*')"
60 reverting subrepo s
60 reverting subrepo s
61 reverting s/a (glob)
61 reverting s/a (glob)
62 $ cat s/a
62 $ cat s/a
63 b
63 b
64 $ hg revert "set:subrepo('glob:s*')"
64 $ hg revert "set:subrepo('glob:s*')"
65 reverting subrepo s
65 reverting subrepo s
66 reverting s/a (glob)
66 reverting s/a (glob)
67 $ cat s/a
67 $ cat s/a
68 a
68 a
69 $ rm s/a.orig
69 $ rm s/a.orig
70
70
71 Revert subrepo with no backup. The "reverting s/a" line is gone since
71 Revert subrepo with no backup. The "reverting s/a" line is gone since
72 we're really running 'hg update' in the subrepo:
72 we're really running 'hg update' in the subrepo:
73
73
74 $ echo b > s/a
74 $ echo b > s/a
75 $ hg revert --no-backup s
75 $ hg revert --no-backup s
76 reverting subrepo s
76 reverting subrepo s
77
77
78 Issue2022: update -C
78 Issue2022: update -C
79
79
80 $ echo b > s/a
80 $ echo b > s/a
81 $ hg sum
81 $ hg sum
82 parent: 1:7cf8cfea66e4 tip
82 parent: 1:7cf8cfea66e4 tip
83 1
83 1
84 branch: default
84 branch: default
85 commit: 1 subrepos
85 commit: 1 subrepos
86 update: (current)
86 update: (current)
87 phases: 2 draft
87 phases: 2 draft
88 $ hg co -C 1
88 $ hg co -C 1
89 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
89 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
90 $ hg sum
90 $ hg sum
91 parent: 1:7cf8cfea66e4 tip
91 parent: 1:7cf8cfea66e4 tip
92 1
92 1
93 branch: default
93 branch: default
94 commit: (clean)
94 commit: (clean)
95 update: (current)
95 update: (current)
96 phases: 2 draft
96 phases: 2 draft
97
97
98 commands that require a clean repo should respect subrepos
98 commands that require a clean repo should respect subrepos
99
99
100 $ echo b >> s/a
100 $ echo b >> s/a
101 $ hg backout tip
101 $ hg backout tip
102 abort: uncommitted changes in subrepository 's'
102 abort: uncommitted changes in subrepository 's'
103 [255]
103 [255]
104 $ hg revert -C -R s s/a
104 $ hg revert -C -R s s/a
105
105
106 add sub sub
106 add sub sub
107
107
108 $ echo ss = ss > s/.hgsub
108 $ echo ss = ss > s/.hgsub
109 $ hg init s/ss
109 $ hg init s/ss
110 $ echo a > s/ss/a
110 $ echo a > s/ss/a
111 $ hg -R s add s/.hgsub
111 $ hg -R s add s/.hgsub
112 $ hg -R s/ss add s/ss/a
112 $ hg -R s/ss add s/ss/a
113 $ hg sum
113 $ hg sum
114 parent: 1:7cf8cfea66e4 tip
114 parent: 1:7cf8cfea66e4 tip
115 1
115 1
116 branch: default
116 branch: default
117 commit: 1 subrepos
117 commit: 1 subrepos
118 update: (current)
118 update: (current)
119 phases: 2 draft
119 phases: 2 draft
120 $ hg ci -m2
120 $ hg ci -m2
121 committing subrepository s
121 committing subrepository s
122 committing subrepository s/ss (glob)
122 committing subrepository s/ss (glob)
123 $ hg sum
123 $ hg sum
124 parent: 2:df30734270ae tip
124 parent: 2:df30734270ae tip
125 2
125 2
126 branch: default
126 branch: default
127 commit: (clean)
127 commit: (clean)
128 update: (current)
128 update: (current)
129 phases: 3 draft
129 phases: 3 draft
130
130
131 test handling .hgsubstate "modified" explicitly.
131 test handling .hgsubstate "modified" explicitly.
132
132
133 $ hg parents --template '{node}\n{files}\n'
133 $ hg parents --template '{node}\n{files}\n'
134 df30734270ae757feb35e643b7018e818e78a9aa
134 df30734270ae757feb35e643b7018e818e78a9aa
135 .hgsubstate
135 .hgsubstate
136 $ hg rollback -q
136 $ hg rollback -q
137 $ hg status -A .hgsubstate
137 $ hg status -A .hgsubstate
138 M .hgsubstate
138 M .hgsubstate
139 $ hg ci -m2
139 $ hg ci -m2
140 $ hg parents --template '{node}\n{files}\n'
140 $ hg parents --template '{node}\n{files}\n'
141 df30734270ae757feb35e643b7018e818e78a9aa
141 df30734270ae757feb35e643b7018e818e78a9aa
142 .hgsubstate
142 .hgsubstate
143
143
144 bump sub rev (and check it is ignored by ui.commitsubrepos)
144 bump sub rev (and check it is ignored by ui.commitsubrepos)
145
145
146 $ echo b > s/a
146 $ echo b > s/a
147 $ hg -R s ci -ms1
147 $ hg -R s ci -ms1
148 $ hg --config ui.commitsubrepos=no ci -m3
148 $ hg --config ui.commitsubrepos=no ci -m3
149
149
150 leave sub dirty (and check ui.commitsubrepos=no aborts the commit)
150 leave sub dirty (and check ui.commitsubrepos=no aborts the commit)
151
151
152 $ echo c > s/a
152 $ echo c > s/a
153 $ hg --config ui.commitsubrepos=no ci -m4
153 $ hg --config ui.commitsubrepos=no ci -m4
154 abort: uncommitted changes in subrepository 's'
154 abort: uncommitted changes in subrepository 's'
155 (use --subrepos for recursive commit)
155 (use --subrepos for recursive commit)
156 [255]
156 [255]
157 $ hg id
157 $ hg id
158 f6affe3fbfaa+ tip
158 f6affe3fbfaa+ tip
159 $ hg -R s ci -mc
159 $ hg -R s ci -mc
160 $ hg id
160 $ hg id
161 f6affe3fbfaa+ tip
161 f6affe3fbfaa+ tip
162 $ echo d > s/a
162 $ echo d > s/a
163 $ hg ci -m4
163 $ hg ci -m4
164 committing subrepository s
164 committing subrepository s
165 $ hg tip -R s
165 $ hg tip -R s
166 changeset: 4:02dcf1d70411
166 changeset: 4:02dcf1d70411
167 tag: tip
167 tag: tip
168 user: test
168 user: test
169 date: Thu Jan 01 00:00:00 1970 +0000
169 date: Thu Jan 01 00:00:00 1970 +0000
170 summary: 4
170 summary: 4
171
171
172
172
173 check caching
173 check caching
174
174
175 $ hg co 0
175 $ hg co 0
176 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
176 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
177 $ hg debugsub
177 $ hg debugsub
178
178
179 restore
179 restore
180
180
181 $ hg co
181 $ hg co
182 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
182 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
183 $ hg debugsub
183 $ hg debugsub
184 path s
184 path s
185 source s
185 source s
186 revision 02dcf1d704118aee3ee306ccfa1910850d5b05ef
186 revision 02dcf1d704118aee3ee306ccfa1910850d5b05ef
187
187
188 new branch for merge tests
188 new branch for merge tests
189
189
190 $ hg co 1
190 $ hg co 1
191 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
191 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
192 $ echo t = t >> .hgsub
192 $ echo t = t >> .hgsub
193 $ hg init t
193 $ hg init t
194 $ echo t > t/t
194 $ echo t > t/t
195 $ hg -R t add t
195 $ hg -R t add t
196 adding t/t (glob)
196 adding t/t (glob)
197
197
198 5
198 5
199
199
200 $ hg ci -m5 # add sub
200 $ hg ci -m5 # add sub
201 committing subrepository t
201 committing subrepository t
202 created new head
202 created new head
203 $ echo t2 > t/t
203 $ echo t2 > t/t
204
204
205 6
205 6
206
206
207 $ hg st -R s
207 $ hg st -R s
208 $ hg ci -m6 # change sub
208 $ hg ci -m6 # change sub
209 committing subrepository t
209 committing subrepository t
210 $ hg debugsub
210 $ hg debugsub
211 path s
211 path s
212 source s
212 source s
213 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
213 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
214 path t
214 path t
215 source t
215 source t
216 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
216 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
217 $ echo t3 > t/t
217 $ echo t3 > t/t
218
218
219 7
219 7
220
220
221 $ hg ci -m7 # change sub again for conflict test
221 $ hg ci -m7 # change sub again for conflict test
222 committing subrepository t
222 committing subrepository t
223 $ hg rm .hgsub
223 $ hg rm .hgsub
224
224
225 8
225 8
226
226
227 $ hg ci -m8 # remove sub
227 $ hg ci -m8 # remove sub
228
228
229 test handling .hgsubstate "removed" explicitly.
229 test handling .hgsubstate "removed" explicitly.
230
230
231 $ hg parents --template '{node}\n{files}\n'
231 $ hg parents --template '{node}\n{files}\n'
232 96615c1dad2dc8e3796d7332c77ce69156f7b78e
232 96615c1dad2dc8e3796d7332c77ce69156f7b78e
233 .hgsub .hgsubstate
233 .hgsub .hgsubstate
234 $ hg rollback -q
234 $ hg rollback -q
235 $ hg remove .hgsubstate
235 $ hg remove .hgsubstate
236 $ hg ci -m8
236 $ hg ci -m8
237 $ hg parents --template '{node}\n{files}\n'
237 $ hg parents --template '{node}\n{files}\n'
238 96615c1dad2dc8e3796d7332c77ce69156f7b78e
238 96615c1dad2dc8e3796d7332c77ce69156f7b78e
239 .hgsub .hgsubstate
239 .hgsub .hgsubstate
240
240
241 merge tests
241 merge tests
242
242
243 $ hg co -C 3
243 $ hg co -C 3
244 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
244 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
245 $ hg merge 5 # test adding
245 $ hg merge 5 # test adding
246 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
246 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
247 (branch merge, don't forget to commit)
247 (branch merge, don't forget to commit)
248 $ hg debugsub
248 $ hg debugsub
249 path s
249 path s
250 source s
250 source s
251 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
251 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
252 path t
252 path t
253 source t
253 source t
254 revision 60ca1237c19474e7a3978b0dc1ca4e6f36d51382
254 revision 60ca1237c19474e7a3978b0dc1ca4e6f36d51382
255 $ hg ci -m9
255 $ hg ci -m9
256 created new head
256 created new head
257 $ hg merge 6 --debug # test change
257 $ hg merge 6 --debug # test change
258 searching for copies back to rev 2
258 searching for copies back to rev 2
259 resolving manifests
259 resolving manifests
260 branchmerge: True, force: False, partial: False
260 branchmerge: True, force: False, partial: False
261 ancestor: 1f14a2e2d3ec, local: f0d2028bf86d+, remote: 1831e14459c4
261 ancestor: 1f14a2e2d3ec, local: f0d2028bf86d+, remote: 1831e14459c4
262 .hgsubstate: versions differ -> m
262 .hgsubstate: versions differ -> m
263 subrepo merge f0d2028bf86d+ 1831e14459c4 1f14a2e2d3ec
263 subrepo merge f0d2028bf86d+ 1831e14459c4 1f14a2e2d3ec
264 subrepo t: other changed, get t:6747d179aa9a688023c4b0cad32e4c92bb7f34ad:hg
264 subrepo t: other changed, get t:6747d179aa9a688023c4b0cad32e4c92bb7f34ad:hg
265 getting subrepo t
265 getting subrepo t
266 resolving manifests
266 resolving manifests
267 branchmerge: False, force: False, partial: False
267 branchmerge: False, force: False, partial: False
268 ancestor: 60ca1237c194, local: 60ca1237c194+, remote: 6747d179aa9a
268 ancestor: 60ca1237c194, local: 60ca1237c194+, remote: 6747d179aa9a
269 t: remote is newer -> g
269 t: remote is newer -> g
270 getting t
270 getting t
271 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
271 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
272 (branch merge, don't forget to commit)
272 (branch merge, don't forget to commit)
273 $ hg debugsub
273 $ hg debugsub
274 path s
274 path s
275 source s
275 source s
276 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
276 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
277 path t
277 path t
278 source t
278 source t
279 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
279 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
280 $ echo conflict > t/t
280 $ echo conflict > t/t
281 $ hg ci -m10
281 $ hg ci -m10
282 committing subrepository t
282 committing subrepository t
283 $ HGMERGE=internal:merge hg merge --debug 7 # test conflict
283 $ HGMERGE=internal:merge hg merge --debug 7 # test conflict
284 searching for copies back to rev 2
284 searching for copies back to rev 2
285 resolving manifests
285 resolving manifests
286 branchmerge: True, force: False, partial: False
286 branchmerge: True, force: False, partial: False
287 ancestor: 1831e14459c4, local: e45c8b14af55+, remote: f94576341bcf
287 ancestor: 1831e14459c4, local: e45c8b14af55+, remote: f94576341bcf
288 .hgsubstate: versions differ -> m
288 .hgsubstate: versions differ -> m
289 subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4
289 subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4
290 subrepo t: both sides changed
290 subrepo t: both sides changed
291 subrepository t diverged (local revision: 20a0db6fbf6c, remote revision: 7af322bc1198)
291 subrepository t diverged (local revision: 20a0db6fbf6c, remote revision: 7af322bc1198)
292 (M)erge, keep (l)ocal or keep (r)emote? m
292 (M)erge, keep (l)ocal or keep (r)emote? m
293 merging subrepo t
293 merging subrepo t
294 searching for copies back to rev 2
294 searching for copies back to rev 2
295 resolving manifests
295 resolving manifests
296 branchmerge: True, force: False, partial: False
296 branchmerge: True, force: False, partial: False
297 ancestor: 6747d179aa9a, local: 20a0db6fbf6c+, remote: 7af322bc1198
297 ancestor: 6747d179aa9a, local: 20a0db6fbf6c+, remote: 7af322bc1198
298 preserving t for resolve of t
298 preserving t for resolve of t
299 t: versions differ -> m
299 t: versions differ -> m
300 picked tool 'internal:merge' for t (binary False symlink False)
300 picked tool ':merge' for t (binary False symlink False)
301 merging t
301 merging t
302 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
302 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
303 warning: conflicts during merge.
303 warning: conflicts during merge.
304 merging t incomplete! (edit conflicts, then use 'hg resolve --mark')
304 merging t incomplete! (edit conflicts, then use 'hg resolve --mark')
305 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
305 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
306 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
306 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
307 subrepo t: merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg
307 subrepo t: merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg
308 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
308 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
309 (branch merge, don't forget to commit)
309 (branch merge, don't forget to commit)
310
310
311 should conflict
311 should conflict
312
312
313 $ cat t/t
313 $ cat t/t
314 <<<<<<< local: 20a0db6fbf6c - test: 10
314 <<<<<<< local: 20a0db6fbf6c - test: 10
315 conflict
315 conflict
316 =======
316 =======
317 t3
317 t3
318 >>>>>>> other: 7af322bc1198 - test: 7
318 >>>>>>> other: 7af322bc1198 - test: 7
319
319
320 11: remove subrepo t
320 11: remove subrepo t
321
321
322 $ hg co -C 5
322 $ hg co -C 5
323 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
323 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
324 $ hg revert -r 4 .hgsub # remove t
324 $ hg revert -r 4 .hgsub # remove t
325 $ hg ci -m11
325 $ hg ci -m11
326 created new head
326 created new head
327 $ hg debugsub
327 $ hg debugsub
328 path s
328 path s
329 source s
329 source s
330 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
330 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
331
331
332 local removed, remote changed, keep changed
332 local removed, remote changed, keep changed
333
333
334 $ hg merge 6
334 $ hg merge 6
335 remote changed subrepository t which local removed
335 remote changed subrepository t which local removed
336 use (c)hanged version or (d)elete? c
336 use (c)hanged version or (d)elete? c
337 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
337 0 files updated, 0 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 BROKEN: should include subrepo t
339 BROKEN: should include subrepo t
340 $ hg debugsub
340 $ hg debugsub
341 path s
341 path s
342 source s
342 source s
343 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
343 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
344 $ cat .hgsubstate
344 $ cat .hgsubstate
345 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
345 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
346 6747d179aa9a688023c4b0cad32e4c92bb7f34ad t
346 6747d179aa9a688023c4b0cad32e4c92bb7f34ad t
347 $ hg ci -m 'local removed, remote changed, keep changed'
347 $ hg ci -m 'local removed, remote changed, keep changed'
348 BROKEN: should include subrepo t
348 BROKEN: should include subrepo t
349 $ hg debugsub
349 $ hg debugsub
350 path s
350 path s
351 source s
351 source s
352 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
352 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
353 BROKEN: should include subrepo t
353 BROKEN: should include subrepo t
354 $ cat .hgsubstate
354 $ cat .hgsubstate
355 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
355 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
356 $ cat t/t
356 $ cat t/t
357 t2
357 t2
358
358
359 local removed, remote changed, keep removed
359 local removed, remote changed, keep removed
360
360
361 $ hg co -C 11
361 $ hg co -C 11
362 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
362 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
363 $ hg merge --config ui.interactive=true 6 <<EOF
363 $ hg merge --config ui.interactive=true 6 <<EOF
364 > d
364 > d
365 > EOF
365 > EOF
366 remote changed subrepository t which local removed
366 remote changed subrepository t which local removed
367 use (c)hanged version or (d)elete? d
367 use (c)hanged version or (d)elete? d
368 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
368 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
369 (branch merge, don't forget to commit)
369 (branch merge, don't forget to commit)
370 $ hg debugsub
370 $ hg debugsub
371 path s
371 path s
372 source s
372 source s
373 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
373 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
374 $ cat .hgsubstate
374 $ cat .hgsubstate
375 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
375 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
376 $ hg ci -m 'local removed, remote changed, keep removed'
376 $ hg ci -m 'local removed, remote changed, keep removed'
377 created new head
377 created new head
378 $ hg debugsub
378 $ hg debugsub
379 path s
379 path s
380 source s
380 source s
381 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
381 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
382 $ cat .hgsubstate
382 $ cat .hgsubstate
383 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
383 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
384
384
385 local changed, remote removed, keep changed
385 local changed, remote removed, keep changed
386
386
387 $ hg co -C 6
387 $ hg co -C 6
388 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
388 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
389 $ hg merge 11
389 $ hg merge 11
390 local changed subrepository t which remote removed
390 local changed subrepository t which remote removed
391 use (c)hanged version or (d)elete? c
391 use (c)hanged version or (d)elete? c
392 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
392 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
393 (branch merge, don't forget to commit)
393 (branch merge, don't forget to commit)
394 BROKEN: should include subrepo t
394 BROKEN: should include subrepo t
395 $ hg debugsub
395 $ hg debugsub
396 path s
396 path s
397 source s
397 source s
398 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
398 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
399 BROKEN: should include subrepo t
399 BROKEN: should include subrepo t
400 $ cat .hgsubstate
400 $ cat .hgsubstate
401 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
401 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
402 $ hg ci -m 'local changed, remote removed, keep changed'
402 $ hg ci -m 'local changed, remote removed, keep changed'
403 created new head
403 created new head
404 BROKEN: should include subrepo t
404 BROKEN: should include subrepo t
405 $ hg debugsub
405 $ hg debugsub
406 path s
406 path s
407 source s
407 source s
408 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
408 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
409 BROKEN: should include subrepo t
409 BROKEN: should include subrepo t
410 $ cat .hgsubstate
410 $ cat .hgsubstate
411 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
411 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
412 $ cat t/t
412 $ cat t/t
413 t2
413 t2
414
414
415 local changed, remote removed, keep removed
415 local changed, remote removed, keep removed
416
416
417 $ hg co -C 6
417 $ hg co -C 6
418 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
418 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
419 $ hg merge --config ui.interactive=true 11 <<EOF
419 $ hg merge --config ui.interactive=true 11 <<EOF
420 > d
420 > d
421 > EOF
421 > EOF
422 local changed subrepository t which remote removed
422 local changed subrepository t which remote removed
423 use (c)hanged version or (d)elete? d
423 use (c)hanged version or (d)elete? d
424 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
424 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
425 (branch merge, don't forget to commit)
425 (branch merge, don't forget to commit)
426 $ hg debugsub
426 $ hg debugsub
427 path s
427 path s
428 source s
428 source s
429 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
429 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
430 $ cat .hgsubstate
430 $ cat .hgsubstate
431 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
431 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
432 $ hg ci -m 'local changed, remote removed, keep removed'
432 $ hg ci -m 'local changed, remote removed, keep removed'
433 created new head
433 created new head
434 $ hg debugsub
434 $ hg debugsub
435 path s
435 path s
436 source s
436 source s
437 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
437 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
438 $ cat .hgsubstate
438 $ cat .hgsubstate
439 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
439 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
440
440
441 clean up to avoid having to fix up the tests below
441 clean up to avoid having to fix up the tests below
442
442
443 $ hg co -C 10
443 $ hg co -C 10
444 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
444 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
445 $ cat >> $HGRCPATH <<EOF
445 $ cat >> $HGRCPATH <<EOF
446 > [extensions]
446 > [extensions]
447 > strip=
447 > strip=
448 > EOF
448 > EOF
449 $ hg strip -r 11:15
449 $ hg strip -r 11:15
450 saved backup bundle to $TESTTMP/t/.hg/strip-backup/*-backup.hg (glob)
450 saved backup bundle to $TESTTMP/t/.hg/strip-backup/*-backup.hg (glob)
451
451
452 clone
452 clone
453
453
454 $ cd ..
454 $ cd ..
455 $ hg clone t tc
455 $ hg clone t tc
456 updating to branch default
456 updating to branch default
457 cloning subrepo s from $TESTTMP/t/s
457 cloning subrepo s from $TESTTMP/t/s
458 cloning subrepo s/ss from $TESTTMP/t/s/ss (glob)
458 cloning subrepo s/ss from $TESTTMP/t/s/ss (glob)
459 cloning subrepo t from $TESTTMP/t/t
459 cloning subrepo t from $TESTTMP/t/t
460 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
460 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
461 $ cd tc
461 $ cd tc
462 $ hg debugsub
462 $ hg debugsub
463 path s
463 path s
464 source s
464 source s
465 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
465 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
466 path t
466 path t
467 source t
467 source t
468 revision 20a0db6fbf6c3d2836e6519a642ae929bfc67c0e
468 revision 20a0db6fbf6c3d2836e6519a642ae929bfc67c0e
469
469
470 push
470 push
471
471
472 $ echo bah > t/t
472 $ echo bah > t/t
473 $ hg ci -m11
473 $ hg ci -m11
474 committing subrepository t
474 committing subrepository t
475 $ hg push
475 $ hg push
476 pushing to $TESTTMP/t (glob)
476 pushing to $TESTTMP/t (glob)
477 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
477 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
478 no changes made to subrepo s since last push to $TESTTMP/t/s
478 no changes made to subrepo s since last push to $TESTTMP/t/s
479 pushing subrepo t to $TESTTMP/t/t
479 pushing subrepo t to $TESTTMP/t/t
480 searching for changes
480 searching for changes
481 adding changesets
481 adding changesets
482 adding manifests
482 adding manifests
483 adding file changes
483 adding file changes
484 added 1 changesets with 1 changes to 1 files
484 added 1 changesets with 1 changes to 1 files
485 searching for changes
485 searching for changes
486 adding changesets
486 adding changesets
487 adding manifests
487 adding manifests
488 adding file changes
488 adding file changes
489 added 1 changesets with 1 changes to 1 files
489 added 1 changesets with 1 changes to 1 files
490
490
491 push -f
491 push -f
492
492
493 $ echo bah > s/a
493 $ echo bah > s/a
494 $ hg ci -m12
494 $ hg ci -m12
495 committing subrepository s
495 committing subrepository s
496 $ hg push
496 $ hg push
497 pushing to $TESTTMP/t (glob)
497 pushing to $TESTTMP/t (glob)
498 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
498 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
499 pushing subrepo s to $TESTTMP/t/s
499 pushing subrepo s to $TESTTMP/t/s
500 searching for changes
500 searching for changes
501 abort: push creates new remote head 12a213df6fa9! (in subrepo s)
501 abort: push creates new remote head 12a213df6fa9! (in subrepo s)
502 (merge or see "hg help push" for details about pushing new heads)
502 (merge or see "hg help push" for details about pushing new heads)
503 [255]
503 [255]
504 $ hg push -f
504 $ hg push -f
505 pushing to $TESTTMP/t (glob)
505 pushing to $TESTTMP/t (glob)
506 pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
506 pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
507 searching for changes
507 searching for changes
508 no changes found
508 no changes found
509 pushing subrepo s to $TESTTMP/t/s
509 pushing subrepo s to $TESTTMP/t/s
510 searching for changes
510 searching for changes
511 adding changesets
511 adding changesets
512 adding manifests
512 adding manifests
513 adding file changes
513 adding file changes
514 added 1 changesets with 1 changes to 1 files (+1 heads)
514 added 1 changesets with 1 changes to 1 files (+1 heads)
515 pushing subrepo t to $TESTTMP/t/t
515 pushing subrepo t to $TESTTMP/t/t
516 searching for changes
516 searching for changes
517 no changes found
517 no changes found
518 searching for changes
518 searching for changes
519 adding changesets
519 adding changesets
520 adding manifests
520 adding manifests
521 adding file changes
521 adding file changes
522 added 1 changesets with 1 changes to 1 files
522 added 1 changesets with 1 changes to 1 files
523
523
524 check that unmodified subrepos are not pushed
524 check that unmodified subrepos are not pushed
525
525
526 $ hg clone . ../tcc
526 $ hg clone . ../tcc
527 updating to branch default
527 updating to branch default
528 cloning subrepo s from $TESTTMP/tc/s
528 cloning subrepo s from $TESTTMP/tc/s
529 cloning subrepo s/ss from $TESTTMP/tc/s/ss (glob)
529 cloning subrepo s/ss from $TESTTMP/tc/s/ss (glob)
530 cloning subrepo t from $TESTTMP/tc/t
530 cloning subrepo t from $TESTTMP/tc/t
531 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
531 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
532
532
533 the subrepos on the new clone have nothing to push to its source
533 the subrepos on the new clone have nothing to push to its source
534
534
535 $ hg push -R ../tcc .
535 $ hg push -R ../tcc .
536 pushing to .
536 pushing to .
537 no changes made to subrepo s/ss since last push to s/ss (glob)
537 no changes made to subrepo s/ss since last push to s/ss (glob)
538 no changes made to subrepo s since last push to s
538 no changes made to subrepo s since last push to s
539 no changes made to subrepo t since last push to t
539 no changes made to subrepo t since last push to t
540 searching for changes
540 searching for changes
541 no changes found
541 no changes found
542 [1]
542 [1]
543
543
544 the subrepos on the source do not have a clean store versus the clone target
544 the subrepos on the source do not have a clean store versus the clone target
545 because they were never explicitly pushed to the source
545 because they were never explicitly pushed to the source
546
546
547 $ hg push ../tcc
547 $ hg push ../tcc
548 pushing to ../tcc
548 pushing to ../tcc
549 pushing subrepo s/ss to ../tcc/s/ss (glob)
549 pushing subrepo s/ss to ../tcc/s/ss (glob)
550 searching for changes
550 searching for changes
551 no changes found
551 no changes found
552 pushing subrepo s to ../tcc/s
552 pushing subrepo s to ../tcc/s
553 searching for changes
553 searching for changes
554 no changes found
554 no changes found
555 pushing subrepo t to ../tcc/t
555 pushing subrepo t to ../tcc/t
556 searching for changes
556 searching for changes
557 no changes found
557 no changes found
558 searching for changes
558 searching for changes
559 no changes found
559 no changes found
560 [1]
560 [1]
561
561
562 after push their stores become clean
562 after push their stores become clean
563
563
564 $ hg push ../tcc
564 $ hg push ../tcc
565 pushing to ../tcc
565 pushing to ../tcc
566 no changes made to subrepo s/ss since last push to ../tcc/s/ss (glob)
566 no changes made to subrepo s/ss since last push to ../tcc/s/ss (glob)
567 no changes made to subrepo s since last push to ../tcc/s
567 no changes made to subrepo s since last push to ../tcc/s
568 no changes made to subrepo t since last push to ../tcc/t
568 no changes made to subrepo t since last push to ../tcc/t
569 searching for changes
569 searching for changes
570 no changes found
570 no changes found
571 [1]
571 [1]
572
572
573 updating a subrepo to a different revision or changing
573 updating a subrepo to a different revision or changing
574 its working directory does not make its store dirty
574 its working directory does not make its store dirty
575
575
576 $ hg -R s update '.^'
576 $ hg -R s update '.^'
577 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
577 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
578 $ hg push
578 $ hg push
579 pushing to $TESTTMP/t (glob)
579 pushing to $TESTTMP/t (glob)
580 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
580 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
581 no changes made to subrepo s since last push to $TESTTMP/t/s
581 no changes made to subrepo s since last push to $TESTTMP/t/s
582 no changes made to subrepo t since last push to $TESTTMP/t/t
582 no changes made to subrepo t since last push to $TESTTMP/t/t
583 searching for changes
583 searching for changes
584 no changes found
584 no changes found
585 [1]
585 [1]
586 $ echo foo >> s/a
586 $ echo foo >> s/a
587 $ hg push
587 $ hg push
588 pushing to $TESTTMP/t (glob)
588 pushing to $TESTTMP/t (glob)
589 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
589 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
590 no changes made to subrepo s since last push to $TESTTMP/t/s
590 no changes made to subrepo s since last push to $TESTTMP/t/s
591 no changes made to subrepo t since last push to $TESTTMP/t/t
591 no changes made to subrepo t since last push to $TESTTMP/t/t
592 searching for changes
592 searching for changes
593 no changes found
593 no changes found
594 [1]
594 [1]
595 $ hg -R s update -C tip
595 $ hg -R s update -C tip
596 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
596 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
597
597
598 committing into a subrepo makes its store (but not its parent's store) dirty
598 committing into a subrepo makes its store (but not its parent's store) dirty
599
599
600 $ echo foo >> s/ss/a
600 $ echo foo >> s/ss/a
601 $ hg -R s/ss commit -m 'test dirty store detection'
601 $ hg -R s/ss commit -m 'test dirty store detection'
602
602
603 $ hg out -S -r `hg log -r tip -T "{node|short}"`
603 $ hg out -S -r `hg log -r tip -T "{node|short}"`
604 comparing with $TESTTMP/t (glob)
604 comparing with $TESTTMP/t (glob)
605 searching for changes
605 searching for changes
606 no changes found
606 no changes found
607 comparing with $TESTTMP/t/s
607 comparing with $TESTTMP/t/s
608 searching for changes
608 searching for changes
609 no changes found
609 no changes found
610 comparing with $TESTTMP/t/s/ss
610 comparing with $TESTTMP/t/s/ss
611 searching for changes
611 searching for changes
612 changeset: 1:79ea5566a333
612 changeset: 1:79ea5566a333
613 tag: tip
613 tag: tip
614 user: test
614 user: test
615 date: Thu Jan 01 00:00:00 1970 +0000
615 date: Thu Jan 01 00:00:00 1970 +0000
616 summary: test dirty store detection
616 summary: test dirty store detection
617
617
618 comparing with $TESTTMP/t/t
618 comparing with $TESTTMP/t/t
619 searching for changes
619 searching for changes
620 no changes found
620 no changes found
621
621
622 $ hg push
622 $ hg push
623 pushing to $TESTTMP/t (glob)
623 pushing to $TESTTMP/t (glob)
624 pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
624 pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
625 searching for changes
625 searching for changes
626 adding changesets
626 adding changesets
627 adding manifests
627 adding manifests
628 adding file changes
628 adding file changes
629 added 1 changesets with 1 changes to 1 files
629 added 1 changesets with 1 changes to 1 files
630 no changes made to subrepo s since last push to $TESTTMP/t/s
630 no changes made to subrepo s since last push to $TESTTMP/t/s
631 no changes made to subrepo t since last push to $TESTTMP/t/t
631 no changes made to subrepo t since last push to $TESTTMP/t/t
632 searching for changes
632 searching for changes
633 no changes found
633 no changes found
634 [1]
634 [1]
635
635
636 a subrepo store may be clean versus one repo but not versus another
636 a subrepo store may be clean versus one repo but not versus another
637
637
638 $ hg push
638 $ hg push
639 pushing to $TESTTMP/t (glob)
639 pushing to $TESTTMP/t (glob)
640 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
640 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
641 no changes made to subrepo s since last push to $TESTTMP/t/s
641 no changes made to subrepo s since last push to $TESTTMP/t/s
642 no changes made to subrepo t since last push to $TESTTMP/t/t
642 no changes made to subrepo t since last push to $TESTTMP/t/t
643 searching for changes
643 searching for changes
644 no changes found
644 no changes found
645 [1]
645 [1]
646 $ hg push ../tcc
646 $ hg push ../tcc
647 pushing to ../tcc
647 pushing to ../tcc
648 pushing subrepo s/ss to ../tcc/s/ss (glob)
648 pushing subrepo s/ss to ../tcc/s/ss (glob)
649 searching for changes
649 searching for changes
650 adding changesets
650 adding changesets
651 adding manifests
651 adding manifests
652 adding file changes
652 adding file changes
653 added 1 changesets with 1 changes to 1 files
653 added 1 changesets with 1 changes to 1 files
654 no changes made to subrepo s since last push to ../tcc/s
654 no changes made to subrepo s since last push to ../tcc/s
655 no changes made to subrepo t since last push to ../tcc/t
655 no changes made to subrepo t since last push to ../tcc/t
656 searching for changes
656 searching for changes
657 no changes found
657 no changes found
658 [1]
658 [1]
659
659
660 update
660 update
661
661
662 $ cd ../t
662 $ cd ../t
663 $ hg up -C # discard our earlier merge
663 $ hg up -C # discard our earlier merge
664 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
664 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
665 $ echo blah > t/t
665 $ echo blah > t/t
666 $ hg ci -m13
666 $ hg ci -m13
667 committing subrepository t
667 committing subrepository t
668
668
669 backout calls revert internally with minimal opts, which should not raise
669 backout calls revert internally with minimal opts, which should not raise
670 KeyError
670 KeyError
671
671
672 $ hg backout ".^"
672 $ hg backout ".^"
673 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
673 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
674 changeset c373c8102e68 backed out, don't forget to commit.
674 changeset c373c8102e68 backed out, don't forget to commit.
675
675
676 $ hg up -C # discard changes
676 $ hg up -C # discard changes
677 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
677 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
678
678
679 pull
679 pull
680
680
681 $ cd ../tc
681 $ cd ../tc
682 $ hg pull
682 $ hg pull
683 pulling from $TESTTMP/t (glob)
683 pulling from $TESTTMP/t (glob)
684 searching for changes
684 searching for changes
685 adding changesets
685 adding changesets
686 adding manifests
686 adding manifests
687 adding file changes
687 adding file changes
688 added 1 changesets with 1 changes to 1 files
688 added 1 changesets with 1 changes to 1 files
689 (run 'hg update' to get a working copy)
689 (run 'hg update' to get a working copy)
690
690
691 should pull t
691 should pull t
692
692
693 $ hg incoming -S -r `hg log -r tip -T "{node|short}"`
693 $ hg incoming -S -r `hg log -r tip -T "{node|short}"`
694 comparing with $TESTTMP/t (glob)
694 comparing with $TESTTMP/t (glob)
695 no changes found
695 no changes found
696 comparing with $TESTTMP/t/s
696 comparing with $TESTTMP/t/s
697 searching for changes
697 searching for changes
698 no changes found
698 no changes found
699 comparing with $TESTTMP/t/s/ss
699 comparing with $TESTTMP/t/s/ss
700 searching for changes
700 searching for changes
701 no changes found
701 no changes found
702 comparing with $TESTTMP/t/t
702 comparing with $TESTTMP/t/t
703 searching for changes
703 searching for changes
704 changeset: 5:52c0adc0515a
704 changeset: 5:52c0adc0515a
705 tag: tip
705 tag: tip
706 user: test
706 user: test
707 date: Thu Jan 01 00:00:00 1970 +0000
707 date: Thu Jan 01 00:00:00 1970 +0000
708 summary: 13
708 summary: 13
709
709
710
710
711 $ hg up
711 $ hg up
712 pulling subrepo t from $TESTTMP/t/t
712 pulling subrepo t from $TESTTMP/t/t
713 searching for changes
713 searching for changes
714 adding changesets
714 adding changesets
715 adding manifests
715 adding manifests
716 adding file changes
716 adding file changes
717 added 1 changesets with 1 changes to 1 files
717 added 1 changesets with 1 changes to 1 files
718 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
718 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
719 $ cat t/t
719 $ cat t/t
720 blah
720 blah
721
721
722 bogus subrepo path aborts
722 bogus subrepo path aborts
723
723
724 $ echo 'bogus=[boguspath' >> .hgsub
724 $ echo 'bogus=[boguspath' >> .hgsub
725 $ hg ci -m 'bogus subrepo path'
725 $ hg ci -m 'bogus subrepo path'
726 abort: missing ] in subrepo source
726 abort: missing ] in subrepo source
727 [255]
727 [255]
728
728
729 Issue1986: merge aborts when trying to merge a subrepo that
729 Issue1986: merge aborts when trying to merge a subrepo that
730 shouldn't need merging
730 shouldn't need merging
731
731
732 # subrepo layout
732 # subrepo layout
733 #
733 #
734 # o 5 br
734 # o 5 br
735 # /|
735 # /|
736 # o | 4 default
736 # o | 4 default
737 # | |
737 # | |
738 # | o 3 br
738 # | o 3 br
739 # |/|
739 # |/|
740 # o | 2 default
740 # o | 2 default
741 # | |
741 # | |
742 # | o 1 br
742 # | o 1 br
743 # |/
743 # |/
744 # o 0 default
744 # o 0 default
745
745
746 $ cd ..
746 $ cd ..
747 $ rm -rf sub
747 $ rm -rf sub
748 $ hg init main
748 $ hg init main
749 $ cd main
749 $ cd main
750 $ hg init s
750 $ hg init s
751 $ cd s
751 $ cd s
752 $ echo a > a
752 $ echo a > a
753 $ hg ci -Am1
753 $ hg ci -Am1
754 adding a
754 adding a
755 $ hg branch br
755 $ hg branch br
756 marked working directory as branch br
756 marked working directory as branch br
757 (branches are permanent and global, did you want a bookmark?)
757 (branches are permanent and global, did you want a bookmark?)
758 $ echo a >> a
758 $ echo a >> a
759 $ hg ci -m1
759 $ hg ci -m1
760 $ hg up default
760 $ hg up default
761 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
761 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
762 $ echo b > b
762 $ echo b > b
763 $ hg ci -Am1
763 $ hg ci -Am1
764 adding b
764 adding b
765 $ hg up br
765 $ hg up br
766 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
766 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
767 $ hg merge tip
767 $ hg merge tip
768 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
768 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
769 (branch merge, don't forget to commit)
769 (branch merge, don't forget to commit)
770 $ hg ci -m1
770 $ hg ci -m1
771 $ hg up 2
771 $ hg up 2
772 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
772 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
773 $ echo c > c
773 $ echo c > c
774 $ hg ci -Am1
774 $ hg ci -Am1
775 adding c
775 adding c
776 $ hg up 3
776 $ hg up 3
777 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
777 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
778 $ hg merge 4
778 $ hg merge 4
779 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
779 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
780 (branch merge, don't forget to commit)
780 (branch merge, don't forget to commit)
781 $ hg ci -m1
781 $ hg ci -m1
782
782
783 # main repo layout:
783 # main repo layout:
784 #
784 #
785 # * <-- try to merge default into br again
785 # * <-- try to merge default into br again
786 # .`|
786 # .`|
787 # . o 5 br --> substate = 5
787 # . o 5 br --> substate = 5
788 # . |
788 # . |
789 # o | 4 default --> substate = 4
789 # o | 4 default --> substate = 4
790 # | |
790 # | |
791 # | o 3 br --> substate = 2
791 # | o 3 br --> substate = 2
792 # |/|
792 # |/|
793 # o | 2 default --> substate = 2
793 # o | 2 default --> substate = 2
794 # | |
794 # | |
795 # | o 1 br --> substate = 3
795 # | o 1 br --> substate = 3
796 # |/
796 # |/
797 # o 0 default --> substate = 2
797 # o 0 default --> substate = 2
798
798
799 $ cd ..
799 $ cd ..
800 $ echo 's = s' > .hgsub
800 $ echo 's = s' > .hgsub
801 $ hg -R s up 2
801 $ hg -R s up 2
802 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
802 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
803 $ hg ci -Am1
803 $ hg ci -Am1
804 adding .hgsub
804 adding .hgsub
805 $ hg branch br
805 $ hg branch br
806 marked working directory as branch br
806 marked working directory as branch br
807 (branches are permanent and global, did you want a bookmark?)
807 (branches are permanent and global, did you want a bookmark?)
808 $ echo b > b
808 $ echo b > b
809 $ hg -R s up 3
809 $ hg -R s up 3
810 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
810 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
811 $ hg ci -Am1
811 $ hg ci -Am1
812 adding b
812 adding b
813 $ hg up default
813 $ hg up default
814 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
814 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
815 $ echo c > c
815 $ echo c > c
816 $ hg ci -Am1
816 $ hg ci -Am1
817 adding c
817 adding c
818 $ hg up 1
818 $ hg up 1
819 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
819 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
820 $ hg merge 2
820 $ hg merge 2
821 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
821 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
822 (branch merge, don't forget to commit)
822 (branch merge, don't forget to commit)
823 $ hg ci -m1
823 $ hg ci -m1
824 $ hg up 2
824 $ hg up 2
825 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
825 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
826 $ hg -R s up 4
826 $ hg -R s up 4
827 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
827 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
828 $ echo d > d
828 $ echo d > d
829 $ hg ci -Am1
829 $ hg ci -Am1
830 adding d
830 adding d
831 $ hg up 3
831 $ hg up 3
832 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
832 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
833 $ hg -R s up 5
833 $ hg -R s up 5
834 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
834 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
835 $ echo e > e
835 $ echo e > e
836 $ hg ci -Am1
836 $ hg ci -Am1
837 adding e
837 adding e
838
838
839 $ hg up 5
839 $ hg up 5
840 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
840 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
841 $ hg merge 4 # try to merge default into br again
841 $ hg merge 4 # try to merge default into br again
842 subrepository s diverged (local revision: f8f13b33206e, remote revision: a3f9062a4f88)
842 subrepository s diverged (local revision: f8f13b33206e, remote revision: a3f9062a4f88)
843 (M)erge, keep (l)ocal or keep (r)emote? m
843 (M)erge, keep (l)ocal or keep (r)emote? m
844 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
844 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
845 (branch merge, don't forget to commit)
845 (branch merge, don't forget to commit)
846 $ cd ..
846 $ cd ..
847
847
848 test subrepo delete from .hgsubstate
848 test subrepo delete from .hgsubstate
849
849
850 $ hg init testdelete
850 $ hg init testdelete
851 $ mkdir testdelete/nested testdelete/nested2
851 $ mkdir testdelete/nested testdelete/nested2
852 $ hg init testdelete/nested
852 $ hg init testdelete/nested
853 $ hg init testdelete/nested2
853 $ hg init testdelete/nested2
854 $ echo test > testdelete/nested/foo
854 $ echo test > testdelete/nested/foo
855 $ echo test > testdelete/nested2/foo
855 $ echo test > testdelete/nested2/foo
856 $ hg -R testdelete/nested add
856 $ hg -R testdelete/nested add
857 adding testdelete/nested/foo (glob)
857 adding testdelete/nested/foo (glob)
858 $ hg -R testdelete/nested2 add
858 $ hg -R testdelete/nested2 add
859 adding testdelete/nested2/foo (glob)
859 adding testdelete/nested2/foo (glob)
860 $ hg -R testdelete/nested ci -m test
860 $ hg -R testdelete/nested ci -m test
861 $ hg -R testdelete/nested2 ci -m test
861 $ hg -R testdelete/nested2 ci -m test
862 $ echo nested = nested > testdelete/.hgsub
862 $ echo nested = nested > testdelete/.hgsub
863 $ echo nested2 = nested2 >> testdelete/.hgsub
863 $ echo nested2 = nested2 >> testdelete/.hgsub
864 $ hg -R testdelete add
864 $ hg -R testdelete add
865 adding testdelete/.hgsub (glob)
865 adding testdelete/.hgsub (glob)
866 $ hg -R testdelete ci -m "nested 1 & 2 added"
866 $ hg -R testdelete ci -m "nested 1 & 2 added"
867 $ echo nested = nested > testdelete/.hgsub
867 $ echo nested = nested > testdelete/.hgsub
868 $ hg -R testdelete ci -m "nested 2 deleted"
868 $ hg -R testdelete ci -m "nested 2 deleted"
869 $ cat testdelete/.hgsubstate
869 $ cat testdelete/.hgsubstate
870 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
870 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
871 $ hg -R testdelete remove testdelete/.hgsub
871 $ hg -R testdelete remove testdelete/.hgsub
872 $ hg -R testdelete ci -m ".hgsub deleted"
872 $ hg -R testdelete ci -m ".hgsub deleted"
873 $ cat testdelete/.hgsubstate
873 $ cat testdelete/.hgsubstate
874 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
874 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
875
875
876 test repository cloning
876 test repository cloning
877
877
878 $ mkdir mercurial mercurial2
878 $ mkdir mercurial mercurial2
879 $ hg init nested_absolute
879 $ hg init nested_absolute
880 $ echo test > nested_absolute/foo
880 $ echo test > nested_absolute/foo
881 $ hg -R nested_absolute add
881 $ hg -R nested_absolute add
882 adding nested_absolute/foo (glob)
882 adding nested_absolute/foo (glob)
883 $ hg -R nested_absolute ci -mtest
883 $ hg -R nested_absolute ci -mtest
884 $ cd mercurial
884 $ cd mercurial
885 $ hg init nested_relative
885 $ hg init nested_relative
886 $ echo test2 > nested_relative/foo2
886 $ echo test2 > nested_relative/foo2
887 $ hg -R nested_relative add
887 $ hg -R nested_relative add
888 adding nested_relative/foo2 (glob)
888 adding nested_relative/foo2 (glob)
889 $ hg -R nested_relative ci -mtest2
889 $ hg -R nested_relative ci -mtest2
890 $ hg init main
890 $ hg init main
891 $ echo "nested_relative = ../nested_relative" > main/.hgsub
891 $ echo "nested_relative = ../nested_relative" > main/.hgsub
892 $ echo "nested_absolute = `pwd`/nested_absolute" >> main/.hgsub
892 $ echo "nested_absolute = `pwd`/nested_absolute" >> main/.hgsub
893 $ hg -R main add
893 $ hg -R main add
894 adding main/.hgsub (glob)
894 adding main/.hgsub (glob)
895 $ hg -R main ci -m "add subrepos"
895 $ hg -R main ci -m "add subrepos"
896 $ cd ..
896 $ cd ..
897 $ hg clone mercurial/main mercurial2/main
897 $ hg clone mercurial/main mercurial2/main
898 updating to branch default
898 updating to branch default
899 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
899 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
900 $ cat mercurial2/main/nested_absolute/.hg/hgrc \
900 $ cat mercurial2/main/nested_absolute/.hg/hgrc \
901 > mercurial2/main/nested_relative/.hg/hgrc
901 > mercurial2/main/nested_relative/.hg/hgrc
902 [paths]
902 [paths]
903 default = $TESTTMP/mercurial/nested_absolute
903 default = $TESTTMP/mercurial/nested_absolute
904 [paths]
904 [paths]
905 default = $TESTTMP/mercurial/nested_relative
905 default = $TESTTMP/mercurial/nested_relative
906 $ rm -rf mercurial mercurial2
906 $ rm -rf mercurial mercurial2
907
907
908 Issue1977: multirepo push should fail if subrepo push fails
908 Issue1977: multirepo push should fail if subrepo push fails
909
909
910 $ hg init repo
910 $ hg init repo
911 $ hg init repo/s
911 $ hg init repo/s
912 $ echo a > repo/s/a
912 $ echo a > repo/s/a
913 $ hg -R repo/s ci -Am0
913 $ hg -R repo/s ci -Am0
914 adding a
914 adding a
915 $ echo s = s > repo/.hgsub
915 $ echo s = s > repo/.hgsub
916 $ hg -R repo ci -Am1
916 $ hg -R repo ci -Am1
917 adding .hgsub
917 adding .hgsub
918 $ hg clone repo repo2
918 $ hg clone repo repo2
919 updating to branch default
919 updating to branch default
920 cloning subrepo s from $TESTTMP/repo/s
920 cloning subrepo s from $TESTTMP/repo/s
921 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
921 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
922 $ hg -q -R repo2 pull -u
922 $ hg -q -R repo2 pull -u
923 $ echo 1 > repo2/s/a
923 $ echo 1 > repo2/s/a
924 $ hg -R repo2/s ci -m2
924 $ hg -R repo2/s ci -m2
925 $ hg -q -R repo2/s push
925 $ hg -q -R repo2/s push
926 $ hg -R repo2/s up -C 0
926 $ hg -R repo2/s up -C 0
927 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
927 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
928 $ echo 2 > repo2/s/b
928 $ echo 2 > repo2/s/b
929 $ hg -R repo2/s ci -m3 -A
929 $ hg -R repo2/s ci -m3 -A
930 adding b
930 adding b
931 created new head
931 created new head
932 $ hg -R repo2 ci -m3
932 $ hg -R repo2 ci -m3
933 $ hg -q -R repo2 push
933 $ hg -q -R repo2 push
934 abort: push creates new remote head cc505f09a8b2! (in subrepo s)
934 abort: push creates new remote head cc505f09a8b2! (in subrepo s)
935 (merge or see "hg help push" for details about pushing new heads)
935 (merge or see "hg help push" for details about pushing new heads)
936 [255]
936 [255]
937 $ hg -R repo update
937 $ hg -R repo update
938 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
938 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
939
939
940 test if untracked file is not overwritten
940 test if untracked file is not overwritten
941
941
942 (this also tests that updated .hgsubstate is treated as "modified",
942 (this also tests that updated .hgsubstate is treated as "modified",
943 when 'merge.update()' is aborted before 'merge.recordupdates()', even
943 when 'merge.update()' is aborted before 'merge.recordupdates()', even
944 if none of mode, size and timestamp of it isn't changed on the
944 if none of mode, size and timestamp of it isn't changed on the
945 filesystem (see also issue4583))
945 filesystem (see also issue4583))
946
946
947 $ echo issue3276_ok > repo/s/b
947 $ echo issue3276_ok > repo/s/b
948 $ hg -R repo2 push -f -q
948 $ hg -R repo2 push -f -q
949 $ touch -t 200001010000 repo/.hgsubstate
949 $ touch -t 200001010000 repo/.hgsubstate
950
950
951 $ cat >> repo/.hg/hgrc <<EOF
951 $ cat >> repo/.hg/hgrc <<EOF
952 > [fakedirstatewritetime]
952 > [fakedirstatewritetime]
953 > # emulate invoking dirstate.write() via repo.status()
953 > # emulate invoking dirstate.write() via repo.status()
954 > # at 2000-01-01 00:00
954 > # at 2000-01-01 00:00
955 > fakenow = 200001010000
955 > fakenow = 200001010000
956 >
956 >
957 > [extensions]
957 > [extensions]
958 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
958 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
959 > EOF
959 > EOF
960 $ hg -R repo update
960 $ hg -R repo update
961 b: untracked file differs
961 b: untracked file differs
962 abort: untracked files in working directory differ from files in requested revision (in subrepo s)
962 abort: untracked files in working directory differ from files in requested revision (in subrepo s)
963 [255]
963 [255]
964 $ cat >> repo/.hg/hgrc <<EOF
964 $ cat >> repo/.hg/hgrc <<EOF
965 > [extensions]
965 > [extensions]
966 > fakedirstatewritetime = !
966 > fakedirstatewritetime = !
967 > EOF
967 > EOF
968
968
969 $ cat repo/s/b
969 $ cat repo/s/b
970 issue3276_ok
970 issue3276_ok
971 $ rm repo/s/b
971 $ rm repo/s/b
972 $ touch -t 200001010000 repo/.hgsubstate
972 $ touch -t 200001010000 repo/.hgsubstate
973 $ hg -R repo revert --all
973 $ hg -R repo revert --all
974 reverting repo/.hgsubstate (glob)
974 reverting repo/.hgsubstate (glob)
975 reverting subrepo s
975 reverting subrepo s
976 $ hg -R repo update
976 $ hg -R repo update
977 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
977 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
978 $ cat repo/s/b
978 $ cat repo/s/b
979 2
979 2
980 $ rm -rf repo2 repo
980 $ rm -rf repo2 repo
981
981
982
982
983 Issue1852 subrepos with relative paths always push/pull relative to default
983 Issue1852 subrepos with relative paths always push/pull relative to default
984
984
985 Prepare a repo with subrepo
985 Prepare a repo with subrepo
986
986
987 $ hg init issue1852a
987 $ hg init issue1852a
988 $ cd issue1852a
988 $ cd issue1852a
989 $ hg init sub/repo
989 $ hg init sub/repo
990 $ echo test > sub/repo/foo
990 $ echo test > sub/repo/foo
991 $ hg -R sub/repo add sub/repo/foo
991 $ hg -R sub/repo add sub/repo/foo
992 $ echo sub/repo = sub/repo > .hgsub
992 $ echo sub/repo = sub/repo > .hgsub
993 $ hg add .hgsub
993 $ hg add .hgsub
994 $ hg ci -mtest
994 $ hg ci -mtest
995 committing subrepository sub/repo (glob)
995 committing subrepository sub/repo (glob)
996 $ echo test >> sub/repo/foo
996 $ echo test >> sub/repo/foo
997 $ hg ci -mtest
997 $ hg ci -mtest
998 committing subrepository sub/repo (glob)
998 committing subrepository sub/repo (glob)
999 $ hg cat sub/repo/foo
999 $ hg cat sub/repo/foo
1000 test
1000 test
1001 test
1001 test
1002 $ mkdir -p tmp/sub/repo
1002 $ mkdir -p tmp/sub/repo
1003 $ hg cat -r 0 --output tmp/%p_p sub/repo/foo
1003 $ hg cat -r 0 --output tmp/%p_p sub/repo/foo
1004 $ cat tmp/sub/repo/foo_p
1004 $ cat tmp/sub/repo/foo_p
1005 test
1005 test
1006 $ mv sub/repo sub_
1006 $ mv sub/repo sub_
1007 $ hg cat sub/repo/baz
1007 $ hg cat sub/repo/baz
1008 skipping missing subrepository: sub/repo
1008 skipping missing subrepository: sub/repo
1009 [1]
1009 [1]
1010 $ rm -rf sub/repo
1010 $ rm -rf sub/repo
1011 $ mv sub_ sub/repo
1011 $ mv sub_ sub/repo
1012 $ cd ..
1012 $ cd ..
1013
1013
1014 Create repo without default path, pull top repo, and see what happens on update
1014 Create repo without default path, pull top repo, and see what happens on update
1015
1015
1016 $ hg init issue1852b
1016 $ hg init issue1852b
1017 $ hg -R issue1852b pull issue1852a
1017 $ hg -R issue1852b pull issue1852a
1018 pulling from issue1852a
1018 pulling from issue1852a
1019 requesting all changes
1019 requesting all changes
1020 adding changesets
1020 adding changesets
1021 adding manifests
1021 adding manifests
1022 adding file changes
1022 adding file changes
1023 added 2 changesets with 3 changes to 2 files
1023 added 2 changesets with 3 changes to 2 files
1024 (run 'hg update' to get a working copy)
1024 (run 'hg update' to get a working copy)
1025 $ hg -R issue1852b update
1025 $ hg -R issue1852b update
1026 abort: default path for subrepository not found (in subrepo sub/repo) (glob)
1026 abort: default path for subrepository not found (in subrepo sub/repo) (glob)
1027 [255]
1027 [255]
1028
1028
1029 Ensure a full traceback, not just the SubrepoAbort part
1029 Ensure a full traceback, not just the SubrepoAbort part
1030
1030
1031 $ hg -R issue1852b update --traceback 2>&1 | grep 'raise util\.Abort'
1031 $ hg -R issue1852b update --traceback 2>&1 | grep 'raise util\.Abort'
1032 raise util.Abort(_("default path for subrepository not found"))
1032 raise util.Abort(_("default path for subrepository not found"))
1033
1033
1034 Pull -u now doesn't help
1034 Pull -u now doesn't help
1035
1035
1036 $ hg -R issue1852b pull -u issue1852a
1036 $ hg -R issue1852b pull -u issue1852a
1037 pulling from issue1852a
1037 pulling from issue1852a
1038 searching for changes
1038 searching for changes
1039 no changes found
1039 no changes found
1040
1040
1041 Try the same, but with pull -u
1041 Try the same, but with pull -u
1042
1042
1043 $ hg init issue1852c
1043 $ hg init issue1852c
1044 $ hg -R issue1852c pull -r0 -u issue1852a
1044 $ hg -R issue1852c pull -r0 -u issue1852a
1045 pulling from issue1852a
1045 pulling from issue1852a
1046 adding changesets
1046 adding changesets
1047 adding manifests
1047 adding manifests
1048 adding file changes
1048 adding file changes
1049 added 1 changesets with 2 changes to 2 files
1049 added 1 changesets with 2 changes to 2 files
1050 cloning subrepo sub/repo from issue1852a/sub/repo (glob)
1050 cloning subrepo sub/repo from issue1852a/sub/repo (glob)
1051 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1051 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1052
1052
1053 Try to push from the other side
1053 Try to push from the other side
1054
1054
1055 $ hg -R issue1852a push `pwd`/issue1852c
1055 $ hg -R issue1852a push `pwd`/issue1852c
1056 pushing to $TESTTMP/issue1852c (glob)
1056 pushing to $TESTTMP/issue1852c (glob)
1057 pushing subrepo sub/repo to $TESTTMP/issue1852c/sub/repo (glob)
1057 pushing subrepo sub/repo to $TESTTMP/issue1852c/sub/repo (glob)
1058 searching for changes
1058 searching for changes
1059 no changes found
1059 no changes found
1060 searching for changes
1060 searching for changes
1061 adding changesets
1061 adding changesets
1062 adding manifests
1062 adding manifests
1063 adding file changes
1063 adding file changes
1064 added 1 changesets with 1 changes to 1 files
1064 added 1 changesets with 1 changes to 1 files
1065
1065
1066 Incoming and outgoing should not use the default path:
1066 Incoming and outgoing should not use the default path:
1067
1067
1068 $ hg clone -q issue1852a issue1852d
1068 $ hg clone -q issue1852a issue1852d
1069 $ hg -R issue1852d outgoing --subrepos issue1852c
1069 $ hg -R issue1852d outgoing --subrepos issue1852c
1070 comparing with issue1852c
1070 comparing with issue1852c
1071 searching for changes
1071 searching for changes
1072 no changes found
1072 no changes found
1073 comparing with issue1852c/sub/repo
1073 comparing with issue1852c/sub/repo
1074 searching for changes
1074 searching for changes
1075 no changes found
1075 no changes found
1076 [1]
1076 [1]
1077 $ hg -R issue1852d incoming --subrepos issue1852c
1077 $ hg -R issue1852d incoming --subrepos issue1852c
1078 comparing with issue1852c
1078 comparing with issue1852c
1079 searching for changes
1079 searching for changes
1080 no changes found
1080 no changes found
1081 comparing with issue1852c/sub/repo
1081 comparing with issue1852c/sub/repo
1082 searching for changes
1082 searching for changes
1083 no changes found
1083 no changes found
1084 [1]
1084 [1]
1085
1085
1086 Check that merge of a new subrepo doesn't write the uncommitted state to
1086 Check that merge of a new subrepo doesn't write the uncommitted state to
1087 .hgsubstate (issue4622)
1087 .hgsubstate (issue4622)
1088
1088
1089 $ hg init issue1852a/addedsub
1089 $ hg init issue1852a/addedsub
1090 $ echo zzz > issue1852a/addedsub/zz.txt
1090 $ echo zzz > issue1852a/addedsub/zz.txt
1091 $ hg -R issue1852a/addedsub ci -Aqm "initial ZZ"
1091 $ hg -R issue1852a/addedsub ci -Aqm "initial ZZ"
1092
1092
1093 $ hg clone issue1852a/addedsub issue1852d/addedsub
1093 $ hg clone issue1852a/addedsub issue1852d/addedsub
1094 updating to branch default
1094 updating to branch default
1095 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1095 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1096
1096
1097 $ echo def > issue1852a/sub/repo/foo
1097 $ echo def > issue1852a/sub/repo/foo
1098 $ hg -R issue1852a ci -SAm 'tweaked subrepo'
1098 $ hg -R issue1852a ci -SAm 'tweaked subrepo'
1099 adding tmp/sub/repo/foo_p
1099 adding tmp/sub/repo/foo_p
1100 committing subrepository sub/repo (glob)
1100 committing subrepository sub/repo (glob)
1101
1101
1102 $ echo 'addedsub = addedsub' >> issue1852d/.hgsub
1102 $ echo 'addedsub = addedsub' >> issue1852d/.hgsub
1103 $ echo xyz > issue1852d/sub/repo/foo
1103 $ echo xyz > issue1852d/sub/repo/foo
1104 $ hg -R issue1852d pull -u
1104 $ hg -R issue1852d pull -u
1105 pulling from $TESTTMP/issue1852a (glob)
1105 pulling from $TESTTMP/issue1852a (glob)
1106 searching for changes
1106 searching for changes
1107 adding changesets
1107 adding changesets
1108 adding manifests
1108 adding manifests
1109 adding file changes
1109 adding file changes
1110 added 1 changesets with 2 changes to 2 files
1110 added 1 changesets with 2 changes to 2 files
1111 subrepository sub/repo diverged (local revision: f42d5c7504a8, remote revision: 46cd4aac504c)
1111 subrepository sub/repo diverged (local revision: f42d5c7504a8, remote revision: 46cd4aac504c)
1112 (M)erge, keep (l)ocal or keep (r)emote? m
1112 (M)erge, keep (l)ocal or keep (r)emote? m
1113 pulling subrepo sub/repo from $TESTTMP/issue1852a/sub/repo (glob)
1113 pulling subrepo sub/repo from $TESTTMP/issue1852a/sub/repo (glob)
1114 searching for changes
1114 searching for changes
1115 adding changesets
1115 adding changesets
1116 adding manifests
1116 adding manifests
1117 adding file changes
1117 adding file changes
1118 added 1 changesets with 1 changes to 1 files
1118 added 1 changesets with 1 changes to 1 files
1119 subrepository sources for sub/repo differ (glob)
1119 subrepository sources for sub/repo differ (glob)
1120 use (l)ocal source (f42d5c7504a8) or (r)emote source (46cd4aac504c)? l
1120 use (l)ocal source (f42d5c7504a8) or (r)emote source (46cd4aac504c)? l
1121 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1121 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1122 $ cat issue1852d/.hgsubstate
1122 $ cat issue1852d/.hgsubstate
1123 f42d5c7504a811dda50f5cf3e5e16c3330b87172 sub/repo
1123 f42d5c7504a811dda50f5cf3e5e16c3330b87172 sub/repo
1124
1124
1125 Check status of files when none of them belong to the first
1125 Check status of files when none of them belong to the first
1126 subrepository:
1126 subrepository:
1127
1127
1128 $ hg init subrepo-status
1128 $ hg init subrepo-status
1129 $ cd subrepo-status
1129 $ cd subrepo-status
1130 $ hg init subrepo-1
1130 $ hg init subrepo-1
1131 $ hg init subrepo-2
1131 $ hg init subrepo-2
1132 $ cd subrepo-2
1132 $ cd subrepo-2
1133 $ touch file
1133 $ touch file
1134 $ hg add file
1134 $ hg add file
1135 $ cd ..
1135 $ cd ..
1136 $ echo subrepo-1 = subrepo-1 > .hgsub
1136 $ echo subrepo-1 = subrepo-1 > .hgsub
1137 $ echo subrepo-2 = subrepo-2 >> .hgsub
1137 $ echo subrepo-2 = subrepo-2 >> .hgsub
1138 $ hg add .hgsub
1138 $ hg add .hgsub
1139 $ hg ci -m 'Added subrepos'
1139 $ hg ci -m 'Added subrepos'
1140 committing subrepository subrepo-2
1140 committing subrepository subrepo-2
1141 $ hg st subrepo-2/file
1141 $ hg st subrepo-2/file
1142
1142
1143 Check that share works with subrepo
1143 Check that share works with subrepo
1144 $ hg --config extensions.share= share . ../shared
1144 $ hg --config extensions.share= share . ../shared
1145 updating working directory
1145 updating working directory
1146 cloning subrepo subrepo-2 from $TESTTMP/subrepo-status/subrepo-2
1146 cloning subrepo subrepo-2 from $TESTTMP/subrepo-status/subrepo-2
1147 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1147 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1148 $ test -f ../shared/subrepo-1/.hg/sharedpath
1148 $ test -f ../shared/subrepo-1/.hg/sharedpath
1149 [1]
1149 [1]
1150 $ hg -R ../shared in
1150 $ hg -R ../shared in
1151 abort: repository default not found!
1151 abort: repository default not found!
1152 [255]
1152 [255]
1153 $ hg -R ../shared/subrepo-2 showconfig paths
1153 $ hg -R ../shared/subrepo-2 showconfig paths
1154 paths.default=$TESTTMP/subrepo-status/subrepo-2
1154 paths.default=$TESTTMP/subrepo-status/subrepo-2
1155 $ hg -R ../shared/subrepo-1 sum --remote
1155 $ hg -R ../shared/subrepo-1 sum --remote
1156 parent: -1:000000000000 tip (empty repository)
1156 parent: -1:000000000000 tip (empty repository)
1157 branch: default
1157 branch: default
1158 commit: (clean)
1158 commit: (clean)
1159 update: (current)
1159 update: (current)
1160 remote: (synced)
1160 remote: (synced)
1161
1161
1162 Check hg update --clean
1162 Check hg update --clean
1163 $ cd $TESTTMP/t
1163 $ cd $TESTTMP/t
1164 $ rm -r t/t.orig
1164 $ rm -r t/t.orig
1165 $ hg status -S --all
1165 $ hg status -S --all
1166 C .hgsub
1166 C .hgsub
1167 C .hgsubstate
1167 C .hgsubstate
1168 C a
1168 C a
1169 C s/.hgsub
1169 C s/.hgsub
1170 C s/.hgsubstate
1170 C s/.hgsubstate
1171 C s/a
1171 C s/a
1172 C s/ss/a
1172 C s/ss/a
1173 C t/t
1173 C t/t
1174 $ echo c1 > s/a
1174 $ echo c1 > s/a
1175 $ cd s
1175 $ cd s
1176 $ echo c1 > b
1176 $ echo c1 > b
1177 $ echo c1 > c
1177 $ echo c1 > c
1178 $ hg add b
1178 $ hg add b
1179 $ cd ..
1179 $ cd ..
1180 $ hg status -S
1180 $ hg status -S
1181 M s/a
1181 M s/a
1182 A s/b
1182 A s/b
1183 ? s/c
1183 ? s/c
1184 $ hg update -C
1184 $ hg update -C
1185 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1185 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1186 $ hg status -S
1186 $ hg status -S
1187 ? s/b
1187 ? s/b
1188 ? s/c
1188 ? s/c
1189
1189
1190 Sticky subrepositories, no changes
1190 Sticky subrepositories, no changes
1191 $ cd $TESTTMP/t
1191 $ cd $TESTTMP/t
1192 $ hg id
1192 $ hg id
1193 925c17564ef8 tip
1193 925c17564ef8 tip
1194 $ hg -R s id
1194 $ hg -R s id
1195 12a213df6fa9 tip
1195 12a213df6fa9 tip
1196 $ hg -R t id
1196 $ hg -R t id
1197 52c0adc0515a tip
1197 52c0adc0515a tip
1198 $ hg update 11
1198 $ hg update 11
1199 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1199 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1200 $ hg id
1200 $ hg id
1201 365661e5936a
1201 365661e5936a
1202 $ hg -R s id
1202 $ hg -R s id
1203 fc627a69481f
1203 fc627a69481f
1204 $ hg -R t id
1204 $ hg -R t id
1205 e95bcfa18a35
1205 e95bcfa18a35
1206
1206
1207 Sticky subrepositories, file changes
1207 Sticky subrepositories, file changes
1208 $ touch s/f1
1208 $ touch s/f1
1209 $ touch t/f1
1209 $ touch t/f1
1210 $ hg add -S s/f1
1210 $ hg add -S s/f1
1211 $ hg add -S t/f1
1211 $ hg add -S t/f1
1212 $ hg id
1212 $ hg id
1213 365661e5936a+
1213 365661e5936a+
1214 $ hg -R s id
1214 $ hg -R s id
1215 fc627a69481f+
1215 fc627a69481f+
1216 $ hg -R t id
1216 $ hg -R t id
1217 e95bcfa18a35+
1217 e95bcfa18a35+
1218 $ hg update tip
1218 $ hg update tip
1219 subrepository s diverged (local revision: fc627a69481f, remote revision: 12a213df6fa9)
1219 subrepository s diverged (local revision: fc627a69481f, remote revision: 12a213df6fa9)
1220 (M)erge, keep (l)ocal or keep (r)emote? m
1220 (M)erge, keep (l)ocal or keep (r)emote? m
1221 subrepository sources for s differ
1221 subrepository sources for s differ
1222 use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9)? l
1222 use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9)? l
1223 subrepository t diverged (local revision: e95bcfa18a35, remote revision: 52c0adc0515a)
1223 subrepository t diverged (local revision: e95bcfa18a35, remote revision: 52c0adc0515a)
1224 (M)erge, keep (l)ocal or keep (r)emote? m
1224 (M)erge, keep (l)ocal or keep (r)emote? m
1225 subrepository sources for t differ
1225 subrepository sources for t differ
1226 use (l)ocal source (e95bcfa18a35) or (r)emote source (52c0adc0515a)? l
1226 use (l)ocal source (e95bcfa18a35) or (r)emote source (52c0adc0515a)? l
1227 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1227 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1228 $ hg id
1228 $ hg id
1229 925c17564ef8+ tip
1229 925c17564ef8+ tip
1230 $ hg -R s id
1230 $ hg -R s id
1231 fc627a69481f+
1231 fc627a69481f+
1232 $ hg -R t id
1232 $ hg -R t id
1233 e95bcfa18a35+
1233 e95bcfa18a35+
1234 $ hg update --clean tip
1234 $ hg update --clean tip
1235 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1235 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1236
1236
1237 Sticky subrepository, revision updates
1237 Sticky subrepository, revision updates
1238 $ hg id
1238 $ hg id
1239 925c17564ef8 tip
1239 925c17564ef8 tip
1240 $ hg -R s id
1240 $ hg -R s id
1241 12a213df6fa9 tip
1241 12a213df6fa9 tip
1242 $ hg -R t id
1242 $ hg -R t id
1243 52c0adc0515a tip
1243 52c0adc0515a tip
1244 $ cd s
1244 $ cd s
1245 $ hg update -r -2
1245 $ hg update -r -2
1246 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1246 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1247 $ cd ../t
1247 $ cd ../t
1248 $ hg update -r 2
1248 $ hg update -r 2
1249 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1249 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1250 $ cd ..
1250 $ cd ..
1251 $ hg update 10
1251 $ hg update 10
1252 subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
1252 subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
1253 (M)erge, keep (l)ocal or keep (r)emote? m
1253 (M)erge, keep (l)ocal or keep (r)emote? m
1254 subrepository t diverged (local revision: 52c0adc0515a, remote revision: 20a0db6fbf6c)
1254 subrepository t diverged (local revision: 52c0adc0515a, remote revision: 20a0db6fbf6c)
1255 (M)erge, keep (l)ocal or keep (r)emote? m
1255 (M)erge, keep (l)ocal or keep (r)emote? m
1256 subrepository sources for t differ (in checked out version)
1256 subrepository sources for t differ (in checked out version)
1257 use (l)ocal source (7af322bc1198) or (r)emote source (20a0db6fbf6c)? l
1257 use (l)ocal source (7af322bc1198) or (r)emote source (20a0db6fbf6c)? l
1258 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1258 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1259 $ hg id
1259 $ hg id
1260 e45c8b14af55+
1260 e45c8b14af55+
1261 $ hg -R s id
1261 $ hg -R s id
1262 02dcf1d70411
1262 02dcf1d70411
1263 $ hg -R t id
1263 $ hg -R t id
1264 7af322bc1198
1264 7af322bc1198
1265
1265
1266 Sticky subrepository, file changes and revision updates
1266 Sticky subrepository, file changes and revision updates
1267 $ touch s/f1
1267 $ touch s/f1
1268 $ touch t/f1
1268 $ touch t/f1
1269 $ hg add -S s/f1
1269 $ hg add -S s/f1
1270 $ hg add -S t/f1
1270 $ hg add -S t/f1
1271 $ hg id
1271 $ hg id
1272 e45c8b14af55+
1272 e45c8b14af55+
1273 $ hg -R s id
1273 $ hg -R s id
1274 02dcf1d70411+
1274 02dcf1d70411+
1275 $ hg -R t id
1275 $ hg -R t id
1276 7af322bc1198+
1276 7af322bc1198+
1277 $ hg update tip
1277 $ hg update tip
1278 subrepository s diverged (local revision: 12a213df6fa9, remote revision: 12a213df6fa9)
1278 subrepository s diverged (local revision: 12a213df6fa9, remote revision: 12a213df6fa9)
1279 (M)erge, keep (l)ocal or keep (r)emote? m
1279 (M)erge, keep (l)ocal or keep (r)emote? m
1280 subrepository sources for s differ
1280 subrepository sources for s differ
1281 use (l)ocal source (02dcf1d70411) or (r)emote source (12a213df6fa9)? l
1281 use (l)ocal source (02dcf1d70411) or (r)emote source (12a213df6fa9)? l
1282 subrepository t diverged (local revision: 52c0adc0515a, remote revision: 52c0adc0515a)
1282 subrepository t diverged (local revision: 52c0adc0515a, remote revision: 52c0adc0515a)
1283 (M)erge, keep (l)ocal or keep (r)emote? m
1283 (M)erge, keep (l)ocal or keep (r)emote? m
1284 subrepository sources for t differ
1284 subrepository sources for t differ
1285 use (l)ocal source (7af322bc1198) or (r)emote source (52c0adc0515a)? l
1285 use (l)ocal source (7af322bc1198) or (r)emote source (52c0adc0515a)? l
1286 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1286 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1287 $ hg id
1287 $ hg id
1288 925c17564ef8+ tip
1288 925c17564ef8+ tip
1289 $ hg -R s id
1289 $ hg -R s id
1290 02dcf1d70411+
1290 02dcf1d70411+
1291 $ hg -R t id
1291 $ hg -R t id
1292 7af322bc1198+
1292 7af322bc1198+
1293
1293
1294 Sticky repository, update --clean
1294 Sticky repository, update --clean
1295 $ hg update --clean tip
1295 $ hg update --clean tip
1296 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1296 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1297 $ hg id
1297 $ hg id
1298 925c17564ef8 tip
1298 925c17564ef8 tip
1299 $ hg -R s id
1299 $ hg -R s id
1300 12a213df6fa9 tip
1300 12a213df6fa9 tip
1301 $ hg -R t id
1301 $ hg -R t id
1302 52c0adc0515a tip
1302 52c0adc0515a tip
1303
1303
1304 Test subrepo already at intended revision:
1304 Test subrepo already at intended revision:
1305 $ cd s
1305 $ cd s
1306 $ hg update fc627a69481f
1306 $ hg update fc627a69481f
1307 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1307 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1308 $ cd ..
1308 $ cd ..
1309 $ hg update 11
1309 $ hg update 11
1310 subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
1310 subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
1311 (M)erge, keep (l)ocal or keep (r)emote? m
1311 (M)erge, keep (l)ocal or keep (r)emote? m
1312 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1312 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1313 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1313 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1314 $ hg id -n
1314 $ hg id -n
1315 11+
1315 11+
1316 $ hg -R s id
1316 $ hg -R s id
1317 fc627a69481f
1317 fc627a69481f
1318 $ hg -R t id
1318 $ hg -R t id
1319 e95bcfa18a35
1319 e95bcfa18a35
1320
1320
1321 Test that removing .hgsubstate doesn't break anything:
1321 Test that removing .hgsubstate doesn't break anything:
1322
1322
1323 $ hg rm -f .hgsubstate
1323 $ hg rm -f .hgsubstate
1324 $ hg ci -mrm
1324 $ hg ci -mrm
1325 nothing changed
1325 nothing changed
1326 [1]
1326 [1]
1327 $ hg log -vr tip
1327 $ hg log -vr tip
1328 changeset: 13:925c17564ef8
1328 changeset: 13:925c17564ef8
1329 tag: tip
1329 tag: tip
1330 user: test
1330 user: test
1331 date: Thu Jan 01 00:00:00 1970 +0000
1331 date: Thu Jan 01 00:00:00 1970 +0000
1332 files: .hgsubstate
1332 files: .hgsubstate
1333 description:
1333 description:
1334 13
1334 13
1335
1335
1336
1336
1337
1337
1338 Test that removing .hgsub removes .hgsubstate:
1338 Test that removing .hgsub removes .hgsubstate:
1339
1339
1340 $ hg rm .hgsub
1340 $ hg rm .hgsub
1341 $ hg ci -mrm2
1341 $ hg ci -mrm2
1342 created new head
1342 created new head
1343 $ hg log -vr tip
1343 $ hg log -vr tip
1344 changeset: 14:2400bccd50af
1344 changeset: 14:2400bccd50af
1345 tag: tip
1345 tag: tip
1346 parent: 11:365661e5936a
1346 parent: 11:365661e5936a
1347 user: test
1347 user: test
1348 date: Thu Jan 01 00:00:00 1970 +0000
1348 date: Thu Jan 01 00:00:00 1970 +0000
1349 files: .hgsub .hgsubstate
1349 files: .hgsub .hgsubstate
1350 description:
1350 description:
1351 rm2
1351 rm2
1352
1352
1353
1353
1354 Test issue3153: diff -S with deleted subrepos
1354 Test issue3153: diff -S with deleted subrepos
1355
1355
1356 $ hg diff --nodates -S -c .
1356 $ hg diff --nodates -S -c .
1357 diff -r 365661e5936a -r 2400bccd50af .hgsub
1357 diff -r 365661e5936a -r 2400bccd50af .hgsub
1358 --- a/.hgsub
1358 --- a/.hgsub
1359 +++ /dev/null
1359 +++ /dev/null
1360 @@ -1,2 +0,0 @@
1360 @@ -1,2 +0,0 @@
1361 -s = s
1361 -s = s
1362 -t = t
1362 -t = t
1363 diff -r 365661e5936a -r 2400bccd50af .hgsubstate
1363 diff -r 365661e5936a -r 2400bccd50af .hgsubstate
1364 --- a/.hgsubstate
1364 --- a/.hgsubstate
1365 +++ /dev/null
1365 +++ /dev/null
1366 @@ -1,2 +0,0 @@
1366 @@ -1,2 +0,0 @@
1367 -fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
1367 -fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
1368 -e95bcfa18a358dc4936da981ebf4147b4cad1362 t
1368 -e95bcfa18a358dc4936da981ebf4147b4cad1362 t
1369
1369
1370 Test behavior of add for explicit path in subrepo:
1370 Test behavior of add for explicit path in subrepo:
1371 $ cd ..
1371 $ cd ..
1372 $ hg init explicit
1372 $ hg init explicit
1373 $ cd explicit
1373 $ cd explicit
1374 $ echo s = s > .hgsub
1374 $ echo s = s > .hgsub
1375 $ hg add .hgsub
1375 $ hg add .hgsub
1376 $ hg init s
1376 $ hg init s
1377 $ hg ci -m0
1377 $ hg ci -m0
1378 Adding with an explicit path in a subrepo adds the file
1378 Adding with an explicit path in a subrepo adds the file
1379 $ echo c1 > f1
1379 $ echo c1 > f1
1380 $ echo c2 > s/f2
1380 $ echo c2 > s/f2
1381 $ hg st -S
1381 $ hg st -S
1382 ? f1
1382 ? f1
1383 ? s/f2
1383 ? s/f2
1384 $ hg add s/f2
1384 $ hg add s/f2
1385 $ hg st -S
1385 $ hg st -S
1386 A s/f2
1386 A s/f2
1387 ? f1
1387 ? f1
1388 $ hg ci -R s -m0
1388 $ hg ci -R s -m0
1389 $ hg ci -Am1
1389 $ hg ci -Am1
1390 adding f1
1390 adding f1
1391 Adding with an explicit path in a subrepo with -S has the same behavior
1391 Adding with an explicit path in a subrepo with -S has the same behavior
1392 $ echo c3 > f3
1392 $ echo c3 > f3
1393 $ echo c4 > s/f4
1393 $ echo c4 > s/f4
1394 $ hg st -S
1394 $ hg st -S
1395 ? f3
1395 ? f3
1396 ? s/f4
1396 ? s/f4
1397 $ hg add -S s/f4
1397 $ hg add -S s/f4
1398 $ hg st -S
1398 $ hg st -S
1399 A s/f4
1399 A s/f4
1400 ? f3
1400 ? f3
1401 $ hg ci -R s -m1
1401 $ hg ci -R s -m1
1402 $ hg ci -Ama2
1402 $ hg ci -Ama2
1403 adding f3
1403 adding f3
1404 Adding without a path or pattern silently ignores subrepos
1404 Adding without a path or pattern silently ignores subrepos
1405 $ echo c5 > f5
1405 $ echo c5 > f5
1406 $ echo c6 > s/f6
1406 $ echo c6 > s/f6
1407 $ echo c7 > s/f7
1407 $ echo c7 > s/f7
1408 $ hg st -S
1408 $ hg st -S
1409 ? f5
1409 ? f5
1410 ? s/f6
1410 ? s/f6
1411 ? s/f7
1411 ? s/f7
1412 $ hg add
1412 $ hg add
1413 adding f5
1413 adding f5
1414 $ hg st -S
1414 $ hg st -S
1415 A f5
1415 A f5
1416 ? s/f6
1416 ? s/f6
1417 ? s/f7
1417 ? s/f7
1418 $ hg ci -R s -Am2
1418 $ hg ci -R s -Am2
1419 adding f6
1419 adding f6
1420 adding f7
1420 adding f7
1421 $ hg ci -m3
1421 $ hg ci -m3
1422 Adding without a path or pattern with -S also adds files in subrepos
1422 Adding without a path or pattern with -S also adds files in subrepos
1423 $ echo c8 > f8
1423 $ echo c8 > f8
1424 $ echo c9 > s/f9
1424 $ echo c9 > s/f9
1425 $ echo c10 > s/f10
1425 $ echo c10 > s/f10
1426 $ hg st -S
1426 $ hg st -S
1427 ? f8
1427 ? f8
1428 ? s/f10
1428 ? s/f10
1429 ? s/f9
1429 ? s/f9
1430 $ hg add -S
1430 $ hg add -S
1431 adding f8
1431 adding f8
1432 adding s/f10 (glob)
1432 adding s/f10 (glob)
1433 adding s/f9 (glob)
1433 adding s/f9 (glob)
1434 $ hg st -S
1434 $ hg st -S
1435 A f8
1435 A f8
1436 A s/f10
1436 A s/f10
1437 A s/f9
1437 A s/f9
1438 $ hg ci -R s -m3
1438 $ hg ci -R s -m3
1439 $ hg ci -m4
1439 $ hg ci -m4
1440 Adding with a pattern silently ignores subrepos
1440 Adding with a pattern silently ignores subrepos
1441 $ echo c11 > fm11
1441 $ echo c11 > fm11
1442 $ echo c12 > fn12
1442 $ echo c12 > fn12
1443 $ echo c13 > s/fm13
1443 $ echo c13 > s/fm13
1444 $ echo c14 > s/fn14
1444 $ echo c14 > s/fn14
1445 $ hg st -S
1445 $ hg st -S
1446 ? fm11
1446 ? fm11
1447 ? fn12
1447 ? fn12
1448 ? s/fm13
1448 ? s/fm13
1449 ? s/fn14
1449 ? s/fn14
1450 $ hg add 'glob:**fm*'
1450 $ hg add 'glob:**fm*'
1451 adding fm11
1451 adding fm11
1452 $ hg st -S
1452 $ hg st -S
1453 A fm11
1453 A fm11
1454 ? fn12
1454 ? fn12
1455 ? s/fm13
1455 ? s/fm13
1456 ? s/fn14
1456 ? s/fn14
1457 $ hg ci -R s -Am4
1457 $ hg ci -R s -Am4
1458 adding fm13
1458 adding fm13
1459 adding fn14
1459 adding fn14
1460 $ hg ci -Am5
1460 $ hg ci -Am5
1461 adding fn12
1461 adding fn12
1462 Adding with a pattern with -S also adds matches in subrepos
1462 Adding with a pattern with -S also adds matches in subrepos
1463 $ echo c15 > fm15
1463 $ echo c15 > fm15
1464 $ echo c16 > fn16
1464 $ echo c16 > fn16
1465 $ echo c17 > s/fm17
1465 $ echo c17 > s/fm17
1466 $ echo c18 > s/fn18
1466 $ echo c18 > s/fn18
1467 $ hg st -S
1467 $ hg st -S
1468 ? fm15
1468 ? fm15
1469 ? fn16
1469 ? fn16
1470 ? s/fm17
1470 ? s/fm17
1471 ? s/fn18
1471 ? s/fn18
1472 $ hg add -S 'glob:**fm*'
1472 $ hg add -S 'glob:**fm*'
1473 adding fm15
1473 adding fm15
1474 adding s/fm17 (glob)
1474 adding s/fm17 (glob)
1475 $ hg st -S
1475 $ hg st -S
1476 A fm15
1476 A fm15
1477 A s/fm17
1477 A s/fm17
1478 ? fn16
1478 ? fn16
1479 ? s/fn18
1479 ? s/fn18
1480 $ hg ci -R s -Am5
1480 $ hg ci -R s -Am5
1481 adding fn18
1481 adding fn18
1482 $ hg ci -Am6
1482 $ hg ci -Am6
1483 adding fn16
1483 adding fn16
1484
1484
1485 Test behavior of forget for explicit path in subrepo:
1485 Test behavior of forget for explicit path in subrepo:
1486 Forgetting an explicit path in a subrepo untracks the file
1486 Forgetting an explicit path in a subrepo untracks the file
1487 $ echo c19 > s/f19
1487 $ echo c19 > s/f19
1488 $ hg add s/f19
1488 $ hg add s/f19
1489 $ hg st -S
1489 $ hg st -S
1490 A s/f19
1490 A s/f19
1491 $ hg forget s/f19
1491 $ hg forget s/f19
1492 $ hg st -S
1492 $ hg st -S
1493 ? s/f19
1493 ? s/f19
1494 $ rm s/f19
1494 $ rm s/f19
1495 $ cd ..
1495 $ cd ..
1496
1496
1497 Courtesy phases synchronisation to publishing server does not block the push
1497 Courtesy phases synchronisation to publishing server does not block the push
1498 (issue3781)
1498 (issue3781)
1499
1499
1500 $ cp -r main issue3781
1500 $ cp -r main issue3781
1501 $ cp -r main issue3781-dest
1501 $ cp -r main issue3781-dest
1502 $ cd issue3781-dest/s
1502 $ cd issue3781-dest/s
1503 $ hg phase tip # show we have draft changeset
1503 $ hg phase tip # show we have draft changeset
1504 5: draft
1504 5: draft
1505 $ chmod a-w .hg/store/phaseroots # prevent phase push
1505 $ chmod a-w .hg/store/phaseroots # prevent phase push
1506 $ cd ../../issue3781
1506 $ cd ../../issue3781
1507 $ cat >> .hg/hgrc << EOF
1507 $ cat >> .hg/hgrc << EOF
1508 > [paths]
1508 > [paths]
1509 > default=../issue3781-dest/
1509 > default=../issue3781-dest/
1510 > EOF
1510 > EOF
1511 $ hg push --config experimental.bundle2-exp=False
1511 $ hg push --config experimental.bundle2-exp=False
1512 pushing to $TESTTMP/issue3781-dest (glob)
1512 pushing to $TESTTMP/issue3781-dest (glob)
1513 pushing subrepo s to $TESTTMP/issue3781-dest/s
1513 pushing subrepo s to $TESTTMP/issue3781-dest/s
1514 searching for changes
1514 searching for changes
1515 no changes found
1515 no changes found
1516 searching for changes
1516 searching for changes
1517 no changes found
1517 no changes found
1518 [1]
1518 [1]
1519 # clean the push cache
1519 # clean the push cache
1520 $ rm s/.hg/cache/storehash/*
1520 $ rm s/.hg/cache/storehash/*
1521 $ hg push --config experimental.bundle2-exp=True
1521 $ hg push --config experimental.bundle2-exp=True
1522 pushing to $TESTTMP/issue3781-dest (glob)
1522 pushing to $TESTTMP/issue3781-dest (glob)
1523 pushing subrepo s to $TESTTMP/issue3781-dest/s
1523 pushing subrepo s to $TESTTMP/issue3781-dest/s
1524 searching for changes
1524 searching for changes
1525 no changes found
1525 no changes found
1526 searching for changes
1526 searching for changes
1527 no changes found
1527 no changes found
1528 [1]
1528 [1]
1529 $ cd ..
1529 $ cd ..
1530
1530
1531 Test phase choice for newly created commit with "phases.subrepochecks"
1531 Test phase choice for newly created commit with "phases.subrepochecks"
1532 configuration
1532 configuration
1533
1533
1534 $ cd t
1534 $ cd t
1535 $ hg update -q -r 12
1535 $ hg update -q -r 12
1536
1536
1537 $ cat >> s/ss/.hg/hgrc <<EOF
1537 $ cat >> s/ss/.hg/hgrc <<EOF
1538 > [phases]
1538 > [phases]
1539 > new-commit = secret
1539 > new-commit = secret
1540 > EOF
1540 > EOF
1541 $ cat >> s/.hg/hgrc <<EOF
1541 $ cat >> s/.hg/hgrc <<EOF
1542 > [phases]
1542 > [phases]
1543 > new-commit = draft
1543 > new-commit = draft
1544 > EOF
1544 > EOF
1545 $ echo phasecheck1 >> s/ss/a
1545 $ echo phasecheck1 >> s/ss/a
1546 $ hg -R s commit -S --config phases.checksubrepos=abort -m phasecheck1
1546 $ hg -R s commit -S --config phases.checksubrepos=abort -m phasecheck1
1547 committing subrepository ss
1547 committing subrepository ss
1548 transaction abort!
1548 transaction abort!
1549 rollback completed
1549 rollback completed
1550 abort: can't commit in draft phase conflicting secret from subrepository ss
1550 abort: can't commit in draft phase conflicting secret from subrepository ss
1551 [255]
1551 [255]
1552 $ echo phasecheck2 >> s/ss/a
1552 $ echo phasecheck2 >> s/ss/a
1553 $ hg -R s commit -S --config phases.checksubrepos=ignore -m phasecheck2
1553 $ hg -R s commit -S --config phases.checksubrepos=ignore -m phasecheck2
1554 committing subrepository ss
1554 committing subrepository ss
1555 $ hg -R s/ss phase tip
1555 $ hg -R s/ss phase tip
1556 3: secret
1556 3: secret
1557 $ hg -R s phase tip
1557 $ hg -R s phase tip
1558 6: draft
1558 6: draft
1559 $ echo phasecheck3 >> s/ss/a
1559 $ echo phasecheck3 >> s/ss/a
1560 $ hg -R s commit -S -m phasecheck3
1560 $ hg -R s commit -S -m phasecheck3
1561 committing subrepository ss
1561 committing subrepository ss
1562 warning: changes are committed in secret phase from subrepository ss
1562 warning: changes are committed in secret phase from subrepository ss
1563 $ hg -R s/ss phase tip
1563 $ hg -R s/ss phase tip
1564 4: secret
1564 4: secret
1565 $ hg -R s phase tip
1565 $ hg -R s phase tip
1566 7: secret
1566 7: secret
1567
1567
1568 $ cat >> t/.hg/hgrc <<EOF
1568 $ cat >> t/.hg/hgrc <<EOF
1569 > [phases]
1569 > [phases]
1570 > new-commit = draft
1570 > new-commit = draft
1571 > EOF
1571 > EOF
1572 $ cat >> .hg/hgrc <<EOF
1572 $ cat >> .hg/hgrc <<EOF
1573 > [phases]
1573 > [phases]
1574 > new-commit = public
1574 > new-commit = public
1575 > EOF
1575 > EOF
1576 $ echo phasecheck4 >> s/ss/a
1576 $ echo phasecheck4 >> s/ss/a
1577 $ echo phasecheck4 >> t/t
1577 $ echo phasecheck4 >> t/t
1578 $ hg commit -S -m phasecheck4
1578 $ hg commit -S -m phasecheck4
1579 committing subrepository s
1579 committing subrepository s
1580 committing subrepository s/ss (glob)
1580 committing subrepository s/ss (glob)
1581 warning: changes are committed in secret phase from subrepository ss
1581 warning: changes are committed in secret phase from subrepository ss
1582 committing subrepository t
1582 committing subrepository t
1583 warning: changes are committed in secret phase from subrepository s
1583 warning: changes are committed in secret phase from subrepository s
1584 created new head
1584 created new head
1585 $ hg -R s/ss phase tip
1585 $ hg -R s/ss phase tip
1586 5: secret
1586 5: secret
1587 $ hg -R s phase tip
1587 $ hg -R s phase tip
1588 8: secret
1588 8: secret
1589 $ hg -R t phase tip
1589 $ hg -R t phase tip
1590 6: draft
1590 6: draft
1591 $ hg phase tip
1591 $ hg phase tip
1592 15: secret
1592 15: secret
1593
1593
1594 $ cd ..
1594 $ cd ..
1595
1595
1596
1596
1597 Test that commit --secret works on both repo and subrepo (issue4182)
1597 Test that commit --secret works on both repo and subrepo (issue4182)
1598
1598
1599 $ cd main
1599 $ cd main
1600 $ echo secret >> b
1600 $ echo secret >> b
1601 $ echo secret >> s/b
1601 $ echo secret >> s/b
1602 $ hg commit --secret --subrepo -m "secret"
1602 $ hg commit --secret --subrepo -m "secret"
1603 committing subrepository s
1603 committing subrepository s
1604 $ hg phase -r .
1604 $ hg phase -r .
1605 6: secret
1605 6: secret
1606 $ cd s
1606 $ cd s
1607 $ hg phase -r .
1607 $ hg phase -r .
1608 6: secret
1608 6: secret
1609 $ cd ../../
1609 $ cd ../../
1610
1610
1611 Test "subrepos" template keyword
1611 Test "subrepos" template keyword
1612
1612
1613 $ cd t
1613 $ cd t
1614 $ hg update -q 15
1614 $ hg update -q 15
1615 $ cat > .hgsub <<EOF
1615 $ cat > .hgsub <<EOF
1616 > s = s
1616 > s = s
1617 > EOF
1617 > EOF
1618 $ hg commit -m "16"
1618 $ hg commit -m "16"
1619 warning: changes are committed in secret phase from subrepository s
1619 warning: changes are committed in secret phase from subrepository s
1620
1620
1621 (addition of ".hgsub" itself)
1621 (addition of ".hgsub" itself)
1622
1622
1623 $ hg diff --nodates -c 1 .hgsubstate
1623 $ hg diff --nodates -c 1 .hgsubstate
1624 diff -r f7b1eb17ad24 -r 7cf8cfea66e4 .hgsubstate
1624 diff -r f7b1eb17ad24 -r 7cf8cfea66e4 .hgsubstate
1625 --- /dev/null
1625 --- /dev/null
1626 +++ b/.hgsubstate
1626 +++ b/.hgsubstate
1627 @@ -0,0 +1,1 @@
1627 @@ -0,0 +1,1 @@
1628 +e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1628 +e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1629 $ hg log -r 1 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1629 $ hg log -r 1 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1630 f7b1eb17ad24 000000000000
1630 f7b1eb17ad24 000000000000
1631 s
1631 s
1632
1632
1633 (modification of existing entry)
1633 (modification of existing entry)
1634
1634
1635 $ hg diff --nodates -c 2 .hgsubstate
1635 $ hg diff --nodates -c 2 .hgsubstate
1636 diff -r 7cf8cfea66e4 -r df30734270ae .hgsubstate
1636 diff -r 7cf8cfea66e4 -r df30734270ae .hgsubstate
1637 --- a/.hgsubstate
1637 --- a/.hgsubstate
1638 +++ b/.hgsubstate
1638 +++ b/.hgsubstate
1639 @@ -1,1 +1,1 @@
1639 @@ -1,1 +1,1 @@
1640 -e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1640 -e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1641 +dc73e2e6d2675eb2e41e33c205f4bdab4ea5111d s
1641 +dc73e2e6d2675eb2e41e33c205f4bdab4ea5111d s
1642 $ hg log -r 2 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1642 $ hg log -r 2 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1643 7cf8cfea66e4 000000000000
1643 7cf8cfea66e4 000000000000
1644 s
1644 s
1645
1645
1646 (addition of entry)
1646 (addition of entry)
1647
1647
1648 $ hg diff --nodates -c 5 .hgsubstate
1648 $ hg diff --nodates -c 5 .hgsubstate
1649 diff -r 7cf8cfea66e4 -r 1f14a2e2d3ec .hgsubstate
1649 diff -r 7cf8cfea66e4 -r 1f14a2e2d3ec .hgsubstate
1650 --- a/.hgsubstate
1650 --- a/.hgsubstate
1651 +++ b/.hgsubstate
1651 +++ b/.hgsubstate
1652 @@ -1,1 +1,2 @@
1652 @@ -1,1 +1,2 @@
1653 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1653 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1654 +60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t
1654 +60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t
1655 $ hg log -r 5 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1655 $ hg log -r 5 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1656 7cf8cfea66e4 000000000000
1656 7cf8cfea66e4 000000000000
1657 t
1657 t
1658
1658
1659 (removal of existing entry)
1659 (removal of existing entry)
1660
1660
1661 $ hg diff --nodates -c 16 .hgsubstate
1661 $ hg diff --nodates -c 16 .hgsubstate
1662 diff -r 8bec38d2bd0b -r f2f70bc3d3c9 .hgsubstate
1662 diff -r 8bec38d2bd0b -r f2f70bc3d3c9 .hgsubstate
1663 --- a/.hgsubstate
1663 --- a/.hgsubstate
1664 +++ b/.hgsubstate
1664 +++ b/.hgsubstate
1665 @@ -1,2 +1,1 @@
1665 @@ -1,2 +1,1 @@
1666 0731af8ca9423976d3743119d0865097c07bdc1b s
1666 0731af8ca9423976d3743119d0865097c07bdc1b s
1667 -e202dc79b04c88a636ea8913d9182a1346d9b3dc t
1667 -e202dc79b04c88a636ea8913d9182a1346d9b3dc t
1668 $ hg log -r 16 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1668 $ hg log -r 16 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1669 8bec38d2bd0b 000000000000
1669 8bec38d2bd0b 000000000000
1670 t
1670 t
1671
1671
1672 (merging)
1672 (merging)
1673
1673
1674 $ hg diff --nodates -c 9 .hgsubstate
1674 $ hg diff --nodates -c 9 .hgsubstate
1675 diff -r f6affe3fbfaa -r f0d2028bf86d .hgsubstate
1675 diff -r f6affe3fbfaa -r f0d2028bf86d .hgsubstate
1676 --- a/.hgsubstate
1676 --- a/.hgsubstate
1677 +++ b/.hgsubstate
1677 +++ b/.hgsubstate
1678 @@ -1,1 +1,2 @@
1678 @@ -1,1 +1,2 @@
1679 fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
1679 fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
1680 +60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t
1680 +60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t
1681 $ hg log -r 9 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1681 $ hg log -r 9 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1682 f6affe3fbfaa 1f14a2e2d3ec
1682 f6affe3fbfaa 1f14a2e2d3ec
1683 t
1683 t
1684
1684
1685 (removal of ".hgsub" itself)
1685 (removal of ".hgsub" itself)
1686
1686
1687 $ hg diff --nodates -c 8 .hgsubstate
1687 $ hg diff --nodates -c 8 .hgsubstate
1688 diff -r f94576341bcf -r 96615c1dad2d .hgsubstate
1688 diff -r f94576341bcf -r 96615c1dad2d .hgsubstate
1689 --- a/.hgsubstate
1689 --- a/.hgsubstate
1690 +++ /dev/null
1690 +++ /dev/null
1691 @@ -1,2 +0,0 @@
1691 @@ -1,2 +0,0 @@
1692 -e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1692 -e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1693 -7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4 t
1693 -7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4 t
1694 $ hg log -r 8 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1694 $ hg log -r 8 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1695 f94576341bcf 000000000000
1695 f94576341bcf 000000000000
1696
1696
1697 Test that '[paths]' is configured correctly at subrepo creation
1697 Test that '[paths]' is configured correctly at subrepo creation
1698
1698
1699 $ cd $TESTTMP/tc
1699 $ cd $TESTTMP/tc
1700 $ cat > .hgsub <<EOF
1700 $ cat > .hgsub <<EOF
1701 > # to clear bogus subrepo path 'bogus=[boguspath'
1701 > # to clear bogus subrepo path 'bogus=[boguspath'
1702 > s = s
1702 > s = s
1703 > t = t
1703 > t = t
1704 > EOF
1704 > EOF
1705 $ hg update -q --clean null
1705 $ hg update -q --clean null
1706 $ rm -rf s t
1706 $ rm -rf s t
1707 $ cat >> .hg/hgrc <<EOF
1707 $ cat >> .hg/hgrc <<EOF
1708 > [paths]
1708 > [paths]
1709 > default-push = /foo/bar
1709 > default-push = /foo/bar
1710 > EOF
1710 > EOF
1711 $ hg update -q
1711 $ hg update -q
1712 $ cat s/.hg/hgrc
1712 $ cat s/.hg/hgrc
1713 [paths]
1713 [paths]
1714 default = $TESTTMP/t/s
1714 default = $TESTTMP/t/s
1715 default-push = /foo/bar/s
1715 default-push = /foo/bar/s
1716 $ cat s/ss/.hg/hgrc
1716 $ cat s/ss/.hg/hgrc
1717 [paths]
1717 [paths]
1718 default = $TESTTMP/t/s/ss
1718 default = $TESTTMP/t/s/ss
1719 default-push = /foo/bar/s/ss
1719 default-push = /foo/bar/s/ss
1720 $ cat t/.hg/hgrc
1720 $ cat t/.hg/hgrc
1721 [paths]
1721 [paths]
1722 default = $TESTTMP/t/t
1722 default = $TESTTMP/t/t
1723 default-push = /foo/bar/t
1723 default-push = /foo/bar/t
1724
1724
1725 $ cd $TESTTMP/t
1725 $ cd $TESTTMP/t
1726 $ hg up -qC 0
1726 $ hg up -qC 0
1727 $ echo 'bar' > bar.txt
1727 $ echo 'bar' > bar.txt
1728 $ hg ci -Am 'branch before subrepo add'
1728 $ hg ci -Am 'branch before subrepo add'
1729 adding bar.txt
1729 adding bar.txt
1730 created new head
1730 created new head
1731 $ hg merge -r "first(subrepo('s'))"
1731 $ hg merge -r "first(subrepo('s'))"
1732 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1732 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1733 (branch merge, don't forget to commit)
1733 (branch merge, don't forget to commit)
1734 $ hg status -S -X '.hgsub*'
1734 $ hg status -S -X '.hgsub*'
1735 A s/a
1735 A s/a
1736 ? s/b
1736 ? s/b
1737 ? s/c
1737 ? s/c
1738 ? s/f1
1738 ? s/f1
1739 $ hg status -S --rev 'p2()'
1739 $ hg status -S --rev 'p2()'
1740 A bar.txt
1740 A bar.txt
1741 ? s/b
1741 ? s/b
1742 ? s/c
1742 ? s/c
1743 ? s/f1
1743 ? s/f1
1744 $ hg diff -S -X '.hgsub*' --nodates
1744 $ hg diff -S -X '.hgsub*' --nodates
1745 diff -r 000000000000 s/a
1745 diff -r 000000000000 s/a
1746 --- /dev/null
1746 --- /dev/null
1747 +++ b/s/a
1747 +++ b/s/a
1748 @@ -0,0 +1,1 @@
1748 @@ -0,0 +1,1 @@
1749 +a
1749 +a
1750 $ hg diff -S --rev 'p2()' --nodates
1750 $ hg diff -S --rev 'p2()' --nodates
1751 diff -r 7cf8cfea66e4 bar.txt
1751 diff -r 7cf8cfea66e4 bar.txt
1752 --- /dev/null
1752 --- /dev/null
1753 +++ b/bar.txt
1753 +++ b/bar.txt
1754 @@ -0,0 +1,1 @@
1754 @@ -0,0 +1,1 @@
1755 +bar
1755 +bar
1756
1756
1757 $ cd ..
1757 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now