##// END OF EJS Templates
copies: handle a case when both merging csets are not descendant of merge base...
Sushil khanchi -
r42098:7694b685 default
parent child Browse files
Show More
@@ -608,7 +608,7 b' def _fullcopytracing(repo, c1, c2, base)'
608 if dirtyc1:
608 if dirtyc1:
609 _combinecopies(data2['incomplete'], data1['incomplete'], copy, diverge,
609 _combinecopies(data2['incomplete'], data1['incomplete'], copy, diverge,
610 incompletediverge)
610 incompletediverge)
611 else:
611 if dirtyc2:
612 _combinecopies(data1['incomplete'], data2['incomplete'], copy, diverge,
612 _combinecopies(data1['incomplete'], data2['incomplete'], copy, diverge,
613 incompletediverge)
613 incompletediverge)
614
614
@@ -647,7 +647,13 b' def _fullcopytracing(repo, c1, c2, base)'
647 for f in bothnew:
647 for f in bothnew:
648 _checkcopies(c1, c2, f, base, tca, dirtyc1, limit, both1)
648 _checkcopies(c1, c2, f, base, tca, dirtyc1, limit, both1)
649 _checkcopies(c2, c1, f, base, tca, dirtyc2, limit, both2)
649 _checkcopies(c2, c1, f, base, tca, dirtyc2, limit, both2)
650 if dirtyc1:
650 if dirtyc1 and dirtyc2:
651 remainder = _combinecopies(both2['incomplete'], both1['incomplete'],
652 copy, bothdiverge, bothincompletediverge)
653 remainder1 = _combinecopies(both1['incomplete'], both2['incomplete'],
654 copy, bothdiverge, bothincompletediverge)
655 remainder.update(remainder1)
656 elif dirtyc1:
651 # incomplete copies may only be found on the "dirty" side for bothnew
657 # incomplete copies may only be found on the "dirty" side for bothnew
652 assert not both2['incomplete']
658 assert not both2['incomplete']
653 remainder = _combinecopies({}, both1['incomplete'], copy, bothdiverge,
659 remainder = _combinecopies({}, both1['incomplete'], copy, bothdiverge,
@@ -554,8 +554,9 b' Grafting revision 4 on top of revision 2'
554 b
554 b
555 +baba
555 +baba
556
556
557 Test which demonstrate that fullcopytracing algorithm can fail to handle a case when both the csets are dirty
557 Test to make sure that fullcopytracing algorithm don't fail when both the merging csets are dirty
558 ----------------------------------------------------------------------------------------------------------
558 (a dirty cset is one who is not the descendant of merge base)
559 -------------------------------------------------------------------------------------------------
559
560
560 $ newrepo
561 $ newrepo
561 $ echo a > a
562 $ echo a > a
@@ -628,6 +629,5 b' Test which demonstrate that fullcopytrac'
628 Now if we trigger a merge between cset revision 3 and 6 using base revision 4, in this case
629 Now if we trigger a merge between cset revision 3 and 6 using base revision 4, in this case
629 both the merging csets will be dirty as no one is descendent of base revision:
630 both the merging csets will be dirty as no one is descendent of base revision:
630
631
631 $ hg graft -r 6 --base 4 --hidden 2>&1 | grep "AssertionError"
632 $ hg graft -r 6 --base 4 --hidden -t :other
632 AssertionError
633 grafting 6:99802e4f1e46 "added willconflict and d" (tip)
633
General Comments 0
You need to be logged in to leave comments. Login now