##// END OF EJS Templates
copies: skip directory rename checks when not merging...
Matt Mackall -
r6425:2d9328a2 default
parent child Browse files
Show More
@@ -1,194 +1,192 b''
1 1 # copies.py - copy detection for Mercurial
2 2 #
3 3 # Copyright 2008 Matt Mackall <mpm@selenic.com>
4 4 #
5 5 # This software may be used and distributed according to the terms
6 6 # of the GNU General Public License, incorporated herein by reference.
7 7
8 8 from node import nullid, nullrev
9 9 from i18n import _
10 10 import util, ancestor
11 11
12 12 def _nonoverlap(d1, d2, d3):
13 13 "Return list of elements in d1 not in d2 or d3"
14 14 l = [d for d in d1 if d not in d3 and d not in d2]
15 15 l.sort()
16 16 return l
17 17
18 18 def _dirname(f):
19 19 s = f.rfind("/")
20 20 if s == -1:
21 21 return ""
22 22 return f[:s]
23 23
24 24 def _dirs(files):
25 25 d = {}
26 26 for f in files:
27 27 f = _dirname(f)
28 28 while f not in d:
29 29 d[f] = True
30 30 f = _dirname(f)
31 31 return d
32 32
33 33 def _findoldnames(fctx, limit):
34 34 "find files that path was copied from, back to linkrev limit"
35 35 old = {}
36 36 seen = {}
37 37 orig = fctx.path()
38 38 visit = [(fctx, 0)]
39 39 while visit:
40 40 fc, depth = visit.pop()
41 41 s = str(fc)
42 42 if s in seen:
43 43 continue
44 44 seen[s] = 1
45 45 if fc.path() != orig and fc.path() not in old:
46 46 old[fc.path()] = (depth, fc.path()) # remember depth
47 47 if fc.rev() < limit and fc.rev() is not None:
48 48 continue
49 49 visit += [(p, depth - 1) for p in fc.parents()]
50 50
51 51 # return old names sorted by depth
52 52 old = old.values()
53 53 old.sort()
54 54 return [o[1] for o in old]
55 55
56 def copies(repo, c1, c2, ca):
56 def copies(repo, c1, c2, ca, checkdirs=False):
57 57 """
58 58 Find moves and copies between context c1 and c2
59 59 """
60 60 # avoid silly behavior for update from empty dir
61 61 if not c1 or not c2:
62 62 return {}, {}
63 63
64 64 rev1, rev2 = c1.rev(), c2.rev()
65 65 if rev1 is None: # c1 is a workingctx
66 66 rev1 = c1.parents()[0].rev()
67 67 if rev2 is None: # c2 is a workingctx
68 68 rev2 = c2.parents()[0].rev()
69 69 pr = repo.changelog.parentrevs
70 70 def parents(rev):
71 71 return [p for p in pr(rev) if p != nullrev]
72 72 limit = min(ancestor.symmetricdifference(rev1, rev2, parents))
73 73 m1 = c1.manifest()
74 74 m2 = c2.manifest()
75 75 ma = ca.manifest()
76 76
77 77 def makectx(f, n):
78 78 if len(n) != 20: # in a working context?
79 79 if c1.rev() is None:
80 80 return c1.filectx(f)
81 81 return c2.filectx(f)
82 82 return repo.filectx(f, fileid=n)
83 83 ctx = util.cachefunc(makectx)
84 84
85 85 copy = {}
86 86 fullcopy = {}
87 87 diverge = {}
88 88
89 89 def checkcopies(f, m1, m2):
90 90 '''check possible copies of f from m1 to m2'''
91 91 c1 = ctx(f, m1[f])
92 92 for of in _findoldnames(c1, limit):
93 93 fullcopy[f] = of # remember for dir rename detection
94 94 if of in m2: # original file not in other manifest?
95 95 # if the original file is unchanged on the other branch,
96 96 # no merge needed
97 97 if m2[of] != ma.get(of):
98 98 c2 = ctx(of, m2[of])
99 99 ca = c1.ancestor(c2)
100 100 # related and named changed on only one side?
101 101 if ca and (ca.path() == f or ca.path() == c2.path()):
102 102 if c1 != ca or c2 != ca: # merge needed?
103 103 copy[f] = of
104 104 elif of in ma:
105 105 diverge.setdefault(of, []).append(f)
106 106
107 if not repo.ui.configbool("merge", "followcopies", True):
108 return {}, {}
109
110 107 repo.ui.debug(_(" searching for copies back to rev %d\n") % limit)
111 108
112 109 u1 = _nonoverlap(m1, m2, ma)
113 110 u2 = _nonoverlap(m2, m1, ma)
114 111
115 112 if u1:
116 113 repo.ui.debug(_(" unmatched files in local:\n %s\n")
117 114 % "\n ".join(u1))
118 115 if u2:
119 116 repo.ui.debug(_(" unmatched files in other:\n %s\n")
120 117 % "\n ".join(u2))
121 118
122 119 for f in u1:
123 120 checkcopies(f, m1, m2)
124 121 for f in u2:
125 122 checkcopies(f, m2, m1)
126 123
127 124 diverge2 = {}
128 125 for of, fl in diverge.items():
129 126 if len(fl) == 1:
130 127 del diverge[of] # not actually divergent
131 128 else:
132 129 diverge2.update(dict.fromkeys(fl)) # reverse map for below
133 130
134 131 if fullcopy:
135 132 repo.ui.debug(_(" all copies found (* = to merge, ! = divergent):\n"))
136 133 for f in fullcopy:
137 134 note = ""
138 135 if f in copy: note += "*"
139 136 if f in diverge2: note += "!"
140 137 repo.ui.debug(_(" %s -> %s %s\n") % (f, fullcopy[f], note))
141 138 del diverge2
142 139
143 if not fullcopy or not repo.ui.configbool("merge", "followdirs", True):
140 if not fullcopy or not checkdirs:
144 141 return copy, diverge
145 142
146 143 repo.ui.debug(_(" checking for directory renames\n"))
147 144
148 145 # generate a directory move map
149 146 d1, d2 = _dirs(m1), _dirs(m2)
150 147 invalid = {}
151 148 dirmove = {}
152 149
153 150 # examine each file copy for a potential directory move, which is
154 151 # when all the files in a directory are moved to a new directory
155 152 for dst, src in fullcopy.items():
156 153 dsrc, ddst = _dirname(src), _dirname(dst)
157 154 if dsrc in invalid:
158 155 # already seen to be uninteresting
159 156 continue
160 157 elif dsrc in d1 and ddst in d1:
161 158 # directory wasn't entirely moved locally
162 159 invalid[dsrc] = True
163 160 elif dsrc in d2 and ddst in d2:
164 161 # directory wasn't entirely moved remotely
165 162 invalid[dsrc] = True
166 163 elif dsrc in dirmove and dirmove[dsrc] != ddst:
167 164 # files from the same directory moved to two different places
168 165 invalid[dsrc] = True
169 166 else:
170 167 # looks good so far
171 168 dirmove[dsrc + "/"] = ddst + "/"
172 169
173 170 for i in invalid:
174 171 if i in dirmove:
175 172 del dirmove[i]
176 173 del d1, d2, invalid
177 174
178 175 if not dirmove:
179 176 return copy, diverge
180 177
181 178 for d in dirmove:
182 179 repo.ui.debug(_(" dir %s -> %s\n") % (d, dirmove[d]))
183 180
184 181 # check unaccounted nonoverlapping files against directory moves
185 182 for f in u1 + u2:
186 183 if f not in fullcopy:
187 184 for d in dirmove:
188 185 if f.startswith(d):
189 186 # new file added in a directory that was moved, move it
190 copy[f] = dirmove[d] + f[len(d):]
187 df = dirmove[d] + f[len(d):]
188 copy[f] = df
191 189 repo.ui.debug(_(" file %s -> %s\n") % (f, copy[f]))
192 190 break
193 191
194 192 return copy, diverge
@@ -1,411 +1,413 b''
1 1 # merge.py - directory-level update/merge handling for Mercurial
2 2 #
3 3 # Copyright 2006, 2007 Matt Mackall <mpm@selenic.com>
4 4 #
5 5 # This software may be used and distributed according to the terms
6 6 # of the GNU General Public License, incorporated herein by reference.
7 7
8 8 from node import nullid, nullrev
9 9 from i18n import _
10 10 import errno, util, os, filemerge, copies
11 11
12 12 def _checkunknown(wctx, mctx):
13 13 "check for collisions between unknown files and files in mctx"
14 14 for f in wctx.unknown():
15 15 if f in mctx and mctx[f].cmp(wctx[f].data()):
16 16 raise util.Abort(_("untracked file in working directory differs"
17 17 " from file in requested revision: '%s'") % f)
18 18
19 19 def _checkcollision(mctx):
20 20 "check for case folding collisions in the destination context"
21 21 folded = {}
22 22 for fn in mctx:
23 23 fold = fn.lower()
24 24 if fold in folded:
25 25 raise util.Abort(_("case-folding collision between %s and %s")
26 26 % (fn, folded[fold]))
27 27 folded[fold] = fn
28 28
29 29 def _forgetremoved(wctx, mctx, branchmerge):
30 30 """
31 31 Forget removed files
32 32
33 33 If we're jumping between revisions (as opposed to merging), and if
34 34 neither the working directory nor the target rev has the file,
35 35 then we need to remove it from the dirstate, to prevent the
36 36 dirstate from listing the file when it is no longer in the
37 37 manifest.
38 38
39 39 If we're merging, and the other revision has removed a file
40 40 that is not present in the working directory, we need to mark it
41 41 as removed.
42 42 """
43 43
44 44 action = []
45 45 state = branchmerge and 'r' or 'f'
46 46 for f in wctx.deleted():
47 47 if f not in mctx:
48 48 action.append((f, state))
49 49
50 50 if not branchmerge:
51 51 for f in wctx.removed():
52 52 if f not in mctx:
53 53 action.append((f, "f"))
54 54
55 55 return action
56 56
57 57 def manifestmerge(repo, p1, p2, pa, overwrite, partial):
58 58 """
59 59 Merge p1 and p2 with ancestor ma and generate merge action list
60 60
61 61 overwrite = whether we clobber working files
62 62 partial = function to filter file lists
63 63 """
64 64
65 65 repo.ui.note(_("resolving manifests\n"))
66 66 repo.ui.debug(_(" overwrite %s partial %s\n") % (overwrite, bool(partial)))
67 67 repo.ui.debug(_(" ancestor %s local %s remote %s\n") % (pa, p1, p2))
68 68
69 69 m1 = p1.manifest()
70 70 m2 = p2.manifest()
71 71 ma = pa.manifest()
72 72 backwards = (pa == p2)
73 73 action = []
74 74 copy, copied, diverge = {}, {}, {}
75 75
76 76 def fmerge(f, f2=None, fa=None):
77 77 """merge flags"""
78 78 if not f2:
79 79 f2 = f
80 80 fa = f
81 81 a, m, n = ma.flags(fa), m1.flags(f), m2.flags(f2)
82 82 if m == n: # flags agree
83 83 return m # unchanged
84 84 if m and n: # flags are set but don't agree
85 85 if not a: # both differ from parent
86 86 r = repo.ui.prompt(
87 87 _(" conflicting flags for %s\n"
88 88 "(n)one, e(x)ec or sym(l)ink?") % f, "[nxl]", "n")
89 89 return r != "n" and r or ''
90 90 if m == a:
91 91 return n # changed from m to n
92 92 return m # changed from n to m
93 93 if m and m != a: # changed from a to m
94 94 return m
95 95 if n and n != a: # changed from a to n
96 96 return n
97 97 return '' # flag was cleared
98 98
99 99 def act(msg, m, f, *args):
100 100 repo.ui.debug(" %s: %s -> %s\n" % (f, msg, m))
101 101 action.append((f, m) + args)
102 102
103 103 if pa and not (backwards or overwrite):
104 copy, diverge = copies.copies(repo, p1, p2, pa)
104 if repo.ui.configbool("merge", "followcopies", True):
105 dirs = repo.ui.configbool("merge", "followdirs", True)
106 copy, diverge = copies.copies(repo, p1, p2, pa, dirs)
105 107 copied = dict.fromkeys(copy.values())
106 108 for of, fl in diverge.items():
107 109 act("divergent renames", "dr", of, fl)
108 110
109 111 # Compare manifests
110 112 for f, n in m1.iteritems():
111 113 if partial and not partial(f):
112 114 continue
113 115 if f in m2:
114 116 if overwrite or backwards:
115 117 rflags = m2.flags(f)
116 118 else:
117 119 rflags = fmerge(f)
118 120 # are files different?
119 121 if n != m2[f]:
120 122 a = ma.get(f, nullid)
121 123 # are we clobbering?
122 124 if overwrite:
123 125 act("clobbering", "g", f, rflags)
124 126 # or are we going back in time and clean?
125 127 elif backwards and not n[20:]:
126 128 act("reverting", "g", f, rflags)
127 129 # are both different from the ancestor?
128 130 elif n != a and m2[f] != a:
129 131 act("versions differ", "m", f, f, f, rflags, False)
130 132 # is remote's version newer?
131 133 elif m2[f] != a:
132 134 act("remote is newer", "g", f, rflags)
133 135 # local is newer, not overwrite, check mode bits
134 136 elif m1.flags(f) != rflags:
135 137 act("update permissions", "e", f, rflags)
136 138 # contents same, check mode bits
137 139 elif m1.flags(f) != rflags:
138 140 act("update permissions", "e", f, rflags)
139 141 elif f in copied:
140 142 continue
141 143 elif f in copy:
142 144 f2 = copy[f]
143 145 if f2 not in m2: # directory rename
144 146 act("remote renamed directory to " + f2, "d",
145 147 f, None, f2, m1.flags(f))
146 148 elif f2 in m1: # case 2 A,B/B/B
147 149 act("local copied to " + f2, "m",
148 150 f, f2, f, fmerge(f, f2, f2), False)
149 151 else: # case 4,21 A/B/B
150 152 act("local moved to " + f2, "m",
151 153 f, f2, f, fmerge(f, f2, f2), False)
152 154 elif f in ma:
153 155 if n != ma[f] and not overwrite:
154 156 if repo.ui.prompt(
155 157 _(" local changed %s which remote deleted\n"
156 158 "use (c)hanged version or (d)elete?") % f,
157 159 _("[cd]"), _("c")) == _("d"):
158 160 act("prompt delete", "r", f)
159 161 else:
160 162 act("other deleted", "r", f)
161 163 else:
162 164 # file is created on branch or in working directory
163 165 if (overwrite and n[20:] != "u") or (backwards and not n[20:]):
164 166 act("remote deleted", "r", f)
165 167
166 168 for f, n in m2.iteritems():
167 169 if partial and not partial(f):
168 170 continue
169 171 if f in m1:
170 172 continue
171 173 if f in copied:
172 174 continue
173 175 if f in copy:
174 176 f2 = copy[f]
175 177 if f2 not in m1: # directory rename
176 178 act("local renamed directory to " + f2, "d",
177 179 None, f, f2, m2.flags(f))
178 180 elif f2 in m2: # rename case 1, A/A,B/A
179 181 act("remote copied to " + f, "m",
180 182 f2, f, f, fmerge(f2, f, f2), False)
181 183 else: # case 3,20 A/B/A
182 184 act("remote moved to " + f, "m",
183 185 f2, f, f, fmerge(f2, f, f2), True)
184 186 elif f in ma:
185 187 if overwrite or backwards:
186 188 act("recreating", "g", f, m2.flags(f))
187 189 elif n != ma[f]:
188 190 if repo.ui.prompt(
189 191 _("remote changed %s which local deleted\n"
190 192 "use (c)hanged version or leave (d)eleted?") % f,
191 193 _("[cd]"), _("c")) == _("c"):
192 194 act("prompt recreating", "g", f, m2.flags(f))
193 195 else:
194 196 act("remote created", "g", f, m2.flags(f))
195 197
196 198 return action
197 199
198 200 def applyupdates(repo, action, wctx, mctx):
199 201 "apply the merge action list to the working directory"
200 202
201 203 updated, merged, removed, unresolved = 0, 0, 0, 0
202 204 action.sort()
203 205 # prescan for copy/renames
204 206 for a in action:
205 207 f, m = a[:2]
206 208 if m == 'm': # merge
207 209 f2, fd, flags, move = a[2:]
208 210 if f != fd:
209 211 repo.ui.debug(_("copying %s to %s\n") % (f, fd))
210 212 repo.wwrite(fd, repo.wread(f), flags)
211 213
212 214 audit_path = util.path_auditor(repo.root)
213 215
214 216 for a in action:
215 217 f, m = a[:2]
216 218 if f and f[0] == "/":
217 219 continue
218 220 if m == "r": # remove
219 221 repo.ui.note(_("removing %s\n") % f)
220 222 audit_path(f)
221 223 try:
222 224 util.unlink(repo.wjoin(f))
223 225 except OSError, inst:
224 226 if inst.errno != errno.ENOENT:
225 227 repo.ui.warn(_("update failed to remove %s: %s!\n") %
226 228 (f, inst.strerror))
227 229 removed += 1
228 230 elif m == "m": # merge
229 231 f2, fd, flags, move = a[2:]
230 232 r = filemerge.filemerge(repo, f, fd, f2, wctx, mctx)
231 233 if r > 0:
232 234 unresolved += 1
233 235 else:
234 236 if r is None:
235 237 updated += 1
236 238 else:
237 239 merged += 1
238 240 util.set_flags(repo.wjoin(fd), flags)
239 241 if f != fd and move and util.lexists(repo.wjoin(f)):
240 242 repo.ui.debug(_("removing %s\n") % f)
241 243 os.unlink(repo.wjoin(f))
242 244 elif m == "g": # get
243 245 flags = a[2]
244 246 repo.ui.note(_("getting %s\n") % f)
245 247 t = mctx.filectx(f).data()
246 248 repo.wwrite(f, t, flags)
247 249 updated += 1
248 250 elif m == "d": # directory rename
249 251 f2, fd, flags = a[2:]
250 252 if f:
251 253 repo.ui.note(_("moving %s to %s\n") % (f, fd))
252 254 t = wctx.filectx(f).data()
253 255 repo.wwrite(fd, t, flags)
254 256 util.unlink(repo.wjoin(f))
255 257 if f2:
256 258 repo.ui.note(_("getting %s to %s\n") % (f2, fd))
257 259 t = mctx.filectx(f2).data()
258 260 repo.wwrite(fd, t, flags)
259 261 updated += 1
260 262 elif m == "dr": # divergent renames
261 263 fl = a[2]
262 264 repo.ui.warn("warning: detected divergent renames of %s to:\n" % f)
263 265 for nf in fl:
264 266 repo.ui.warn(" %s\n" % nf)
265 267 elif m == "e": # exec
266 268 flags = a[2]
267 269 util.set_flags(repo.wjoin(f), flags)
268 270
269 271 return updated, merged, removed, unresolved
270 272
271 273 def recordupdates(repo, action, branchmerge):
272 274 "record merge actions to the dirstate"
273 275
274 276 for a in action:
275 277 f, m = a[:2]
276 278 if m == "r": # remove
277 279 if branchmerge:
278 280 repo.dirstate.remove(f)
279 281 else:
280 282 repo.dirstate.forget(f)
281 283 elif m == "f": # forget
282 284 repo.dirstate.forget(f)
283 285 elif m in "ge": # get or exec change
284 286 if branchmerge:
285 287 repo.dirstate.normaldirty(f)
286 288 else:
287 289 repo.dirstate.normal(f)
288 290 elif m == "m": # merge
289 291 f2, fd, flag, move = a[2:]
290 292 if branchmerge:
291 293 # We've done a branch merge, mark this file as merged
292 294 # so that we properly record the merger later
293 295 repo.dirstate.merge(fd)
294 296 if f != f2: # copy/rename
295 297 if move:
296 298 repo.dirstate.remove(f)
297 299 if f != fd:
298 300 repo.dirstate.copy(f, fd)
299 301 else:
300 302 repo.dirstate.copy(f2, fd)
301 303 else:
302 304 # We've update-merged a locally modified file, so
303 305 # we set the dirstate to emulate a normal checkout
304 306 # of that file some time in the past. Thus our
305 307 # merge will appear as a normal local file
306 308 # modification.
307 309 repo.dirstate.normallookup(fd)
308 310 if move:
309 311 repo.dirstate.forget(f)
310 312 elif m == "d": # directory rename
311 313 f2, fd, flag = a[2:]
312 314 if not f2 and f not in repo.dirstate:
313 315 # untracked file moved
314 316 continue
315 317 if branchmerge:
316 318 repo.dirstate.add(fd)
317 319 if f:
318 320 repo.dirstate.remove(f)
319 321 repo.dirstate.copy(f, fd)
320 322 if f2:
321 323 repo.dirstate.copy(f2, fd)
322 324 else:
323 325 repo.dirstate.normal(fd)
324 326 if f:
325 327 repo.dirstate.forget(f)
326 328
327 329 def update(repo, node, branchmerge, force, partial):
328 330 """
329 331 Perform a merge between the working directory and the given node
330 332
331 333 branchmerge = whether to merge between branches
332 334 force = whether to force branch merging or file overwriting
333 335 partial = a function to filter file lists (dirstate not updated)
334 336 """
335 337
336 338 wlock = repo.wlock()
337 339 try:
338 340 wc = repo.workingctx()
339 341 if node is None:
340 342 # tip of current branch
341 343 try:
342 344 node = repo.branchtags()[wc.branch()]
343 345 except KeyError:
344 346 if wc.branch() == "default": # no default branch!
345 347 node = repo.lookup("tip") # update to tip
346 348 else:
347 349 raise util.Abort(_("branch %s not found") % wc.branch())
348 350 overwrite = force and not branchmerge
349 351 pl = wc.parents()
350 352 p1, p2 = pl[0], repo.changectx(node)
351 353 pa = p1.ancestor(p2)
352 354 fp1, fp2, xp1, xp2 = p1.node(), p2.node(), str(p1), str(p2)
353 355 fastforward = False
354 356
355 357 ### check phase
356 358 if not overwrite and len(pl) > 1:
357 359 raise util.Abort(_("outstanding uncommitted merges"))
358 360 if branchmerge:
359 361 if pa == p2:
360 362 raise util.Abort(_("can't merge with ancestor"))
361 363 elif pa == p1:
362 364 if p1.branch() != p2.branch():
363 365 fastforward = True
364 366 else:
365 367 raise util.Abort(_("nothing to merge (use 'hg update'"
366 368 " or check 'hg heads')"))
367 369 if not force and (wc.files() or wc.deleted()):
368 370 raise util.Abort(_("outstanding uncommitted changes"))
369 371 elif not overwrite:
370 372 if pa == p1 or pa == p2: # linear
371 373 pass # all good
372 374 elif p1.branch() == p2.branch():
373 375 if wc.files() or wc.deleted():
374 376 raise util.Abort(_("crosses branches (use 'hg merge' or "
375 377 "'hg update -C' to discard changes)"))
376 378 raise util.Abort(_("crosses branches (use 'hg merge' "
377 379 "or 'hg update -C')"))
378 380 elif wc.files() or wc.deleted():
379 381 raise util.Abort(_("crosses named branches (use "
380 382 "'hg update -C' to discard changes)"))
381 383 else:
382 384 # Allow jumping branches if there are no changes
383 385 overwrite = True
384 386
385 387 ### calculate phase
386 388 action = []
387 389 if not force:
388 390 _checkunknown(wc, p2)
389 391 if not util.checkfolding(repo.path):
390 392 _checkcollision(p2)
391 393 action += _forgetremoved(wc, p2, branchmerge)
392 394 action += manifestmerge(repo, wc, p2, pa, overwrite, partial)
393 395
394 396 ### apply phase
395 397 if not branchmerge: # just jump to the new rev
396 398 fp1, fp2, xp1, xp2 = fp2, nullid, xp2, ''
397 399 if not partial:
398 400 repo.hook('preupdate', throw=True, parent1=xp1, parent2=xp2)
399 401
400 402 stats = applyupdates(repo, action, wc, p2)
401 403
402 404 if not partial:
403 405 recordupdates(repo, action, branchmerge)
404 406 repo.dirstate.setparents(fp1, fp2)
405 407 if not branchmerge and not fastforward:
406 408 repo.dirstate.setbranch(p2.branch())
407 409 repo.hook('update', parent1=xp1, parent2=xp2, error=stats[3])
408 410
409 411 return stats
410 412 finally:
411 413 del wlock
@@ -1,68 +1,76 b''
1 1 #!/bin/sh
2 2
3 3 add()
4 4 {
5 5 echo $2 >> $1
6 6 }
7 7
8 8 hg init t
9 9 cd t
10 10
11 11 # set up a boring main branch
12 12 add a a
13 13 hg add a
14 mkdir x
15 add x/x x
16 hg add x/x
14 17 hg ci -m0
15 18
16 19 add a m1
17 20 hg ci -m1
18 21
19 22 add a m2
23 add x/y y1
24 hg add x/y
20 25 hg ci -m2
21 26
22 27 show()
23 28 {
24 29 echo "- $2: $1"
25 30 hg st -C $1
26 31 echo
27 32 hg diff --git $1
28 33 echo
29 34 }
30 35
31 36 count=0
32 37 # make a new branch and get diff/status output
33 38 # $1 - first commit
34 39 # $2 - second commit
35 40 # $3 - working dir action
36 41 # $4 - test description
37 42 tb()
38 43 {
39 44 hg co -q -C 0
40 45
41 46 add a $count
42 47 count=`expr $count + 1`
43 48 hg ci -m "t0"
44 49 $1
45 50 hg ci -m "t1"
46 51 $2
47 52 hg ci -m "t2"
48 53 $3
49 54
50 55 echo "** $4 **"
51 56 echo "** $1 / $2 / $3"
52 57 show "" "working to parent"
53 58 show "--rev 0" "working to root"
54 59 show "--rev 2" "working to branch"
55 60 show "--rev 0 --rev ." "root to parent"
56 61 show "--rev . --rev 0" "parent to root"
57 62 show "--rev 2 --rev ." "branch to parent"
58 63 show "--rev . --rev 2" "parent to branch"
59 64 echo
60 65 }
61 66
67
62 68 tb "add a a1" "add a a2" "hg mv a b" "rename in working dir"
63 69 tb "add a a1" "add a a2" "hg cp a b" "copy in working dir"
64 70 tb "hg mv a b" "add b b1" "add b w" "single rename"
65 71 tb "hg cp a b" "add b b1" "add a w" "single copy"
66 72 tb "hg mv a b" "hg mv b c" "hg mv c d" "rename chain"
67 73 tb "hg cp a b" "hg cp b c" "hg cp c d" "copy chain"
68 74 tb "add a a1" "hg mv a b" "hg mv b a" "circular rename"
75
76 tb "hg mv x y" "add y/x x1" "add y/x x2" "directory move"
@@ -1,902 +1,1220 b''
1 1 created new head
2 2 ** rename in working dir **
3 3 ** add a a1 / add a a2 / hg mv a b
4 4 - working to parent:
5 5 A b
6 6 a
7 7 R a
8 8
9 9 diff --git a/a b/b
10 10 rename from a
11 11 rename to b
12 12
13 13 - working to root: --rev 0
14 14 A b
15 15 a
16 16 R a
17 17
18 18 diff --git a/a b/b
19 19 rename from a
20 20 rename to b
21 21 --- a/a
22 22 +++ b/b
23 23 @@ -1,1 +1,4 @@
24 24 a
25 25 +0
26 26 +a1
27 27 +a2
28 28
29 29 - working to branch: --rev 2
30 30 A b
31 31 a
32 32 R a
33 R x/y
33 34
34 35 diff --git a/a b/b
35 36 rename from a
36 37 rename to b
37 38 --- a/a
38 39 +++ b/b
39 40 @@ -1,3 +1,4 @@
40 41 a
41 42 -m1
42 43 -m2
43 44 +0
44 45 +a1
45 46 +a2
47 diff --git a/x/y b/x/y
48 deleted file mode 100644
49 --- a/x/y
50 +++ /dev/null
51 @@ -1,1 +0,0 @@
52 -y1
46 53
47 54 - root to parent: --rev 0 --rev .
48 55 M a
49 56
50 57 diff --git a/a b/a
51 58 --- a/a
52 59 +++ b/a
53 60 @@ -1,1 +1,4 @@
54 61 a
55 62 +0
56 63 +a1
57 64 +a2
58 65
59 66 - parent to root: --rev . --rev 0
60 67 M a
61 68
62 69 diff --git a/a b/a
63 70 --- a/a
64 71 +++ b/a
65 72 @@ -1,4 +1,1 @@
66 73 a
67 74 -0
68 75 -a1
69 76 -a2
70 77
71 78 - branch to parent: --rev 2 --rev .
72 79 M a
80 R x/y
73 81
74 82 diff --git a/a b/a
75 83 --- a/a
76 84 +++ b/a
77 85 @@ -1,3 +1,4 @@
78 86 a
79 87 -m1
80 88 -m2
81 89 +0
82 90 +a1
83 91 +a2
92 diff --git a/x/y b/x/y
93 deleted file mode 100644
94 --- a/x/y
95 +++ /dev/null
96 @@ -1,1 +0,0 @@
97 -y1
84 98
85 99 - parent to branch: --rev . --rev 2
86 100 M a
101 A x/y
87 102
88 103 diff --git a/a b/a
89 104 --- a/a
90 105 +++ b/a
91 106 @@ -1,4 +1,3 @@
92 107 a
93 108 -0
94 109 -a1
95 110 -a2
96 111 +m1
97 112 +m2
113 diff --git a/x/y b/x/y
114 new file mode 100644
115 --- /dev/null
116 +++ b/x/y
117 @@ -0,0 +1,1 @@
118 +y1
98 119
99 120
100 121 created new head
101 122 ** copy in working dir **
102 123 ** add a a1 / add a a2 / hg cp a b
103 124 - working to parent:
104 125 A b
105 126 a
106 127
107 128 diff --git a/a b/b
108 129 copy from a
109 130 copy to b
110 131
111 132 - working to root: --rev 0
112 133 M a
113 134 A b
114 135 a
115 136
116 137 diff --git a/a b/a
117 138 --- a/a
118 139 +++ b/a
119 140 @@ -1,1 +1,4 @@
120 141 a
121 142 +1
122 143 +a1
123 144 +a2
124 145 diff --git a/a b/b
125 146 copy from a
126 147 copy to b
127 148 --- a/a
128 149 +++ b/b
129 150 @@ -1,1 +1,4 @@
130 151 a
131 152 +1
132 153 +a1
133 154 +a2
134 155
135 156 - working to branch: --rev 2
136 157 M a
137 158 A b
138 159 a
160 R x/y
139 161
140 162 diff --git a/a b/a
141 163 --- a/a
142 164 +++ b/a
143 165 @@ -1,3 +1,4 @@
144 166 a
145 167 -m1
146 168 -m2
147 169 +1
148 170 +a1
149 171 +a2
150 172 diff --git a/a b/b
151 173 copy from a
152 174 copy to b
153 175 --- a/a
154 176 +++ b/b
155 177 @@ -1,3 +1,4 @@
156 178 a
157 179 -m1
158 180 -m2
159 181 +1
160 182 +a1
161 183 +a2
184 diff --git a/x/y b/x/y
185 deleted file mode 100644
186 --- a/x/y
187 +++ /dev/null
188 @@ -1,1 +0,0 @@
189 -y1
162 190
163 191 - root to parent: --rev 0 --rev .
164 192 M a
165 193
166 194 diff --git a/a b/a
167 195 --- a/a
168 196 +++ b/a
169 197 @@ -1,1 +1,4 @@
170 198 a
171 199 +1
172 200 +a1
173 201 +a2
174 202
175 203 - parent to root: --rev . --rev 0
176 204 M a
177 205
178 206 diff --git a/a b/a
179 207 --- a/a
180 208 +++ b/a
181 209 @@ -1,4 +1,1 @@
182 210 a
183 211 -1
184 212 -a1
185 213 -a2
186 214
187 215 - branch to parent: --rev 2 --rev .
188 216 M a
217 R x/y
189 218
190 219 diff --git a/a b/a
191 220 --- a/a
192 221 +++ b/a
193 222 @@ -1,3 +1,4 @@
194 223 a
195 224 -m1
196 225 -m2
197 226 +1
198 227 +a1
199 228 +a2
229 diff --git a/x/y b/x/y
230 deleted file mode 100644
231 --- a/x/y
232 +++ /dev/null
233 @@ -1,1 +0,0 @@
234 -y1
200 235
201 236 - parent to branch: --rev . --rev 2
202 237 M a
238 A x/y
203 239
204 240 diff --git a/a b/a
205 241 --- a/a
206 242 +++ b/a
207 243 @@ -1,4 +1,3 @@
208 244 a
209 245 -1
210 246 -a1
211 247 -a2
212 248 +m1
213 249 +m2
250 diff --git a/x/y b/x/y
251 new file mode 100644
252 --- /dev/null
253 +++ b/x/y
254 @@ -0,0 +1,1 @@
255 +y1
214 256
215 257
216 258 created new head
217 259 ** single rename **
218 260 ** hg mv a b / add b b1 / add b w
219 261 - working to parent:
220 262 M b
221 263
222 264 diff --git a/b b/b
223 265 --- a/b
224 266 +++ b/b
225 267 @@ -1,3 +1,4 @@
226 268 a
227 269 2
228 270 b1
229 271 +w
230 272
231 273 - working to root: --rev 0
232 274 A b
233 275 a
234 276 R a
235 277
236 278 diff --git a/a b/b
237 279 rename from a
238 280 rename to b
239 281 --- a/a
240 282 +++ b/b
241 283 @@ -1,1 +1,4 @@
242 284 a
243 285 +2
244 286 +b1
245 287 +w
246 288
247 289 - working to branch: --rev 2
248 290 A b
249 291 a
250 292 R a
293 R x/y
251 294
252 295 diff --git a/a b/b
253 296 rename from a
254 297 rename to b
255 298 --- a/a
256 299 +++ b/b
257 300 @@ -1,3 +1,4 @@
258 301 a
259 302 -m1
260 303 -m2
261 304 +2
262 305 +b1
263 306 +w
307 diff --git a/x/y b/x/y
308 deleted file mode 100644
309 --- a/x/y
310 +++ /dev/null
311 @@ -1,1 +0,0 @@
312 -y1
264 313
265 314 - root to parent: --rev 0 --rev .
266 315 A b
267 316 a
268 317 R a
269 318
270 319 diff --git a/a b/b
271 320 rename from a
272 321 rename to b
273 322 --- a/a
274 323 +++ b/b
275 324 @@ -1,1 +1,3 @@
276 325 a
277 326 +2
278 327 +b1
279 328
280 329 - parent to root: --rev . --rev 0
281 330 A a
282 331 b
283 332 R b
284 333
285 334 diff --git a/b b/a
286 335 rename from b
287 336 rename to a
288 337 --- a/b
289 338 +++ b/a
290 339 @@ -1,3 +1,1 @@
291 340 a
292 341 -2
293 342 -b1
294 343
295 344 - branch to parent: --rev 2 --rev .
296 345 A b
297 346 a
298 347 R a
348 R x/y
299 349
300 350 diff --git a/a b/b
301 351 rename from a
302 352 rename to b
303 353 --- a/a
304 354 +++ b/b
305 355 @@ -1,3 +1,3 @@
306 356 a
307 357 -m1
308 358 -m2
309 359 +2
310 360 +b1
361 diff --git a/x/y b/x/y
362 deleted file mode 100644
363 --- a/x/y
364 +++ /dev/null
365 @@ -1,1 +0,0 @@
366 -y1
311 367
312 368 - parent to branch: --rev . --rev 2
313 369 A a
314 370 b
371 A x/y
315 372 R b
316 373
317 374 diff --git a/b b/a
318 375 rename from b
319 376 rename to a
320 377 --- a/b
321 378 +++ b/a
322 379 @@ -1,3 +1,3 @@
323 380 a
324 381 -2
325 382 -b1
326 383 +m1
327 384 +m2
385 diff --git a/x/y b/x/y
386 new file mode 100644
387 --- /dev/null
388 +++ b/x/y
389 @@ -0,0 +1,1 @@
390 +y1
328 391
329 392
330 393 created new head
331 394 ** single copy **
332 395 ** hg cp a b / add b b1 / add a w
333 396 - working to parent:
334 397 M a
335 398
336 399 diff --git a/a b/a
337 400 --- a/a
338 401 +++ b/a
339 402 @@ -1,2 +1,3 @@
340 403 a
341 404 3
342 405 +w
343 406
344 407 - working to root: --rev 0
345 408 M a
346 409 A b
347 410 a
348 411
349 412 diff --git a/a b/a
350 413 --- a/a
351 414 +++ b/a
352 415 @@ -1,1 +1,3 @@
353 416 a
354 417 +3
355 418 +w
356 419 diff --git a/a b/b
357 420 copy from a
358 421 copy to b
359 422 --- a/a
360 423 +++ b/b
361 424 @@ -1,1 +1,3 @@
362 425 a
363 426 +3
364 427 +b1
365 428
366 429 - working to branch: --rev 2
367 430 M a
368 431 A b
369 432 a
433 R x/y
370 434
371 435 diff --git a/a b/a
372 436 --- a/a
373 437 +++ b/a
374 438 @@ -1,3 +1,3 @@
375 439 a
376 440 -m1
377 441 -m2
378 442 +3
379 443 +w
380 444 diff --git a/a b/b
381 445 copy from a
382 446 copy to b
383 447 --- a/a
384 448 +++ b/b
385 449 @@ -1,3 +1,3 @@
386 450 a
387 451 -m1
388 452 -m2
389 453 +3
390 454 +b1
455 diff --git a/x/y b/x/y
456 deleted file mode 100644
457 --- a/x/y
458 +++ /dev/null
459 @@ -1,1 +0,0 @@
460 -y1
391 461
392 462 - root to parent: --rev 0 --rev .
393 463 M a
394 464 A b
395 465 a
396 466
397 467 diff --git a/a b/a
398 468 --- a/a
399 469 +++ b/a
400 470 @@ -1,1 +1,2 @@
401 471 a
402 472 +3
403 473 diff --git a/a b/b
404 474 copy from a
405 475 copy to b
406 476 --- a/a
407 477 +++ b/b
408 478 @@ -1,1 +1,3 @@
409 479 a
410 480 +3
411 481 +b1
412 482
413 483 - parent to root: --rev . --rev 0
414 484 M a
415 485 R b
416 486
417 487 diff --git a/a b/a
418 488 --- a/a
419 489 +++ b/a
420 490 @@ -1,2 +1,1 @@
421 491 a
422 492 -3
423 493 diff --git a/b b/b
424 494 deleted file mode 100644
425 495 --- a/b
426 496 +++ /dev/null
427 497 @@ -1,3 +0,0 @@
428 498 -a
429 499 -3
430 500 -b1
431 501
432 502 - branch to parent: --rev 2 --rev .
433 503 M a
434 504 A b
435 505 a
506 R x/y
436 507
437 508 diff --git a/a b/a
438 509 --- a/a
439 510 +++ b/a
440 511 @@ -1,3 +1,2 @@
441 512 a
442 513 -m1
443 514 -m2
444 515 +3
445 516 diff --git a/a b/b
446 517 copy from a
447 518 copy to b
448 519 --- a/a
449 520 +++ b/b
450 521 @@ -1,3 +1,3 @@
451 522 a
452 523 -m1
453 524 -m2
454 525 +3
455 526 +b1
527 diff --git a/x/y b/x/y
528 deleted file mode 100644
529 --- a/x/y
530 +++ /dev/null
531 @@ -1,1 +0,0 @@
532 -y1
456 533
457 534 - parent to branch: --rev . --rev 2
458 535 M a
536 A x/y
459 537 R b
460 538
461 539 diff --git a/a b/a
462 540 --- a/a
463 541 +++ b/a
464 542 @@ -1,2 +1,3 @@
465 543 a
466 544 -3
467 545 +m1
468 546 +m2
469 547 diff --git a/b b/b
470 548 deleted file mode 100644
471 549 --- a/b
472 550 +++ /dev/null
473 551 @@ -1,3 +0,0 @@
474 552 -a
475 553 -3
476 554 -b1
555 diff --git a/x/y b/x/y
556 new file mode 100644
557 --- /dev/null
558 +++ b/x/y
559 @@ -0,0 +1,1 @@
560 +y1
477 561
478 562
479 563 created new head
480 564 ** rename chain **
481 565 ** hg mv a b / hg mv b c / hg mv c d
482 566 - working to parent:
483 567 A d
484 568 c
485 569 R c
486 570
487 571 diff --git a/c b/d
488 572 rename from c
489 573 rename to d
490 574
491 575 - working to root: --rev 0
492 576 A d
493 577 a
494 578 R a
495 579
496 580 diff --git a/a b/d
497 581 rename from a
498 582 rename to d
499 583 --- a/a
500 584 +++ b/d
501 585 @@ -1,1 +1,2 @@
502 586 a
503 587 +4
504 588
505 589 - working to branch: --rev 2
506 590 A d
507 591 a
508 592 R a
593 R x/y
509 594
510 595 diff --git a/a b/d
511 596 rename from a
512 597 rename to d
513 598 --- a/a
514 599 +++ b/d
515 600 @@ -1,3 +1,2 @@
516 601 a
517 602 -m1
518 603 -m2
519 604 +4
605 diff --git a/x/y b/x/y
606 deleted file mode 100644
607 --- a/x/y
608 +++ /dev/null
609 @@ -1,1 +0,0 @@
610 -y1
520 611
521 612 - root to parent: --rev 0 --rev .
522 613 A c
523 614 a
524 615 R a
525 616
526 617 diff --git a/a b/c
527 618 rename from a
528 619 rename to c
529 620 --- a/a
530 621 +++ b/c
531 622 @@ -1,1 +1,2 @@
532 623 a
533 624 +4
534 625
535 626 - parent to root: --rev . --rev 0
536 627 A a
537 628 c
538 629 R c
539 630
540 631 diff --git a/c b/a
541 632 rename from c
542 633 rename to a
543 634 --- a/c
544 635 +++ b/a
545 636 @@ -1,2 +1,1 @@
546 637 a
547 638 -4
548 639
549 640 - branch to parent: --rev 2 --rev .
550 641 A c
551 642 a
552 643 R a
644 R x/y
553 645
554 646 diff --git a/a b/c
555 647 rename from a
556 648 rename to c
557 649 --- a/a
558 650 +++ b/c
559 651 @@ -1,3 +1,2 @@
560 652 a
561 653 -m1
562 654 -m2
563 655 +4
656 diff --git a/x/y b/x/y
657 deleted file mode 100644
658 --- a/x/y
659 +++ /dev/null
660 @@ -1,1 +0,0 @@
661 -y1
564 662
565 663 - parent to branch: --rev . --rev 2
566 664 A a
567 665 c
666 A x/y
568 667 R c
569 668
570 669 diff --git a/c b/a
571 670 rename from c
572 671 rename to a
573 672 --- a/c
574 673 +++ b/a
575 674 @@ -1,2 +1,3 @@
576 675 a
577 676 -4
578 677 +m1
579 678 +m2
679 diff --git a/x/y b/x/y
680 new file mode 100644
681 --- /dev/null
682 +++ b/x/y
683 @@ -0,0 +1,1 @@
684 +y1
580 685
581 686
582 687 created new head
583 688 ** copy chain **
584 689 ** hg cp a b / hg cp b c / hg cp c d
585 690 - working to parent:
586 691 A d
587 692 c
588 693
589 694 diff --git a/c b/d
590 695 copy from c
591 696 copy to d
592 697
593 698 - working to root: --rev 0
594 699 M a
595 700 A b
596 701 a
597 702 A c
598 703 a
599 704 A d
600 705 a
601 706
602 707 diff --git a/a b/a
603 708 --- a/a
604 709 +++ b/a
605 710 @@ -1,1 +1,2 @@
606 711 a
607 712 +5
608 713 diff --git a/a b/b
609 714 copy from a
610 715 copy to b
611 716 --- a/a
612 717 +++ b/b
613 718 @@ -1,1 +1,2 @@
614 719 a
615 720 +5
616 721 diff --git a/a b/c
617 722 copy from a
618 723 copy to c
619 724 --- a/a
620 725 +++ b/c
621 726 @@ -1,1 +1,2 @@
622 727 a
623 728 +5
624 729 diff --git a/a b/d
625 730 copy from a
626 731 copy to d
627 732 --- a/a
628 733 +++ b/d
629 734 @@ -1,1 +1,2 @@
630 735 a
631 736 +5
632 737
633 738 - working to branch: --rev 2
634 739 M a
635 740 A b
636 741 a
637 742 A c
638 743 a
639 744 A d
640 745 a
746 R x/y
641 747
642 748 diff --git a/a b/a
643 749 --- a/a
644 750 +++ b/a
645 751 @@ -1,3 +1,2 @@
646 752 a
647 753 -m1
648 754 -m2
649 755 +5
650 756 diff --git a/a b/b
651 757 copy from a
652 758 copy to b
653 759 --- a/a
654 760 +++ b/b
655 761 @@ -1,3 +1,2 @@
656 762 a
657 763 -m1
658 764 -m2
659 765 +5
660 766 diff --git a/a b/c
661 767 copy from a
662 768 copy to c
663 769 --- a/a
664 770 +++ b/c
665 771 @@ -1,3 +1,2 @@
666 772 a
667 773 -m1
668 774 -m2
669 775 +5
670 776 diff --git a/a b/d
671 777 copy from a
672 778 copy to d
673 779 --- a/a
674 780 +++ b/d
675 781 @@ -1,3 +1,2 @@
676 782 a
677 783 -m1
678 784 -m2
679 785 +5
786 diff --git a/x/y b/x/y
787 deleted file mode 100644
788 --- a/x/y
789 +++ /dev/null
790 @@ -1,1 +0,0 @@
791 -y1
680 792
681 793 - root to parent: --rev 0 --rev .
682 794 M a
683 795 A b
684 796 a
685 797 A c
686 798 a
687 799
688 800 diff --git a/a b/a
689 801 --- a/a
690 802 +++ b/a
691 803 @@ -1,1 +1,2 @@
692 804 a
693 805 +5
694 806 diff --git a/a b/b
695 807 copy from a
696 808 copy to b
697 809 --- a/a
698 810 +++ b/b
699 811 @@ -1,1 +1,2 @@
700 812 a
701 813 +5
702 814 diff --git a/a b/c
703 815 copy from a
704 816 copy to c
705 817 --- a/a
706 818 +++ b/c
707 819 @@ -1,1 +1,2 @@
708 820 a
709 821 +5
710 822
711 823 - parent to root: --rev . --rev 0
712 824 M a
713 825 R b
714 826 R c
715 827
716 828 diff --git a/a b/a
717 829 --- a/a
718 830 +++ b/a
719 831 @@ -1,2 +1,1 @@
720 832 a
721 833 -5
722 834 diff --git a/b b/b
723 835 deleted file mode 100644
724 836 --- a/b
725 837 +++ /dev/null
726 838 @@ -1,2 +0,0 @@
727 839 -a
728 840 -5
729 841 diff --git a/c b/c
730 842 deleted file mode 100644
731 843 --- a/c
732 844 +++ /dev/null
733 845 @@ -1,2 +0,0 @@
734 846 -a
735 847 -5
736 848
737 849 - branch to parent: --rev 2 --rev .
738 850 M a
739 851 A b
740 852 a
741 853 A c
742 854 a
855 R x/y
743 856
744 857 diff --git a/a b/a
745 858 --- a/a
746 859 +++ b/a
747 860 @@ -1,3 +1,2 @@
748 861 a
749 862 -m1
750 863 -m2
751 864 +5
752 865 diff --git a/a b/b
753 866 copy from a
754 867 copy to b
755 868 --- a/a
756 869 +++ b/b
757 870 @@ -1,3 +1,2 @@
758 871 a
759 872 -m1
760 873 -m2
761 874 +5
762 875 diff --git a/a b/c
763 876 copy from a
764 877 copy to c
765 878 --- a/a
766 879 +++ b/c
767 880 @@ -1,3 +1,2 @@
768 881 a
769 882 -m1
770 883 -m2
771 884 +5
885 diff --git a/x/y b/x/y
886 deleted file mode 100644
887 --- a/x/y
888 +++ /dev/null
889 @@ -1,1 +0,0 @@
890 -y1
772 891
773 892 - parent to branch: --rev . --rev 2
774 893 M a
894 A x/y
775 895 R b
776 896 R c
777 897
778 898 diff --git a/a b/a
779 899 --- a/a
780 900 +++ b/a
781 901 @@ -1,2 +1,3 @@
782 902 a
783 903 -5
784 904 +m1
785 905 +m2
786 906 diff --git a/b b/b
787 907 deleted file mode 100644
788 908 --- a/b
789 909 +++ /dev/null
790 910 @@ -1,2 +0,0 @@
791 911 -a
792 912 -5
793 913 diff --git a/c b/c
794 914 deleted file mode 100644
795 915 --- a/c
796 916 +++ /dev/null
797 917 @@ -1,2 +0,0 @@
798 918 -a
799 919 -5
920 diff --git a/x/y b/x/y
921 new file mode 100644
922 --- /dev/null
923 +++ b/x/y
924 @@ -0,0 +1,1 @@
925 +y1
800 926
801 927
802 928 created new head
803 929 ** circular rename **
804 930 ** add a a1 / hg mv a b / hg mv b a
805 931 - working to parent:
806 932 A a
807 933 b
808 934 R b
809 935
810 936 diff --git a/b b/a
811 937 rename from b
812 938 rename to a
813 939
814 940 - working to root: --rev 0
815 941 M a
816 942
817 943 diff --git a/a b/a
818 944 --- a/a
819 945 +++ b/a
820 946 @@ -1,1 +1,3 @@
821 947 a
822 948 +6
823 949 +a1
824 950
825 951 - working to branch: --rev 2
826 952 M a
953 R x/y
827 954
828 955 diff --git a/a b/a
829 956 --- a/a
830 957 +++ b/a
831 958 @@ -1,3 +1,3 @@
832 959 a
833 960 -m1
834 961 -m2
835 962 +6
836 963 +a1
964 diff --git a/x/y b/x/y
965 deleted file mode 100644
966 --- a/x/y
967 +++ /dev/null
968 @@ -1,1 +0,0 @@
969 -y1
837 970
838 971 - root to parent: --rev 0 --rev .
839 972 A b
840 973 a
841 974 R a
842 975
843 976 diff --git a/a b/b
844 977 rename from a
845 978 rename to b
846 979 --- a/a
847 980 +++ b/b
848 981 @@ -1,1 +1,3 @@
849 982 a
850 983 +6
851 984 +a1
852 985
853 986 - parent to root: --rev . --rev 0
854 987 A a
855 988 b
856 989 R b
857 990
858 991 diff --git a/b b/a
859 992 rename from b
860 993 rename to a
861 994 --- a/b
862 995 +++ b/a
863 996 @@ -1,3 +1,1 @@
864 997 a
865 998 -6
866 999 -a1
867 1000
868 1001 - branch to parent: --rev 2 --rev .
869 1002 A b
870 1003 a
871 1004 R a
1005 R x/y
872 1006
873 1007 diff --git a/a b/b
874 1008 rename from a
875 1009 rename to b
876 1010 --- a/a
877 1011 +++ b/b
878 1012 @@ -1,3 +1,3 @@
879 1013 a
880 1014 -m1
881 1015 -m2
882 1016 +6
883 1017 +a1
1018 diff --git a/x/y b/x/y
1019 deleted file mode 100644
1020 --- a/x/y
1021 +++ /dev/null
1022 @@ -1,1 +0,0 @@
1023 -y1
884 1024
885 1025 - parent to branch: --rev . --rev 2
886 1026 A a
887 1027 b
1028 A x/y
888 1029 R b
889 1030
890 1031 diff --git a/b b/a
891 1032 rename from b
892 1033 rename to a
893 1034 --- a/b
894 1035 +++ b/a
895 1036 @@ -1,3 +1,3 @@
896 1037 a
897 1038 -6
898 1039 -a1
899 1040 +m1
900 1041 +m2
1042 diff --git a/x/y b/x/y
1043 new file mode 100644
1044 --- /dev/null
1045 +++ b/x/y
1046 @@ -0,0 +1,1 @@
1047 +y1
901 1048
902 1049
1050 created new head
1051 moving x/x to y/x
1052 ** directory move **
1053 ** hg mv x y / add y/x x1 / add y/x x2
1054 - working to parent:
1055 M y/x
1056
1057 diff --git a/y/x b/y/x
1058 --- a/y/x
1059 +++ b/y/x
1060 @@ -1,2 +1,3 @@
1061 x
1062 x1
1063 +x2
1064
1065 - working to root: --rev 0
1066 M a
1067 A y/x
1068 x/x
1069 R x/x
1070
1071 diff --git a/a b/a
1072 --- a/a
1073 +++ b/a
1074 @@ -1,1 +1,2 @@
1075 a
1076 +7
1077 diff --git a/x/x b/y/x
1078 rename from x/x
1079 rename to y/x
1080 --- a/x/x
1081 +++ b/y/x
1082 @@ -1,1 +1,3 @@
1083 x
1084 +x1
1085 +x2
1086
1087 - working to branch: --rev 2
1088 M a
1089 A y/x
1090 x/x
1091 R x/x
1092 R x/y
1093
1094 diff --git a/a b/a
1095 --- a/a
1096 +++ b/a
1097 @@ -1,3 +1,2 @@
1098 a
1099 -m1
1100 -m2
1101 +7
1102 diff --git a/x/y b/x/y
1103 deleted file mode 100644
1104 --- a/x/y
1105 +++ /dev/null
1106 @@ -1,1 +0,0 @@
1107 -y1
1108 diff --git a/x/x b/y/x
1109 rename from x/x
1110 rename to y/x
1111 --- a/x/x
1112 +++ b/y/x
1113 @@ -1,1 +1,3 @@
1114 x
1115 +x1
1116 +x2
1117
1118 - root to parent: --rev 0 --rev .
1119 M a
1120 A y/x
1121 x/x
1122 R x/x
1123
1124 diff --git a/a b/a
1125 --- a/a
1126 +++ b/a
1127 @@ -1,1 +1,2 @@
1128 a
1129 +7
1130 diff --git a/x/x b/y/x
1131 rename from x/x
1132 rename to y/x
1133 --- a/x/x
1134 +++ b/y/x
1135 @@ -1,1 +1,2 @@
1136 x
1137 +x1
1138
1139 - parent to root: --rev . --rev 0
1140 M a
1141 A x/x
1142 y/x
1143 R y/x
1144
1145 diff --git a/a b/a
1146 --- a/a
1147 +++ b/a
1148 @@ -1,2 +1,1 @@
1149 a
1150 -7
1151 diff --git a/y/x b/x/x
1152 rename from y/x
1153 rename to x/x
1154 --- a/y/x
1155 +++ b/x/x
1156 @@ -1,2 +1,1 @@
1157 x
1158 -x1
1159
1160 - branch to parent: --rev 2 --rev .
1161 M a
1162 A y/x
1163 x/x
1164 R x/x
1165 R x/y
1166
1167 diff --git a/a b/a
1168 --- a/a
1169 +++ b/a
1170 @@ -1,3 +1,2 @@
1171 a
1172 -m1
1173 -m2
1174 +7
1175 diff --git a/x/y b/x/y
1176 deleted file mode 100644
1177 --- a/x/y
1178 +++ /dev/null
1179 @@ -1,1 +0,0 @@
1180 -y1
1181 diff --git a/x/x b/y/x
1182 rename from x/x
1183 rename to y/x
1184 --- a/x/x
1185 +++ b/y/x
1186 @@ -1,1 +1,2 @@
1187 x
1188 +x1
1189
1190 - parent to branch: --rev . --rev 2
1191 M a
1192 A x/x
1193 y/x
1194 A x/y
1195 R y/x
1196
1197 diff --git a/a b/a
1198 --- a/a
1199 +++ b/a
1200 @@ -1,2 +1,3 @@
1201 a
1202 -7
1203 +m1
1204 +m2
1205 diff --git a/y/x b/x/x
1206 rename from y/x
1207 rename to x/x
1208 --- a/y/x
1209 +++ b/x/x
1210 @@ -1,2 +1,1 @@
1211 x
1212 -x1
1213 diff --git a/x/y b/x/y
1214 new file mode 100644
1215 --- /dev/null
1216 +++ b/x/y
1217 @@ -0,0 +1,1 @@
1218 +y1
1219
1220
General Comments 0
You need to be logged in to leave comments. Login now