##// END OF EJS Templates
merge: make debug output easier to read...
Martin Geisler -
r15625:efdcce3f default
parent child Browse files
Show More
@@ -1,575 +1,576 b''
1 # merge.py - directory-level update/merge handling for Mercurial
1 # merge.py - directory-level update/merge handling for Mercurial
2 #
2 #
3 # Copyright 2006, 2007 Matt Mackall <mpm@selenic.com>
3 # Copyright 2006, 2007 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 node import nullid, nullrev, hex, bin
8 from node import nullid, nullrev, hex, bin
9 from i18n import _
9 from i18n import _
10 import scmutil, util, filemerge, copies, subrepo, encoding
10 import scmutil, util, filemerge, copies, subrepo, encoding
11 import errno, os, shutil
11 import errno, os, shutil
12
12
13 class mergestate(object):
13 class mergestate(object):
14 '''track 3-way merge state of individual files'''
14 '''track 3-way merge state of individual files'''
15 def __init__(self, repo):
15 def __init__(self, repo):
16 self._repo = repo
16 self._repo = repo
17 self._dirty = False
17 self._dirty = False
18 self._read()
18 self._read()
19 def reset(self, node=None):
19 def reset(self, node=None):
20 self._state = {}
20 self._state = {}
21 if node:
21 if node:
22 self._local = node
22 self._local = node
23 shutil.rmtree(self._repo.join("merge"), True)
23 shutil.rmtree(self._repo.join("merge"), True)
24 self._dirty = False
24 self._dirty = False
25 def _read(self):
25 def _read(self):
26 self._state = {}
26 self._state = {}
27 try:
27 try:
28 f = self._repo.opener("merge/state")
28 f = self._repo.opener("merge/state")
29 for i, l in enumerate(f):
29 for i, l in enumerate(f):
30 if i == 0:
30 if i == 0:
31 self._local = bin(l[:-1])
31 self._local = bin(l[:-1])
32 else:
32 else:
33 bits = l[:-1].split("\0")
33 bits = l[:-1].split("\0")
34 self._state[bits[0]] = bits[1:]
34 self._state[bits[0]] = bits[1:]
35 f.close()
35 f.close()
36 except IOError, err:
36 except IOError, err:
37 if err.errno != errno.ENOENT:
37 if err.errno != errno.ENOENT:
38 raise
38 raise
39 self._dirty = False
39 self._dirty = False
40 def commit(self):
40 def commit(self):
41 if self._dirty:
41 if self._dirty:
42 f = self._repo.opener("merge/state", "w")
42 f = self._repo.opener("merge/state", "w")
43 f.write(hex(self._local) + "\n")
43 f.write(hex(self._local) + "\n")
44 for d, v in self._state.iteritems():
44 for d, v in self._state.iteritems():
45 f.write("\0".join([d] + v) + "\n")
45 f.write("\0".join([d] + v) + "\n")
46 f.close()
46 f.close()
47 self._dirty = False
47 self._dirty = False
48 def add(self, fcl, fco, fca, fd, flags):
48 def add(self, fcl, fco, fca, fd, flags):
49 hash = util.sha1(fcl.path()).hexdigest()
49 hash = util.sha1(fcl.path()).hexdigest()
50 self._repo.opener.write("merge/" + hash, fcl.data())
50 self._repo.opener.write("merge/" + hash, fcl.data())
51 self._state[fd] = ['u', hash, fcl.path(), fca.path(),
51 self._state[fd] = ['u', hash, fcl.path(), fca.path(),
52 hex(fca.filenode()), fco.path(), flags]
52 hex(fca.filenode()), fco.path(), flags]
53 self._dirty = True
53 self._dirty = True
54 def __contains__(self, dfile):
54 def __contains__(self, dfile):
55 return dfile in self._state
55 return dfile in self._state
56 def __getitem__(self, dfile):
56 def __getitem__(self, dfile):
57 return self._state[dfile][0]
57 return self._state[dfile][0]
58 def __iter__(self):
58 def __iter__(self):
59 l = self._state.keys()
59 l = self._state.keys()
60 l.sort()
60 l.sort()
61 for f in l:
61 for f in l:
62 yield f
62 yield f
63 def mark(self, dfile, state):
63 def mark(self, dfile, state):
64 self._state[dfile][0] = state
64 self._state[dfile][0] = state
65 self._dirty = True
65 self._dirty = True
66 def resolve(self, dfile, wctx, octx):
66 def resolve(self, dfile, wctx, octx):
67 if self[dfile] == 'r':
67 if self[dfile] == 'r':
68 return 0
68 return 0
69 state, hash, lfile, afile, anode, ofile, flags = self._state[dfile]
69 state, hash, lfile, afile, anode, ofile, flags = self._state[dfile]
70 f = self._repo.opener("merge/" + hash)
70 f = self._repo.opener("merge/" + hash)
71 self._repo.wwrite(dfile, f.read(), flags)
71 self._repo.wwrite(dfile, f.read(), flags)
72 f.close()
72 f.close()
73 fcd = wctx[dfile]
73 fcd = wctx[dfile]
74 fco = octx[ofile]
74 fco = octx[ofile]
75 fca = self._repo.filectx(afile, fileid=anode)
75 fca = self._repo.filectx(afile, fileid=anode)
76 r = filemerge.filemerge(self._repo, self._local, lfile, fcd, fco, fca)
76 r = filemerge.filemerge(self._repo, self._local, lfile, fcd, fco, fca)
77 if r is None:
77 if r is None:
78 # no real conflict
78 # no real conflict
79 del self._state[dfile]
79 del self._state[dfile]
80 elif not r:
80 elif not r:
81 self.mark(dfile, 'r')
81 self.mark(dfile, 'r')
82 return r
82 return r
83
83
84 def _checkunknown(wctx, mctx, folding):
84 def _checkunknown(wctx, mctx, folding):
85 "check for collisions between unknown files and files in mctx"
85 "check for collisions between unknown files and files in mctx"
86 if folding:
86 if folding:
87 foldf = util.normcase
87 foldf = util.normcase
88 else:
88 else:
89 foldf = lambda fn: fn
89 foldf = lambda fn: fn
90 folded = {}
90 folded = {}
91 for fn in mctx:
91 for fn in mctx:
92 folded[foldf(fn)] = fn
92 folded[foldf(fn)] = fn
93 for fn in wctx.unknown():
93 for fn in wctx.unknown():
94 f = foldf(fn)
94 f = foldf(fn)
95 if f in folded and mctx[folded[f]].cmp(wctx[f]):
95 if f in folded and mctx[folded[f]].cmp(wctx[f]):
96 raise util.Abort(_("untracked file in working directory differs"
96 raise util.Abort(_("untracked file in working directory differs"
97 " from file in requested revision: '%s'") % fn)
97 " from file in requested revision: '%s'") % fn)
98
98
99 def _checkcollision(mctx):
99 def _checkcollision(mctx):
100 "check for case folding collisions in the destination context"
100 "check for case folding collisions in the destination context"
101 folded = {}
101 folded = {}
102 for fn in mctx:
102 for fn in mctx:
103 fold = encoding.lower(fn)
103 fold = encoding.lower(fn)
104 if fold in folded:
104 if fold in folded:
105 raise util.Abort(_("case-folding collision between %s and %s")
105 raise util.Abort(_("case-folding collision between %s and %s")
106 % (fn, folded[fold]))
106 % (fn, folded[fold]))
107 folded[fold] = fn
107 folded[fold] = fn
108
108
109 def _forgetremoved(wctx, mctx, branchmerge):
109 def _forgetremoved(wctx, mctx, branchmerge):
110 """
110 """
111 Forget removed files
111 Forget removed files
112
112
113 If we're jumping between revisions (as opposed to merging), and if
113 If we're jumping between revisions (as opposed to merging), and if
114 neither the working directory nor the target rev has the file,
114 neither the working directory nor the target rev has the file,
115 then we need to remove it from the dirstate, to prevent the
115 then we need to remove it from the dirstate, to prevent the
116 dirstate from listing the file when it is no longer in the
116 dirstate from listing the file when it is no longer in the
117 manifest.
117 manifest.
118
118
119 If we're merging, and the other revision has removed a file
119 If we're merging, and the other revision has removed a file
120 that is not present in the working directory, we need to mark it
120 that is not present in the working directory, we need to mark it
121 as removed.
121 as removed.
122 """
122 """
123
123
124 action = []
124 action = []
125 state = branchmerge and 'r' or 'f'
125 state = branchmerge and 'r' or 'f'
126 for f in wctx.deleted():
126 for f in wctx.deleted():
127 if f not in mctx:
127 if f not in mctx:
128 action.append((f, state))
128 action.append((f, state))
129
129
130 if not branchmerge:
130 if not branchmerge:
131 for f in wctx.removed():
131 for f in wctx.removed():
132 if f not in mctx:
132 if f not in mctx:
133 action.append((f, "f"))
133 action.append((f, "f"))
134
134
135 return action
135 return action
136
136
137 def manifestmerge(repo, p1, p2, pa, overwrite, partial):
137 def manifestmerge(repo, p1, p2, pa, overwrite, partial):
138 """
138 """
139 Merge p1 and p2 with ancestor pa and generate merge action list
139 Merge p1 and p2 with ancestor pa and generate merge action list
140
140
141 overwrite = whether we clobber working files
141 overwrite = whether we clobber working files
142 partial = function to filter file lists
142 partial = function to filter file lists
143 """
143 """
144
144
145 def fmerge(f, f2, fa):
145 def fmerge(f, f2, fa):
146 """merge flags"""
146 """merge flags"""
147 a, m, n = ma.flags(fa), m1.flags(f), m2.flags(f2)
147 a, m, n = ma.flags(fa), m1.flags(f), m2.flags(f2)
148 if m == n: # flags agree
148 if m == n: # flags agree
149 return m # unchanged
149 return m # unchanged
150 if m and n and not a: # flags set, don't agree, differ from parent
150 if m and n and not a: # flags set, don't agree, differ from parent
151 r = repo.ui.promptchoice(
151 r = repo.ui.promptchoice(
152 _(" conflicting flags for %s\n"
152 _(" conflicting flags for %s\n"
153 "(n)one, e(x)ec or sym(l)ink?") % f,
153 "(n)one, e(x)ec or sym(l)ink?") % f,
154 (_("&None"), _("E&xec"), _("Sym&link")), 0)
154 (_("&None"), _("E&xec"), _("Sym&link")), 0)
155 if r == 1:
155 if r == 1:
156 return "x" # Exec
156 return "x" # Exec
157 if r == 2:
157 if r == 2:
158 return "l" # Symlink
158 return "l" # Symlink
159 return ""
159 return ""
160 if m and m != a: # changed from a to m
160 if m and m != a: # changed from a to m
161 return m
161 return m
162 if n and n != a: # changed from a to n
162 if n and n != a: # changed from a to n
163 return n
163 return n
164 return '' # flag was cleared
164 return '' # flag was cleared
165
165
166 def act(msg, m, f, *args):
166 def act(msg, m, f, *args):
167 repo.ui.debug(" %s: %s -> %s\n" % (f, msg, m))
167 repo.ui.debug(" %s: %s -> %s\n" % (f, msg, m))
168 action.append((f, m) + args)
168 action.append((f, m) + args)
169
169
170 action, copy = [], {}
170 action, copy = [], {}
171
171
172 if overwrite:
172 if overwrite:
173 pa = p1
173 pa = p1
174 elif pa == p2: # backwards
174 elif pa == p2: # backwards
175 pa = p1.p1()
175 pa = p1.p1()
176 elif pa and repo.ui.configbool("merge", "followcopies", True):
176 elif pa and repo.ui.configbool("merge", "followcopies", True):
177 dirs = repo.ui.configbool("merge", "followdirs", True)
177 dirs = repo.ui.configbool("merge", "followdirs", True)
178 copy, diverge = copies.copies(repo, p1, p2, pa, dirs)
178 copy, diverge = copies.copies(repo, p1, p2, pa, dirs)
179 for of, fl in diverge.iteritems():
179 for of, fl in diverge.iteritems():
180 act("divergent renames", "dr", of, fl)
180 act("divergent renames", "dr", of, fl)
181
181
182 repo.ui.note(_("resolving manifests\n"))
182 repo.ui.note(_("resolving manifests\n"))
183 repo.ui.debug(" overwrite %s partial %s\n" % (overwrite, bool(partial)))
183 repo.ui.debug(" overwrite: %s, partial: %s\n"
184 repo.ui.debug(" ancestor %s local %s remote %s\n" % (pa, p1, p2))
184 % (bool(overwrite), bool(partial)))
185 repo.ui.debug(" ancestor: %s, local: %s, remote: %s\n" % (pa, p1, p2))
185
186
186 m1, m2, ma = p1.manifest(), p2.manifest(), pa.manifest()
187 m1, m2, ma = p1.manifest(), p2.manifest(), pa.manifest()
187 copied = set(copy.values())
188 copied = set(copy.values())
188
189
189 if '.hgsubstate' in m1:
190 if '.hgsubstate' in m1:
190 # check whether sub state is modified
191 # check whether sub state is modified
191 for s in p1.substate:
192 for s in p1.substate:
192 if p1.sub(s).dirty():
193 if p1.sub(s).dirty():
193 m1['.hgsubstate'] += "+"
194 m1['.hgsubstate'] += "+"
194 break
195 break
195
196
196 # Compare manifests
197 # Compare manifests
197 for f, n in m1.iteritems():
198 for f, n in m1.iteritems():
198 if partial and not partial(f):
199 if partial and not partial(f):
199 continue
200 continue
200 if f in m2:
201 if f in m2:
201 rflags = fmerge(f, f, f)
202 rflags = fmerge(f, f, f)
202 a = ma.get(f, nullid)
203 a = ma.get(f, nullid)
203 if n == m2[f] or m2[f] == a: # same or local newer
204 if n == m2[f] or m2[f] == a: # same or local newer
204 # is file locally modified or flags need changing?
205 # is file locally modified or flags need changing?
205 # dirstate flags may need to be made current
206 # dirstate flags may need to be made current
206 if m1.flags(f) != rflags or n[20:]:
207 if m1.flags(f) != rflags or n[20:]:
207 act("update permissions", "e", f, rflags)
208 act("update permissions", "e", f, rflags)
208 elif n == a: # remote newer
209 elif n == a: # remote newer
209 act("remote is newer", "g", f, rflags)
210 act("remote is newer", "g", f, rflags)
210 else: # both changed
211 else: # both changed
211 act("versions differ", "m", f, f, f, rflags, False)
212 act("versions differ", "m", f, f, f, rflags, False)
212 elif f in copied: # files we'll deal with on m2 side
213 elif f in copied: # files we'll deal with on m2 side
213 pass
214 pass
214 elif f in copy:
215 elif f in copy:
215 f2 = copy[f]
216 f2 = copy[f]
216 if f2 not in m2: # directory rename
217 if f2 not in m2: # directory rename
217 act("remote renamed directory to " + f2, "d",
218 act("remote renamed directory to " + f2, "d",
218 f, None, f2, m1.flags(f))
219 f, None, f2, m1.flags(f))
219 else: # case 2 A,B/B/B or case 4,21 A/B/B
220 else: # case 2 A,B/B/B or case 4,21 A/B/B
220 act("local copied/moved to " + f2, "m",
221 act("local copied/moved to " + f2, "m",
221 f, f2, f, fmerge(f, f2, f2), False)
222 f, f2, f, fmerge(f, f2, f2), False)
222 elif f in ma: # clean, a different, no remote
223 elif f in ma: # clean, a different, no remote
223 if n != ma[f]:
224 if n != ma[f]:
224 if repo.ui.promptchoice(
225 if repo.ui.promptchoice(
225 _(" local changed %s which remote deleted\n"
226 _(" local changed %s which remote deleted\n"
226 "use (c)hanged version or (d)elete?") % f,
227 "use (c)hanged version or (d)elete?") % f,
227 (_("&Changed"), _("&Delete")), 0):
228 (_("&Changed"), _("&Delete")), 0):
228 act("prompt delete", "r", f)
229 act("prompt delete", "r", f)
229 else:
230 else:
230 act("prompt keep", "a", f)
231 act("prompt keep", "a", f)
231 elif n[20:] == "a": # added, no remote
232 elif n[20:] == "a": # added, no remote
232 act("remote deleted", "f", f)
233 act("remote deleted", "f", f)
233 elif n[20:] != "u":
234 elif n[20:] != "u":
234 act("other deleted", "r", f)
235 act("other deleted", "r", f)
235
236
236 for f, n in m2.iteritems():
237 for f, n in m2.iteritems():
237 if partial and not partial(f):
238 if partial and not partial(f):
238 continue
239 continue
239 if f in m1 or f in copied: # files already visited
240 if f in m1 or f in copied: # files already visited
240 continue
241 continue
241 if f in copy:
242 if f in copy:
242 f2 = copy[f]
243 f2 = copy[f]
243 if f2 not in m1: # directory rename
244 if f2 not in m1: # directory rename
244 act("local renamed directory to " + f2, "d",
245 act("local renamed directory to " + f2, "d",
245 None, f, f2, m2.flags(f))
246 None, f, f2, m2.flags(f))
246 elif f2 in m2: # rename case 1, A/A,B/A
247 elif f2 in m2: # rename case 1, A/A,B/A
247 act("remote copied to " + f, "m",
248 act("remote copied to " + f, "m",
248 f2, f, f, fmerge(f2, f, f2), False)
249 f2, f, f, fmerge(f2, f, f2), False)
249 else: # case 3,20 A/B/A
250 else: # case 3,20 A/B/A
250 act("remote moved to " + f, "m",
251 act("remote moved to " + f, "m",
251 f2, f, f, fmerge(f2, f, f2), True)
252 f2, f, f, fmerge(f2, f, f2), True)
252 elif f not in ma:
253 elif f not in ma:
253 act("remote created", "g", f, m2.flags(f))
254 act("remote created", "g", f, m2.flags(f))
254 elif n != ma[f]:
255 elif n != ma[f]:
255 if repo.ui.promptchoice(
256 if repo.ui.promptchoice(
256 _("remote changed %s which local deleted\n"
257 _("remote changed %s which local deleted\n"
257 "use (c)hanged version or leave (d)eleted?") % f,
258 "use (c)hanged version or leave (d)eleted?") % f,
258 (_("&Changed"), _("&Deleted")), 0) == 0:
259 (_("&Changed"), _("&Deleted")), 0) == 0:
259 act("prompt recreating", "g", f, m2.flags(f))
260 act("prompt recreating", "g", f, m2.flags(f))
260
261
261 return action
262 return action
262
263
263 def actionkey(a):
264 def actionkey(a):
264 return a[1] == 'r' and -1 or 0, a
265 return a[1] == 'r' and -1 or 0, a
265
266
266 def applyupdates(repo, action, wctx, mctx, actx, overwrite):
267 def applyupdates(repo, action, wctx, mctx, actx, overwrite):
267 """apply the merge action list to the working directory
268 """apply the merge action list to the working directory
268
269
269 wctx is the working copy context
270 wctx is the working copy context
270 mctx is the context to be merged into the working copy
271 mctx is the context to be merged into the working copy
271 actx is the context of the common ancestor
272 actx is the context of the common ancestor
272
273
273 Return a tuple of counts (updated, merged, removed, unresolved) that
274 Return a tuple of counts (updated, merged, removed, unresolved) that
274 describes how many files were affected by the update.
275 describes how many files were affected by the update.
275 """
276 """
276
277
277 updated, merged, removed, unresolved = 0, 0, 0, 0
278 updated, merged, removed, unresolved = 0, 0, 0, 0
278 ms = mergestate(repo)
279 ms = mergestate(repo)
279 ms.reset(wctx.p1().node())
280 ms.reset(wctx.p1().node())
280 moves = []
281 moves = []
281 action.sort(key=actionkey)
282 action.sort(key=actionkey)
282
283
283 # prescan for merges
284 # prescan for merges
284 for a in action:
285 for a in action:
285 f, m = a[:2]
286 f, m = a[:2]
286 if m == 'm': # merge
287 if m == 'm': # merge
287 f2, fd, flags, move = a[2:]
288 f2, fd, flags, move = a[2:]
288 if f == '.hgsubstate': # merged internally
289 if f == '.hgsubstate': # merged internally
289 continue
290 continue
290 repo.ui.debug("preserving %s for resolve of %s\n" % (f, fd))
291 repo.ui.debug("preserving %s for resolve of %s\n" % (f, fd))
291 fcl = wctx[f]
292 fcl = wctx[f]
292 fco = mctx[f2]
293 fco = mctx[f2]
293 if mctx == actx: # backwards, use working dir parent as ancestor
294 if mctx == actx: # backwards, use working dir parent as ancestor
294 if fcl.parents():
295 if fcl.parents():
295 fca = fcl.p1()
296 fca = fcl.p1()
296 else:
297 else:
297 fca = repo.filectx(f, fileid=nullrev)
298 fca = repo.filectx(f, fileid=nullrev)
298 else:
299 else:
299 fca = fcl.ancestor(fco, actx)
300 fca = fcl.ancestor(fco, actx)
300 if not fca:
301 if not fca:
301 fca = repo.filectx(f, fileid=nullrev)
302 fca = repo.filectx(f, fileid=nullrev)
302 ms.add(fcl, fco, fca, fd, flags)
303 ms.add(fcl, fco, fca, fd, flags)
303 if f != fd and move:
304 if f != fd and move:
304 moves.append(f)
305 moves.append(f)
305
306
306 audit = scmutil.pathauditor(repo.root)
307 audit = scmutil.pathauditor(repo.root)
307
308
308 # remove renamed files after safely stored
309 # remove renamed files after safely stored
309 for f in moves:
310 for f in moves:
310 if os.path.lexists(repo.wjoin(f)):
311 if os.path.lexists(repo.wjoin(f)):
311 repo.ui.debug("removing %s\n" % f)
312 repo.ui.debug("removing %s\n" % f)
312 audit(f)
313 audit(f)
313 os.unlink(repo.wjoin(f))
314 os.unlink(repo.wjoin(f))
314
315
315 numupdates = len(action)
316 numupdates = len(action)
316 for i, a in enumerate(action):
317 for i, a in enumerate(action):
317 f, m = a[:2]
318 f, m = a[:2]
318 repo.ui.progress(_('updating'), i + 1, item=f, total=numupdates,
319 repo.ui.progress(_('updating'), i + 1, item=f, total=numupdates,
319 unit=_('files'))
320 unit=_('files'))
320 if f and f[0] == "/":
321 if f and f[0] == "/":
321 continue
322 continue
322 if m == "r": # remove
323 if m == "r": # remove
323 repo.ui.note(_("removing %s\n") % f)
324 repo.ui.note(_("removing %s\n") % f)
324 audit(f)
325 audit(f)
325 if f == '.hgsubstate': # subrepo states need updating
326 if f == '.hgsubstate': # subrepo states need updating
326 subrepo.submerge(repo, wctx, mctx, wctx, overwrite)
327 subrepo.submerge(repo, wctx, mctx, wctx, overwrite)
327 try:
328 try:
328 util.unlinkpath(repo.wjoin(f))
329 util.unlinkpath(repo.wjoin(f))
329 except OSError, inst:
330 except OSError, inst:
330 if inst.errno != errno.ENOENT:
331 if inst.errno != errno.ENOENT:
331 repo.ui.warn(_("update failed to remove %s: %s!\n") %
332 repo.ui.warn(_("update failed to remove %s: %s!\n") %
332 (f, inst.strerror))
333 (f, inst.strerror))
333 removed += 1
334 removed += 1
334 elif m == "m": # merge
335 elif m == "m": # merge
335 if f == '.hgsubstate': # subrepo states need updating
336 if f == '.hgsubstate': # subrepo states need updating
336 subrepo.submerge(repo, wctx, mctx, wctx.ancestor(mctx), overwrite)
337 subrepo.submerge(repo, wctx, mctx, wctx.ancestor(mctx), overwrite)
337 continue
338 continue
338 f2, fd, flags, move = a[2:]
339 f2, fd, flags, move = a[2:]
339 repo.wopener.audit(fd)
340 repo.wopener.audit(fd)
340 r = ms.resolve(fd, wctx, mctx)
341 r = ms.resolve(fd, wctx, mctx)
341 if r is not None and r > 0:
342 if r is not None and r > 0:
342 unresolved += 1
343 unresolved += 1
343 else:
344 else:
344 if r is None:
345 if r is None:
345 updated += 1
346 updated += 1
346 else:
347 else:
347 merged += 1
348 merged += 1
348 util.setflags(repo.wjoin(fd), 'l' in flags, 'x' in flags)
349 util.setflags(repo.wjoin(fd), 'l' in flags, 'x' in flags)
349 if (move and repo.dirstate.normalize(fd) != f
350 if (move and repo.dirstate.normalize(fd) != f
350 and os.path.lexists(repo.wjoin(f))):
351 and os.path.lexists(repo.wjoin(f))):
351 repo.ui.debug("removing %s\n" % f)
352 repo.ui.debug("removing %s\n" % f)
352 audit(f)
353 audit(f)
353 os.unlink(repo.wjoin(f))
354 os.unlink(repo.wjoin(f))
354 elif m == "g": # get
355 elif m == "g": # get
355 flags = a[2]
356 flags = a[2]
356 repo.ui.note(_("getting %s\n") % f)
357 repo.ui.note(_("getting %s\n") % f)
357 t = mctx.filectx(f).data()
358 t = mctx.filectx(f).data()
358 repo.wwrite(f, t, flags)
359 repo.wwrite(f, t, flags)
359 t = None
360 t = None
360 updated += 1
361 updated += 1
361 if f == '.hgsubstate': # subrepo states need updating
362 if f == '.hgsubstate': # subrepo states need updating
362 subrepo.submerge(repo, wctx, mctx, wctx, overwrite)
363 subrepo.submerge(repo, wctx, mctx, wctx, overwrite)
363 elif m == "d": # directory rename
364 elif m == "d": # directory rename
364 f2, fd, flags = a[2:]
365 f2, fd, flags = a[2:]
365 if f:
366 if f:
366 repo.ui.note(_("moving %s to %s\n") % (f, fd))
367 repo.ui.note(_("moving %s to %s\n") % (f, fd))
367 audit(f)
368 audit(f)
368 t = wctx.filectx(f).data()
369 t = wctx.filectx(f).data()
369 repo.wwrite(fd, t, flags)
370 repo.wwrite(fd, t, flags)
370 util.unlinkpath(repo.wjoin(f))
371 util.unlinkpath(repo.wjoin(f))
371 if f2:
372 if f2:
372 repo.ui.note(_("getting %s to %s\n") % (f2, fd))
373 repo.ui.note(_("getting %s to %s\n") % (f2, fd))
373 t = mctx.filectx(f2).data()
374 t = mctx.filectx(f2).data()
374 repo.wwrite(fd, t, flags)
375 repo.wwrite(fd, t, flags)
375 updated += 1
376 updated += 1
376 elif m == "dr": # divergent renames
377 elif m == "dr": # divergent renames
377 fl = a[2]
378 fl = a[2]
378 repo.ui.warn(_("note: possible conflict - %s was renamed "
379 repo.ui.warn(_("note: possible conflict - %s was renamed "
379 "multiple times to:\n") % f)
380 "multiple times to:\n") % f)
380 for nf in fl:
381 for nf in fl:
381 repo.ui.warn(" %s\n" % nf)
382 repo.ui.warn(" %s\n" % nf)
382 elif m == "e": # exec
383 elif m == "e": # exec
383 flags = a[2]
384 flags = a[2]
384 repo.wopener.audit(f)
385 repo.wopener.audit(f)
385 util.setflags(repo.wjoin(f), 'l' in flags, 'x' in flags)
386 util.setflags(repo.wjoin(f), 'l' in flags, 'x' in flags)
386 ms.commit()
387 ms.commit()
387 repo.ui.progress(_('updating'), None, total=numupdates, unit=_('files'))
388 repo.ui.progress(_('updating'), None, total=numupdates, unit=_('files'))
388
389
389 return updated, merged, removed, unresolved
390 return updated, merged, removed, unresolved
390
391
391 def recordupdates(repo, action, branchmerge):
392 def recordupdates(repo, action, branchmerge):
392 "record merge actions to the dirstate"
393 "record merge actions to the dirstate"
393
394
394 for a in action:
395 for a in action:
395 f, m = a[:2]
396 f, m = a[:2]
396 if m == "r": # remove
397 if m == "r": # remove
397 if branchmerge:
398 if branchmerge:
398 repo.dirstate.remove(f)
399 repo.dirstate.remove(f)
399 else:
400 else:
400 repo.dirstate.drop(f)
401 repo.dirstate.drop(f)
401 elif m == "a": # re-add
402 elif m == "a": # re-add
402 if not branchmerge:
403 if not branchmerge:
403 repo.dirstate.add(f)
404 repo.dirstate.add(f)
404 elif m == "f": # forget
405 elif m == "f": # forget
405 repo.dirstate.drop(f)
406 repo.dirstate.drop(f)
406 elif m == "e": # exec change
407 elif m == "e": # exec change
407 repo.dirstate.normallookup(f)
408 repo.dirstate.normallookup(f)
408 elif m == "g": # get
409 elif m == "g": # get
409 if branchmerge:
410 if branchmerge:
410 repo.dirstate.otherparent(f)
411 repo.dirstate.otherparent(f)
411 else:
412 else:
412 repo.dirstate.normal(f)
413 repo.dirstate.normal(f)
413 elif m == "m": # merge
414 elif m == "m": # merge
414 f2, fd, flag, move = a[2:]
415 f2, fd, flag, move = a[2:]
415 if branchmerge:
416 if branchmerge:
416 # We've done a branch merge, mark this file as merged
417 # We've done a branch merge, mark this file as merged
417 # so that we properly record the merger later
418 # so that we properly record the merger later
418 repo.dirstate.merge(fd)
419 repo.dirstate.merge(fd)
419 if f != f2: # copy/rename
420 if f != f2: # copy/rename
420 if move:
421 if move:
421 repo.dirstate.remove(f)
422 repo.dirstate.remove(f)
422 if f != fd:
423 if f != fd:
423 repo.dirstate.copy(f, fd)
424 repo.dirstate.copy(f, fd)
424 else:
425 else:
425 repo.dirstate.copy(f2, fd)
426 repo.dirstate.copy(f2, fd)
426 else:
427 else:
427 # We've update-merged a locally modified file, so
428 # We've update-merged a locally modified file, so
428 # we set the dirstate to emulate a normal checkout
429 # we set the dirstate to emulate a normal checkout
429 # of that file some time in the past. Thus our
430 # of that file some time in the past. Thus our
430 # merge will appear as a normal local file
431 # merge will appear as a normal local file
431 # modification.
432 # modification.
432 if f2 == fd: # file not locally copied/moved
433 if f2 == fd: # file not locally copied/moved
433 repo.dirstate.normallookup(fd)
434 repo.dirstate.normallookup(fd)
434 if move:
435 if move:
435 repo.dirstate.drop(f)
436 repo.dirstate.drop(f)
436 elif m == "d": # directory rename
437 elif m == "d": # directory rename
437 f2, fd, flag = a[2:]
438 f2, fd, flag = a[2:]
438 if not f2 and f not in repo.dirstate:
439 if not f2 and f not in repo.dirstate:
439 # untracked file moved
440 # untracked file moved
440 continue
441 continue
441 if branchmerge:
442 if branchmerge:
442 repo.dirstate.add(fd)
443 repo.dirstate.add(fd)
443 if f:
444 if f:
444 repo.dirstate.remove(f)
445 repo.dirstate.remove(f)
445 repo.dirstate.copy(f, fd)
446 repo.dirstate.copy(f, fd)
446 if f2:
447 if f2:
447 repo.dirstate.copy(f2, fd)
448 repo.dirstate.copy(f2, fd)
448 else:
449 else:
449 repo.dirstate.normal(fd)
450 repo.dirstate.normal(fd)
450 if f:
451 if f:
451 repo.dirstate.drop(f)
452 repo.dirstate.drop(f)
452
453
453 def update(repo, node, branchmerge, force, partial, ancestor=None):
454 def update(repo, node, branchmerge, force, partial, ancestor=None):
454 """
455 """
455 Perform a merge between the working directory and the given node
456 Perform a merge between the working directory and the given node
456
457
457 node = the node to update to, or None if unspecified
458 node = the node to update to, or None if unspecified
458 branchmerge = whether to merge between branches
459 branchmerge = whether to merge between branches
459 force = whether to force branch merging or file overwriting
460 force = whether to force branch merging or file overwriting
460 partial = a function to filter file lists (dirstate not updated)
461 partial = a function to filter file lists (dirstate not updated)
461
462
462 The table below shows all the behaviors of the update command
463 The table below shows all the behaviors of the update command
463 given the -c and -C or no options, whether the working directory
464 given the -c and -C or no options, whether the working directory
464 is dirty, whether a revision is specified, and the relationship of
465 is dirty, whether a revision is specified, and the relationship of
465 the parent rev to the target rev (linear, on the same named
466 the parent rev to the target rev (linear, on the same named
466 branch, or on another named branch).
467 branch, or on another named branch).
467
468
468 This logic is tested by test-update-branches.t.
469 This logic is tested by test-update-branches.t.
469
470
470 -c -C dirty rev | linear same cross
471 -c -C dirty rev | linear same cross
471 n n n n | ok (1) x
472 n n n n | ok (1) x
472 n n n y | ok ok ok
473 n n n y | ok ok ok
473 n n y * | merge (2) (2)
474 n n y * | merge (2) (2)
474 n y * * | --- discard ---
475 n y * * | --- discard ---
475 y n y * | --- (3) ---
476 y n y * | --- (3) ---
476 y n n * | --- ok ---
477 y n n * | --- ok ---
477 y y * * | --- (4) ---
478 y y * * | --- (4) ---
478
479
479 x = can't happen
480 x = can't happen
480 * = don't-care
481 * = don't-care
481 1 = abort: crosses branches (use 'hg merge' or 'hg update -c')
482 1 = abort: crosses branches (use 'hg merge' or 'hg update -c')
482 2 = abort: crosses branches (use 'hg merge' to merge or
483 2 = abort: crosses branches (use 'hg merge' to merge or
483 use 'hg update -C' to discard changes)
484 use 'hg update -C' to discard changes)
484 3 = abort: uncommitted local changes
485 3 = abort: uncommitted local changes
485 4 = incompatible options (checked in commands.py)
486 4 = incompatible options (checked in commands.py)
486
487
487 Return the same tuple as applyupdates().
488 Return the same tuple as applyupdates().
488 """
489 """
489
490
490 onode = node
491 onode = node
491 wlock = repo.wlock()
492 wlock = repo.wlock()
492 try:
493 try:
493 wc = repo[None]
494 wc = repo[None]
494 if node is None:
495 if node is None:
495 # tip of current branch
496 # tip of current branch
496 try:
497 try:
497 node = repo.branchtags()[wc.branch()]
498 node = repo.branchtags()[wc.branch()]
498 except KeyError:
499 except KeyError:
499 if wc.branch() == "default": # no default branch!
500 if wc.branch() == "default": # no default branch!
500 node = repo.lookup("tip") # update to tip
501 node = repo.lookup("tip") # update to tip
501 else:
502 else:
502 raise util.Abort(_("branch %s not found") % wc.branch())
503 raise util.Abort(_("branch %s not found") % wc.branch())
503 overwrite = force and not branchmerge
504 overwrite = force and not branchmerge
504 pl = wc.parents()
505 pl = wc.parents()
505 p1, p2 = pl[0], repo[node]
506 p1, p2 = pl[0], repo[node]
506 if ancestor:
507 if ancestor:
507 pa = repo[ancestor]
508 pa = repo[ancestor]
508 else:
509 else:
509 pa = p1.ancestor(p2)
510 pa = p1.ancestor(p2)
510
511
511 fp1, fp2, xp1, xp2 = p1.node(), p2.node(), str(p1), str(p2)
512 fp1, fp2, xp1, xp2 = p1.node(), p2.node(), str(p1), str(p2)
512
513
513 ### check phase
514 ### check phase
514 if not overwrite and len(pl) > 1:
515 if not overwrite and len(pl) > 1:
515 raise util.Abort(_("outstanding uncommitted merges"))
516 raise util.Abort(_("outstanding uncommitted merges"))
516 if branchmerge:
517 if branchmerge:
517 if pa == p2:
518 if pa == p2:
518 raise util.Abort(_("merging with a working directory ancestor"
519 raise util.Abort(_("merging with a working directory ancestor"
519 " has no effect"))
520 " has no effect"))
520 elif pa == p1:
521 elif pa == p1:
521 if p1.branch() == p2.branch():
522 if p1.branch() == p2.branch():
522 raise util.Abort(_("nothing to merge"),
523 raise util.Abort(_("nothing to merge"),
523 hint=_("use 'hg update' "
524 hint=_("use 'hg update' "
524 "or check 'hg heads'"))
525 "or check 'hg heads'"))
525 if not force and (wc.files() or wc.deleted()):
526 if not force and (wc.files() or wc.deleted()):
526 raise util.Abort(_("outstanding uncommitted changes"),
527 raise util.Abort(_("outstanding uncommitted changes"),
527 hint=_("use 'hg status' to list changes"))
528 hint=_("use 'hg status' to list changes"))
528 for s in wc.substate:
529 for s in wc.substate:
529 if wc.sub(s).dirty():
530 if wc.sub(s).dirty():
530 raise util.Abort(_("outstanding uncommitted changes in "
531 raise util.Abort(_("outstanding uncommitted changes in "
531 "subrepository '%s'") % s)
532 "subrepository '%s'") % s)
532
533
533 elif not overwrite:
534 elif not overwrite:
534 if pa == p1 or pa == p2: # linear
535 if pa == p1 or pa == p2: # linear
535 pass # all good
536 pass # all good
536 elif wc.dirty(missing=True):
537 elif wc.dirty(missing=True):
537 raise util.Abort(_("crosses branches (merge branches or use"
538 raise util.Abort(_("crosses branches (merge branches or use"
538 " --clean to discard changes)"))
539 " --clean to discard changes)"))
539 elif onode is None:
540 elif onode is None:
540 raise util.Abort(_("crosses branches (merge branches or update"
541 raise util.Abort(_("crosses branches (merge branches or update"
541 " --check to force update)"))
542 " --check to force update)"))
542 else:
543 else:
543 # Allow jumping branches if clean and specific rev given
544 # Allow jumping branches if clean and specific rev given
544 overwrite = True
545 overwrite = True
545
546
546 ### calculate phase
547 ### calculate phase
547 action = []
548 action = []
548 wc.status(unknown=True) # prime cache
549 wc.status(unknown=True) # prime cache
549 folding = not util.checkcase(repo.path)
550 folding = not util.checkcase(repo.path)
550 if not force:
551 if not force:
551 _checkunknown(wc, p2, folding)
552 _checkunknown(wc, p2, folding)
552 if folding:
553 if folding:
553 _checkcollision(p2)
554 _checkcollision(p2)
554 action += _forgetremoved(wc, p2, branchmerge)
555 action += _forgetremoved(wc, p2, branchmerge)
555 action += manifestmerge(repo, wc, p2, pa, overwrite, partial)
556 action += manifestmerge(repo, wc, p2, pa, overwrite, partial)
556
557
557 ### apply phase
558 ### apply phase
558 if not branchmerge: # just jump to the new rev
559 if not branchmerge: # just jump to the new rev
559 fp1, fp2, xp1, xp2 = fp2, nullid, xp2, ''
560 fp1, fp2, xp1, xp2 = fp2, nullid, xp2, ''
560 if not partial:
561 if not partial:
561 repo.hook('preupdate', throw=True, parent1=xp1, parent2=xp2)
562 repo.hook('preupdate', throw=True, parent1=xp1, parent2=xp2)
562
563
563 stats = applyupdates(repo, action, wc, p2, pa, overwrite)
564 stats = applyupdates(repo, action, wc, p2, pa, overwrite)
564
565
565 if not partial:
566 if not partial:
566 repo.dirstate.setparents(fp1, fp2)
567 repo.dirstate.setparents(fp1, fp2)
567 recordupdates(repo, action, branchmerge)
568 recordupdates(repo, action, branchmerge)
568 if not branchmerge:
569 if not branchmerge:
569 repo.dirstate.setbranch(p2.branch())
570 repo.dirstate.setbranch(p2.branch())
570 finally:
571 finally:
571 wlock.release()
572 wlock.release()
572
573
573 if not partial:
574 if not partial:
574 repo.hook('update', parent1=xp1, parent2=xp2, error=stats[3])
575 repo.hook('update', parent1=xp1, parent2=xp2, error=stats[3])
575 return stats
576 return stats
@@ -1,62 +1,62 b''
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):
27 all copies found (* = to merge, ! = divergent):
28 c -> a *
28 c -> a *
29 b -> a *
29 b -> a *
30 checking for directory renames
30 checking for directory renames
31 resolving manifests
31 resolving manifests
32 overwrite None partial False
32 overwrite: False, partial: False
33 ancestor b8bf91eeebbc local add3f11052fa+ remote 17c05bb7fcb6
33 ancestor: b8bf91eeebbc, local: add3f11052fa+, remote: 17c05bb7fcb6
34 a: remote moved to c -> m
34 a: remote moved to c -> m
35 a: remote moved to b -> m
35 a: remote moved to b -> m
36 preserving a for resolve of b
36 preserving a for resolve of b
37 preserving a for resolve of c
37 preserving a for resolve of c
38 removing a
38 removing a
39 updating: a 1/2 files (50.00%)
39 updating: a 1/2 files (50.00%)
40 picked tool 'internal:merge' for b (binary False symlink False)
40 picked tool 'internal:merge' for b (binary False symlink False)
41 merging a and b to b
41 merging a and b to b
42 my b@add3f11052fa+ other b@17c05bb7fcb6 ancestor a@b8bf91eeebbc
42 my b@add3f11052fa+ other b@17c05bb7fcb6 ancestor a@b8bf91eeebbc
43 premerge successful
43 premerge successful
44 updating: a 2/2 files (100.00%)
44 updating: a 2/2 files (100.00%)
45 picked tool 'internal:merge' for c (binary False symlink False)
45 picked tool 'internal:merge' for c (binary False symlink False)
46 merging a and c to c
46 merging a and c to c
47 my c@add3f11052fa+ other c@17c05bb7fcb6 ancestor a@b8bf91eeebbc
47 my c@add3f11052fa+ other c@17c05bb7fcb6 ancestor a@b8bf91eeebbc
48 premerge successful
48 premerge successful
49 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
49 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
50 (branch merge, don't forget to commit)
50 (branch merge, don't forget to commit)
51
51
52 file b
52 file b
53 $ cat b
53 $ cat b
54 0
54 0
55 1
55 1
56 2
56 2
57
57
58 file c
58 file c
59 $ cat c
59 $ cat c
60 0
60 0
61 1
61 1
62 2
62 2
@@ -1,65 +1,65 b''
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):
32 all copies found (* = to merge, ! = divergent):
33 bar -> foo *
33 bar -> foo *
34 checking for directory renames
34 checking for directory renames
35 resolving manifests
35 resolving manifests
36 overwrite None partial False
36 overwrite: False, partial: False
37 ancestor e6dc8efe11cc local 6a0df1dad128+ remote 484bf6903104
37 ancestor: e6dc8efe11cc, local: 6a0df1dad128+, remote: 484bf6903104
38 foo: versions differ -> m
38 foo: versions differ -> m
39 foo: remote copied to bar -> m
39 foo: remote copied to bar -> m
40 preserving foo for resolve of bar
40 preserving foo for resolve of bar
41 preserving foo for resolve of foo
41 preserving foo for resolve of foo
42 updating: foo 1/2 files (50.00%)
42 updating: foo 1/2 files (50.00%)
43 picked tool 'internal:merge' for bar (binary False symlink False)
43 picked tool 'internal:merge' for bar (binary False symlink False)
44 merging foo and bar to bar
44 merging foo and bar to bar
45 my bar@6a0df1dad128+ other bar@484bf6903104 ancestor foo@e6dc8efe11cc
45 my bar@6a0df1dad128+ other bar@484bf6903104 ancestor foo@e6dc8efe11cc
46 premerge successful
46 premerge successful
47 updating: foo 2/2 files (100.00%)
47 updating: foo 2/2 files (100.00%)
48 picked tool 'internal:merge' for foo (binary False symlink False)
48 picked tool 'internal:merge' for foo (binary False symlink False)
49 merging foo
49 merging foo
50 my foo@6a0df1dad128+ other foo@484bf6903104 ancestor foo@e6dc8efe11cc
50 my foo@6a0df1dad128+ other foo@484bf6903104 ancestor foo@e6dc8efe11cc
51 premerge successful
51 premerge successful
52 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
52 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
53 (branch merge, don't forget to commit)
53 (branch merge, don't forget to commit)
54
54
55 contents of foo
55 contents of foo
56 $ cat foo
56 $ cat foo
57 line 0
57 line 0
58 line 1
58 line 1
59 line 2-1
59 line 2-1
60
60
61 contents of bar
61 contents of bar
62 $ cat bar
62 $ cat bar
63 line 0
63 line 0
64 line 1
64 line 1
65 line 2-2
65 line 2-2
@@ -1,279 +1,279 b''
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
25
26 Need to specify a rev:
26 Need to specify a rev:
27
27
28 $ hg graft
28 $ hg graft
29 abort: no revisions specified
29 abort: no revisions specified
30 [255]
30 [255]
31
31
32 Can't graft ancestor:
32 Can't graft ancestor:
33
33
34 $ hg graft 1 2
34 $ hg graft 1 2
35 skipping ancestor revision 1
35 skipping ancestor revision 1
36 skipping ancestor revision 2
36 skipping ancestor revision 2
37 [255]
37 [255]
38
38
39 Can't graft with dirty wd:
39 Can't graft with dirty wd:
40
40
41 $ hg up -q 0
41 $ hg up -q 0
42 $ echo foo > a
42 $ echo foo > a
43 $ hg graft 1
43 $ hg graft 1
44 abort: outstanding uncommitted changes
44 abort: outstanding uncommitted changes
45 [255]
45 [255]
46 $ hg revert a
46 $ hg revert a
47
47
48 Graft a rename:
48 Graft a rename:
49
49
50 $ hg graft 2 -u foo
50 $ hg graft 2 -u foo
51 grafting revision 2
51 grafting revision 2
52 merging a and b to b
52 merging a and b to b
53 $ hg export tip --git
53 $ hg export tip --git
54 # HG changeset patch
54 # HG changeset patch
55 # User foo
55 # User foo
56 # Date 0 0
56 # Date 0 0
57 # Node ID d2e44c99fd3f31c176ea4efb9eca9f6306c81756
57 # Node ID d2e44c99fd3f31c176ea4efb9eca9f6306c81756
58 # Parent 68795b066622ca79a25816a662041d8f78f3cd9e
58 # Parent 68795b066622ca79a25816a662041d8f78f3cd9e
59 2
59 2
60
60
61 diff --git a/a b/b
61 diff --git a/a b/b
62 rename from a
62 rename from a
63 rename to b
63 rename to b
64 --- a/a
64 --- a/a
65 +++ b/b
65 +++ b/b
66 @@ -1,1 +1,1 @@
66 @@ -1,1 +1,1 @@
67 -a
67 -a
68 +b
68 +b
69
69
70 Look for extra:source
70 Look for extra:source
71
71
72 $ hg log --debug -r tip
72 $ hg log --debug -r tip
73 changeset: 7:d2e44c99fd3f31c176ea4efb9eca9f6306c81756
73 changeset: 7:d2e44c99fd3f31c176ea4efb9eca9f6306c81756
74 tag: tip
74 tag: tip
75 parent: 0:68795b066622ca79a25816a662041d8f78f3cd9e
75 parent: 0:68795b066622ca79a25816a662041d8f78f3cd9e
76 parent: -1:0000000000000000000000000000000000000000
76 parent: -1:0000000000000000000000000000000000000000
77 manifest: 7:5d59766436fd8fbcd38e7bebef0f6eaf3eebe637
77 manifest: 7:5d59766436fd8fbcd38e7bebef0f6eaf3eebe637
78 user: foo
78 user: foo
79 date: Thu Jan 01 00:00:00 1970 +0000
79 date: Thu Jan 01 00:00:00 1970 +0000
80 files+: b
80 files+: b
81 files-: a
81 files-: a
82 extra: branch=default
82 extra: branch=default
83 extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4
83 extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4
84 description:
84 description:
85 2
85 2
86
86
87
87
88
88
89 Graft out of order, skipping a merge and a duplicate
89 Graft out of order, skipping a merge and a duplicate
90
90
91 $ hg graft 1 5 4 3 'merge()' 2 --debug
91 $ hg graft 1 5 4 3 'merge()' 2 --debug
92 skipping ungraftable merge revision 6
92 skipping ungraftable merge revision 6
93 scanning for duplicate grafts
93 scanning for duplicate grafts
94 skipping already grafted revision 2
94 skipping already grafted revision 2
95 grafting revision 1
95 grafting revision 1
96 searching for copies back to rev 1
96 searching for copies back to rev 1
97 unmatched files in local:
97 unmatched files in local:
98 a.orig
98 a.orig
99 b
99 b
100 all copies found (* = to merge, ! = divergent):
100 all copies found (* = to merge, ! = divergent):
101 b -> a *
101 b -> a *
102 checking for directory renames
102 checking for directory renames
103 resolving manifests
103 resolving manifests
104 overwrite False partial False
104 overwrite: False, partial: False
105 ancestor 68795b066622 local d2e44c99fd3f+ remote 5d205f8b35b6
105 ancestor: 68795b066622, local: d2e44c99fd3f+, remote: 5d205f8b35b6
106 b: local copied/moved to a -> m
106 b: local copied/moved to a -> m
107 preserving b for resolve of b
107 preserving b for resolve of b
108 updating: b 1/1 files (100.00%)
108 updating: b 1/1 files (100.00%)
109 searching for copies back to rev 1
109 searching for copies back to rev 1
110 unmatched files in local:
110 unmatched files in local:
111 a
111 a
112 unmatched files in other:
112 unmatched files in other:
113 b
113 b
114 all copies found (* = to merge, ! = divergent):
114 all copies found (* = to merge, ! = divergent):
115 b -> a *
115 b -> a *
116 checking for directory renames
116 checking for directory renames
117 b
117 b
118 b: searching for copy revision for a
118 b: searching for copy revision for a
119 b: copy a:b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
119 b: copy a:b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
120 grafting revision 5
120 grafting revision 5
121 searching for copies back to rev 1
121 searching for copies back to rev 1
122 unmatched files in local:
122 unmatched files in local:
123 a.orig
123 a.orig
124 resolving manifests
124 resolving manifests
125 overwrite False partial False
125 overwrite: False, partial: False
126 ancestor 4c60f11aa304 local 6f5ea6ac8b70+ remote 97f8bfe72746
126 ancestor: 4c60f11aa304, local: 6f5ea6ac8b70+, remote: 97f8bfe72746
127 e: remote is newer -> g
127 e: remote is newer -> g
128 updating: e 1/1 files (100.00%)
128 updating: e 1/1 files (100.00%)
129 getting e
129 getting e
130 searching for copies back to rev 1
130 searching for copies back to rev 1
131 unmatched files in local:
131 unmatched files in local:
132 c
132 c
133 all copies found (* = to merge, ! = divergent):
133 all copies found (* = to merge, ! = divergent):
134 c -> b *
134 c -> b *
135 checking for directory renames
135 checking for directory renames
136 e
136 e
137 grafting revision 4
137 grafting revision 4
138 searching for copies back to rev 1
138 searching for copies back to rev 1
139 unmatched files in local:
139 unmatched files in local:
140 a.orig
140 a.orig
141 resolving manifests
141 resolving manifests
142 overwrite False partial False
142 overwrite: False, partial: False
143 ancestor 4c60f11aa304 local 77eb504366ab+ remote 9c233e8e184d
143 ancestor: 4c60f11aa304, local: 77eb504366ab+, remote: 9c233e8e184d
144 e: versions differ -> m
144 e: versions differ -> m
145 d: remote is newer -> g
145 d: remote is newer -> g
146 preserving e for resolve of e
146 preserving e for resolve of e
147 updating: d 1/2 files (50.00%)
147 updating: d 1/2 files (50.00%)
148 getting d
148 getting d
149 updating: e 2/2 files (100.00%)
149 updating: e 2/2 files (100.00%)
150 picked tool 'internal:merge' for e (binary False symlink False)
150 picked tool 'internal:merge' for e (binary False symlink False)
151 merging e
151 merging e
152 my e@77eb504366ab+ other e@9c233e8e184d ancestor e@68795b066622
152 my e@77eb504366ab+ other e@9c233e8e184d ancestor e@68795b066622
153 warning: conflicts during merge.
153 warning: conflicts during merge.
154 merging e incomplete! (edit conflicts, then use 'hg resolve --mark')
154 merging e incomplete! (edit conflicts, then use 'hg resolve --mark')
155 searching for copies back to rev 1
155 searching for copies back to rev 1
156 unmatched files in local:
156 unmatched files in local:
157 c
157 c
158 all copies found (* = to merge, ! = divergent):
158 all copies found (* = to merge, ! = divergent):
159 c -> b *
159 c -> b *
160 checking for directory renames
160 checking for directory renames
161 abort: unresolved conflicts, can't continue
161 abort: unresolved conflicts, can't continue
162 (use hg resolve and hg graft --continue)
162 (use hg resolve and hg graft --continue)
163 [255]
163 [255]
164
164
165 Continue without resolve should fail:
165 Continue without resolve should fail:
166
166
167 $ hg graft -c
167 $ hg graft -c
168 grafting revision 4
168 grafting revision 4
169 abort: unresolved merge conflicts (see hg help resolve)
169 abort: unresolved merge conflicts (see hg help resolve)
170 [255]
170 [255]
171
171
172 Fix up:
172 Fix up:
173
173
174 $ echo b > e
174 $ echo b > e
175 $ hg resolve -m e
175 $ hg resolve -m e
176
176
177 Continue with a revision should fail:
177 Continue with a revision should fail:
178
178
179 $ hg graft -c 6
179 $ hg graft -c 6
180 abort: can't specify --continue and revisions
180 abort: can't specify --continue and revisions
181 [255]
181 [255]
182
182
183 Continue for real, clobber usernames
183 Continue for real, clobber usernames
184
184
185 $ hg graft -c -U
185 $ hg graft -c -U
186 grafting revision 4
186 grafting revision 4
187 grafting revision 3
187 grafting revision 3
188
188
189 Compare with original:
189 Compare with original:
190
190
191 $ hg diff -r 6
191 $ hg diff -r 6
192 $ hg status --rev 0:. -C
192 $ hg status --rev 0:. -C
193 M d
193 M d
194 M e
194 M e
195 A b
195 A b
196 a
196 a
197 A c
197 A c
198 a
198 a
199 R a
199 R a
200
200
201 View graph:
201 View graph:
202
202
203 $ hg --config extensions.graphlog= log -G --template '{author}@{rev}: {desc}\n'
203 $ hg --config extensions.graphlog= log -G --template '{author}@{rev}: {desc}\n'
204 @ test@11: 3
204 @ test@11: 3
205 |
205 |
206 o test@10: 4
206 o test@10: 4
207 |
207 |
208 o test@9: 5
208 o test@9: 5
209 |
209 |
210 o bar@8: 1
210 o bar@8: 1
211 |
211 |
212 o foo@7: 2
212 o foo@7: 2
213 |
213 |
214 | o test@6: 6
214 | o test@6: 6
215 | |\
215 | |\
216 | | o test@5: 5
216 | | o test@5: 5
217 | | |
217 | | |
218 | o | test@4: 4
218 | o | test@4: 4
219 | |/
219 | |/
220 | o baz@3: 3
220 | o baz@3: 3
221 | |
221 | |
222 | o test@2: 2
222 | o test@2: 2
223 | |
223 | |
224 | o bar@1: 1
224 | o bar@1: 1
225 |/
225 |/
226 o test@0: 0
226 o test@0: 0
227
227
228 Graft again onto another branch should preserve the original source
228 Graft again onto another branch should preserve the original source
229 $ hg up -q 0
229 $ hg up -q 0
230 $ echo 'g'>g
230 $ echo 'g'>g
231 $ hg add g
231 $ hg add g
232 $ hg ci -m 7
232 $ hg ci -m 7
233 created new head
233 created new head
234 $ hg graft 7
234 $ hg graft 7
235 grafting revision 7
235 grafting revision 7
236
236
237 $ hg log -r 7 --template '{rev}:{node}\n'
237 $ hg log -r 7 --template '{rev}:{node}\n'
238 7:d2e44c99fd3f31c176ea4efb9eca9f6306c81756
238 7:d2e44c99fd3f31c176ea4efb9eca9f6306c81756
239 $ hg log -r 2 --template '{rev}:{node}\n'
239 $ hg log -r 2 --template '{rev}:{node}\n'
240 2:5c095ad7e90f871700f02dd1fa5012cb4498a2d4
240 2:5c095ad7e90f871700f02dd1fa5012cb4498a2d4
241
241
242 $ hg log --debug -r tip
242 $ hg log --debug -r tip
243 changeset: 13:39bb1d13572759bd1e6fc874fed1b12ece047a18
243 changeset: 13:39bb1d13572759bd1e6fc874fed1b12ece047a18
244 tag: tip
244 tag: tip
245 parent: 12:b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
245 parent: 12:b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
246 parent: -1:0000000000000000000000000000000000000000
246 parent: -1:0000000000000000000000000000000000000000
247 manifest: 13:0780e055d8f4cd12eadd5a2719481648f336f7a9
247 manifest: 13:0780e055d8f4cd12eadd5a2719481648f336f7a9
248 user: foo
248 user: foo
249 date: Thu Jan 01 00:00:00 1970 +0000
249 date: Thu Jan 01 00:00:00 1970 +0000
250 files+: b
250 files+: b
251 files-: a
251 files-: a
252 extra: branch=default
252 extra: branch=default
253 extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4
253 extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4
254 description:
254 description:
255 2
255 2
256
256
257
257
258 Disallow grafting an already grafted cset onto its original branch
258 Disallow grafting an already grafted cset onto its original branch
259 $ hg up -q 6
259 $ hg up -q 6
260 $ hg graft 7
260 $ hg graft 7
261 skipping already grafted revision 7 (was grafted from 2)
261 skipping already grafted revision 7 (was grafted from 2)
262 [255]
262 [255]
263
263
264 Disallow grafting already grafted csets with the same origin onto each other
264 Disallow grafting already grafted csets with the same origin onto each other
265 $ hg up -q 13
265 $ hg up -q 13
266 $ hg graft 2
266 $ hg graft 2
267 skipping already grafted revision 2
267 skipping already grafted revision 2
268 [255]
268 [255]
269 $ hg graft 7
269 $ hg graft 7
270 skipping already grafted revision 7 (same origin 2)
270 skipping already grafted revision 7 (same origin 2)
271 [255]
271 [255]
272
272
273 $ hg up -q 7
273 $ hg up -q 7
274 $ hg graft 2
274 $ hg graft 2
275 skipping already grafted revision 2
275 skipping already grafted revision 2
276 [255]
276 [255]
277 $ hg graft tip
277 $ hg graft tip
278 skipping already grafted revision 13 (same origin 2)
278 skipping already grafted revision 13 (same origin 2)
279 [255]
279 [255]
@@ -1,71 +1,71 b''
1 $ "$TESTDIR/hghave" execbit || exit 80
1 $ "$TESTDIR/hghave" execbit || exit 80
2
2
3 Create extension that can disable exec checks:
3 Create extension that can disable exec checks:
4
4
5 $ cat > noexec.py <<EOF
5 $ cat > noexec.py <<EOF
6 > from mercurial import extensions, util
6 > from mercurial import extensions, util
7 > def setflags(orig, f, l, x):
7 > def setflags(orig, f, l, x):
8 > pass
8 > pass
9 > def checkexec(orig, path):
9 > def checkexec(orig, path):
10 > return False
10 > return False
11 > def extsetup(ui):
11 > def extsetup(ui):
12 > extensions.wrapfunction(util, 'setflags', setflags)
12 > extensions.wrapfunction(util, 'setflags', setflags)
13 > extensions.wrapfunction(util, 'checkexec', checkexec)
13 > extensions.wrapfunction(util, 'checkexec', checkexec)
14 > EOF
14 > EOF
15
15
16 $ hg init unix-repo
16 $ hg init unix-repo
17 $ cd unix-repo
17 $ cd unix-repo
18 $ touch a
18 $ touch a
19 $ hg add a
19 $ hg add a
20 $ hg commit -m 'unix: add a'
20 $ hg commit -m 'unix: add a'
21 $ hg clone . ../win-repo
21 $ hg clone . ../win-repo
22 updating to branch default
22 updating to branch default
23 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
23 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
24 $ chmod +x a
24 $ chmod +x a
25 $ hg commit -m 'unix: chmod a'
25 $ hg commit -m 'unix: chmod a'
26 $ hg manifest -v
26 $ hg manifest -v
27 755 * a
27 755 * a
28
28
29 $ cd ../win-repo
29 $ cd ../win-repo
30
30
31 $ touch b
31 $ touch b
32 $ hg add b
32 $ hg add b
33 $ hg commit -m 'win: add b'
33 $ hg commit -m 'win: add b'
34
34
35 $ hg manifest -v
35 $ hg manifest -v
36 644 a
36 644 a
37 644 b
37 644 b
38
38
39 $ hg pull
39 $ hg pull
40 pulling from $TESTTMP/unix-repo
40 pulling from $TESTTMP/unix-repo
41 searching for changes
41 searching for changes
42 adding changesets
42 adding changesets
43 adding manifests
43 adding manifests
44 adding file changes
44 adding file changes
45 added 1 changesets with 0 changes to 0 files (+1 heads)
45 added 1 changesets with 0 changes to 0 files (+1 heads)
46 (run 'hg heads' to see heads, 'hg merge' to merge)
46 (run 'hg heads' to see heads, 'hg merge' to merge)
47
47
48 $ hg manifest -v -r tip
48 $ hg manifest -v -r tip
49 755 * a
49 755 * a
50
50
51 Simulate a Windows merge:
51 Simulate a Windows merge:
52
52
53 $ hg --config extensions.n=$TESTTMP/noexec.py merge --debug
53 $ hg --config extensions.n=$TESTTMP/noexec.py merge --debug
54 searching for copies back to rev 1
54 searching for copies back to rev 1
55 unmatched files in local:
55 unmatched files in local:
56 b
56 b
57 resolving manifests
57 resolving manifests
58 overwrite None partial False
58 overwrite: False, partial: False
59 ancestor a03b0deabf2b local d6fa54f68ae1+ remote 2d8bcf2dda39
59 ancestor: a03b0deabf2b, local: d6fa54f68ae1+, remote: 2d8bcf2dda39
60 a: update permissions -> e
60 a: update permissions -> e
61 updating: a 1/1 files (100.00%)
61 updating: a 1/1 files (100.00%)
62 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
62 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
63 (branch merge, don't forget to commit)
63 (branch merge, don't forget to commit)
64
64
65 Simulate a Windows commit:
65 Simulate a Windows commit:
66
66
67 $ hg --config extensions.n=$TESTTMP/noexec.py commit -m 'win: merge'
67 $ hg --config extensions.n=$TESTTMP/noexec.py commit -m 'win: merge'
68
68
69 $ hg manifest -v
69 $ hg manifest -v
70 755 * a
70 755 * a
71 644 b
71 644 b
@@ -1,56 +1,56 b''
1 http://mercurial.selenic.com/bts/issue522
1 http://mercurial.selenic.com/bts/issue522
2
2
3 In the merge below, the file "foo" has the same contents in both
3 In the merge below, the file "foo" has the same contents in both
4 parents, but if we look at the file-level history, we'll notice that
4 parents, but if we look at the file-level history, we'll notice that
5 the version in p1 is an ancestor of the version in p2. This test makes
5 the version in p1 is an ancestor of the version in p2. This test makes
6 sure that we'll use the version from p2 in the manifest of the merge
6 sure that we'll use the version from p2 in the manifest of the merge
7 revision.
7 revision.
8
8
9 $ hg init
9 $ hg init
10
10
11 $ echo foo > foo
11 $ echo foo > foo
12 $ hg ci -qAm 'add foo'
12 $ hg ci -qAm 'add foo'
13
13
14 $ echo bar >> foo
14 $ echo bar >> foo
15 $ hg ci -m 'change foo'
15 $ hg ci -m 'change foo'
16
16
17 $ hg backout -r tip -m 'backout changed foo'
17 $ hg backout -r tip -m 'backout changed foo'
18 reverting foo
18 reverting foo
19 changeset 2:4d9e78aaceee backs out changeset 1:b515023e500e
19 changeset 2:4d9e78aaceee backs out changeset 1:b515023e500e
20
20
21 $ hg up -C 0
21 $ hg up -C 0
22 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
22 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
23
23
24 $ touch bar
24 $ touch bar
25 $ hg ci -qAm 'add bar'
25 $ hg ci -qAm 'add bar'
26
26
27 $ hg merge --debug
27 $ hg merge --debug
28 searching for copies back to rev 1
28 searching for copies back to rev 1
29 unmatched files in local:
29 unmatched files in local:
30 bar
30 bar
31 resolving manifests
31 resolving manifests
32 overwrite None partial False
32 overwrite: False, partial: False
33 ancestor bbd179dfa0a7 local 71766447bdbb+ remote 4d9e78aaceee
33 ancestor: bbd179dfa0a7, local: 71766447bdbb+, remote: 4d9e78aaceee
34 foo: remote is newer -> g
34 foo: remote is newer -> g
35 updating: foo 1/1 files (100.00%)
35 updating: foo 1/1 files (100.00%)
36 getting foo
36 getting foo
37 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
37 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
38 (branch merge, don't forget to commit)
38 (branch merge, don't forget to commit)
39
39
40 $ hg debugstate | grep foo
40 $ hg debugstate | grep foo
41 n 0 -2 unset foo
41 n 0 -2 unset foo
42
42
43 $ hg st -A foo
43 $ hg st -A foo
44 M foo
44 M foo
45
45
46 $ hg ci -m 'merge'
46 $ hg ci -m 'merge'
47
47
48 $ hg manifest --debug | grep foo
48 $ hg manifest --debug | grep foo
49 c6fc755d7e68f49f880599da29f15add41f42f5a 644 foo
49 c6fc755d7e68f49f880599da29f15add41f42f5a 644 foo
50
50
51 $ hg debugindex foo
51 $ hg debugindex foo
52 rev offset length base linkrev nodeid p1 p2
52 rev offset length base linkrev nodeid p1 p2
53 0 0 5 0 0 2ed2a3912a0b 000000000000 000000000000
53 0 0 5 0 0 2ed2a3912a0b 000000000000 000000000000
54 1 5 9 1 1 6f4310b00b9a 2ed2a3912a0b 000000000000
54 1 5 9 1 1 6f4310b00b9a 2ed2a3912a0b 000000000000
55 2 14 5 2 2 c6fc755d7e68 6f4310b00b9a 000000000000
55 2 14 5 2 2 c6fc755d7e68 6f4310b00b9a 000000000000
56
56
@@ -1,101 +1,101 b''
1 http://mercurial.selenic.com/bts/issue672
1 http://mercurial.selenic.com/bts/issue672
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):
31 all copies found (* = to merge, ! = divergent):
32 1a -> 1
32 1a -> 1
33 checking for directory renames
33 checking for directory renames
34 resolving manifests
34 resolving manifests
35 overwrite None partial False
35 overwrite: 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 1a: remote created -> g
38 1a: remote created -> g
39 updating: 1 1/2 files (50.00%)
39 updating: 1 1/2 files (50.00%)
40 removing 1
40 removing 1
41 updating: 1a 2/2 files (100.00%)
41 updating: 1a 2/2 files (100.00%)
42 getting 1a
42 getting 1a
43 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
43 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
44 (branch merge, don't forget to commit)
44 (branch merge, don't forget to commit)
45
45
46 $ hg ci -m merge1 # 3
46 $ hg ci -m merge1 # 3
47
47
48 $ hg co -C 2
48 $ hg co -C 2
49 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
49 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
50
50
51 $ echo hello >> 1
51 $ echo hello >> 1
52 $ hg ci -m unrelated2 # 4
52 $ hg ci -m unrelated2 # 4
53 created new head
53 created new head
54
54
55 $ hg co -C 3
55 $ hg co -C 3
56 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
56 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
57
57
58 $ hg merge -y --debug 4
58 $ hg merge -y --debug 4
59 searching for copies back to rev 1
59 searching for copies back to rev 1
60 unmatched files in local:
60 unmatched files in local:
61 1a
61 1a
62 all copies found (* = to merge, ! = divergent):
62 all copies found (* = to merge, ! = divergent):
63 1a -> 1 *
63 1a -> 1 *
64 checking for directory renames
64 checking for directory renames
65 resolving manifests
65 resolving manifests
66 overwrite None partial False
66 overwrite: False, partial: False
67 ancestor c64f439569a9 local e327dca35ac8+ remote 746e9549ea96
67 ancestor: c64f439569a9, local: e327dca35ac8+, remote: 746e9549ea96
68 1a: local copied/moved to 1 -> m
68 1a: local copied/moved to 1 -> m
69 preserving 1a for resolve of 1a
69 preserving 1a for resolve of 1a
70 updating: 1a 1/1 files (100.00%)
70 updating: 1a 1/1 files (100.00%)
71 picked tool 'internal:merge' for 1a (binary False symlink False)
71 picked tool 'internal:merge' for 1a (binary False symlink False)
72 merging 1a and 1 to 1a
72 merging 1a and 1 to 1a
73 my 1a@e327dca35ac8+ other 1@746e9549ea96 ancestor 1@81f4b099af3d
73 my 1a@e327dca35ac8+ other 1@746e9549ea96 ancestor 1@81f4b099af3d
74 premerge successful
74 premerge successful
75 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
75 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
76 (branch merge, don't forget to commit)
76 (branch merge, don't forget to commit)
77
77
78 $ hg co -C 4
78 $ hg co -C 4
79 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
79 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
80
80
81 $ hg merge -y --debug 3
81 $ hg merge -y --debug 3
82 searching for copies back to rev 1
82 searching for copies back to rev 1
83 unmatched files in other:
83 unmatched files in other:
84 1a
84 1a
85 all copies found (* = to merge, ! = divergent):
85 all copies found (* = to merge, ! = divergent):
86 1a -> 1 *
86 1a -> 1 *
87 checking for directory renames
87 checking for directory renames
88 resolving manifests
88 resolving manifests
89 overwrite None partial False
89 overwrite: False, partial: False
90 ancestor c64f439569a9 local 746e9549ea96+ remote e327dca35ac8
90 ancestor: c64f439569a9, local: 746e9549ea96+, remote: e327dca35ac8
91 1: remote moved to 1a -> m
91 1: remote moved to 1a -> m
92 preserving 1 for resolve of 1a
92 preserving 1 for resolve of 1a
93 removing 1
93 removing 1
94 updating: 1 1/1 files (100.00%)
94 updating: 1 1/1 files (100.00%)
95 picked tool 'internal:merge' for 1a (binary False symlink False)
95 picked tool 'internal:merge' for 1a (binary False symlink False)
96 merging 1 and 1a to 1a
96 merging 1 and 1a to 1a
97 my 1a@746e9549ea96+ other 1a@e327dca35ac8 ancestor 1@81f4b099af3d
97 my 1a@746e9549ea96+ other 1a@e327dca35ac8 ancestor 1@81f4b099af3d
98 premerge successful
98 premerge successful
99 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
99 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
100 (branch merge, don't forget to commit)
100 (branch merge, don't forget to commit)
101
101
@@ -1,183 +1,183 b''
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 base linkrev nodeid p1 p2
38 rev offset length base linkrev nodeid p1 p2
39 0 0 77 0 2 d35118874825 000000000000 000000000000
39 0 0 77 0 2 d35118874825 000000000000 000000000000
40 1 77 76 0 3 5345f5ab8abd 000000000000 d35118874825
40 1 77 76 0 3 5345f5ab8abd 000000000000 d35118874825
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 base linkrev nodeid p1 p2
46 rev offset length base linkrev nodeid p1 p2
47 0 0 7 0 0 690b295714ae 000000000000 000000000000
47 0 0 7 0 0 690b295714ae 000000000000 000000000000
48 1 7 13 1 1 9e25c27b8757 690b295714ae 000000000000
48 1 7 13 1 1 9e25c27b8757 690b295714ae 000000000000
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 overwrite None partial False
72 overwrite: False, partial: False
73 ancestor 0f2ff26688b9 local 2263c1be0967+ remote 0555950ead28
73 ancestor: 0f2ff26688b9, local: 2263c1be0967+, remote: 0555950ead28
74 bar: versions differ -> m
74 bar: versions differ -> m
75 preserving bar for resolve of bar
75 preserving bar for resolve of bar
76 updating: bar 1/1 files (100.00%)
76 updating: bar 1/1 files (100.00%)
77 picked tool 'internal:merge' for bar (binary False symlink False)
77 picked tool 'internal:merge' for bar (binary False symlink False)
78 merging bar
78 merging bar
79 my bar@2263c1be0967+ other bar@0555950ead28 ancestor bar@0f2ff26688b9
79 my bar@2263c1be0967+ other bar@0555950ead28 ancestor bar@0f2ff26688b9
80 premerge successful
80 premerge successful
81 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
81 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
82 (branch merge, don't forget to commit)
82 (branch merge, don't forget to commit)
83
83
84 $ cat bar
84 $ cat bar
85 line1
85 line1
86 line2
86 line2
87
87
88 $ hg ci -m '5: merge'
88 $ hg ci -m '5: merge'
89
89
90 $ hg debugindex bar
90 $ hg debugindex bar
91 rev offset length base linkrev nodeid p1 p2
91 rev offset length base linkrev nodeid p1 p2
92 0 0 77 0 2 d35118874825 000000000000 000000000000
92 0 0 77 0 2 d35118874825 000000000000 000000000000
93 1 77 76 0 3 5345f5ab8abd 000000000000 d35118874825
93 1 77 76 0 3 5345f5ab8abd 000000000000 d35118874825
94 2 153 7 2 4 ff4b45017382 d35118874825 000000000000
94 2 153 7 2 4 ff4b45017382 d35118874825 000000000000
95 3 160 13 3 5 3701b4893544 ff4b45017382 5345f5ab8abd
95 3 160 13 3 5 3701b4893544 ff4b45017382 5345f5ab8abd
96
96
97
97
98 Same thing, but with the merge on 3 having the rename
98 Same thing, but with the merge on 3 having the rename
99 on the remote parent:
99 on the remote parent:
100
100
101 $ cd ..
101 $ cd ..
102 $ hg clone -U -r 1 -r 2 a b
102 $ hg clone -U -r 1 -r 2 a b
103 adding changesets
103 adding changesets
104 adding manifests
104 adding manifests
105 adding file changes
105 adding file changes
106 added 3 changesets with 3 changes to 2 files (+1 heads)
106 added 3 changesets with 3 changes to 2 files (+1 heads)
107 $ cd b
107 $ cd b
108
108
109 $ hg up -C 1
109 $ hg up -C 1
110 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
110 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
111
111
112 $ hg merge 2
112 $ hg merge 2
113 merging foo and bar to bar
113 merging foo and bar to bar
114 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
114 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
115 (branch merge, don't forget to commit)
115 (branch merge, don't forget to commit)
116
116
117 $ cat bar
117 $ cat bar
118 line0
118 line0
119 line1
119 line1
120 line2
120 line2
121
121
122 $ hg ci -m '3: merge with remote rename'
122 $ hg ci -m '3: merge with remote rename'
123
123
124 $ hg debugindex bar
124 $ hg debugindex bar
125 rev offset length base linkrev nodeid p1 p2
125 rev offset length base linkrev nodeid p1 p2
126 0 0 77 0 2 d35118874825 000000000000 000000000000
126 0 0 77 0 2 d35118874825 000000000000 000000000000
127 1 77 76 0 3 5345f5ab8abd 000000000000 d35118874825
127 1 77 76 0 3 5345f5ab8abd 000000000000 d35118874825
128
128
129 $ hg debugrename bar
129 $ hg debugrename bar
130 bar renamed from foo:9e25c27b87571a1edee5ae4dddee5687746cc8e2
130 bar renamed from foo:9e25c27b87571a1edee5ae4dddee5687746cc8e2
131
131
132 $ hg debugindex foo
132 $ hg debugindex foo
133 rev offset length base linkrev nodeid p1 p2
133 rev offset length base linkrev nodeid p1 p2
134 0 0 7 0 0 690b295714ae 000000000000 000000000000
134 0 0 7 0 0 690b295714ae 000000000000 000000000000
135 1 7 13 1 1 9e25c27b8757 690b295714ae 000000000000
135 1 7 13 1 1 9e25c27b8757 690b295714ae 000000000000
136
136
137
137
138 Revert the content change from rev 2:
138 Revert the content change from rev 2:
139
139
140 $ hg up -C 2
140 $ hg up -C 2
141 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
141 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
142 $ rm bar
142 $ rm bar
143 $ echo line1 > bar
143 $ echo line1 > bar
144 $ hg ci -m '4: revert content change from rev 2'
144 $ hg ci -m '4: revert content change from rev 2'
145 created new head
145 created new head
146
146
147 $ hg log --template '{rev}:{node|short} {parents}\n'
147 $ hg log --template '{rev}:{node|short} {parents}\n'
148 4:2263c1be0967 2:0f2ff26688b9
148 4:2263c1be0967 2:0f2ff26688b9
149 3:3ffa6b9e35f0 1:5cd961e4045d 2:0f2ff26688b9
149 3:3ffa6b9e35f0 1:5cd961e4045d 2:0f2ff26688b9
150 2:0f2ff26688b9 0:2665aaee66e9
150 2:0f2ff26688b9 0:2665aaee66e9
151 1:5cd961e4045d
151 1:5cd961e4045d
152 0:2665aaee66e9
152 0:2665aaee66e9
153
153
154 This should use bar@rev2 as the ancestor:
154 This should use bar@rev2 as the ancestor:
155
155
156 $ hg --debug merge 3
156 $ hg --debug merge 3
157 searching for copies back to rev 1
157 searching for copies back to rev 1
158 resolving manifests
158 resolving manifests
159 overwrite None partial False
159 overwrite: False, partial: False
160 ancestor 0f2ff26688b9 local 2263c1be0967+ remote 3ffa6b9e35f0
160 ancestor: 0f2ff26688b9, local: 2263c1be0967+, remote: 3ffa6b9e35f0
161 bar: versions differ -> m
161 bar: versions differ -> m
162 preserving bar for resolve of bar
162 preserving bar for resolve of bar
163 updating: bar 1/1 files (100.00%)
163 updating: bar 1/1 files (100.00%)
164 picked tool 'internal:merge' for bar (binary False symlink False)
164 picked tool 'internal:merge' for bar (binary False symlink False)
165 merging bar
165 merging bar
166 my bar@2263c1be0967+ other bar@3ffa6b9e35f0 ancestor bar@0f2ff26688b9
166 my bar@2263c1be0967+ other bar@3ffa6b9e35f0 ancestor bar@0f2ff26688b9
167 premerge successful
167 premerge successful
168 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
168 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
169 (branch merge, don't forget to commit)
169 (branch merge, don't forget to commit)
170
170
171 $ cat bar
171 $ cat bar
172 line1
172 line1
173 line2
173 line2
174
174
175 $ hg ci -m '5: merge'
175 $ hg ci -m '5: merge'
176
176
177 $ hg debugindex bar
177 $ hg debugindex bar
178 rev offset length base linkrev nodeid p1 p2
178 rev offset length base linkrev nodeid p1 p2
179 0 0 77 0 2 d35118874825 000000000000 000000000000
179 0 0 77 0 2 d35118874825 000000000000 000000000000
180 1 77 76 0 3 5345f5ab8abd 000000000000 d35118874825
180 1 77 76 0 3 5345f5ab8abd 000000000000 d35118874825
181 2 153 7 2 4 ff4b45017382 d35118874825 000000000000
181 2 153 7 2 4 ff4b45017382 d35118874825 000000000000
182 3 160 13 3 5 3701b4893544 ff4b45017382 5345f5ab8abd
182 3 160 13 3 5 3701b4893544 ff4b45017382 5345f5ab8abd
183
183
@@ -1,72 +1,72 b''
1 $ "$TESTDIR/hghave" symlink execbit || exit 80
1 $ "$TESTDIR/hghave" symlink execbit || exit 80
2
2
3 $ hg init
3 $ hg init
4
4
5 $ echo a > a
5 $ echo a > a
6 $ hg ci -Amadd
6 $ hg ci -Amadd
7 adding a
7 adding a
8
8
9 $ chmod +x a
9 $ chmod +x a
10 $ hg ci -mexecutable
10 $ hg ci -mexecutable
11
11
12 $ hg up 0
12 $ hg up 0
13 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
13 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
14 $ rm a
14 $ rm a
15 $ ln -s symlink a
15 $ ln -s symlink a
16 $ hg ci -msymlink
16 $ hg ci -msymlink
17 created new head
17 created new head
18
18
19 $ hg merge --debug
19 $ hg merge --debug
20 searching for copies back to rev 1
20 searching for copies back to rev 1
21 resolving manifests
21 resolving manifests
22 overwrite None partial False
22 overwrite: False, partial: False
23 ancestor c334dc3be0da local 521a1e40188f+ remote 3574f3e69b1c
23 ancestor: c334dc3be0da, local: 521a1e40188f+, remote: 3574f3e69b1c
24 conflicting flags for a
24 conflicting flags for a
25 (n)one, e(x)ec or sym(l)ink? n
25 (n)one, e(x)ec or sym(l)ink? n
26 a: update permissions -> e
26 a: update permissions -> e
27 updating: a 1/1 files (100.00%)
27 updating: a 1/1 files (100.00%)
28 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
28 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
29 (branch merge, don't forget to commit)
29 (branch merge, don't forget to commit)
30
30
31
31
32 Symlink is local parent, executable is other:
32 Symlink is local parent, executable is other:
33
33
34 $ if [ -h a ]; then
34 $ if [ -h a ]; then
35 > echo a is a symlink
35 > echo a is a symlink
36 > $TESTDIR/readlink.py a
36 > $TESTDIR/readlink.py a
37 > elif [ -x a ]; then
37 > elif [ -x a ]; then
38 > echo a is executable
38 > echo a is executable
39 > else
39 > else
40 > echo "a has no flags (default for conflicts)"
40 > echo "a has no flags (default for conflicts)"
41 > fi
41 > fi
42 a has no flags (default for conflicts)
42 a has no flags (default for conflicts)
43
43
44 $ hg update -C 1
44 $ hg update -C 1
45 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
45 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
46
46
47 $ hg merge --debug
47 $ hg merge --debug
48 searching for copies back to rev 1
48 searching for copies back to rev 1
49 resolving manifests
49 resolving manifests
50 overwrite None partial False
50 overwrite: False, partial: False
51 ancestor c334dc3be0da local 3574f3e69b1c+ remote 521a1e40188f
51 ancestor: c334dc3be0da, local: 3574f3e69b1c+, remote: 521a1e40188f
52 conflicting flags for a
52 conflicting flags for a
53 (n)one, e(x)ec or sym(l)ink? n
53 (n)one, e(x)ec or sym(l)ink? n
54 a: remote is newer -> g
54 a: remote is newer -> g
55 updating: a 1/1 files (100.00%)
55 updating: a 1/1 files (100.00%)
56 getting a
56 getting a
57 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
57 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
58 (branch merge, don't forget to commit)
58 (branch merge, don't forget to commit)
59
59
60
60
61 Symlink is other parent, executable is local:
61 Symlink is other parent, executable is local:
62
62
63 $ if [ -h a ]; then
63 $ if [ -h a ]; then
64 > echo a is a symlink
64 > echo a is a symlink
65 > $TESTDIR/readlink.py a
65 > $TESTDIR/readlink.py a
66 > elif [ -x a ]; then
66 > elif [ -x a ]; then
67 > echo a is executable
67 > echo a is executable
68 > else
68 > else
69 > echo "a has no flags (default for conflicts)"
69 > echo "a has no flags (default for conflicts)"
70 > fi
70 > fi
71 a has no flags (default for conflicts)
71 a has no flags (default for conflicts)
72
72
@@ -1,145 +1,145 b''
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 $ hg commit -m "Merge 1"
60 $ hg commit -m "Merge 1"
61
61
62 change test-a again
62 change test-a again
63 $ cd ../test-a
63 $ cd ../test-a
64 $ cat >test.txt <<"EOF"
64 $ cat >test.txt <<"EOF"
65 > one
65 > one
66 > two-point-one
66 > two-point-one
67 > three
67 > three
68 > EOF
68 > EOF
69 $ hg commit -m "two -> two-point-one"
69 $ hg commit -m "two -> two-point-one"
70
70
71 pull and merge from test-a again
71 pull and merge from test-a again
72 $ cd ../test-b
72 $ cd ../test-b
73 $ hg pull ../test-a
73 $ hg pull ../test-a
74 pulling from ../test-a
74 pulling from ../test-a
75 searching for changes
75 searching for changes
76 adding changesets
76 adding changesets
77 adding manifests
77 adding manifests
78 adding file changes
78 adding file changes
79 added 1 changesets with 1 changes to 1 files (+1 heads)
79 added 1 changesets with 1 changes to 1 files (+1 heads)
80 (run 'hg heads' to see heads, 'hg merge' to merge)
80 (run 'hg heads' to see heads, 'hg merge' to merge)
81 $ hg merge --debug
81 $ hg merge --debug
82 searching for copies back to rev 1
82 searching for copies back to rev 1
83 resolving manifests
83 resolving manifests
84 overwrite None partial False
84 overwrite: False, partial: False
85 ancestor 96b70246a118 local 50c3a7e29886+ remote 40d11a4173a8
85 ancestor: 96b70246a118, local: 50c3a7e29886+, remote: 40d11a4173a8
86 test.txt: versions differ -> m
86 test.txt: versions differ -> m
87 preserving test.txt for resolve of test.txt
87 preserving test.txt for resolve of test.txt
88 updating: test.txt 1/1 files (100.00%)
88 updating: test.txt 1/1 files (100.00%)
89 picked tool 'internal:merge' for test.txt (binary False symlink False)
89 picked tool 'internal: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
100 <<<<<<< local
101 two-point-five
101 two-point-five
102 =======
102 =======
103 two-point-one
103 two-point-one
104 >>>>>>> other
104 >>>>>>> other
105 three
105 three
106
106
107 $ hg debugindex test.txt
107 $ hg debugindex test.txt
108 rev offset length base linkrev nodeid p1 p2
108 rev offset length base linkrev nodeid p1 p2
109 0 0 7 0 0 01365c4cca56 000000000000 000000000000
109 0 0 7 0 0 01365c4cca56 000000000000 000000000000
110 1 7 9 1 1 7b013192566a 01365c4cca56 000000000000
110 1 7 9 1 1 7b013192566a 01365c4cca56 000000000000
111 2 16 15 2 2 8fe46a3eb557 01365c4cca56 000000000000
111 2 16 15 2 2 8fe46a3eb557 01365c4cca56 000000000000
112 3 31 27 2 3 fc3148072371 7b013192566a 8fe46a3eb557
112 3 31 27 2 3 fc3148072371 7b013192566a 8fe46a3eb557
113 4 58 25 4 4 d40249267ae3 8fe46a3eb557 000000000000
113 4 58 25 4 4 d40249267ae3 8fe46a3eb557 000000000000
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
@@ -1,163 +1,163 b''
1 $ hg init t
1 $ hg init t
2 $ cd t
2 $ cd t
3
3
4 $ mkdir a
4 $ mkdir a
5 $ echo foo > a/a
5 $ echo foo > a/a
6 $ echo bar > a/b
6 $ echo bar > a/b
7 $ hg ci -Am "0"
7 $ hg ci -Am "0"
8 adding a/a
8 adding a/a
9 adding a/b
9 adding a/b
10
10
11 $ hg co -C 0
11 $ hg co -C 0
12 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
12 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
13 $ hg mv a b
13 $ hg mv a b
14 moving a/a to b/a (glob)
14 moving a/a to b/a (glob)
15 moving a/b to b/b (glob)
15 moving a/b to b/b (glob)
16 $ hg ci -m "1 mv a/ b/"
16 $ hg ci -m "1 mv a/ b/"
17
17
18 $ hg co -C 0
18 $ hg co -C 0
19 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
19 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
20 $ echo baz > a/c
20 $ echo baz > a/c
21 $ echo quux > a/d
21 $ echo quux > a/d
22 $ hg add a/c
22 $ hg add a/c
23 $ hg ci -m "2 add a/c"
23 $ hg ci -m "2 add a/c"
24 created new head
24 created new head
25
25
26 $ hg merge --debug 1
26 $ hg merge --debug 1
27 searching for copies back to rev 1
27 searching for copies back to rev 1
28 unmatched files in local:
28 unmatched files in local:
29 a/c
29 a/c
30 a/d
30 a/d
31 unmatched files in other:
31 unmatched files in other:
32 b/a
32 b/a
33 b/b
33 b/b
34 all copies found (* = to merge, ! = divergent):
34 all copies found (* = to merge, ! = divergent):
35 b/a -> a/a
35 b/a -> a/a
36 b/b -> a/b
36 b/b -> a/b
37 checking for directory renames
37 checking for directory renames
38 dir a/ -> b/
38 dir a/ -> b/
39 file a/c -> b/c
39 file a/c -> b/c
40 file a/d -> b/d
40 file a/d -> b/d
41 resolving manifests
41 resolving manifests
42 overwrite None partial False
42 overwrite: False, partial: False
43 ancestor f9b20c0d4c51 local ce36d17b18fb+ remote 397f8b00a740
43 ancestor: f9b20c0d4c51, local: ce36d17b18fb+, remote: 397f8b00a740
44 a/d: remote renamed directory to b/d -> d
44 a/d: remote renamed directory to b/d -> d
45 a/c: remote renamed directory to b/c -> d
45 a/c: remote renamed directory to b/c -> d
46 a/b: other deleted -> r
46 a/b: other deleted -> r
47 a/a: other deleted -> r
47 a/a: other deleted -> r
48 b/a: remote created -> g
48 b/a: remote created -> g
49 b/b: remote created -> g
49 b/b: remote created -> g
50 updating: a/a 1/6 files (16.67%)
50 updating: a/a 1/6 files (16.67%)
51 removing a/a
51 removing a/a
52 updating: a/b 2/6 files (33.33%)
52 updating: a/b 2/6 files (33.33%)
53 removing a/b
53 removing a/b
54 updating: a/c 3/6 files (50.00%)
54 updating: a/c 3/6 files (50.00%)
55 moving a/c to b/c
55 moving a/c to b/c
56 updating: a/d 4/6 files (66.67%)
56 updating: a/d 4/6 files (66.67%)
57 moving a/d to b/d
57 moving a/d to b/d
58 updating: b/a 5/6 files (83.33%)
58 updating: b/a 5/6 files (83.33%)
59 getting b/a
59 getting b/a
60 updating: b/b 6/6 files (100.00%)
60 updating: b/b 6/6 files (100.00%)
61 getting b/b
61 getting b/b
62 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
62 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
63 (branch merge, don't forget to commit)
63 (branch merge, don't forget to commit)
64
64
65 $ echo a/* b/*
65 $ echo a/* b/*
66 a/* b/a b/b b/c b/d
66 a/* b/a b/b b/c b/d
67 $ hg st -C
67 $ hg st -C
68 M b/a
68 M b/a
69 M b/b
69 M b/b
70 A b/c
70 A b/c
71 a/c
71 a/c
72 R a/a
72 R a/a
73 R a/b
73 R a/b
74 R a/c
74 R a/c
75 ? b/d
75 ? b/d
76 $ hg ci -m "3 merge 2+1"
76 $ hg ci -m "3 merge 2+1"
77 $ hg debugrename b/c
77 $ hg debugrename b/c
78 b/c renamed from a/c:354ae8da6e890359ef49ade27b68bbc361f3ca88 (glob)
78 b/c renamed from a/c:354ae8da6e890359ef49ade27b68bbc361f3ca88 (glob)
79
79
80 $ hg co -C 1
80 $ hg co -C 1
81 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
81 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
82 $ hg merge --debug 2
82 $ hg merge --debug 2
83 searching for copies back to rev 1
83 searching for copies back to rev 1
84 unmatched files in local:
84 unmatched files in local:
85 b/a
85 b/a
86 b/b
86 b/b
87 b/d
87 b/d
88 unmatched files in other:
88 unmatched files in other:
89 a/c
89 a/c
90 all copies found (* = to merge, ! = divergent):
90 all copies found (* = to merge, ! = divergent):
91 b/a -> a/a
91 b/a -> a/a
92 b/b -> a/b
92 b/b -> a/b
93 checking for directory renames
93 checking for directory renames
94 dir a/ -> b/
94 dir a/ -> b/
95 file a/c -> b/c
95 file a/c -> b/c
96 resolving manifests
96 resolving manifests
97 overwrite None partial False
97 overwrite: False, partial: False
98 ancestor f9b20c0d4c51 local 397f8b00a740+ remote ce36d17b18fb
98 ancestor: f9b20c0d4c51, local: 397f8b00a740+, remote: ce36d17b18fb
99 None: local renamed directory to b/c -> d
99 None: local renamed directory to b/c -> d
100 updating:None 1/1 files (100.00%)
100 updating:None 1/1 files (100.00%)
101 getting a/c to b/c
101 getting a/c to b/c
102 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
102 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
103 (branch merge, don't forget to commit)
103 (branch merge, don't forget to commit)
104
104
105 $ echo a/* b/*
105 $ echo a/* b/*
106 a/* b/a b/b b/c b/d
106 a/* b/a b/b b/c b/d
107 $ hg st -C
107 $ hg st -C
108 A b/c
108 A b/c
109 a/c
109 a/c
110 ? b/d
110 ? b/d
111 $ hg ci -m "4 merge 1+2"
111 $ hg ci -m "4 merge 1+2"
112 created new head
112 created new head
113 $ hg debugrename b/c
113 $ hg debugrename b/c
114 b/c renamed from a/c:354ae8da6e890359ef49ade27b68bbc361f3ca88 (glob)
114 b/c renamed from a/c:354ae8da6e890359ef49ade27b68bbc361f3ca88 (glob)
115
115
116
116
117 Second scenario with two repos:
117 Second scenario with two repos:
118
118
119 $ cd ..
119 $ cd ..
120 $ hg init r1
120 $ hg init r1
121 $ cd r1
121 $ cd r1
122 $ mkdir a
122 $ mkdir a
123 $ echo foo > a/f
123 $ echo foo > a/f
124 $ hg add a
124 $ hg add a
125 adding a/f (glob)
125 adding a/f (glob)
126 $ hg ci -m "a/f == foo"
126 $ hg ci -m "a/f == foo"
127 $ cd ..
127 $ cd ..
128
128
129 $ hg clone r1 r2
129 $ hg clone r1 r2
130 updating to branch default
130 updating to branch default
131 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
131 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
132 $ cd r2
132 $ cd r2
133 $ hg mv a b
133 $ hg mv a b
134 moving a/f to b/f (glob)
134 moving a/f to b/f (glob)
135 $ echo foo1 > b/f
135 $ echo foo1 > b/f
136 $ hg ci -m" a -> b, b/f == foo1"
136 $ hg ci -m" a -> b, b/f == foo1"
137 $ cd ..
137 $ cd ..
138
138
139 $ cd r1
139 $ cd r1
140 $ mkdir a/aa
140 $ mkdir a/aa
141 $ echo bar > a/aa/g
141 $ echo bar > a/aa/g
142 $ hg add a/aa
142 $ hg add a/aa
143 adding a/aa/g (glob)
143 adding a/aa/g (glob)
144 $ hg ci -m "a/aa/g"
144 $ hg ci -m "a/aa/g"
145 $ hg pull ../r2
145 $ hg pull ../r2
146 pulling from ../r2
146 pulling from ../r2
147 searching for changes
147 searching for changes
148 adding changesets
148 adding changesets
149 adding manifests
149 adding manifests
150 adding file changes
150 adding file changes
151 added 1 changesets with 1 changes to 1 files (+1 heads)
151 added 1 changesets with 1 changes to 1 files (+1 heads)
152 (run 'hg heads' to see heads, 'hg merge' to merge)
152 (run 'hg heads' to see heads, 'hg merge' to merge)
153
153
154 $ hg merge
154 $ hg merge
155 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
155 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
156 (branch merge, don't forget to commit)
156 (branch merge, don't forget to commit)
157
157
158 $ hg st -C
158 $ hg st -C
159 M b/f
159 M b/f
160 A b/aa/g
160 A b/aa/g
161 a/aa/g
161 a/aa/g
162 R a/aa/g
162 R a/aa/g
163 R a/f
163 R a/f
@@ -1,157 +1,157 b''
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):
31 all copies found (* = to merge, ! = divergent):
32 c2 -> a2 !
32 c2 -> a2 !
33 b -> a *
33 b -> a *
34 b2 -> a2 !
34 b2 -> a2 !
35 checking for directory renames
35 checking for directory renames
36 a2: divergent renames -> dr
36 a2: divergent renames -> dr
37 resolving manifests
37 resolving manifests
38 overwrite None partial False
38 overwrite: False, partial: False
39 ancestor af1939970a1c local 044f8520aeeb+ remote 85c198ef2f6c
39 ancestor: af1939970a1c, local: 044f8520aeeb+, remote: 85c198ef2f6c
40 a: remote moved to b -> m
40 a: remote moved to b -> m
41 b2: remote created -> g
41 b2: remote created -> g
42 preserving a for resolve of b
42 preserving a for resolve of b
43 removing a
43 removing a
44 updating: a 1/3 files (33.33%)
44 updating: a 1/3 files (33.33%)
45 picked tool 'internal:merge' for b (binary False symlink False)
45 picked tool 'internal:merge' for b (binary False symlink False)
46 merging a and b to b
46 merging a and b to b
47 my b@044f8520aeeb+ other b@85c198ef2f6c ancestor a@af1939970a1c
47 my b@044f8520aeeb+ other b@85c198ef2f6c ancestor a@af1939970a1c
48 premerge successful
48 premerge successful
49 updating: a2 2/3 files (66.67%)
49 updating: a2 2/3 files (66.67%)
50 note: possible conflict - a2 was renamed multiple times to:
50 note: possible conflict - a2 was renamed multiple times to:
51 c2
51 c2
52 b2
52 b2
53 updating: b2 3/3 files (100.00%)
53 updating: b2 3/3 files (100.00%)
54 getting b2
54 getting b2
55 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
55 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
56 (branch merge, don't forget to commit)
56 (branch merge, don't forget to commit)
57
57
58 $ hg status -AC
58 $ hg status -AC
59 M b
59 M b
60 a
60 a
61 M b2
61 M b2
62 R a
62 R a
63 C c2
63 C c2
64
64
65 $ cat b
65 $ cat b
66 blahblah
66 blahblah
67
67
68 $ hg ci -m "merge"
68 $ hg ci -m "merge"
69
69
70 $ hg debugindex b
70 $ hg debugindex b
71 rev offset length base linkrev nodeid p1 p2
71 rev offset length base linkrev nodeid p1 p2
72 0 0 67 0 1 57eacc201a7f 000000000000 000000000000
72 0 0 67 0 1 57eacc201a7f 000000000000 000000000000
73 1 67 72 1 3 4727ba907962 000000000000 57eacc201a7f
73 1 67 72 1 3 4727ba907962 000000000000 57eacc201a7f
74
74
75 $ hg debugrename b
75 $ hg debugrename b
76 b renamed from a:dd03b83622e78778b403775d0d074b9ac7387a66
76 b renamed from a:dd03b83622e78778b403775d0d074b9ac7387a66
77
77
78 This used to trigger a "divergent renames" warning, despite no renames
78 This used to trigger a "divergent renames" warning, despite no renames
79
79
80 $ hg cp b b3
80 $ hg cp b b3
81 $ hg cp b b4
81 $ hg cp b b4
82 $ hg ci -A -m 'copy b twice'
82 $ hg ci -A -m 'copy b twice'
83 $ hg up eb92d88a9712
83 $ hg up eb92d88a9712
84 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
84 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
85 $ hg up
85 $ hg up
86 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
86 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
87 $ hg rm b3 b4
87 $ hg rm b3 b4
88 $ hg ci -m 'clean up a bit of our mess'
88 $ hg ci -m 'clean up a bit of our mess'
89
89
90 We'd rather not warn on divergent renames done in the same changeset (issue2113)
90 We'd rather not warn on divergent renames done in the same changeset (issue2113)
91
91
92 $ hg cp b b3
92 $ hg cp b b3
93 $ hg mv b b4
93 $ hg mv b b4
94 $ hg ci -A -m 'divergent renames in same changeset'
94 $ hg ci -A -m 'divergent renames in same changeset'
95 $ hg up c761c6948de0
95 $ hg up c761c6948de0
96 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
96 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
97 $ hg up
97 $ hg up
98 note: possible conflict - b was renamed multiple times to:
98 note: possible conflict - b was renamed multiple times to:
99 b3
99 b3
100 b4
100 b4
101 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
101 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
102
102
103 Check for issue2642
103 Check for issue2642
104
104
105 $ hg init t
105 $ hg init t
106 $ cd t
106 $ cd t
107
107
108 $ echo c0 > f1
108 $ echo c0 > f1
109 $ hg ci -Aqm0
109 $ hg ci -Aqm0
110
110
111 $ hg up null -q
111 $ hg up null -q
112 $ echo c1 > f1 # backport
112 $ echo c1 > f1 # backport
113 $ hg ci -Aqm1
113 $ hg ci -Aqm1
114 $ hg mv f1 f2
114 $ hg mv f1 f2
115 $ hg ci -qm2
115 $ hg ci -qm2
116
116
117 $ hg up 0 -q
117 $ hg up 0 -q
118 $ hg merge 1 -q --tool internal:local
118 $ hg merge 1 -q --tool internal:local
119 $ hg ci -qm3
119 $ hg ci -qm3
120
120
121 $ hg merge 2
121 $ hg merge 2
122 merging f1 and f2 to f2
122 merging f1 and f2 to f2
123 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
123 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
124 (branch merge, don't forget to commit)
124 (branch merge, don't forget to commit)
125
125
126 $ cat f2
126 $ cat f2
127 c0
127 c0
128
128
129 Check for issue2089
129 Check for issue2089
130
130
131 $ hg init repo2089
131 $ hg init repo2089
132 $ cd repo2089
132 $ cd repo2089
133
133
134 $ echo c0 > f1
134 $ echo c0 > f1
135 $ hg ci -Aqm0
135 $ hg ci -Aqm0
136
136
137 $ hg up null -q
137 $ hg up null -q
138 $ echo c1 > f1
138 $ echo c1 > f1
139 $ hg ci -Aqm1
139 $ hg ci -Aqm1
140
140
141 $ hg up 0 -q
141 $ hg up 0 -q
142 $ hg merge 1 -q --tool internal:local
142 $ hg merge 1 -q --tool internal:local
143 $ echo c2 > f1
143 $ echo c2 > f1
144 $ hg ci -qm2
144 $ hg ci -qm2
145
145
146 $ hg up 1 -q
146 $ hg up 1 -q
147 $ hg mv f1 f2
147 $ hg mv f1 f2
148 $ hg ci -Aqm3
148 $ hg ci -Aqm3
149
149
150 $ hg up 2 -q
150 $ hg up 2 -q
151 $ hg merge 3
151 $ hg merge 3
152 merging f1 and f2 to f2
152 merging f1 and f2 to f2
153 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
153 0 files updated, 1 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 $ cat f2
156 $ cat f2
157 c2
157 c2
@@ -1,752 +1,752 b''
1
1
2 $ mkdir -p t
2 $ mkdir -p t
3 $ cd t
3 $ cd t
4 $ cat <<EOF > merge
4 $ cat <<EOF > merge
5 > import sys, os
5 > import sys, os
6 > f = open(sys.argv[1], "wb")
6 > f = open(sys.argv[1], "wb")
7 > f.write("merge %s %s %s" % (sys.argv[1], sys.argv[2], sys.argv[3]))
7 > f.write("merge %s %s %s" % (sys.argv[1], sys.argv[2], sys.argv[3]))
8 > f.close()
8 > f.close()
9 > EOF
9 > EOF
10
10
11 perform a test merge with possible renaming
11 perform a test merge with possible renaming
12 args:
12 args:
13 $1 = action in local branch
13 $1 = action in local branch
14 $2 = action in remote branch
14 $2 = action in remote branch
15 $3 = action in working dir
15 $3 = action in working dir
16 $4 = expected result
16 $4 = expected result
17
17
18 $ tm()
18 $ tm()
19 > {
19 > {
20 > hg init t
20 > hg init t
21 > cd t
21 > cd t
22 > echo "[merge]" >> .hg/hgrc
22 > echo "[merge]" >> .hg/hgrc
23 > echo "followcopies = 1" >> .hg/hgrc
23 > echo "followcopies = 1" >> .hg/hgrc
24 >
24 >
25 > # base
25 > # base
26 > echo base > a
26 > echo base > a
27 > echo base > rev # used to force commits
27 > echo base > rev # used to force commits
28 > hg add a rev
28 > hg add a rev
29 > hg ci -m "base"
29 > hg ci -m "base"
30 >
30 >
31 > # remote
31 > # remote
32 > echo remote > rev
32 > echo remote > rev
33 > if [ "$2" != "" ] ; then $2 ; fi
33 > if [ "$2" != "" ] ; then $2 ; fi
34 > hg ci -m "remote"
34 > hg ci -m "remote"
35 >
35 >
36 > # local
36 > # local
37 > hg co -q 0
37 > hg co -q 0
38 > echo local > rev
38 > echo local > rev
39 > if [ "$1" != "" ] ; then $1 ; fi
39 > if [ "$1" != "" ] ; then $1 ; fi
40 > hg ci -m "local"
40 > hg ci -m "local"
41 >
41 >
42 > # working dir
42 > # working dir
43 > echo local > rev
43 > echo local > rev
44 > if [ "$3" != "" ] ; then $3 ; fi
44 > if [ "$3" != "" ] ; then $3 ; fi
45 >
45 >
46 > # merge
46 > # merge
47 > echo "--------------"
47 > echo "--------------"
48 > echo "test L:$1 R:$2 W:$3 - $4"
48 > echo "test L:$1 R:$2 W:$3 - $4"
49 > echo "--------------"
49 > echo "--------------"
50 > hg merge -y --debug --traceback --tool="python ../merge"
50 > hg merge -y --debug --traceback --tool="python ../merge"
51 >
51 >
52 > echo "--------------"
52 > echo "--------------"
53 > hg status -camC -X rev
53 > hg status -camC -X rev
54 >
54 >
55 > hg ci -m "merge"
55 > hg ci -m "merge"
56 >
56 >
57 > echo "--------------"
57 > echo "--------------"
58 > echo
58 > echo
59 >
59 >
60 > cd ..
60 > cd ..
61 > rm -r t
61 > rm -r t
62 > }
62 > }
63 $ up() {
63 $ up() {
64 > cp rev $1
64 > cp rev $1
65 > hg add $1 2> /dev/null
65 > hg add $1 2> /dev/null
66 > if [ "$2" != "" ] ; then
66 > if [ "$2" != "" ] ; then
67 > cp rev $2
67 > cp rev $2
68 > hg add $2 2> /dev/null
68 > hg add $2 2> /dev/null
69 > fi
69 > fi
70 > }
70 > }
71 $ uc() { up $1; hg cp $1 $2; } # update + copy
71 $ uc() { up $1; hg cp $1 $2; } # update + copy
72 $ um() { up $1; hg mv $1 $2; }
72 $ um() { up $1; hg mv $1 $2; }
73 $ nc() { hg cp $1 $2; } # just copy
73 $ nc() { hg cp $1 $2; } # just copy
74 $ nm() { hg mv $1 $2; } # just move
74 $ nm() { hg mv $1 $2; } # just move
75 $ tm "up a " "nc a b" " " "1 get local a to b"
75 $ tm "up a " "nc a b" " " "1 get local a to b"
76 created new head
76 created new head
77 --------------
77 --------------
78 test L:up a R:nc a b W: - 1 get local a to b
78 test L:up a R:nc a b W: - 1 get local a to b
79 --------------
79 --------------
80 searching for copies back to rev 1
80 searching for copies back to rev 1
81 unmatched files in other:
81 unmatched files in other:
82 b
82 b
83 all copies found (* = to merge, ! = divergent):
83 all copies found (* = to merge, ! = divergent):
84 b -> a *
84 b -> a *
85 checking for directory renames
85 checking for directory renames
86 resolving manifests
86 resolving manifests
87 overwrite None partial False
87 overwrite: False, partial: False
88 ancestor 924404dff337 local e300d1c794ec+ remote 4ce40f5aca24
88 ancestor: 924404dff337, local: e300d1c794ec+, remote: 4ce40f5aca24
89 rev: versions differ -> m
89 rev: versions differ -> m
90 a: remote copied to b -> m
90 a: remote copied to b -> m
91 preserving a for resolve of b
91 preserving a for resolve of b
92 preserving rev for resolve of rev
92 preserving rev for resolve of rev
93 updating: a 1/2 files (50.00%)
93 updating: a 1/2 files (50.00%)
94 picked tool 'python ../merge' for b (binary False symlink False)
94 picked tool 'python ../merge' for b (binary False symlink False)
95 merging a and b to b
95 merging a and b to b
96 my b@e300d1c794ec+ other b@4ce40f5aca24 ancestor a@924404dff337
96 my b@e300d1c794ec+ other b@4ce40f5aca24 ancestor a@924404dff337
97 premerge successful
97 premerge successful
98 updating: rev 2/2 files (100.00%)
98 updating: rev 2/2 files (100.00%)
99 picked tool 'python ../merge' for rev (binary False symlink False)
99 picked tool 'python ../merge' for rev (binary False symlink False)
100 merging rev
100 merging rev
101 my rev@e300d1c794ec+ other rev@4ce40f5aca24 ancestor rev@924404dff337
101 my rev@e300d1c794ec+ other rev@4ce40f5aca24 ancestor rev@924404dff337
102 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
102 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
103 (branch merge, don't forget to commit)
103 (branch merge, don't forget to commit)
104 --------------
104 --------------
105 M b
105 M b
106 a
106 a
107 C a
107 C a
108 --------------
108 --------------
109
109
110 $ tm "nc a b" "up a " " " "2 get rem change to a and b"
110 $ tm "nc a b" "up a " " " "2 get rem change to a and b"
111 created new head
111 created new head
112 --------------
112 --------------
113 test L:nc a b R:up a W: - 2 get rem change to a and b
113 test L:nc a b R:up a W: - 2 get rem change to a and b
114 --------------
114 --------------
115 searching for copies back to rev 1
115 searching for copies back to rev 1
116 unmatched files in local:
116 unmatched files in local:
117 b
117 b
118 all copies found (* = to merge, ! = divergent):
118 all copies found (* = to merge, ! = divergent):
119 b -> a *
119 b -> a *
120 checking for directory renames
120 checking for directory renames
121 resolving manifests
121 resolving manifests
122 overwrite None partial False
122 overwrite: False, partial: False
123 ancestor 924404dff337 local 86a2aa42fc76+ remote f4db7e329e71
123 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: f4db7e329e71
124 a: remote is newer -> g
124 a: remote is newer -> g
125 b: local copied/moved to a -> m
125 b: local copied/moved to a -> m
126 rev: versions differ -> m
126 rev: versions differ -> m
127 preserving b for resolve of b
127 preserving b for resolve of b
128 preserving rev for resolve of rev
128 preserving rev for resolve of rev
129 updating: a 1/3 files (33.33%)
129 updating: a 1/3 files (33.33%)
130 getting a
130 getting a
131 updating: b 2/3 files (66.67%)
131 updating: b 2/3 files (66.67%)
132 picked tool 'python ../merge' for b (binary False symlink False)
132 picked tool 'python ../merge' for b (binary False symlink False)
133 merging b and a to b
133 merging b and a to b
134 my b@86a2aa42fc76+ other a@f4db7e329e71 ancestor a@924404dff337
134 my b@86a2aa42fc76+ other a@f4db7e329e71 ancestor a@924404dff337
135 premerge successful
135 premerge successful
136 updating: rev 3/3 files (100.00%)
136 updating: rev 3/3 files (100.00%)
137 picked tool 'python ../merge' for rev (binary False symlink False)
137 picked tool 'python ../merge' for rev (binary False symlink False)
138 merging rev
138 merging rev
139 my rev@86a2aa42fc76+ other rev@f4db7e329e71 ancestor rev@924404dff337
139 my rev@86a2aa42fc76+ other rev@f4db7e329e71 ancestor rev@924404dff337
140 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
140 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
141 (branch merge, don't forget to commit)
141 (branch merge, don't forget to commit)
142 --------------
142 --------------
143 M a
143 M a
144 M b
144 M b
145 a
145 a
146 --------------
146 --------------
147
147
148 $ tm "up a " "nm a b" " " "3 get local a change to b, remove a"
148 $ tm "up a " "nm a b" " " "3 get local a change to b, remove a"
149 created new head
149 created new head
150 --------------
150 --------------
151 test L:up a R:nm a b W: - 3 get local a change to b, remove a
151 test L:up a R:nm a b W: - 3 get local a change to b, remove a
152 --------------
152 --------------
153 searching for copies back to rev 1
153 searching for copies back to rev 1
154 unmatched files in other:
154 unmatched files in other:
155 b
155 b
156 all copies found (* = to merge, ! = divergent):
156 all copies found (* = to merge, ! = divergent):
157 b -> a *
157 b -> a *
158 checking for directory renames
158 checking for directory renames
159 resolving manifests
159 resolving manifests
160 overwrite None partial False
160 overwrite: False, partial: False
161 ancestor 924404dff337 local e300d1c794ec+ remote bdb19105162a
161 ancestor: 924404dff337, local: e300d1c794ec+, remote: bdb19105162a
162 rev: versions differ -> m
162 rev: versions differ -> m
163 a: remote moved to b -> m
163 a: remote moved to b -> m
164 preserving a for resolve of b
164 preserving a for resolve of b
165 preserving rev for resolve of rev
165 preserving rev for resolve of rev
166 removing a
166 removing a
167 updating: a 1/2 files (50.00%)
167 updating: a 1/2 files (50.00%)
168 picked tool 'python ../merge' for b (binary False symlink False)
168 picked tool 'python ../merge' for b (binary False symlink False)
169 merging a and b to b
169 merging a and b to b
170 my b@e300d1c794ec+ other b@bdb19105162a ancestor a@924404dff337
170 my b@e300d1c794ec+ other b@bdb19105162a ancestor a@924404dff337
171 premerge successful
171 premerge successful
172 updating: rev 2/2 files (100.00%)
172 updating: rev 2/2 files (100.00%)
173 picked tool 'python ../merge' for rev (binary False symlink False)
173 picked tool 'python ../merge' for rev (binary False symlink False)
174 merging rev
174 merging rev
175 my rev@e300d1c794ec+ other rev@bdb19105162a ancestor rev@924404dff337
175 my rev@e300d1c794ec+ other rev@bdb19105162a ancestor rev@924404dff337
176 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
176 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
177 (branch merge, don't forget to commit)
177 (branch merge, don't forget to commit)
178 --------------
178 --------------
179 M b
179 M b
180 a
180 a
181 --------------
181 --------------
182
182
183 $ tm "nm a b" "up a " " " "4 get remote change to b"
183 $ tm "nm a b" "up a " " " "4 get remote change to b"
184 created new head
184 created new head
185 --------------
185 --------------
186 test L:nm a b R:up a W: - 4 get remote change to b
186 test L:nm a b R:up a W: - 4 get remote change to b
187 --------------
187 --------------
188 searching for copies back to rev 1
188 searching for copies back to rev 1
189 unmatched files in local:
189 unmatched files in local:
190 b
190 b
191 all copies found (* = to merge, ! = divergent):
191 all copies found (* = to merge, ! = divergent):
192 b -> a *
192 b -> a *
193 checking for directory renames
193 checking for directory renames
194 resolving manifests
194 resolving manifests
195 overwrite None partial False
195 overwrite: False, partial: False
196 ancestor 924404dff337 local 02963e448370+ remote f4db7e329e71
196 ancestor: 924404dff337, local: 02963e448370+, remote: f4db7e329e71
197 b: local copied/moved to a -> m
197 b: local copied/moved to a -> m
198 rev: versions differ -> m
198 rev: versions differ -> m
199 preserving b for resolve of b
199 preserving b for resolve of b
200 preserving rev for resolve of rev
200 preserving rev for resolve of rev
201 updating: b 1/2 files (50.00%)
201 updating: b 1/2 files (50.00%)
202 picked tool 'python ../merge' for b (binary False symlink False)
202 picked tool 'python ../merge' for b (binary False symlink False)
203 merging b and a to b
203 merging b and a to b
204 my b@02963e448370+ other a@f4db7e329e71 ancestor a@924404dff337
204 my b@02963e448370+ other a@f4db7e329e71 ancestor a@924404dff337
205 premerge successful
205 premerge successful
206 updating: rev 2/2 files (100.00%)
206 updating: rev 2/2 files (100.00%)
207 picked tool 'python ../merge' for rev (binary False symlink False)
207 picked tool 'python ../merge' for rev (binary False symlink False)
208 merging rev
208 merging rev
209 my rev@02963e448370+ other rev@f4db7e329e71 ancestor rev@924404dff337
209 my rev@02963e448370+ other rev@f4db7e329e71 ancestor rev@924404dff337
210 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
210 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
211 (branch merge, don't forget to commit)
211 (branch merge, don't forget to commit)
212 --------------
212 --------------
213 M b
213 M b
214 a
214 a
215 --------------
215 --------------
216
216
217 $ tm " " "nc a b" " " "5 get b"
217 $ tm " " "nc a b" " " "5 get b"
218 created new head
218 created new head
219 --------------
219 --------------
220 test L: R:nc a b W: - 5 get b
220 test L: R:nc a b W: - 5 get b
221 --------------
221 --------------
222 searching for copies back to rev 1
222 searching for copies back to rev 1
223 unmatched files in other:
223 unmatched files in other:
224 b
224 b
225 all copies found (* = to merge, ! = divergent):
225 all copies found (* = to merge, ! = divergent):
226 b -> a
226 b -> a
227 checking for directory renames
227 checking for directory renames
228 resolving manifests
228 resolving manifests
229 overwrite None partial False
229 overwrite: False, partial: False
230 ancestor 924404dff337 local 94b33a1b7f2d+ remote 4ce40f5aca24
230 ancestor: 924404dff337, local: 94b33a1b7f2d+, remote: 4ce40f5aca24
231 rev: versions differ -> m
231 rev: versions differ -> m
232 b: remote created -> g
232 b: remote created -> g
233 preserving rev for resolve of rev
233 preserving rev for resolve of rev
234 updating: b 1/2 files (50.00%)
234 updating: b 1/2 files (50.00%)
235 getting b
235 getting b
236 updating: rev 2/2 files (100.00%)
236 updating: rev 2/2 files (100.00%)
237 picked tool 'python ../merge' for rev (binary False symlink False)
237 picked tool 'python ../merge' for rev (binary False symlink False)
238 merging rev
238 merging rev
239 my rev@94b33a1b7f2d+ other rev@4ce40f5aca24 ancestor rev@924404dff337
239 my rev@94b33a1b7f2d+ other rev@4ce40f5aca24 ancestor rev@924404dff337
240 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
240 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
241 (branch merge, don't forget to commit)
241 (branch merge, don't forget to commit)
242 --------------
242 --------------
243 M b
243 M b
244 C a
244 C a
245 --------------
245 --------------
246
246
247 $ tm "nc a b" " " " " "6 nothing"
247 $ tm "nc a b" " " " " "6 nothing"
248 created new head
248 created new head
249 --------------
249 --------------
250 test L:nc a b R: W: - 6 nothing
250 test L:nc a b R: W: - 6 nothing
251 --------------
251 --------------
252 searching for copies back to rev 1
252 searching for copies back to rev 1
253 unmatched files in local:
253 unmatched files in local:
254 b
254 b
255 all copies found (* = to merge, ! = divergent):
255 all copies found (* = to merge, ! = divergent):
256 b -> a
256 b -> a
257 checking for directory renames
257 checking for directory renames
258 resolving manifests
258 resolving manifests
259 overwrite None partial False
259 overwrite: False, partial: False
260 ancestor 924404dff337 local 86a2aa42fc76+ remote 97c705ade336
260 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 97c705ade336
261 rev: versions differ -> m
261 rev: versions differ -> m
262 preserving rev for resolve of rev
262 preserving rev for resolve of rev
263 updating: rev 1/1 files (100.00%)
263 updating: rev 1/1 files (100.00%)
264 picked tool 'python ../merge' for rev (binary False symlink False)
264 picked tool 'python ../merge' for rev (binary False symlink False)
265 merging rev
265 merging rev
266 my rev@86a2aa42fc76+ other rev@97c705ade336 ancestor rev@924404dff337
266 my rev@86a2aa42fc76+ other rev@97c705ade336 ancestor rev@924404dff337
267 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
267 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
268 (branch merge, don't forget to commit)
268 (branch merge, don't forget to commit)
269 --------------
269 --------------
270 C a
270 C a
271 C b
271 C b
272 --------------
272 --------------
273
273
274 $ tm " " "nm a b" " " "7 get b"
274 $ tm " " "nm a b" " " "7 get b"
275 created new head
275 created new head
276 --------------
276 --------------
277 test L: R:nm a b W: - 7 get b
277 test L: R:nm a b W: - 7 get b
278 --------------
278 --------------
279 searching for copies back to rev 1
279 searching for copies back to rev 1
280 unmatched files in other:
280 unmatched files in other:
281 b
281 b
282 all copies found (* = to merge, ! = divergent):
282 all copies found (* = to merge, ! = divergent):
283 b -> a
283 b -> a
284 checking for directory renames
284 checking for directory renames
285 resolving manifests
285 resolving manifests
286 overwrite None partial False
286 overwrite: False, partial: False
287 ancestor 924404dff337 local 94b33a1b7f2d+ remote bdb19105162a
287 ancestor: 924404dff337, local: 94b33a1b7f2d+, remote: bdb19105162a
288 a: other deleted -> r
288 a: other deleted -> r
289 rev: versions differ -> m
289 rev: versions differ -> m
290 b: remote created -> g
290 b: remote created -> g
291 preserving rev for resolve of rev
291 preserving rev for resolve of rev
292 updating: a 1/3 files (33.33%)
292 updating: a 1/3 files (33.33%)
293 removing a
293 removing a
294 updating: b 2/3 files (66.67%)
294 updating: b 2/3 files (66.67%)
295 getting b
295 getting b
296 updating: rev 3/3 files (100.00%)
296 updating: rev 3/3 files (100.00%)
297 picked tool 'python ../merge' for rev (binary False symlink False)
297 picked tool 'python ../merge' for rev (binary False symlink False)
298 merging rev
298 merging rev
299 my rev@94b33a1b7f2d+ other rev@bdb19105162a ancestor rev@924404dff337
299 my rev@94b33a1b7f2d+ other rev@bdb19105162a ancestor rev@924404dff337
300 1 files updated, 1 files merged, 1 files removed, 0 files unresolved
300 1 files updated, 1 files merged, 1 files removed, 0 files unresolved
301 (branch merge, don't forget to commit)
301 (branch merge, don't forget to commit)
302 --------------
302 --------------
303 M b
303 M b
304 --------------
304 --------------
305
305
306 $ tm "nm a b" " " " " "8 nothing"
306 $ tm "nm a b" " " " " "8 nothing"
307 created new head
307 created new head
308 --------------
308 --------------
309 test L:nm a b R: W: - 8 nothing
309 test L:nm a b R: W: - 8 nothing
310 --------------
310 --------------
311 searching for copies back to rev 1
311 searching for copies back to rev 1
312 unmatched files in local:
312 unmatched files in local:
313 b
313 b
314 all copies found (* = to merge, ! = divergent):
314 all copies found (* = to merge, ! = divergent):
315 b -> a
315 b -> a
316 checking for directory renames
316 checking for directory renames
317 resolving manifests
317 resolving manifests
318 overwrite None partial False
318 overwrite: False, partial: False
319 ancestor 924404dff337 local 02963e448370+ remote 97c705ade336
319 ancestor: 924404dff337, local: 02963e448370+, remote: 97c705ade336
320 rev: versions differ -> m
320 rev: versions differ -> m
321 preserving rev for resolve of rev
321 preserving rev for resolve of rev
322 updating: rev 1/1 files (100.00%)
322 updating: rev 1/1 files (100.00%)
323 picked tool 'python ../merge' for rev (binary False symlink False)
323 picked tool 'python ../merge' for rev (binary False symlink False)
324 merging rev
324 merging rev
325 my rev@02963e448370+ other rev@97c705ade336 ancestor rev@924404dff337
325 my rev@02963e448370+ other rev@97c705ade336 ancestor rev@924404dff337
326 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
326 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
327 (branch merge, don't forget to commit)
327 (branch merge, don't forget to commit)
328 --------------
328 --------------
329 C b
329 C b
330 --------------
330 --------------
331
331
332 $ tm "um a b" "um a b" " " "9 do merge with ancestor in a"
332 $ tm "um a b" "um a b" " " "9 do merge with ancestor in a"
333 created new head
333 created new head
334 --------------
334 --------------
335 test L:um a b R:um a b W: - 9 do merge with ancestor in a
335 test L:um a b R:um a b W: - 9 do merge with ancestor in a
336 --------------
336 --------------
337 searching for copies back to rev 1
337 searching for copies back to rev 1
338 resolving manifests
338 resolving manifests
339 overwrite None partial False
339 overwrite: False, partial: False
340 ancestor 924404dff337 local 62e7bf090eba+ remote 49b6d8032493
340 ancestor: 924404dff337, local: 62e7bf090eba+, remote: 49b6d8032493
341 b: versions differ -> m
341 b: versions differ -> m
342 rev: versions differ -> m
342 rev: versions differ -> m
343 preserving b for resolve of b
343 preserving b for resolve of b
344 preserving rev for resolve of rev
344 preserving rev for resolve of rev
345 updating: b 1/2 files (50.00%)
345 updating: b 1/2 files (50.00%)
346 picked tool 'python ../merge' for b (binary False symlink False)
346 picked tool 'python ../merge' for b (binary False symlink False)
347 merging b
347 merging b
348 my b@62e7bf090eba+ other b@49b6d8032493 ancestor a@924404dff337
348 my b@62e7bf090eba+ other b@49b6d8032493 ancestor a@924404dff337
349 updating: rev 2/2 files (100.00%)
349 updating: rev 2/2 files (100.00%)
350 picked tool 'python ../merge' for rev (binary False symlink False)
350 picked tool 'python ../merge' for rev (binary False symlink False)
351 merging rev
351 merging rev
352 my rev@62e7bf090eba+ other rev@49b6d8032493 ancestor rev@924404dff337
352 my rev@62e7bf090eba+ other rev@49b6d8032493 ancestor rev@924404dff337
353 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
353 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
354 (branch merge, don't forget to commit)
354 (branch merge, don't forget to commit)
355 --------------
355 --------------
356 M b
356 M b
357 --------------
357 --------------
358
358
359
359
360 m "um a c" "um x c" " " "10 do merge with no ancestor"
360 m "um a c" "um x c" " " "10 do merge with no ancestor"
361
361
362 $ tm "nm a b" "nm a c" " " "11 get c, keep b"
362 $ tm "nm a b" "nm a c" " " "11 get c, keep b"
363 created new head
363 created new head
364 --------------
364 --------------
365 test L:nm a b R:nm a c W: - 11 get c, keep b
365 test L:nm a b R:nm a c W: - 11 get c, keep b
366 --------------
366 --------------
367 searching for copies back to rev 1
367 searching for copies back to rev 1
368 unmatched files in local:
368 unmatched files in local:
369 b
369 b
370 unmatched files in other:
370 unmatched files in other:
371 c
371 c
372 all copies found (* = to merge, ! = divergent):
372 all copies found (* = to merge, ! = divergent):
373 c -> a !
373 c -> a !
374 b -> a !
374 b -> a !
375 checking for directory renames
375 checking for directory renames
376 a: divergent renames -> dr
376 a: divergent renames -> dr
377 resolving manifests
377 resolving manifests
378 overwrite None partial False
378 overwrite: False, partial: False
379 ancestor 924404dff337 local 02963e448370+ remote fe905ef2c33e
379 ancestor: 924404dff337, local: 02963e448370+, remote: fe905ef2c33e
380 rev: versions differ -> m
380 rev: versions differ -> m
381 c: remote created -> g
381 c: remote created -> g
382 preserving rev for resolve of rev
382 preserving rev for resolve of rev
383 updating: a 1/3 files (33.33%)
383 updating: a 1/3 files (33.33%)
384 note: possible conflict - a was renamed multiple times to:
384 note: possible conflict - a was renamed multiple times to:
385 b
385 b
386 c
386 c
387 updating: c 2/3 files (66.67%)
387 updating: c 2/3 files (66.67%)
388 getting c
388 getting c
389 updating: rev 3/3 files (100.00%)
389 updating: rev 3/3 files (100.00%)
390 picked tool 'python ../merge' for rev (binary False symlink False)
390 picked tool 'python ../merge' for rev (binary False symlink False)
391 merging rev
391 merging rev
392 my rev@02963e448370+ other rev@fe905ef2c33e ancestor rev@924404dff337
392 my rev@02963e448370+ other rev@fe905ef2c33e ancestor rev@924404dff337
393 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
393 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
394 (branch merge, don't forget to commit)
394 (branch merge, don't forget to commit)
395 --------------
395 --------------
396 M c
396 M c
397 C b
397 C b
398 --------------
398 --------------
399
399
400 $ tm "nc a b" "up b " " " "12 merge b no ancestor"
400 $ tm "nc a b" "up b " " " "12 merge b no ancestor"
401 created new head
401 created new head
402 --------------
402 --------------
403 test L:nc a b R:up b W: - 12 merge b no ancestor
403 test L:nc a b R:up b W: - 12 merge b no ancestor
404 --------------
404 --------------
405 searching for copies back to rev 1
405 searching for copies back to rev 1
406 resolving manifests
406 resolving manifests
407 overwrite None partial False
407 overwrite: False, partial: False
408 ancestor 924404dff337 local 86a2aa42fc76+ remote af30c7647fc7
408 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: af30c7647fc7
409 b: versions differ -> m
409 b: versions differ -> m
410 rev: versions differ -> m
410 rev: versions differ -> m
411 preserving b for resolve of b
411 preserving b for resolve of b
412 preserving rev for resolve of rev
412 preserving rev for resolve of rev
413 updating: b 1/2 files (50.00%)
413 updating: b 1/2 files (50.00%)
414 picked tool 'python ../merge' for b (binary False symlink False)
414 picked tool 'python ../merge' for b (binary False symlink False)
415 merging b
415 merging b
416 my b@86a2aa42fc76+ other b@af30c7647fc7 ancestor b@000000000000
416 my b@86a2aa42fc76+ other b@af30c7647fc7 ancestor b@000000000000
417 updating: rev 2/2 files (100.00%)
417 updating: rev 2/2 files (100.00%)
418 picked tool 'python ../merge' for rev (binary False symlink False)
418 picked tool 'python ../merge' for rev (binary False symlink False)
419 merging rev
419 merging rev
420 my rev@86a2aa42fc76+ other rev@af30c7647fc7 ancestor rev@924404dff337
420 my rev@86a2aa42fc76+ other rev@af30c7647fc7 ancestor rev@924404dff337
421 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
421 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
422 (branch merge, don't forget to commit)
422 (branch merge, don't forget to commit)
423 --------------
423 --------------
424 M b
424 M b
425 C a
425 C a
426 --------------
426 --------------
427
427
428 $ tm "up b " "nm a b" " " "13 merge b no ancestor"
428 $ tm "up b " "nm a b" " " "13 merge b no ancestor"
429 created new head
429 created new head
430 --------------
430 --------------
431 test L:up b R:nm a b W: - 13 merge b no ancestor
431 test L:up b R:nm a b W: - 13 merge b no ancestor
432 --------------
432 --------------
433 searching for copies back to rev 1
433 searching for copies back to rev 1
434 resolving manifests
434 resolving manifests
435 overwrite None partial False
435 overwrite: False, partial: False
436 ancestor 924404dff337 local 59318016310c+ remote bdb19105162a
436 ancestor: 924404dff337, local: 59318016310c+, remote: bdb19105162a
437 a: other deleted -> r
437 a: other deleted -> r
438 b: versions differ -> m
438 b: versions differ -> m
439 rev: versions differ -> m
439 rev: versions differ -> m
440 preserving b for resolve of b
440 preserving b for resolve of b
441 preserving rev for resolve of rev
441 preserving rev for resolve of rev
442 updating: a 1/3 files (33.33%)
442 updating: a 1/3 files (33.33%)
443 removing a
443 removing a
444 updating: b 2/3 files (66.67%)
444 updating: b 2/3 files (66.67%)
445 picked tool 'python ../merge' for b (binary False symlink False)
445 picked tool 'python ../merge' for b (binary False symlink False)
446 merging b
446 merging b
447 my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
447 my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
448 updating: rev 3/3 files (100.00%)
448 updating: rev 3/3 files (100.00%)
449 picked tool 'python ../merge' for rev (binary False symlink False)
449 picked tool 'python ../merge' for rev (binary False symlink False)
450 merging rev
450 merging rev
451 my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
451 my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
452 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
452 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
453 (branch merge, don't forget to commit)
453 (branch merge, don't forget to commit)
454 --------------
454 --------------
455 M b
455 M b
456 --------------
456 --------------
457
457
458 $ tm "nc a b" "up a b" " " "14 merge b no ancestor"
458 $ tm "nc a b" "up a b" " " "14 merge b no ancestor"
459 created new head
459 created new head
460 --------------
460 --------------
461 test L:nc a b R:up a b W: - 14 merge b no ancestor
461 test L:nc a b R:up a b W: - 14 merge b no ancestor
462 --------------
462 --------------
463 searching for copies back to rev 1
463 searching for copies back to rev 1
464 resolving manifests
464 resolving manifests
465 overwrite None partial False
465 overwrite: False, partial: False
466 ancestor 924404dff337 local 86a2aa42fc76+ remote 8dbce441892a
466 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 8dbce441892a
467 a: remote is newer -> g
467 a: remote is newer -> g
468 b: versions differ -> m
468 b: versions differ -> m
469 rev: versions differ -> m
469 rev: versions differ -> m
470 preserving b for resolve of b
470 preserving b for resolve of b
471 preserving rev for resolve of rev
471 preserving rev for resolve of rev
472 updating: a 1/3 files (33.33%)
472 updating: a 1/3 files (33.33%)
473 getting a
473 getting a
474 updating: b 2/3 files (66.67%)
474 updating: b 2/3 files (66.67%)
475 picked tool 'python ../merge' for b (binary False symlink False)
475 picked tool 'python ../merge' for b (binary False symlink False)
476 merging b
476 merging b
477 my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
477 my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
478 updating: rev 3/3 files (100.00%)
478 updating: rev 3/3 files (100.00%)
479 picked tool 'python ../merge' for rev (binary False symlink False)
479 picked tool 'python ../merge' for rev (binary False symlink False)
480 merging rev
480 merging rev
481 my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
481 my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
482 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
482 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
483 (branch merge, don't forget to commit)
483 (branch merge, don't forget to commit)
484 --------------
484 --------------
485 M a
485 M a
486 M b
486 M b
487 --------------
487 --------------
488
488
489 $ tm "up b " "nm a b" " " "15 merge b no ancestor, remove a"
489 $ tm "up b " "nm a b" " " "15 merge b no ancestor, remove a"
490 created new head
490 created new head
491 --------------
491 --------------
492 test L:up b R:nm a b W: - 15 merge b no ancestor, remove a
492 test L:up b R:nm a b W: - 15 merge b no ancestor, remove a
493 --------------
493 --------------
494 searching for copies back to rev 1
494 searching for copies back to rev 1
495 resolving manifests
495 resolving manifests
496 overwrite None partial False
496 overwrite: False, partial: False
497 ancestor 924404dff337 local 59318016310c+ remote bdb19105162a
497 ancestor: 924404dff337, local: 59318016310c+, remote: bdb19105162a
498 a: other deleted -> r
498 a: other deleted -> r
499 b: versions differ -> m
499 b: versions differ -> m
500 rev: versions differ -> m
500 rev: versions differ -> m
501 preserving b for resolve of b
501 preserving b for resolve of b
502 preserving rev for resolve of rev
502 preserving rev for resolve of rev
503 updating: a 1/3 files (33.33%)
503 updating: a 1/3 files (33.33%)
504 removing a
504 removing a
505 updating: b 2/3 files (66.67%)
505 updating: b 2/3 files (66.67%)
506 picked tool 'python ../merge' for b (binary False symlink False)
506 picked tool 'python ../merge' for b (binary False symlink False)
507 merging b
507 merging b
508 my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
508 my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
509 updating: rev 3/3 files (100.00%)
509 updating: rev 3/3 files (100.00%)
510 picked tool 'python ../merge' for rev (binary False symlink False)
510 picked tool 'python ../merge' for rev (binary False symlink False)
511 merging rev
511 merging rev
512 my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
512 my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
513 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
513 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
514 (branch merge, don't forget to commit)
514 (branch merge, don't forget to commit)
515 --------------
515 --------------
516 M b
516 M b
517 --------------
517 --------------
518
518
519 $ tm "nc a b" "up a b" " " "16 get a, merge b no ancestor"
519 $ tm "nc a b" "up a b" " " "16 get a, merge b no ancestor"
520 created new head
520 created new head
521 --------------
521 --------------
522 test L:nc a b R:up a b W: - 16 get a, merge b no ancestor
522 test L:nc a b R:up a b W: - 16 get a, merge b no ancestor
523 --------------
523 --------------
524 searching for copies back to rev 1
524 searching for copies back to rev 1
525 resolving manifests
525 resolving manifests
526 overwrite None partial False
526 overwrite: False, partial: False
527 ancestor 924404dff337 local 86a2aa42fc76+ remote 8dbce441892a
527 ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 8dbce441892a
528 a: remote is newer -> g
528 a: remote is newer -> g
529 b: versions differ -> m
529 b: versions differ -> m
530 rev: versions differ -> m
530 rev: versions differ -> m
531 preserving b for resolve of b
531 preserving b for resolve of b
532 preserving rev for resolve of rev
532 preserving rev for resolve of rev
533 updating: a 1/3 files (33.33%)
533 updating: a 1/3 files (33.33%)
534 getting a
534 getting a
535 updating: b 2/3 files (66.67%)
535 updating: b 2/3 files (66.67%)
536 picked tool 'python ../merge' for b (binary False symlink False)
536 picked tool 'python ../merge' for b (binary False symlink False)
537 merging b
537 merging b
538 my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
538 my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
539 updating: rev 3/3 files (100.00%)
539 updating: rev 3/3 files (100.00%)
540 picked tool 'python ../merge' for rev (binary False symlink False)
540 picked tool 'python ../merge' for rev (binary False symlink False)
541 merging rev
541 merging rev
542 my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
542 my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
543 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
543 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
544 (branch merge, don't forget to commit)
544 (branch merge, don't forget to commit)
545 --------------
545 --------------
546 M a
546 M a
547 M b
547 M b
548 --------------
548 --------------
549
549
550 $ tm "up a b" "nc a b" " " "17 keep a, merge b no ancestor"
550 $ tm "up a b" "nc a b" " " "17 keep a, merge b no ancestor"
551 created new head
551 created new head
552 --------------
552 --------------
553 test L:up a b R:nc a b W: - 17 keep a, merge b no ancestor
553 test L:up a b R:nc a b W: - 17 keep a, merge b no ancestor
554 --------------
554 --------------
555 searching for copies back to rev 1
555 searching for copies back to rev 1
556 resolving manifests
556 resolving manifests
557 overwrite None partial False
557 overwrite: False, partial: False
558 ancestor 924404dff337 local 0b76e65c8289+ remote 4ce40f5aca24
558 ancestor: 924404dff337, local: 0b76e65c8289+, remote: 4ce40f5aca24
559 b: versions differ -> m
559 b: versions differ -> m
560 rev: versions differ -> m
560 rev: versions differ -> m
561 preserving b for resolve of b
561 preserving b for resolve of b
562 preserving rev for resolve of rev
562 preserving rev for resolve of rev
563 updating: b 1/2 files (50.00%)
563 updating: b 1/2 files (50.00%)
564 picked tool 'python ../merge' for b (binary False symlink False)
564 picked tool 'python ../merge' for b (binary False symlink False)
565 merging b
565 merging b
566 my b@0b76e65c8289+ other b@4ce40f5aca24 ancestor b@000000000000
566 my b@0b76e65c8289+ other b@4ce40f5aca24 ancestor b@000000000000
567 updating: rev 2/2 files (100.00%)
567 updating: rev 2/2 files (100.00%)
568 picked tool 'python ../merge' for rev (binary False symlink False)
568 picked tool 'python ../merge' for rev (binary False symlink False)
569 merging rev
569 merging rev
570 my rev@0b76e65c8289+ other rev@4ce40f5aca24 ancestor rev@924404dff337
570 my rev@0b76e65c8289+ other rev@4ce40f5aca24 ancestor rev@924404dff337
571 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
571 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
572 (branch merge, don't forget to commit)
572 (branch merge, don't forget to commit)
573 --------------
573 --------------
574 M b
574 M b
575 C a
575 C a
576 --------------
576 --------------
577
577
578 $ tm "nm a b" "up a b" " " "18 merge b no ancestor"
578 $ tm "nm a b" "up a b" " " "18 merge b no ancestor"
579 created new head
579 created new head
580 --------------
580 --------------
581 test L:nm a b R:up a b W: - 18 merge b no ancestor
581 test L:nm a b R:up a b W: - 18 merge b no ancestor
582 --------------
582 --------------
583 searching for copies back to rev 1
583 searching for copies back to rev 1
584 resolving manifests
584 resolving manifests
585 overwrite None partial False
585 overwrite: False, partial: False
586 ancestor 924404dff337 local 02963e448370+ remote 8dbce441892a
586 ancestor: 924404dff337, local: 02963e448370+, remote: 8dbce441892a
587 b: versions differ -> m
587 b: versions differ -> m
588 rev: versions differ -> m
588 rev: versions differ -> m
589 remote changed a which local deleted
589 remote changed a which local deleted
590 use (c)hanged version or leave (d)eleted? c
590 use (c)hanged version or leave (d)eleted? c
591 a: prompt recreating -> g
591 a: prompt recreating -> g
592 preserving b for resolve of b
592 preserving b for resolve of b
593 preserving rev for resolve of rev
593 preserving rev for resolve of rev
594 updating: a 1/3 files (33.33%)
594 updating: a 1/3 files (33.33%)
595 getting a
595 getting a
596 updating: b 2/3 files (66.67%)
596 updating: b 2/3 files (66.67%)
597 picked tool 'python ../merge' for b (binary False symlink False)
597 picked tool 'python ../merge' for b (binary False symlink False)
598 merging b
598 merging b
599 my b@02963e448370+ other b@8dbce441892a ancestor b@000000000000
599 my b@02963e448370+ other b@8dbce441892a ancestor b@000000000000
600 updating: rev 3/3 files (100.00%)
600 updating: rev 3/3 files (100.00%)
601 picked tool 'python ../merge' for rev (binary False symlink False)
601 picked tool 'python ../merge' for rev (binary False symlink False)
602 merging rev
602 merging rev
603 my rev@02963e448370+ other rev@8dbce441892a ancestor rev@924404dff337
603 my rev@02963e448370+ other rev@8dbce441892a ancestor rev@924404dff337
604 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
604 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
605 (branch merge, don't forget to commit)
605 (branch merge, don't forget to commit)
606 --------------
606 --------------
607 M a
607 M a
608 M b
608 M b
609 --------------
609 --------------
610
610
611 $ tm "up a b" "nm a b" " " "19 merge b no ancestor, prompt remove a"
611 $ tm "up a b" "nm a b" " " "19 merge b no ancestor, prompt remove a"
612 created new head
612 created new head
613 --------------
613 --------------
614 test L:up a b R:nm a b W: - 19 merge b no ancestor, prompt remove a
614 test L:up a b R:nm a b W: - 19 merge b no ancestor, prompt remove a
615 --------------
615 --------------
616 searching for copies back to rev 1
616 searching for copies back to rev 1
617 resolving manifests
617 resolving manifests
618 overwrite None partial False
618 overwrite: False, partial: False
619 ancestor 924404dff337 local 0b76e65c8289+ remote bdb19105162a
619 ancestor: 924404dff337, local: 0b76e65c8289+, remote: bdb19105162a
620 local changed a which remote deleted
620 local changed a which remote deleted
621 use (c)hanged version or (d)elete? c
621 use (c)hanged version or (d)elete? c
622 a: prompt keep -> a
622 a: prompt keep -> a
623 b: versions differ -> m
623 b: versions differ -> m
624 rev: versions differ -> m
624 rev: versions differ -> m
625 preserving b for resolve of b
625 preserving b for resolve of b
626 preserving rev for resolve of rev
626 preserving rev for resolve of rev
627 updating: a 1/3 files (33.33%)
627 updating: a 1/3 files (33.33%)
628 updating: b 2/3 files (66.67%)
628 updating: b 2/3 files (66.67%)
629 picked tool 'python ../merge' for b (binary False symlink False)
629 picked tool 'python ../merge' for b (binary False symlink False)
630 merging b
630 merging b
631 my b@0b76e65c8289+ other b@bdb19105162a ancestor b@000000000000
631 my b@0b76e65c8289+ other b@bdb19105162a ancestor b@000000000000
632 updating: rev 3/3 files (100.00%)
632 updating: rev 3/3 files (100.00%)
633 picked tool 'python ../merge' for rev (binary False symlink False)
633 picked tool 'python ../merge' for rev (binary False symlink False)
634 merging rev
634 merging rev
635 my rev@0b76e65c8289+ other rev@bdb19105162a ancestor rev@924404dff337
635 my rev@0b76e65c8289+ other rev@bdb19105162a ancestor rev@924404dff337
636 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
636 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
637 (branch merge, don't forget to commit)
637 (branch merge, don't forget to commit)
638 --------------
638 --------------
639 M b
639 M b
640 C a
640 C a
641 --------------
641 --------------
642
642
643 $ tm "up a " "um a b" " " "20 merge a and b to b, remove a"
643 $ tm "up a " "um a b" " " "20 merge a and b to b, remove a"
644 created new head
644 created new head
645 --------------
645 --------------
646 test L:up a R:um a b W: - 20 merge a and b to b, remove a
646 test L:up a R:um a b W: - 20 merge a and b to b, remove a
647 --------------
647 --------------
648 searching for copies back to rev 1
648 searching for copies back to rev 1
649 unmatched files in other:
649 unmatched files in other:
650 b
650 b
651 all copies found (* = to merge, ! = divergent):
651 all copies found (* = to merge, ! = divergent):
652 b -> a *
652 b -> a *
653 checking for directory renames
653 checking for directory renames
654 resolving manifests
654 resolving manifests
655 overwrite None partial False
655 overwrite: False, partial: False
656 ancestor 924404dff337 local e300d1c794ec+ remote 49b6d8032493
656 ancestor: 924404dff337, local: e300d1c794ec+, remote: 49b6d8032493
657 rev: versions differ -> m
657 rev: versions differ -> m
658 a: remote moved to b -> m
658 a: remote moved to b -> m
659 preserving a for resolve of b
659 preserving a for resolve of b
660 preserving rev for resolve of rev
660 preserving rev for resolve of rev
661 removing a
661 removing a
662 updating: a 1/2 files (50.00%)
662 updating: a 1/2 files (50.00%)
663 picked tool 'python ../merge' for b (binary False symlink False)
663 picked tool 'python ../merge' for b (binary False symlink False)
664 merging a and b to b
664 merging a and b to b
665 my b@e300d1c794ec+ other b@49b6d8032493 ancestor a@924404dff337
665 my b@e300d1c794ec+ other b@49b6d8032493 ancestor a@924404dff337
666 updating: rev 2/2 files (100.00%)
666 updating: rev 2/2 files (100.00%)
667 picked tool 'python ../merge' for rev (binary False symlink False)
667 picked tool 'python ../merge' for rev (binary False symlink False)
668 merging rev
668 merging rev
669 my rev@e300d1c794ec+ other rev@49b6d8032493 ancestor rev@924404dff337
669 my rev@e300d1c794ec+ other rev@49b6d8032493 ancestor rev@924404dff337
670 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
670 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
671 (branch merge, don't forget to commit)
671 (branch merge, don't forget to commit)
672 --------------
672 --------------
673 M b
673 M b
674 a
674 a
675 --------------
675 --------------
676
676
677 $ tm "um a b" "up a " " " "21 merge a and b to b"
677 $ tm "um a b" "up a " " " "21 merge a and b to b"
678 created new head
678 created new head
679 --------------
679 --------------
680 test L:um a b R:up a W: - 21 merge a and b to b
680 test L:um a b R:up a W: - 21 merge a and b to b
681 --------------
681 --------------
682 searching for copies back to rev 1
682 searching for copies back to rev 1
683 unmatched files in local:
683 unmatched files in local:
684 b
684 b
685 all copies found (* = to merge, ! = divergent):
685 all copies found (* = to merge, ! = divergent):
686 b -> a *
686 b -> a *
687 checking for directory renames
687 checking for directory renames
688 resolving manifests
688 resolving manifests
689 overwrite None partial False
689 overwrite: False, partial: False
690 ancestor 924404dff337 local 62e7bf090eba+ remote f4db7e329e71
690 ancestor: 924404dff337, local: 62e7bf090eba+, remote: f4db7e329e71
691 b: local copied/moved to a -> m
691 b: local copied/moved to a -> m
692 rev: versions differ -> m
692 rev: versions differ -> m
693 preserving b for resolve of b
693 preserving b for resolve of b
694 preserving rev for resolve of rev
694 preserving rev for resolve of rev
695 updating: b 1/2 files (50.00%)
695 updating: b 1/2 files (50.00%)
696 picked tool 'python ../merge' for b (binary False symlink False)
696 picked tool 'python ../merge' for b (binary False symlink False)
697 merging b and a to b
697 merging b and a to b
698 my b@62e7bf090eba+ other a@f4db7e329e71 ancestor a@924404dff337
698 my b@62e7bf090eba+ other a@f4db7e329e71 ancestor a@924404dff337
699 updating: rev 2/2 files (100.00%)
699 updating: rev 2/2 files (100.00%)
700 picked tool 'python ../merge' for rev (binary False symlink False)
700 picked tool 'python ../merge' for rev (binary False symlink False)
701 merging rev
701 merging rev
702 my rev@62e7bf090eba+ other rev@f4db7e329e71 ancestor rev@924404dff337
702 my rev@62e7bf090eba+ other rev@f4db7e329e71 ancestor rev@924404dff337
703 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
703 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
704 (branch merge, don't forget to commit)
704 (branch merge, don't forget to commit)
705 --------------
705 --------------
706 M b
706 M b
707 a
707 a
708 --------------
708 --------------
709
709
710
710
711 m "nm a b" "um x a" " " "22 get a, keep b"
711 m "nm a b" "um x a" " " "22 get a, keep b"
712
712
713 $ tm "nm a b" "up a c" " " "23 get c, keep b"
713 $ tm "nm a b" "up a c" " " "23 get c, keep b"
714 created new head
714 created new head
715 --------------
715 --------------
716 test L:nm a b R:up a c W: - 23 get c, keep b
716 test L:nm a b R:up a c W: - 23 get c, keep b
717 --------------
717 --------------
718 searching for copies back to rev 1
718 searching for copies back to rev 1
719 unmatched files in local:
719 unmatched files in local:
720 b
720 b
721 unmatched files in other:
721 unmatched files in other:
722 c
722 c
723 all copies found (* = to merge, ! = divergent):
723 all copies found (* = to merge, ! = divergent):
724 b -> a *
724 b -> a *
725 checking for directory renames
725 checking for directory renames
726 resolving manifests
726 resolving manifests
727 overwrite None partial False
727 overwrite: False, partial: False
728 ancestor 924404dff337 local 02963e448370+ remote 2b958612230f
728 ancestor: 924404dff337, local: 02963e448370+, remote: 2b958612230f
729 b: local copied/moved to a -> m
729 b: local copied/moved to a -> m
730 rev: versions differ -> m
730 rev: versions differ -> m
731 c: remote created -> g
731 c: remote created -> g
732 preserving b for resolve of b
732 preserving b for resolve of b
733 preserving rev for resolve of rev
733 preserving rev for resolve of rev
734 updating: b 1/3 files (33.33%)
734 updating: b 1/3 files (33.33%)
735 picked tool 'python ../merge' for b (binary False symlink False)
735 picked tool 'python ../merge' for b (binary False symlink False)
736 merging b and a to b
736 merging b and a to b
737 my b@02963e448370+ other a@2b958612230f ancestor a@924404dff337
737 my b@02963e448370+ other a@2b958612230f ancestor a@924404dff337
738 premerge successful
738 premerge successful
739 updating: c 2/3 files (66.67%)
739 updating: c 2/3 files (66.67%)
740 getting c
740 getting c
741 updating: rev 3/3 files (100.00%)
741 updating: rev 3/3 files (100.00%)
742 picked tool 'python ../merge' for rev (binary False symlink False)
742 picked tool 'python ../merge' for rev (binary False symlink False)
743 merging rev
743 merging rev
744 my rev@02963e448370+ other rev@2b958612230f ancestor rev@924404dff337
744 my rev@02963e448370+ other rev@2b958612230f ancestor rev@924404dff337
745 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
745 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
746 (branch merge, don't forget to commit)
746 (branch merge, don't forget to commit)
747 --------------
747 --------------
748 M b
748 M b
749 a
749 a
750 M c
750 M c
751 --------------
751 --------------
752
752
@@ -1,1019 +1,1019 b''
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 $ rm -rf sub
6 $ rm -rf sub
7 $ mkdir sub
7 $ mkdir sub
8 $ cd sub
8 $ cd sub
9 $ hg init t
9 $ hg init t
10 $ cd t
10 $ cd t
11
11
12 first revision, no sub
12 first revision, no sub
13
13
14 $ echo a > a
14 $ echo a > a
15 $ hg ci -Am0
15 $ hg ci -Am0
16 adding a
16 adding a
17
17
18 add first sub
18 add first sub
19
19
20 $ echo s = s > .hgsub
20 $ echo s = s > .hgsub
21 $ hg add .hgsub
21 $ hg add .hgsub
22 $ hg init s
22 $ hg init s
23 $ echo a > s/a
23 $ echo a > s/a
24
24
25 Issue2232: committing a subrepo without .hgsub
25 Issue2232: committing a subrepo without .hgsub
26
26
27 $ hg ci -mbad s
27 $ hg ci -mbad s
28 abort: can't commit subrepos without .hgsub
28 abort: can't commit subrepos without .hgsub
29 [255]
29 [255]
30
30
31 $ hg -R s ci -Ams0
31 $ hg -R s ci -Ams0
32 adding a
32 adding a
33 $ hg sum
33 $ hg sum
34 parent: 0:f7b1eb17ad24 tip
34 parent: 0:f7b1eb17ad24 tip
35 0
35 0
36 branch: default
36 branch: default
37 commit: 1 added, 1 subrepos
37 commit: 1 added, 1 subrepos
38 update: (current)
38 update: (current)
39 $ hg ci -m1
39 $ hg ci -m1
40 committing subrepository s
40 committing subrepository s
41
41
42 Revert can't (yet) revert subrepos:
42 Revert can't (yet) revert subrepos:
43
43
44 $ echo b > s/a
44 $ echo b > s/a
45 $ hg revert s
45 $ hg revert s
46 s: reverting subrepos is unsupported
46 s: reverting subrepos is unsupported
47
47
48 Revert currently ignores subrepos by default
48 Revert currently ignores subrepos by default
49
49
50 $ hg revert -a
50 $ hg revert -a
51 $ hg revert -R s -a -C
51 $ hg revert -R s -a -C
52 reverting s/a (glob)
52 reverting s/a (glob)
53
53
54 Issue2022: update -C
54 Issue2022: update -C
55
55
56 $ echo b > s/a
56 $ echo b > s/a
57 $ hg sum
57 $ hg sum
58 parent: 1:7cf8cfea66e4 tip
58 parent: 1:7cf8cfea66e4 tip
59 1
59 1
60 branch: default
60 branch: default
61 commit: 1 subrepos
61 commit: 1 subrepos
62 update: (current)
62 update: (current)
63 $ hg co -C 1
63 $ hg co -C 1
64 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
64 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
65 $ hg sum
65 $ hg sum
66 parent: 1:7cf8cfea66e4 tip
66 parent: 1:7cf8cfea66e4 tip
67 1
67 1
68 branch: default
68 branch: default
69 commit: (clean)
69 commit: (clean)
70 update: (current)
70 update: (current)
71
71
72 commands that require a clean repo should respect subrepos
72 commands that require a clean repo should respect subrepos
73
73
74 $ echo b >> s/a
74 $ echo b >> s/a
75 $ hg backout tip
75 $ hg backout tip
76 abort: uncommitted changes in subrepo s
76 abort: uncommitted changes in subrepo s
77 [255]
77 [255]
78 $ hg revert -C -R s s/a
78 $ hg revert -C -R s s/a
79
79
80 add sub sub
80 add sub sub
81
81
82 $ echo ss = ss > s/.hgsub
82 $ echo ss = ss > s/.hgsub
83 $ hg init s/ss
83 $ hg init s/ss
84 $ echo a > s/ss/a
84 $ echo a > s/ss/a
85 $ hg -R s add s/.hgsub
85 $ hg -R s add s/.hgsub
86 $ hg -R s/ss add s/ss/a
86 $ hg -R s/ss add s/ss/a
87 $ hg sum
87 $ hg sum
88 parent: 1:7cf8cfea66e4 tip
88 parent: 1:7cf8cfea66e4 tip
89 1
89 1
90 branch: default
90 branch: default
91 commit: 1 subrepos
91 commit: 1 subrepos
92 update: (current)
92 update: (current)
93 $ hg ci -m2
93 $ hg ci -m2
94 committing subrepository s
94 committing subrepository s
95 committing subrepository s/ss (glob)
95 committing subrepository s/ss (glob)
96 $ hg sum
96 $ hg sum
97 parent: 2:df30734270ae tip
97 parent: 2:df30734270ae tip
98 2
98 2
99 branch: default
99 branch: default
100 commit: (clean)
100 commit: (clean)
101 update: (current)
101 update: (current)
102
102
103 bump sub rev (and check it is ignored by ui.commitsubrepos)
103 bump sub rev (and check it is ignored by ui.commitsubrepos)
104
104
105 $ echo b > s/a
105 $ echo b > s/a
106 $ hg -R s ci -ms1
106 $ hg -R s ci -ms1
107 $ hg --config ui.commitsubrepos=no ci -m3
107 $ hg --config ui.commitsubrepos=no ci -m3
108 committing subrepository s
108 committing subrepository s
109
109
110 leave sub dirty (and check ui.commitsubrepos=no aborts the commit)
110 leave sub dirty (and check ui.commitsubrepos=no aborts the commit)
111
111
112 $ echo c > s/a
112 $ echo c > s/a
113 $ hg --config ui.commitsubrepos=no ci -m4
113 $ hg --config ui.commitsubrepos=no ci -m4
114 abort: uncommitted changes in subrepo s
114 abort: uncommitted changes in subrepo s
115 (use --subrepos for recursive commit)
115 (use --subrepos for recursive commit)
116 [255]
116 [255]
117 $ hg ci -m4
117 $ hg ci -m4
118 committing subrepository s
118 committing subrepository s
119 $ hg tip -R s
119 $ hg tip -R s
120 changeset: 3:1c833a7a9e3a
120 changeset: 3:1c833a7a9e3a
121 tag: tip
121 tag: tip
122 user: test
122 user: test
123 date: Thu Jan 01 00:00:00 1970 +0000
123 date: Thu Jan 01 00:00:00 1970 +0000
124 summary: 4
124 summary: 4
125
125
126
126
127 check caching
127 check caching
128
128
129 $ hg co 0
129 $ hg co 0
130 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
130 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
131 $ hg debugsub
131 $ hg debugsub
132
132
133 restore
133 restore
134
134
135 $ hg co
135 $ hg co
136 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
136 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
137 $ hg debugsub
137 $ hg debugsub
138 path s
138 path s
139 source s
139 source s
140 revision 1c833a7a9e3a4445c711aaf0f012379cd0d4034e
140 revision 1c833a7a9e3a4445c711aaf0f012379cd0d4034e
141
141
142 new branch for merge tests
142 new branch for merge tests
143
143
144 $ hg co 1
144 $ hg co 1
145 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
145 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
146 $ echo t = t >> .hgsub
146 $ echo t = t >> .hgsub
147 $ hg init t
147 $ hg init t
148 $ echo t > t/t
148 $ echo t > t/t
149 $ hg -R t add t
149 $ hg -R t add t
150 adding t/t (glob)
150 adding t/t (glob)
151
151
152 5
152 5
153
153
154 $ hg ci -m5 # add sub
154 $ hg ci -m5 # add sub
155 committing subrepository t
155 committing subrepository t
156 created new head
156 created new head
157 $ echo t2 > t/t
157 $ echo t2 > t/t
158
158
159 6
159 6
160
160
161 $ hg st -R s
161 $ hg st -R s
162 $ hg ci -m6 # change sub
162 $ hg ci -m6 # change sub
163 committing subrepository t
163 committing subrepository t
164 $ hg debugsub
164 $ hg debugsub
165 path s
165 path s
166 source s
166 source s
167 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
167 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
168 path t
168 path t
169 source t
169 source t
170 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
170 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
171 $ echo t3 > t/t
171 $ echo t3 > t/t
172
172
173 7
173 7
174
174
175 $ hg ci -m7 # change sub again for conflict test
175 $ hg ci -m7 # change sub again for conflict test
176 committing subrepository t
176 committing subrepository t
177 $ hg rm .hgsub
177 $ hg rm .hgsub
178
178
179 8
179 8
180
180
181 $ hg ci -m8 # remove sub
181 $ hg ci -m8 # remove sub
182
182
183 merge tests
183 merge tests
184
184
185 $ hg co -C 3
185 $ hg co -C 3
186 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
186 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
187 $ hg merge 5 # test adding
187 $ hg merge 5 # test adding
188 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
188 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
189 (branch merge, don't forget to commit)
189 (branch merge, don't forget to commit)
190 $ hg debugsub
190 $ hg debugsub
191 path s
191 path s
192 source s
192 source s
193 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
193 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
194 path t
194 path t
195 source t
195 source t
196 revision 60ca1237c19474e7a3978b0dc1ca4e6f36d51382
196 revision 60ca1237c19474e7a3978b0dc1ca4e6f36d51382
197 $ hg ci -m9
197 $ hg ci -m9
198 created new head
198 created new head
199 $ hg merge 6 --debug # test change
199 $ hg merge 6 --debug # test change
200 searching for copies back to rev 2
200 searching for copies back to rev 2
201 resolving manifests
201 resolving manifests
202 overwrite None partial False
202 overwrite: False, partial: False
203 ancestor 1f14a2e2d3ec local f0d2028bf86d+ remote 1831e14459c4
203 ancestor: 1f14a2e2d3ec, local: f0d2028bf86d+, remote: 1831e14459c4
204 .hgsubstate: versions differ -> m
204 .hgsubstate: versions differ -> m
205 updating: .hgsubstate 1/1 files (100.00%)
205 updating: .hgsubstate 1/1 files (100.00%)
206 subrepo merge f0d2028bf86d+ 1831e14459c4 1f14a2e2d3ec
206 subrepo merge f0d2028bf86d+ 1831e14459c4 1f14a2e2d3ec
207 subrepo t: other changed, get t:6747d179aa9a688023c4b0cad32e4c92bb7f34ad:hg
207 subrepo t: other changed, get t:6747d179aa9a688023c4b0cad32e4c92bb7f34ad:hg
208 getting subrepo t
208 getting subrepo t
209 resolving manifests
209 resolving manifests
210 overwrite True partial False
210 overwrite: True, partial: False
211 ancestor 60ca1237c194+ local 60ca1237c194+ remote 6747d179aa9a
211 ancestor: 60ca1237c194+, local: 60ca1237c194+, remote: 6747d179aa9a
212 t: remote is newer -> g
212 t: remote is newer -> g
213 updating: t 1/1 files (100.00%)
213 updating: t 1/1 files (100.00%)
214 getting t
214 getting t
215 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
215 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
216 (branch merge, don't forget to commit)
216 (branch merge, don't forget to commit)
217 $ hg debugsub
217 $ hg debugsub
218 path s
218 path s
219 source s
219 source s
220 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
220 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
221 path t
221 path t
222 source t
222 source t
223 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
223 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
224 $ echo conflict > t/t
224 $ echo conflict > t/t
225 $ hg ci -m10
225 $ hg ci -m10
226 committing subrepository t
226 committing subrepository t
227 $ HGMERGE=internal:merge hg merge --debug 7 # test conflict
227 $ HGMERGE=internal:merge hg merge --debug 7 # test conflict
228 searching for copies back to rev 2
228 searching for copies back to rev 2
229 resolving manifests
229 resolving manifests
230 overwrite None partial False
230 overwrite: False, partial: False
231 ancestor 1831e14459c4 local e45c8b14af55+ remote f94576341bcf
231 ancestor: 1831e14459c4, local: e45c8b14af55+, remote: f94576341bcf
232 .hgsubstate: versions differ -> m
232 .hgsubstate: versions differ -> m
233 updating: .hgsubstate 1/1 files (100.00%)
233 updating: .hgsubstate 1/1 files (100.00%)
234 subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4
234 subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4
235 subrepo t: both sides changed, merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg
235 subrepo t: both sides changed, merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg
236 merging subrepo t
236 merging subrepo t
237 searching for copies back to rev 2
237 searching for copies back to rev 2
238 resolving manifests
238 resolving manifests
239 overwrite None partial False
239 overwrite: False, partial: False
240 ancestor 6747d179aa9a local 20a0db6fbf6c+ remote 7af322bc1198
240 ancestor: 6747d179aa9a, local: 20a0db6fbf6c+, remote: 7af322bc1198
241 t: versions differ -> m
241 t: versions differ -> m
242 preserving t for resolve of t
242 preserving t for resolve of t
243 updating: t 1/1 files (100.00%)
243 updating: t 1/1 files (100.00%)
244 picked tool 'internal:merge' for t (binary False symlink False)
244 picked tool 'internal:merge' for t (binary False symlink False)
245 merging t
245 merging t
246 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
246 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
247 warning: conflicts during merge.
247 warning: conflicts during merge.
248 merging t incomplete! (edit conflicts, then use 'hg resolve --mark')
248 merging t incomplete! (edit conflicts, then use 'hg resolve --mark')
249 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
249 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
250 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
250 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
251 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
251 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
252 (branch merge, don't forget to commit)
252 (branch merge, don't forget to commit)
253
253
254 should conflict
254 should conflict
255
255
256 $ cat t/t
256 $ cat t/t
257 <<<<<<< local
257 <<<<<<< local
258 conflict
258 conflict
259 =======
259 =======
260 t3
260 t3
261 >>>>>>> other
261 >>>>>>> other
262
262
263 clone
263 clone
264
264
265 $ cd ..
265 $ cd ..
266 $ hg clone t tc
266 $ hg clone t tc
267 updating to branch default
267 updating to branch default
268 cloning subrepo s from $TESTTMP/sub/t/s (glob)
268 cloning subrepo s from $TESTTMP/sub/t/s (glob)
269 cloning subrepo s/ss from $TESTTMP/sub/t/s/ss (glob)
269 cloning subrepo s/ss from $TESTTMP/sub/t/s/ss (glob)
270 cloning subrepo t from $TESTTMP/sub/t/t (glob)
270 cloning subrepo t from $TESTTMP/sub/t/t (glob)
271 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
271 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
272 $ cd tc
272 $ cd tc
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 20a0db6fbf6c3d2836e6519a642ae929bfc67c0e
279 revision 20a0db6fbf6c3d2836e6519a642ae929bfc67c0e
280
280
281 push
281 push
282
282
283 $ echo bah > t/t
283 $ echo bah > t/t
284 $ hg ci -m11
284 $ hg ci -m11
285 committing subrepository t
285 committing subrepository t
286 $ hg push
286 $ hg push
287 pushing to $TESTTMP/sub/t (glob)
287 pushing to $TESTTMP/sub/t (glob)
288 pushing subrepo s/ss to $TESTTMP/sub/t/s/ss (glob)
288 pushing subrepo s/ss to $TESTTMP/sub/t/s/ss (glob)
289 searching for changes
289 searching for changes
290 no changes found
290 no changes found
291 pushing subrepo s to $TESTTMP/sub/t/s (glob)
291 pushing subrepo s to $TESTTMP/sub/t/s (glob)
292 searching for changes
292 searching for changes
293 no changes found
293 no changes found
294 pushing subrepo t to $TESTTMP/sub/t/t (glob)
294 pushing subrepo t to $TESTTMP/sub/t/t (glob)
295 searching for changes
295 searching for changes
296 adding changesets
296 adding changesets
297 adding manifests
297 adding manifests
298 adding file changes
298 adding file changes
299 added 1 changesets with 1 changes to 1 files
299 added 1 changesets with 1 changes to 1 files
300 searching for changes
300 searching for changes
301 adding changesets
301 adding changesets
302 adding manifests
302 adding manifests
303 adding file changes
303 adding file changes
304 added 1 changesets with 1 changes to 1 files
304 added 1 changesets with 1 changes to 1 files
305
305
306 push -f
306 push -f
307
307
308 $ echo bah > s/a
308 $ echo bah > s/a
309 $ hg ci -m12
309 $ hg ci -m12
310 committing subrepository s
310 committing subrepository s
311 $ hg push
311 $ hg push
312 pushing to $TESTTMP/sub/t (glob)
312 pushing to $TESTTMP/sub/t (glob)
313 pushing subrepo s/ss to $TESTTMP/sub/t/s/ss (glob)
313 pushing subrepo s/ss to $TESTTMP/sub/t/s/ss (glob)
314 searching for changes
314 searching for changes
315 no changes found
315 no changes found
316 pushing subrepo s to $TESTTMP/sub/t/s (glob)
316 pushing subrepo s to $TESTTMP/sub/t/s (glob)
317 searching for changes
317 searching for changes
318 abort: push creates new remote head 12a213df6fa9!
318 abort: push creates new remote head 12a213df6fa9!
319 (did you forget to merge? use push -f to force)
319 (did you forget to merge? use push -f to force)
320 [255]
320 [255]
321 $ hg push -f
321 $ hg push -f
322 pushing to $TESTTMP/sub/t (glob)
322 pushing to $TESTTMP/sub/t (glob)
323 pushing subrepo s/ss to $TESTTMP/sub/t/s/ss (glob)
323 pushing subrepo s/ss to $TESTTMP/sub/t/s/ss (glob)
324 searching for changes
324 searching for changes
325 no changes found
325 no changes found
326 pushing subrepo s to $TESTTMP/sub/t/s (glob)
326 pushing subrepo s to $TESTTMP/sub/t/s (glob)
327 searching for changes
327 searching for changes
328 adding changesets
328 adding changesets
329 adding manifests
329 adding manifests
330 adding file changes
330 adding file changes
331 added 1 changesets with 1 changes to 1 files (+1 heads)
331 added 1 changesets with 1 changes to 1 files (+1 heads)
332 pushing subrepo t to $TESTTMP/sub/t/t (glob)
332 pushing subrepo t to $TESTTMP/sub/t/t (glob)
333 searching for changes
333 searching for changes
334 no changes found
334 no changes found
335 searching for changes
335 searching for changes
336 adding changesets
336 adding changesets
337 adding manifests
337 adding manifests
338 adding file changes
338 adding file changes
339 added 1 changesets with 1 changes to 1 files
339 added 1 changesets with 1 changes to 1 files
340
340
341 update
341 update
342
342
343 $ cd ../t
343 $ cd ../t
344 $ hg up -C # discard our earlier merge
344 $ hg up -C # discard our earlier merge
345 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
345 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
346 $ echo blah > t/t
346 $ echo blah > t/t
347 $ hg ci -m13
347 $ hg ci -m13
348 committing subrepository t
348 committing subrepository t
349
349
350 pull
350 pull
351
351
352 $ cd ../tc
352 $ cd ../tc
353 $ hg pull
353 $ hg pull
354 pulling from $TESTTMP/sub/t (glob)
354 pulling from $TESTTMP/sub/t (glob)
355 searching for changes
355 searching for changes
356 adding changesets
356 adding changesets
357 adding manifests
357 adding manifests
358 adding file changes
358 adding file changes
359 added 1 changesets with 1 changes to 1 files
359 added 1 changesets with 1 changes to 1 files
360 (run 'hg update' to get a working copy)
360 (run 'hg update' to get a working copy)
361
361
362 should pull t
362 should pull t
363
363
364 $ hg up
364 $ hg up
365 pulling subrepo t from $TESTTMP/sub/t/t (glob)
365 pulling subrepo t from $TESTTMP/sub/t/t (glob)
366 searching for changes
366 searching for changes
367 adding changesets
367 adding changesets
368 adding manifests
368 adding manifests
369 adding file changes
369 adding file changes
370 added 1 changesets with 1 changes to 1 files
370 added 1 changesets with 1 changes to 1 files
371 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
371 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
372 $ cat t/t
372 $ cat t/t
373 blah
373 blah
374
374
375 bogus subrepo path aborts
375 bogus subrepo path aborts
376
376
377 $ echo 'bogus=[boguspath' >> .hgsub
377 $ echo 'bogus=[boguspath' >> .hgsub
378 $ hg ci -m 'bogus subrepo path'
378 $ hg ci -m 'bogus subrepo path'
379 abort: missing ] in subrepo source
379 abort: missing ] in subrepo source
380 [255]
380 [255]
381
381
382 Issue1986: merge aborts when trying to merge a subrepo that
382 Issue1986: merge aborts when trying to merge a subrepo that
383 shouldn't need merging
383 shouldn't need merging
384
384
385 # subrepo layout
385 # subrepo layout
386 #
386 #
387 # o 5 br
387 # o 5 br
388 # /|
388 # /|
389 # o | 4 default
389 # o | 4 default
390 # | |
390 # | |
391 # | o 3 br
391 # | o 3 br
392 # |/|
392 # |/|
393 # o | 2 default
393 # o | 2 default
394 # | |
394 # | |
395 # | o 1 br
395 # | o 1 br
396 # |/
396 # |/
397 # o 0 default
397 # o 0 default
398
398
399 $ cd ..
399 $ cd ..
400 $ rm -rf sub
400 $ rm -rf sub
401 $ hg init main
401 $ hg init main
402 $ cd main
402 $ cd main
403 $ hg init s
403 $ hg init s
404 $ cd s
404 $ cd s
405 $ echo a > a
405 $ echo a > a
406 $ hg ci -Am1
406 $ hg ci -Am1
407 adding a
407 adding a
408 $ hg branch br
408 $ hg branch br
409 marked working directory as branch br
409 marked working directory as branch br
410 (branches are permanent and global, did you want a bookmark?)
410 (branches are permanent and global, did you want a bookmark?)
411 $ echo a >> a
411 $ echo a >> a
412 $ hg ci -m1
412 $ hg ci -m1
413 $ hg up default
413 $ hg up default
414 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
414 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
415 $ echo b > b
415 $ echo b > b
416 $ hg ci -Am1
416 $ hg ci -Am1
417 adding b
417 adding b
418 $ hg up br
418 $ hg up br
419 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
419 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
420 $ hg merge tip
420 $ hg merge tip
421 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
421 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
422 (branch merge, don't forget to commit)
422 (branch merge, don't forget to commit)
423 $ hg ci -m1
423 $ hg ci -m1
424 $ hg up 2
424 $ hg up 2
425 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
425 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
426 $ echo c > c
426 $ echo c > c
427 $ hg ci -Am1
427 $ hg ci -Am1
428 adding c
428 adding c
429 $ hg up 3
429 $ hg up 3
430 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
430 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
431 $ hg merge 4
431 $ hg merge 4
432 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
432 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
433 (branch merge, don't forget to commit)
433 (branch merge, don't forget to commit)
434 $ hg ci -m1
434 $ hg ci -m1
435
435
436 # main repo layout:
436 # main repo layout:
437 #
437 #
438 # * <-- try to merge default into br again
438 # * <-- try to merge default into br again
439 # .`|
439 # .`|
440 # . o 5 br --> substate = 5
440 # . o 5 br --> substate = 5
441 # . |
441 # . |
442 # o | 4 default --> substate = 4
442 # o | 4 default --> substate = 4
443 # | |
443 # | |
444 # | o 3 br --> substate = 2
444 # | o 3 br --> substate = 2
445 # |/|
445 # |/|
446 # o | 2 default --> substate = 2
446 # o | 2 default --> substate = 2
447 # | |
447 # | |
448 # | o 1 br --> substate = 3
448 # | o 1 br --> substate = 3
449 # |/
449 # |/
450 # o 0 default --> substate = 2
450 # o 0 default --> substate = 2
451
451
452 $ cd ..
452 $ cd ..
453 $ echo 's = s' > .hgsub
453 $ echo 's = s' > .hgsub
454 $ hg -R s up 2
454 $ hg -R s up 2
455 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
455 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
456 $ hg ci -Am1
456 $ hg ci -Am1
457 adding .hgsub
457 adding .hgsub
458 committing subrepository s
458 committing subrepository s
459 $ hg branch br
459 $ hg branch br
460 marked working directory as branch br
460 marked working directory as branch br
461 (branches are permanent and global, did you want a bookmark?)
461 (branches are permanent and global, did you want a bookmark?)
462 $ echo b > b
462 $ echo b > b
463 $ hg -R s up 3
463 $ hg -R s up 3
464 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
464 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
465 $ hg ci -Am1
465 $ hg ci -Am1
466 adding b
466 adding b
467 committing subrepository s
467 committing subrepository s
468 $ hg up default
468 $ hg up default
469 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
469 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
470 $ echo c > c
470 $ echo c > c
471 $ hg ci -Am1
471 $ hg ci -Am1
472 adding c
472 adding c
473 $ hg up 1
473 $ hg up 1
474 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
474 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
475 $ hg merge 2
475 $ hg merge 2
476 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
476 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
477 (branch merge, don't forget to commit)
477 (branch merge, don't forget to commit)
478 $ hg ci -m1
478 $ hg ci -m1
479 $ hg up 2
479 $ hg up 2
480 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
480 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
481 $ hg -R s up 4
481 $ hg -R s up 4
482 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
482 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
483 $ echo d > d
483 $ echo d > d
484 $ hg ci -Am1
484 $ hg ci -Am1
485 adding d
485 adding d
486 committing subrepository s
486 committing subrepository s
487 $ hg up 3
487 $ hg up 3
488 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
488 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
489 $ hg -R s up 5
489 $ hg -R s up 5
490 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
490 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
491 $ echo e > e
491 $ echo e > e
492 $ hg ci -Am1
492 $ hg ci -Am1
493 adding e
493 adding e
494 committing subrepository s
494 committing subrepository s
495
495
496 $ hg up 5
496 $ hg up 5
497 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
497 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
498 $ hg merge 4 # try to merge default into br again
498 $ hg merge 4 # try to merge default into br again
499 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
499 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
500 (branch merge, don't forget to commit)
500 (branch merge, don't forget to commit)
501 $ cd ..
501 $ cd ..
502
502
503 test subrepo delete from .hgsubstate
503 test subrepo delete from .hgsubstate
504
504
505 $ hg init testdelete
505 $ hg init testdelete
506 $ mkdir testdelete/nested testdelete/nested2
506 $ mkdir testdelete/nested testdelete/nested2
507 $ hg init testdelete/nested
507 $ hg init testdelete/nested
508 $ hg init testdelete/nested2
508 $ hg init testdelete/nested2
509 $ echo test > testdelete/nested/foo
509 $ echo test > testdelete/nested/foo
510 $ echo test > testdelete/nested2/foo
510 $ echo test > testdelete/nested2/foo
511 $ hg -R testdelete/nested add
511 $ hg -R testdelete/nested add
512 adding testdelete/nested/foo (glob)
512 adding testdelete/nested/foo (glob)
513 $ hg -R testdelete/nested2 add
513 $ hg -R testdelete/nested2 add
514 adding testdelete/nested2/foo (glob)
514 adding testdelete/nested2/foo (glob)
515 $ hg -R testdelete/nested ci -m test
515 $ hg -R testdelete/nested ci -m test
516 $ hg -R testdelete/nested2 ci -m test
516 $ hg -R testdelete/nested2 ci -m test
517 $ echo nested = nested > testdelete/.hgsub
517 $ echo nested = nested > testdelete/.hgsub
518 $ echo nested2 = nested2 >> testdelete/.hgsub
518 $ echo nested2 = nested2 >> testdelete/.hgsub
519 $ hg -R testdelete add
519 $ hg -R testdelete add
520 adding testdelete/.hgsub (glob)
520 adding testdelete/.hgsub (glob)
521 $ hg -R testdelete ci -m "nested 1 & 2 added"
521 $ hg -R testdelete ci -m "nested 1 & 2 added"
522 committing subrepository nested
522 committing subrepository nested
523 committing subrepository nested2
523 committing subrepository nested2
524 $ echo nested = nested > testdelete/.hgsub
524 $ echo nested = nested > testdelete/.hgsub
525 $ hg -R testdelete ci -m "nested 2 deleted"
525 $ hg -R testdelete ci -m "nested 2 deleted"
526 $ cat testdelete/.hgsubstate
526 $ cat testdelete/.hgsubstate
527 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
527 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
528 $ hg -R testdelete remove testdelete/.hgsub
528 $ hg -R testdelete remove testdelete/.hgsub
529 $ hg -R testdelete ci -m ".hgsub deleted"
529 $ hg -R testdelete ci -m ".hgsub deleted"
530 $ cat testdelete/.hgsubstate
530 $ cat testdelete/.hgsubstate
531 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
531 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
532
532
533 test repository cloning
533 test repository cloning
534
534
535 $ mkdir mercurial mercurial2
535 $ mkdir mercurial mercurial2
536 $ hg init nested_absolute
536 $ hg init nested_absolute
537 $ echo test > nested_absolute/foo
537 $ echo test > nested_absolute/foo
538 $ hg -R nested_absolute add
538 $ hg -R nested_absolute add
539 adding nested_absolute/foo (glob)
539 adding nested_absolute/foo (glob)
540 $ hg -R nested_absolute ci -mtest
540 $ hg -R nested_absolute ci -mtest
541 $ cd mercurial
541 $ cd mercurial
542 $ hg init nested_relative
542 $ hg init nested_relative
543 $ echo test2 > nested_relative/foo2
543 $ echo test2 > nested_relative/foo2
544 $ hg -R nested_relative add
544 $ hg -R nested_relative add
545 adding nested_relative/foo2 (glob)
545 adding nested_relative/foo2 (glob)
546 $ hg -R nested_relative ci -mtest2
546 $ hg -R nested_relative ci -mtest2
547 $ hg init main
547 $ hg init main
548 $ echo "nested_relative = ../nested_relative" > main/.hgsub
548 $ echo "nested_relative = ../nested_relative" > main/.hgsub
549 $ echo "nested_absolute = `pwd`/nested_absolute" >> main/.hgsub
549 $ echo "nested_absolute = `pwd`/nested_absolute" >> main/.hgsub
550 $ hg -R main add
550 $ hg -R main add
551 adding main/.hgsub (glob)
551 adding main/.hgsub (glob)
552 $ hg -R main ci -m "add subrepos"
552 $ hg -R main ci -m "add subrepos"
553 committing subrepository nested_absolute
553 committing subrepository nested_absolute
554 committing subrepository nested_relative
554 committing subrepository nested_relative
555 $ cd ..
555 $ cd ..
556 $ hg clone mercurial/main mercurial2/main
556 $ hg clone mercurial/main mercurial2/main
557 updating to branch default
557 updating to branch default
558 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
558 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
559 $ cat mercurial2/main/nested_absolute/.hg/hgrc \
559 $ cat mercurial2/main/nested_absolute/.hg/hgrc \
560 > mercurial2/main/nested_relative/.hg/hgrc
560 > mercurial2/main/nested_relative/.hg/hgrc
561 [paths]
561 [paths]
562 default = $TESTTMP/sub/mercurial/nested_absolute
562 default = $TESTTMP/sub/mercurial/nested_absolute
563 [paths]
563 [paths]
564 default = $TESTTMP/sub/mercurial/nested_relative
564 default = $TESTTMP/sub/mercurial/nested_relative
565 $ rm -rf mercurial mercurial2
565 $ rm -rf mercurial mercurial2
566
566
567 Issue1977: multirepo push should fail if subrepo push fails
567 Issue1977: multirepo push should fail if subrepo push fails
568
568
569 $ hg init repo
569 $ hg init repo
570 $ hg init repo/s
570 $ hg init repo/s
571 $ echo a > repo/s/a
571 $ echo a > repo/s/a
572 $ hg -R repo/s ci -Am0
572 $ hg -R repo/s ci -Am0
573 adding a
573 adding a
574 $ echo s = s > repo/.hgsub
574 $ echo s = s > repo/.hgsub
575 $ hg -R repo ci -Am1
575 $ hg -R repo ci -Am1
576 adding .hgsub
576 adding .hgsub
577 committing subrepository s
577 committing subrepository s
578 $ hg clone repo repo2
578 $ hg clone repo repo2
579 updating to branch default
579 updating to branch default
580 cloning subrepo s from $TESTTMP/sub/repo/s (glob)
580 cloning subrepo s from $TESTTMP/sub/repo/s (glob)
581 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
581 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
582 $ hg -q -R repo2 pull -u
582 $ hg -q -R repo2 pull -u
583 $ echo 1 > repo2/s/a
583 $ echo 1 > repo2/s/a
584 $ hg -R repo2/s ci -m2
584 $ hg -R repo2/s ci -m2
585 $ hg -q -R repo2/s push
585 $ hg -q -R repo2/s push
586 $ hg -R repo2/s up -C 0
586 $ hg -R repo2/s up -C 0
587 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
587 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
588 $ echo 2 > repo2/s/a
588 $ echo 2 > repo2/s/a
589 $ hg -R repo2/s ci -m3
589 $ hg -R repo2/s ci -m3
590 created new head
590 created new head
591 $ hg -R repo2 ci -m3
591 $ hg -R repo2 ci -m3
592 committing subrepository s
592 committing subrepository s
593 $ hg -q -R repo2 push
593 $ hg -q -R repo2 push
594 abort: push creates new remote head 9d66565e64e1!
594 abort: push creates new remote head 9d66565e64e1!
595 (did you forget to merge? use push -f to force)
595 (did you forget to merge? use push -f to force)
596 [255]
596 [255]
597 $ hg -R repo update
597 $ hg -R repo update
598 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
598 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
599 $ rm -rf repo2 repo
599 $ rm -rf repo2 repo
600
600
601
601
602 Issue1852 subrepos with relative paths always push/pull relative to default
602 Issue1852 subrepos with relative paths always push/pull relative to default
603
603
604 Prepare a repo with subrepo
604 Prepare a repo with subrepo
605
605
606 $ hg init issue1852a
606 $ hg init issue1852a
607 $ cd issue1852a
607 $ cd issue1852a
608 $ hg init sub/repo
608 $ hg init sub/repo
609 $ echo test > sub/repo/foo
609 $ echo test > sub/repo/foo
610 $ hg -R sub/repo add sub/repo/foo
610 $ hg -R sub/repo add sub/repo/foo
611 $ echo sub/repo = sub/repo > .hgsub
611 $ echo sub/repo = sub/repo > .hgsub
612 $ hg add .hgsub
612 $ hg add .hgsub
613 $ hg ci -mtest
613 $ hg ci -mtest
614 committing subrepository sub/repo (glob)
614 committing subrepository sub/repo (glob)
615 $ echo test >> sub/repo/foo
615 $ echo test >> sub/repo/foo
616 $ hg ci -mtest
616 $ hg ci -mtest
617 committing subrepository sub/repo (glob)
617 committing subrepository sub/repo (glob)
618 $ cd ..
618 $ cd ..
619
619
620 Create repo without default path, pull top repo, and see what happens on update
620 Create repo without default path, pull top repo, and see what happens on update
621
621
622 $ hg init issue1852b
622 $ hg init issue1852b
623 $ hg -R issue1852b pull issue1852a
623 $ hg -R issue1852b pull issue1852a
624 pulling from issue1852a
624 pulling from issue1852a
625 requesting all changes
625 requesting all changes
626 adding changesets
626 adding changesets
627 adding manifests
627 adding manifests
628 adding file changes
628 adding file changes
629 added 2 changesets with 3 changes to 2 files
629 added 2 changesets with 3 changes to 2 files
630 (run 'hg update' to get a working copy)
630 (run 'hg update' to get a working copy)
631 $ hg -R issue1852b update
631 $ hg -R issue1852b update
632 abort: default path for subrepository sub/repo not found (glob)
632 abort: default path for subrepository sub/repo not found (glob)
633 [255]
633 [255]
634
634
635 Pull -u now doesn't help
635 Pull -u now doesn't help
636
636
637 $ hg -R issue1852b pull -u issue1852a
637 $ hg -R issue1852b pull -u issue1852a
638 pulling from issue1852a
638 pulling from issue1852a
639 searching for changes
639 searching for changes
640 no changes found
640 no changes found
641
641
642 Try the same, but with pull -u
642 Try the same, but with pull -u
643
643
644 $ hg init issue1852c
644 $ hg init issue1852c
645 $ hg -R issue1852c pull -r0 -u issue1852a
645 $ hg -R issue1852c pull -r0 -u issue1852a
646 pulling from issue1852a
646 pulling from issue1852a
647 adding changesets
647 adding changesets
648 adding manifests
648 adding manifests
649 adding file changes
649 adding file changes
650 added 1 changesets with 2 changes to 2 files
650 added 1 changesets with 2 changes to 2 files
651 cloning subrepo sub/repo from issue1852a/sub/repo (glob)
651 cloning subrepo sub/repo from issue1852a/sub/repo (glob)
652 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
652 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
653
653
654 Try to push from the other side
654 Try to push from the other side
655
655
656 $ hg -R issue1852a push `pwd`/issue1852c
656 $ hg -R issue1852a push `pwd`/issue1852c
657 pushing to $TESTTMP/sub/issue1852c
657 pushing to $TESTTMP/sub/issue1852c
658 pushing subrepo sub/repo to $TESTTMP/sub/issue1852c/sub/repo (glob)
658 pushing subrepo sub/repo to $TESTTMP/sub/issue1852c/sub/repo (glob)
659 searching for changes
659 searching for changes
660 no changes found
660 no changes found
661 searching for changes
661 searching for changes
662 adding changesets
662 adding changesets
663 adding manifests
663 adding manifests
664 adding file changes
664 adding file changes
665 added 1 changesets with 1 changes to 1 files
665 added 1 changesets with 1 changes to 1 files
666
666
667 Incoming and outgoing should not use the default path:
667 Incoming and outgoing should not use the default path:
668
668
669 $ hg clone -q issue1852a issue1852d
669 $ hg clone -q issue1852a issue1852d
670 $ hg -R issue1852d outgoing --subrepos issue1852c
670 $ hg -R issue1852d outgoing --subrepos issue1852c
671 comparing with issue1852c
671 comparing with issue1852c
672 searching for changes
672 searching for changes
673 no changes found
673 no changes found
674 comparing with issue1852c/sub/repo
674 comparing with issue1852c/sub/repo
675 searching for changes
675 searching for changes
676 no changes found
676 no changes found
677 [1]
677 [1]
678 $ hg -R issue1852d incoming --subrepos issue1852c
678 $ hg -R issue1852d incoming --subrepos issue1852c
679 comparing with issue1852c
679 comparing with issue1852c
680 searching for changes
680 searching for changes
681 no changes found
681 no changes found
682 comparing with issue1852c/sub/repo
682 comparing with issue1852c/sub/repo
683 searching for changes
683 searching for changes
684 no changes found
684 no changes found
685 [1]
685 [1]
686
686
687 Check status of files when none of them belong to the first
687 Check status of files when none of them belong to the first
688 subrepository:
688 subrepository:
689
689
690 $ hg init subrepo-status
690 $ hg init subrepo-status
691 $ cd subrepo-status
691 $ cd subrepo-status
692 $ hg init subrepo-1
692 $ hg init subrepo-1
693 $ hg init subrepo-2
693 $ hg init subrepo-2
694 $ cd subrepo-2
694 $ cd subrepo-2
695 $ touch file
695 $ touch file
696 $ hg add file
696 $ hg add file
697 $ cd ..
697 $ cd ..
698 $ echo subrepo-1 = subrepo-1 > .hgsub
698 $ echo subrepo-1 = subrepo-1 > .hgsub
699 $ echo subrepo-2 = subrepo-2 >> .hgsub
699 $ echo subrepo-2 = subrepo-2 >> .hgsub
700 $ hg add .hgsub
700 $ hg add .hgsub
701 $ hg ci -m 'Added subrepos'
701 $ hg ci -m 'Added subrepos'
702 committing subrepository subrepo-1
702 committing subrepository subrepo-1
703 committing subrepository subrepo-2
703 committing subrepository subrepo-2
704 $ hg st subrepo-2/file
704 $ hg st subrepo-2/file
705
705
706 Check hg update --clean
706 Check hg update --clean
707 $ cd $TESTTMP/sub/t
707 $ cd $TESTTMP/sub/t
708 $ rm -r t/t.orig
708 $ rm -r t/t.orig
709 $ hg status -S --all
709 $ hg status -S --all
710 C .hgsub
710 C .hgsub
711 C .hgsubstate
711 C .hgsubstate
712 C a
712 C a
713 C s/.hgsub
713 C s/.hgsub
714 C s/.hgsubstate
714 C s/.hgsubstate
715 C s/a
715 C s/a
716 C s/ss/a
716 C s/ss/a
717 C t/t
717 C t/t
718 $ echo c1 > s/a
718 $ echo c1 > s/a
719 $ cd s
719 $ cd s
720 $ echo c1 > b
720 $ echo c1 > b
721 $ echo c1 > c
721 $ echo c1 > c
722 $ hg add b
722 $ hg add b
723 $ cd ..
723 $ cd ..
724 $ hg status -S
724 $ hg status -S
725 M s/a
725 M s/a
726 A s/b
726 A s/b
727 ? s/c
727 ? s/c
728 $ hg update -C
728 $ hg update -C
729 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
729 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
730 $ hg status -S
730 $ hg status -S
731 ? s/b
731 ? s/b
732 ? s/c
732 ? s/c
733
733
734 Sticky subrepositories, no changes
734 Sticky subrepositories, no changes
735 $ cd $TESTTMP/sub/t
735 $ cd $TESTTMP/sub/t
736 $ hg id
736 $ hg id
737 925c17564ef8 tip
737 925c17564ef8 tip
738 $ hg -R s id
738 $ hg -R s id
739 12a213df6fa9 tip
739 12a213df6fa9 tip
740 $ hg -R t id
740 $ hg -R t id
741 52c0adc0515a tip
741 52c0adc0515a tip
742 $ hg update 11
742 $ hg update 11
743 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
743 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
744 $ hg id
744 $ hg id
745 365661e5936a
745 365661e5936a
746 $ hg -R s id
746 $ hg -R s id
747 fc627a69481f
747 fc627a69481f
748 $ hg -R t id
748 $ hg -R t id
749 e95bcfa18a35
749 e95bcfa18a35
750
750
751 Sticky subrepositorys, file changes
751 Sticky subrepositorys, file changes
752 $ touch s/f1
752 $ touch s/f1
753 $ touch t/f1
753 $ touch t/f1
754 $ hg add -S s/f1
754 $ hg add -S s/f1
755 $ hg add -S t/f1
755 $ hg add -S t/f1
756 $ hg id
756 $ hg id
757 365661e5936a
757 365661e5936a
758 $ hg -R s id
758 $ hg -R s id
759 fc627a69481f+
759 fc627a69481f+
760 $ hg -R t id
760 $ hg -R t id
761 e95bcfa18a35+
761 e95bcfa18a35+
762 $ hg update tip
762 $ hg update tip
763 subrepository sources for s differ
763 subrepository sources for s differ
764 use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9)?
764 use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9)?
765 l
765 l
766 subrepository sources for t differ
766 subrepository sources for t differ
767 use (l)ocal source (e95bcfa18a35) or (r)emote source (52c0adc0515a)?
767 use (l)ocal source (e95bcfa18a35) or (r)emote source (52c0adc0515a)?
768 l
768 l
769 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
769 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
770 $ hg id
770 $ hg id
771 925c17564ef8+ tip
771 925c17564ef8+ tip
772 $ hg -R s id
772 $ hg -R s id
773 fc627a69481f+
773 fc627a69481f+
774 $ hg -R t id
774 $ hg -R t id
775 e95bcfa18a35+
775 e95bcfa18a35+
776 $ hg update --clean tip
776 $ hg update --clean tip
777 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
777 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
778
778
779 Sticky subrepository, revision updates
779 Sticky subrepository, revision updates
780 $ hg id
780 $ hg id
781 925c17564ef8 tip
781 925c17564ef8 tip
782 $ hg -R s id
782 $ hg -R s id
783 12a213df6fa9 tip
783 12a213df6fa9 tip
784 $ hg -R t id
784 $ hg -R t id
785 52c0adc0515a tip
785 52c0adc0515a tip
786 $ cd s
786 $ cd s
787 $ hg update -r -2
787 $ hg update -r -2
788 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
788 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
789 $ cd ../t
789 $ cd ../t
790 $ hg update -r 2
790 $ hg update -r 2
791 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
791 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
792 $ cd ..
792 $ cd ..
793 $ hg update 10
793 $ hg update 10
794 subrepository sources for t differ (in checked out version)
794 subrepository sources for t differ (in checked out version)
795 use (l)ocal source (7af322bc1198) or (r)emote source (20a0db6fbf6c)?
795 use (l)ocal source (7af322bc1198) or (r)emote source (20a0db6fbf6c)?
796 l
796 l
797 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
797 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
798 $ hg id
798 $ hg id
799 e45c8b14af55+
799 e45c8b14af55+
800 $ hg -R s id
800 $ hg -R s id
801 1c833a7a9e3a
801 1c833a7a9e3a
802 $ hg -R t id
802 $ hg -R t id
803 7af322bc1198
803 7af322bc1198
804
804
805 Sticky subrepository, file changes and revision updates
805 Sticky subrepository, file changes and revision updates
806 $ touch s/f1
806 $ touch s/f1
807 $ touch t/f1
807 $ touch t/f1
808 $ hg add -S s/f1
808 $ hg add -S s/f1
809 $ hg add -S t/f1
809 $ hg add -S t/f1
810 $ hg id
810 $ hg id
811 e45c8b14af55+
811 e45c8b14af55+
812 $ hg -R s id
812 $ hg -R s id
813 1c833a7a9e3a+
813 1c833a7a9e3a+
814 $ hg -R t id
814 $ hg -R t id
815 7af322bc1198+
815 7af322bc1198+
816 $ hg update tip
816 $ hg update tip
817 subrepository sources for s differ
817 subrepository sources for s differ
818 use (l)ocal source (1c833a7a9e3a) or (r)emote source (12a213df6fa9)?
818 use (l)ocal source (1c833a7a9e3a) or (r)emote source (12a213df6fa9)?
819 l
819 l
820 subrepository sources for t differ
820 subrepository sources for t differ
821 use (l)ocal source (7af322bc1198) or (r)emote source (52c0adc0515a)?
821 use (l)ocal source (7af322bc1198) or (r)emote source (52c0adc0515a)?
822 l
822 l
823 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
823 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
824 $ hg id
824 $ hg id
825 925c17564ef8 tip
825 925c17564ef8 tip
826 $ hg -R s id
826 $ hg -R s id
827 1c833a7a9e3a+
827 1c833a7a9e3a+
828 $ hg -R t id
828 $ hg -R t id
829 7af322bc1198+
829 7af322bc1198+
830
830
831 Sticky repository, update --clean
831 Sticky repository, update --clean
832 $ hg update --clean tip
832 $ hg update --clean tip
833 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
833 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
834 $ hg id
834 $ hg id
835 925c17564ef8 tip
835 925c17564ef8 tip
836 $ hg -R s id
836 $ hg -R s id
837 12a213df6fa9 tip
837 12a213df6fa9 tip
838 $ hg -R t id
838 $ hg -R t id
839 52c0adc0515a tip
839 52c0adc0515a tip
840
840
841 Test subrepo already at intended revision:
841 Test subrepo already at intended revision:
842 $ cd s
842 $ cd s
843 $ hg update fc627a69481f
843 $ hg update fc627a69481f
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 $ cd ..
845 $ cd ..
846 $ hg update 11
846 $ hg update 11
847 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
847 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
848 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
848 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
849 $ hg id -n
849 $ hg id -n
850 11+
850 11+
851 $ hg -R s id
851 $ hg -R s id
852 fc627a69481f
852 fc627a69481f
853 $ hg -R t id
853 $ hg -R t id
854 e95bcfa18a35
854 e95bcfa18a35
855
855
856 Test that removing .hgsubstate doesn't break anything:
856 Test that removing .hgsubstate doesn't break anything:
857
857
858 $ hg rm -f .hgsubstate
858 $ hg rm -f .hgsubstate
859 $ hg ci -mrm
859 $ hg ci -mrm
860 committing subrepository s
860 committing subrepository s
861 committing subrepository t
861 committing subrepository t
862 created new head
862 created new head
863 $ hg log -vr tip
863 $ hg log -vr tip
864 changeset: 14:3941e0aa5236
864 changeset: 14:3941e0aa5236
865 tag: tip
865 tag: tip
866 parent: 11:365661e5936a
866 parent: 11:365661e5936a
867 user: test
867 user: test
868 date: Thu Jan 01 00:00:00 1970 +0000
868 date: Thu Jan 01 00:00:00 1970 +0000
869 description:
869 description:
870 rm
870 rm
871
871
872
872
873
873
874 Test that removing .hgsub removes .hgsubstate:
874 Test that removing .hgsub removes .hgsubstate:
875
875
876 $ hg rm .hgsub
876 $ hg rm .hgsub
877 $ hg ci -mrm2
877 $ hg ci -mrm2
878 $ hg log -vr tip
878 $ hg log -vr tip
879 changeset: 15:8b31de9d13d1
879 changeset: 15:8b31de9d13d1
880 tag: tip
880 tag: tip
881 user: test
881 user: test
882 date: Thu Jan 01 00:00:00 1970 +0000
882 date: Thu Jan 01 00:00:00 1970 +0000
883 files: .hgsub .hgsubstate
883 files: .hgsub .hgsubstate
884 description:
884 description:
885 rm2
885 rm2
886
886
887
887
888 Test behavior of add for explicit path in subrepo:
888 Test behavior of add for explicit path in subrepo:
889 $ cd ..
889 $ cd ..
890 $ hg init explicit
890 $ hg init explicit
891 $ cd explicit
891 $ cd explicit
892 $ echo s = s > .hgsub
892 $ echo s = s > .hgsub
893 $ hg add .hgsub
893 $ hg add .hgsub
894 $ hg init s
894 $ hg init s
895 $ hg ci -m0
895 $ hg ci -m0
896 committing subrepository s
896 committing subrepository s
897 Adding with an explicit path in a subrepo adds the file
897 Adding with an explicit path in a subrepo adds the file
898 $ echo c1 > f1
898 $ echo c1 > f1
899 $ echo c2 > s/f2
899 $ echo c2 > s/f2
900 $ hg st -S
900 $ hg st -S
901 ? f1
901 ? f1
902 ? s/f2
902 ? s/f2
903 $ hg add s/f2
903 $ hg add s/f2
904 $ hg st -S
904 $ hg st -S
905 A s/f2
905 A s/f2
906 ? f1
906 ? f1
907 $ hg ci -R s -m0
907 $ hg ci -R s -m0
908 $ hg ci -Am1
908 $ hg ci -Am1
909 adding f1
909 adding f1
910 committing subrepository s
910 committing subrepository s
911 Adding with an explicit path in a subrepo with -S has the same behavior
911 Adding with an explicit path in a subrepo with -S has the same behavior
912 $ echo c3 > f3
912 $ echo c3 > f3
913 $ echo c4 > s/f4
913 $ echo c4 > s/f4
914 $ hg st -S
914 $ hg st -S
915 ? f3
915 ? f3
916 ? s/f4
916 ? s/f4
917 $ hg add -S s/f4
917 $ hg add -S s/f4
918 $ hg st -S
918 $ hg st -S
919 A s/f4
919 A s/f4
920 ? f3
920 ? f3
921 $ hg ci -R s -m1
921 $ hg ci -R s -m1
922 $ hg ci -Ama2
922 $ hg ci -Ama2
923 adding f3
923 adding f3
924 committing subrepository s
924 committing subrepository s
925 Adding without a path or pattern silently ignores subrepos
925 Adding without a path or pattern silently ignores subrepos
926 $ echo c5 > f5
926 $ echo c5 > f5
927 $ echo c6 > s/f6
927 $ echo c6 > s/f6
928 $ echo c7 > s/f7
928 $ echo c7 > s/f7
929 $ hg st -S
929 $ hg st -S
930 ? f5
930 ? f5
931 ? s/f6
931 ? s/f6
932 ? s/f7
932 ? s/f7
933 $ hg add
933 $ hg add
934 adding f5
934 adding f5
935 $ hg st -S
935 $ hg st -S
936 A f5
936 A f5
937 ? s/f6
937 ? s/f6
938 ? s/f7
938 ? s/f7
939 $ hg ci -R s -Am2
939 $ hg ci -R s -Am2
940 adding f6
940 adding f6
941 adding f7
941 adding f7
942 $ hg ci -m3
942 $ hg ci -m3
943 committing subrepository s
943 committing subrepository s
944 Adding without a path or pattern with -S also adds files in subrepos
944 Adding without a path or pattern with -S also adds files in subrepos
945 $ echo c8 > f8
945 $ echo c8 > f8
946 $ echo c9 > s/f9
946 $ echo c9 > s/f9
947 $ echo c10 > s/f10
947 $ echo c10 > s/f10
948 $ hg st -S
948 $ hg st -S
949 ? f8
949 ? f8
950 ? s/f10
950 ? s/f10
951 ? s/f9
951 ? s/f9
952 $ hg add -S
952 $ hg add -S
953 adding f8
953 adding f8
954 adding s/f10 (glob)
954 adding s/f10 (glob)
955 adding s/f9 (glob)
955 adding s/f9 (glob)
956 $ hg st -S
956 $ hg st -S
957 A f8
957 A f8
958 A s/f10
958 A s/f10
959 A s/f9
959 A s/f9
960 $ hg ci -R s -m3
960 $ hg ci -R s -m3
961 $ hg ci -m4
961 $ hg ci -m4
962 committing subrepository s
962 committing subrepository s
963 Adding with a pattern silently ignores subrepos
963 Adding with a pattern silently ignores subrepos
964 $ echo c11 > fm11
964 $ echo c11 > fm11
965 $ echo c12 > fn12
965 $ echo c12 > fn12
966 $ echo c13 > s/fm13
966 $ echo c13 > s/fm13
967 $ echo c14 > s/fn14
967 $ echo c14 > s/fn14
968 $ hg st -S
968 $ hg st -S
969 ? fm11
969 ? fm11
970 ? fn12
970 ? fn12
971 ? s/fm13
971 ? s/fm13
972 ? s/fn14
972 ? s/fn14
973 $ hg add 'glob:**fm*'
973 $ hg add 'glob:**fm*'
974 adding fm11
974 adding fm11
975 $ hg st -S
975 $ hg st -S
976 A fm11
976 A fm11
977 ? fn12
977 ? fn12
978 ? s/fm13
978 ? s/fm13
979 ? s/fn14
979 ? s/fn14
980 $ hg ci -R s -Am4
980 $ hg ci -R s -Am4
981 adding fm13
981 adding fm13
982 adding fn14
982 adding fn14
983 $ hg ci -Am5
983 $ hg ci -Am5
984 adding fn12
984 adding fn12
985 committing subrepository s
985 committing subrepository s
986 Adding with a pattern with -S also adds matches in subrepos
986 Adding with a pattern with -S also adds matches in subrepos
987 $ echo c15 > fm15
987 $ echo c15 > fm15
988 $ echo c16 > fn16
988 $ echo c16 > fn16
989 $ echo c17 > s/fm17
989 $ echo c17 > s/fm17
990 $ echo c18 > s/fn18
990 $ echo c18 > s/fn18
991 $ hg st -S
991 $ hg st -S
992 ? fm15
992 ? fm15
993 ? fn16
993 ? fn16
994 ? s/fm17
994 ? s/fm17
995 ? s/fn18
995 ? s/fn18
996 $ hg add -S 'glob:**fm*'
996 $ hg add -S 'glob:**fm*'
997 adding fm15
997 adding fm15
998 adding s/fm17 (glob)
998 adding s/fm17 (glob)
999 $ hg st -S
999 $ hg st -S
1000 A fm15
1000 A fm15
1001 A s/fm17
1001 A s/fm17
1002 ? fn16
1002 ? fn16
1003 ? s/fn18
1003 ? s/fn18
1004 $ hg ci -R s -Am5
1004 $ hg ci -R s -Am5
1005 adding fn18
1005 adding fn18
1006 $ hg ci -Am6
1006 $ hg ci -Am6
1007 adding fn16
1007 adding fn16
1008 committing subrepository s
1008 committing subrepository s
1009
1009
1010 Test behavior of forget for explicit path in subrepo:
1010 Test behavior of forget for explicit path in subrepo:
1011 Forgetting an explicit path in a subrepo untracks the file
1011 Forgetting an explicit path in a subrepo untracks the file
1012 $ echo c19 > s/f19
1012 $ echo c19 > s/f19
1013 $ hg add s/f19
1013 $ hg add s/f19
1014 $ hg st -S
1014 $ hg st -S
1015 A s/f19
1015 A s/f19
1016 $ hg forget s/f19
1016 $ hg forget s/f19
1017 $ hg st -S
1017 $ hg st -S
1018 ? s/f19
1018 ? s/f19
1019 $ rm s/f19
1019 $ rm s/f19
@@ -1,236 +1,236 b''
1 $ HGMERGE=true; export HGMERGE
1 $ HGMERGE=true; export HGMERGE
2
2
3 $ hg init r1
3 $ hg init r1
4 $ cd r1
4 $ cd r1
5 $ echo a > a
5 $ echo a > a
6 $ hg addremove
6 $ hg addremove
7 adding a
7 adding a
8 $ hg commit -m "1"
8 $ hg commit -m "1"
9
9
10 $ hg clone . ../r2
10 $ hg clone . ../r2
11 updating to branch default
11 updating to branch default
12 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
12 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
13 $ cd ../r2
13 $ cd ../r2
14 $ hg up
14 $ hg up
15 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
15 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
16 $ echo abc > a
16 $ echo abc > a
17 $ hg diff --nodates
17 $ hg diff --nodates
18 diff -r c19d34741b0a a
18 diff -r c19d34741b0a a
19 --- a/a
19 --- a/a
20 +++ b/a
20 +++ b/a
21 @@ -1,1 +1,1 @@
21 @@ -1,1 +1,1 @@
22 -a
22 -a
23 +abc
23 +abc
24
24
25 $ cd ../r1
25 $ cd ../r1
26 $ echo b > b
26 $ echo b > b
27 $ echo a2 > a
27 $ echo a2 > a
28 $ hg addremove
28 $ hg addremove
29 adding b
29 adding b
30 $ hg commit -m "2"
30 $ hg commit -m "2"
31
31
32 $ cd ../r2
32 $ cd ../r2
33 $ hg -q pull ../r1
33 $ hg -q pull ../r1
34 $ hg status
34 $ hg status
35 M a
35 M a
36 $ hg parents
36 $ hg parents
37 changeset: 0:c19d34741b0a
37 changeset: 0:c19d34741b0a
38 user: test
38 user: test
39 date: Thu Jan 01 00:00:00 1970 +0000
39 date: Thu Jan 01 00:00:00 1970 +0000
40 summary: 1
40 summary: 1
41
41
42 $ hg --debug up
42 $ hg --debug up
43 searching for copies back to rev 1
43 searching for copies back to rev 1
44 unmatched files in other:
44 unmatched files in other:
45 b
45 b
46 resolving manifests
46 resolving manifests
47 overwrite False partial False
47 overwrite: False, partial: False
48 ancestor c19d34741b0a local c19d34741b0a+ remote 1e71731e6fbb
48 ancestor: c19d34741b0a, local: c19d34741b0a+, remote: 1e71731e6fbb
49 a: versions differ -> m
49 a: versions differ -> m
50 b: remote created -> g
50 b: remote created -> g
51 preserving a for resolve of a
51 preserving a for resolve of a
52 updating: a 1/2 files (50.00%)
52 updating: a 1/2 files (50.00%)
53 picked tool 'true' for a (binary False symlink False)
53 picked tool 'true' for a (binary False symlink False)
54 merging a
54 merging a
55 my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
55 my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
56 updating: b 2/2 files (100.00%)
56 updating: b 2/2 files (100.00%)
57 getting b
57 getting b
58 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
58 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
59 $ hg parents
59 $ hg parents
60 changeset: 1:1e71731e6fbb
60 changeset: 1:1e71731e6fbb
61 tag: tip
61 tag: tip
62 user: test
62 user: test
63 date: Thu Jan 01 00:00:00 1970 +0000
63 date: Thu Jan 01 00:00:00 1970 +0000
64 summary: 2
64 summary: 2
65
65
66 $ hg --debug up 0
66 $ hg --debug up 0
67 resolving manifests
67 resolving manifests
68 overwrite False partial False
68 overwrite: False, partial: False
69 ancestor 1e71731e6fbb local 1e71731e6fbb+ remote c19d34741b0a
69 ancestor: 1e71731e6fbb, local: 1e71731e6fbb+, remote: c19d34741b0a
70 a: versions differ -> m
70 a: versions differ -> m
71 b: other deleted -> r
71 b: other deleted -> r
72 preserving a for resolve of a
72 preserving a for resolve of a
73 updating: b 1/2 files (50.00%)
73 updating: b 1/2 files (50.00%)
74 removing b
74 removing b
75 updating: a 2/2 files (100.00%)
75 updating: a 2/2 files (100.00%)
76 picked tool 'true' for a (binary False symlink False)
76 picked tool 'true' for a (binary False symlink False)
77 merging a
77 merging a
78 my a@1e71731e6fbb+ other a@c19d34741b0a ancestor a@1e71731e6fbb
78 my a@1e71731e6fbb+ other a@c19d34741b0a ancestor a@1e71731e6fbb
79 0 files updated, 1 files merged, 1 files removed, 0 files unresolved
79 0 files updated, 1 files merged, 1 files removed, 0 files unresolved
80 $ hg parents
80 $ hg parents
81 changeset: 0:c19d34741b0a
81 changeset: 0:c19d34741b0a
82 user: test
82 user: test
83 date: Thu Jan 01 00:00:00 1970 +0000
83 date: Thu Jan 01 00:00:00 1970 +0000
84 summary: 1
84 summary: 1
85
85
86 $ hg --debug merge
86 $ hg --debug merge
87 abort: nothing to merge
87 abort: nothing to merge
88 (use 'hg update' instead)
88 (use 'hg update' instead)
89 [255]
89 [255]
90 $ hg parents
90 $ hg parents
91 changeset: 0:c19d34741b0a
91 changeset: 0:c19d34741b0a
92 user: test
92 user: test
93 date: Thu Jan 01 00:00:00 1970 +0000
93 date: Thu Jan 01 00:00:00 1970 +0000
94 summary: 1
94 summary: 1
95
95
96 $ hg --debug up
96 $ hg --debug up
97 searching for copies back to rev 1
97 searching for copies back to rev 1
98 unmatched files in other:
98 unmatched files in other:
99 b
99 b
100 resolving manifests
100 resolving manifests
101 overwrite False partial False
101 overwrite: False, partial: False
102 ancestor c19d34741b0a local c19d34741b0a+ remote 1e71731e6fbb
102 ancestor: c19d34741b0a, local: c19d34741b0a+, remote: 1e71731e6fbb
103 a: versions differ -> m
103 a: versions differ -> m
104 b: remote created -> g
104 b: remote created -> g
105 preserving a for resolve of a
105 preserving a for resolve of a
106 updating: a 1/2 files (50.00%)
106 updating: a 1/2 files (50.00%)
107 picked tool 'true' for a (binary False symlink False)
107 picked tool 'true' for a (binary False symlink False)
108 merging a
108 merging a
109 my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
109 my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
110 updating: b 2/2 files (100.00%)
110 updating: b 2/2 files (100.00%)
111 getting b
111 getting b
112 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
112 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
113 $ hg parents
113 $ hg parents
114 changeset: 1:1e71731e6fbb
114 changeset: 1:1e71731e6fbb
115 tag: tip
115 tag: tip
116 user: test
116 user: test
117 date: Thu Jan 01 00:00:00 1970 +0000
117 date: Thu Jan 01 00:00:00 1970 +0000
118 summary: 2
118 summary: 2
119
119
120 $ hg -v history
120 $ hg -v history
121 changeset: 1:1e71731e6fbb
121 changeset: 1:1e71731e6fbb
122 tag: tip
122 tag: tip
123 user: test
123 user: test
124 date: Thu Jan 01 00:00:00 1970 +0000
124 date: Thu Jan 01 00:00:00 1970 +0000
125 files: a b
125 files: a b
126 description:
126 description:
127 2
127 2
128
128
129
129
130 changeset: 0:c19d34741b0a
130 changeset: 0:c19d34741b0a
131 user: test
131 user: test
132 date: Thu Jan 01 00:00:00 1970 +0000
132 date: Thu Jan 01 00:00:00 1970 +0000
133 files: a
133 files: a
134 description:
134 description:
135 1
135 1
136
136
137
137
138 $ hg diff --nodates
138 $ hg diff --nodates
139 diff -r 1e71731e6fbb a
139 diff -r 1e71731e6fbb a
140 --- a/a
140 --- a/a
141 +++ b/a
141 +++ b/a
142 @@ -1,1 +1,1 @@
142 @@ -1,1 +1,1 @@
143 -a2
143 -a2
144 +abc
144 +abc
145
145
146
146
147 create a second head
147 create a second head
148
148
149 $ cd ../r1
149 $ cd ../r1
150 $ hg up 0
150 $ hg up 0
151 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
151 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
152 $ echo b2 > b
152 $ echo b2 > b
153 $ echo a3 > a
153 $ echo a3 > a
154 $ hg addremove
154 $ hg addremove
155 adding b
155 adding b
156 $ hg commit -m "3"
156 $ hg commit -m "3"
157 created new head
157 created new head
158
158
159 $ cd ../r2
159 $ cd ../r2
160 $ hg -q pull ../r1
160 $ hg -q pull ../r1
161 $ hg status
161 $ hg status
162 M a
162 M a
163 $ hg parents
163 $ hg parents
164 changeset: 1:1e71731e6fbb
164 changeset: 1:1e71731e6fbb
165 user: test
165 user: test
166 date: Thu Jan 01 00:00:00 1970 +0000
166 date: Thu Jan 01 00:00:00 1970 +0000
167 summary: 2
167 summary: 2
168
168
169 $ hg --debug up
169 $ hg --debug up
170 abort: crosses branches (merge branches or use --clean to discard changes)
170 abort: crosses branches (merge branches or use --clean to discard changes)
171 [255]
171 [255]
172 $ hg --debug merge
172 $ hg --debug merge
173 abort: outstanding uncommitted changes
173 abort: outstanding uncommitted changes
174 (use 'hg status' to list changes)
174 (use 'hg status' to list changes)
175 [255]
175 [255]
176 $ hg --debug merge -f
176 $ hg --debug merge -f
177 searching for copies back to rev 1
177 searching for copies back to rev 1
178 resolving manifests
178 resolving manifests
179 overwrite False partial False
179 overwrite: False, partial: False
180 ancestor c19d34741b0a local 1e71731e6fbb+ remote 83c51d0caff4
180 ancestor: c19d34741b0a, local: 1e71731e6fbb+, remote: 83c51d0caff4
181 a: versions differ -> m
181 a: versions differ -> m
182 b: versions differ -> m
182 b: versions differ -> m
183 preserving a for resolve of a
183 preserving a for resolve of a
184 preserving b for resolve of b
184 preserving b for resolve of b
185 updating: a 1/2 files (50.00%)
185 updating: a 1/2 files (50.00%)
186 picked tool 'true' for a (binary False symlink False)
186 picked tool 'true' for a (binary False symlink False)
187 merging a
187 merging a
188 my a@1e71731e6fbb+ other a@83c51d0caff4 ancestor a@c19d34741b0a
188 my a@1e71731e6fbb+ other a@83c51d0caff4 ancestor a@c19d34741b0a
189 updating: b 2/2 files (100.00%)
189 updating: b 2/2 files (100.00%)
190 picked tool 'true' for b (binary False symlink False)
190 picked tool 'true' for b (binary False symlink False)
191 merging b
191 merging b
192 my b@1e71731e6fbb+ other b@83c51d0caff4 ancestor b@000000000000
192 my b@1e71731e6fbb+ other b@83c51d0caff4 ancestor b@000000000000
193 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
193 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
194 (branch merge, don't forget to commit)
194 (branch merge, don't forget to commit)
195 $ hg parents
195 $ hg parents
196 changeset: 1:1e71731e6fbb
196 changeset: 1:1e71731e6fbb
197 user: test
197 user: test
198 date: Thu Jan 01 00:00:00 1970 +0000
198 date: Thu Jan 01 00:00:00 1970 +0000
199 summary: 2
199 summary: 2
200
200
201 changeset: 2:83c51d0caff4
201 changeset: 2:83c51d0caff4
202 tag: tip
202 tag: tip
203 parent: 0:c19d34741b0a
203 parent: 0:c19d34741b0a
204 user: test
204 user: test
205 date: Thu Jan 01 00:00:00 1970 +0000
205 date: Thu Jan 01 00:00:00 1970 +0000
206 summary: 3
206 summary: 3
207
207
208 $ hg diff --nodates
208 $ hg diff --nodates
209 diff -r 1e71731e6fbb a
209 diff -r 1e71731e6fbb a
210 --- a/a
210 --- a/a
211 +++ b/a
211 +++ b/a
212 @@ -1,1 +1,1 @@
212 @@ -1,1 +1,1 @@
213 -a2
213 -a2
214 +abc
214 +abc
215
215
216
216
217 test a local add
217 test a local add
218
218
219 $ cd ..
219 $ cd ..
220 $ hg init a
220 $ hg init a
221 $ hg init b
221 $ hg init b
222 $ echo a > a/a
222 $ echo a > a/a
223 $ echo a > b/a
223 $ echo a > b/a
224 $ hg --cwd a commit -A -m a
224 $ hg --cwd a commit -A -m a
225 adding a
225 adding a
226 $ cd b
226 $ cd b
227 $ hg add a
227 $ hg add a
228 $ hg pull -u ../a
228 $ hg pull -u ../a
229 pulling from ../a
229 pulling from ../a
230 requesting all changes
230 requesting all changes
231 adding changesets
231 adding changesets
232 adding manifests
232 adding manifests
233 adding file changes
233 adding file changes
234 added 1 changesets with 1 changes to 1 files
234 added 1 changesets with 1 changes to 1 files
235 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
235 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
236 $ hg st
236 $ hg st
@@ -1,85 +1,85 b''
1 $ hg init
1 $ hg init
2
2
3 $ touch a
3 $ touch a
4 $ hg add a
4 $ hg add a
5 $ hg commit -m "Added a"
5 $ hg commit -m "Added a"
6
6
7 $ touch main
7 $ touch main
8 $ hg add main
8 $ hg add main
9 $ hg commit -m "Added main"
9 $ hg commit -m "Added main"
10 $ hg checkout 0
10 $ hg checkout 0
11 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
11 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
12
12
13 'main' should be gone:
13 'main' should be gone:
14
14
15 $ ls
15 $ ls
16 a
16 a
17
17
18 $ touch side1
18 $ touch side1
19 $ hg add side1
19 $ hg add side1
20 $ hg commit -m "Added side1"
20 $ hg commit -m "Added side1"
21 created new head
21 created new head
22 $ touch side2
22 $ touch side2
23 $ hg add side2
23 $ hg add side2
24 $ hg commit -m "Added side2"
24 $ hg commit -m "Added side2"
25
25
26 $ hg log
26 $ hg log
27 changeset: 3:91ebc10ed028
27 changeset: 3:91ebc10ed028
28 tag: tip
28 tag: tip
29 user: test
29 user: test
30 date: Thu Jan 01 00:00:00 1970 +0000
30 date: Thu Jan 01 00:00:00 1970 +0000
31 summary: Added side2
31 summary: Added side2
32
32
33 changeset: 2:b932d7dbb1e1
33 changeset: 2:b932d7dbb1e1
34 parent: 0:c2eda428b523
34 parent: 0:c2eda428b523
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: Added side1
37 summary: Added side1
38
38
39 changeset: 1:71a760306caf
39 changeset: 1:71a760306caf
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: Added main
42 summary: Added main
43
43
44 changeset: 0:c2eda428b523
44 changeset: 0:c2eda428b523
45 user: test
45 user: test
46 date: Thu Jan 01 00:00:00 1970 +0000
46 date: Thu Jan 01 00:00:00 1970 +0000
47 summary: Added a
47 summary: Added a
48
48
49
49
50 $ hg heads
50 $ hg heads
51 changeset: 3:91ebc10ed028
51 changeset: 3:91ebc10ed028
52 tag: tip
52 tag: tip
53 user: test
53 user: test
54 date: Thu Jan 01 00:00:00 1970 +0000
54 date: Thu Jan 01 00:00:00 1970 +0000
55 summary: Added side2
55 summary: Added side2
56
56
57 changeset: 1:71a760306caf
57 changeset: 1:71a760306caf
58 user: test
58 user: test
59 date: Thu Jan 01 00:00:00 1970 +0000
59 date: Thu Jan 01 00:00:00 1970 +0000
60 summary: Added main
60 summary: Added main
61
61
62 $ ls
62 $ ls
63 a
63 a
64 side1
64 side1
65 side2
65 side2
66
66
67 $ hg update --debug -C 1
67 $ hg update --debug -C 1
68 resolving manifests
68 resolving manifests
69 overwrite True partial False
69 overwrite: True, partial: False
70 ancestor 91ebc10ed028+ local 91ebc10ed028+ remote 71a760306caf
70 ancestor: 91ebc10ed028+, local: 91ebc10ed028+, remote: 71a760306caf
71 side2: other deleted -> r
71 side2: other deleted -> r
72 side1: other deleted -> r
72 side1: other deleted -> r
73 main: remote created -> g
73 main: remote created -> g
74 updating: side1 1/3 files (33.33%)
74 updating: side1 1/3 files (33.33%)
75 removing side1
75 removing side1
76 updating: side2 2/3 files (66.67%)
76 updating: side2 2/3 files (66.67%)
77 removing side2
77 removing side2
78 updating: main 3/3 files (100.00%)
78 updating: main 3/3 files (100.00%)
79 getting main
79 getting main
80 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
80 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
81
81
82 $ ls
82 $ ls
83 a
83 a
84 main
84 main
85
85
General Comments 0
You need to be logged in to leave comments. Login now