##// END OF EJS Templates
copies: don't filter out copy targets created on other side of merge commit...
Martin von Zweigbergk -
r43071:35d674a3 default
parent child Browse files
Show More
@@ -276,27 +276,22 b' def _changesetforwardcopies(a, b, match)'
276 # We are tracing copies from both parents
276 # We are tracing copies from both parents
277 r, i2, copies2 = heapq.heappop(work)
277 r, i2, copies2 = heapq.heappop(work)
278 copies = {}
278 copies = {}
279 ctx = repo[r]
280 p1man, p2man = ctx.p1().manifest(), ctx.p2().manifest()
281 allcopies = set(copies1) | set(copies2)
279 allcopies = set(copies1) | set(copies2)
282 # TODO: perhaps this filtering should be done as long as ctx
280 # TODO: perhaps this filtering should be done as long as ctx
283 # is merge, whether or not we're tracing from both parent.
281 # is merge, whether or not we're tracing from both parent.
284 for dst in allcopies:
282 for dst in allcopies:
285 if not match(dst):
283 if not match(dst):
286 continue
284 continue
287 if dst not in copies2:
285 # Unlike when copies are stored in the filelog, we consider
288 # Copied on p1 side: mark as copy from p1 side if it didn't
286 # it a copy even if the destination already existed on the
289 # already exist on p2 side
287 # other branch. It's simply too expensive to check if the
290 if dst not in p2man:
288 # file existed in the manifest.
291 copies[dst] = copies1[dst]
289 if dst in copies1:
292 elif dst not in copies1:
290 # If it was copied on the p1 side, mark it as copied from
293 # Copied on p2 side: mark as copy from p2 side if it didn't
291 # that side, even if it was also copied on the p2 side.
294 # already exist on p1 side
292 copies[dst] = copies1[dst]
295 if dst not in p1man:
296 copies[dst] = copies2[dst]
297 else:
293 else:
298 # Copied on both sides: mark as copy from p1 side
294 copies[dst] = copies2[dst]
299 copies[dst] = copies1[dst]
300 else:
295 else:
301 copies = copies1
296 copies = copies1
302 if r == b.rev():
297 if r == b.rev():
@@ -452,8 +452,9 b' first side should not include the y->z r'
452 y -> z
452 y -> z
453 $ hg debugpathcopies 1 3
453 $ hg debugpathcopies 1 3
454
454
455 Create x and y, then rename x to z on one side of merge, and rename y to z and modify z on the
455 Create x and y, then rename x to z on one side of merge, and rename y to z and
456 other side.
456 modify z on the other side. When storing copies in the changeset, we don't
457 filter out copies whose target was created on the other side of the merge.
457 $ newrepo
458 $ newrepo
458 $ echo x > x
459 $ echo x > x
459 $ echo y > y
460 $ echo y > y
@@ -494,12 +495,16 b' Try merging the other direction too'
494 o 0 add x and y
495 o 0 add x and y
495 x y
496 x y
496 $ hg debugpathcopies 1 4
497 $ hg debugpathcopies 1 4
498 y -> z (no-filelog !)
497 $ hg debugpathcopies 2 4
499 $ hg debugpathcopies 2 4
500 x -> z (no-filelog !)
498 $ hg debugpathcopies 0 4
501 $ hg debugpathcopies 0 4
499 x -> z (filelog !)
502 x -> z (filelog !)
500 y -> z (compatibility !)
503 y -> z (compatibility !)
501 $ hg debugpathcopies 1 5
504 $ hg debugpathcopies 1 5
505 y -> z (no-filelog !)
502 $ hg debugpathcopies 2 5
506 $ hg debugpathcopies 2 5
507 x -> z (no-filelog !)
503 $ hg debugpathcopies 0 5
508 $ hg debugpathcopies 0 5
504 x -> z
509 x -> z
505
510
General Comments 0
You need to be logged in to leave comments. Login now