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