##// END OF EJS Templates
graftcopies: use _filter() for filtering out invalid copies...
Martin von Zweigbergk -
r44550:3df0bd70 default
parent child Browse files
Show More
@@ -875,11 +875,12 b' def graftcopies(repo, wctx, ctx, base, s'
875 # of the function is much faster (and is required for carrying copy
875 # of the function is much faster (and is required for carrying copy
876 # metadata across the rebase anyway).
876 # metadata across the rebase anyway).
877 exclude = pathcopies(base, skip)
877 exclude = pathcopies(base, skip)
878 for dst, src in pycompat.iteritems(pathcopies(base, ctx)):
878 new_copies = pathcopies(base, ctx)
879 _filter(wctx.p1(), wctx, new_copies)
880 for dst, src in pycompat.iteritems(new_copies):
879 if dst in exclude:
881 if dst in exclude:
880 continue
882 continue
881 if dst in wctx:
883 wctx[dst].markcopied(src)
882 wctx[dst].markcopied(src)
883
884
884
885
885 def computechangesetfilesadded(ctx):
886 def computechangesetfilesadded(ctx):
@@ -118,7 +118,6 b' two renames actually converge to the sam'
118 grafting 2:f58c7e2b28fa "C0"
118 grafting 2:f58c7e2b28fa "C0"
119 merging f1a and f1b to f1a
119 merging f1a and f1b to f1a
120 merging f5a
120 merging f5a
121 warning: can't find ancestor for 'f5a' copied from 'f5b'!
122 $ hg status --change .
121 $ hg status --change .
123 M f1a
122 M f1a
124 M f5a
123 M f5a
@@ -137,7 +136,6 b' Test the cases A.0 (f4x) and A.6 (f3x)'
137 note: possible conflict - f3b was renamed multiple times to:
136 note: possible conflict - f3b was renamed multiple times to:
138 f3a
137 f3a
139 f3d
138 f3d
140 warning: can't find ancestor for 'f3d' copied from 'f3b'!
141
139
142 Set up the repository for some further tests
140 Set up the repository for some further tests
143
141
@@ -224,7 +222,6 b' Test the cases A.1 (f4x) and A.7 (f3x).'
224 f3d
222 f3d
225 f3e
223 f3e
226 merging f4e and f4a to f4e
224 merging f4e and f4a to f4e
227 warning: can't find ancestor for 'f3d' copied from 'f3b'!
228
225
229 $ hg cat f2c
226 $ hg cat f2c
230 c2e
227 c2e
@@ -232,7 +229,6 b' Test the cases A.1 (f4x) and A.7 (f3x).'
232 Test the case A.5 (move case, f1x).
229 Test the case A.5 (move case, f1x).
233
230
234 $ hg up -q "desc("C0")"
231 $ hg up -q "desc("C0")"
235 BROKEN: Shouldn't get the warning about missing ancestor
236 $ HGEDITOR="echo E1 >" hg graft -r 'desc("E0")' --edit
232 $ HGEDITOR="echo E1 >" hg graft -r 'desc("E0")' --edit
237 grafting 6:6bd1736cab86 "E0"
233 grafting 6:6bd1736cab86 "E0"
238 note: possible conflict - f1a was renamed multiple times to:
234 note: possible conflict - f1a was renamed multiple times to:
@@ -243,18 +239,14 b" BROKEN: Shouldn't get the warning about "
243 f3e
239 f3e
244 merging f2c and f2a to f2c
240 merging f2c and f2a to f2c
245 merging f5a and f5b to f5b
241 merging f5a and f5b to f5b
246 warning: can't find ancestor for 'f1e' copied from 'f1a'!
247 warning: can't find ancestor for 'f3e' copied from 'f3a'!
248 $ cat f1e
242 $ cat f1e
249 c1a
243 c1a
250
244
251 Test the case A.5 (copy case, f1x).
245 Test the case A.5 (copy case, f1x).
252
246
253 $ hg up -q "desc("C0")"
247 $ hg up -q "desc("C0")"
254 BROKEN: Shouldn't get the warning about missing ancestor
255 $ HGEDITOR="echo F1 >" hg graft -r 'desc("F0")' --edit
248 $ HGEDITOR="echo F1 >" hg graft -r 'desc("F0")' --edit
256 grafting 7:d376ab0d7fda "F0"
249 grafting 7:d376ab0d7fda "F0"
257 warning: can't find ancestor for 'f1f' copied from 'f1a'!
258 BROKEN: f1f should be marked a copy from f1b
250 BROKEN: f1f should be marked a copy from f1b
259 $ hg st --copies --change .
251 $ hg st --copies --change .
260 A f1f
252 A f1f
@@ -270,7 +262,6 b' BROKEN: We should get a merge conflict f'
270 "c1a")
262 "c1a")
271 $ HGEDITOR="echo G1 >" hg graft -r 'desc("G0")' --edit
263 $ HGEDITOR="echo G1 >" hg graft -r 'desc("G0")' --edit
272 grafting 8:ba67f08fb15a "G0"
264 grafting 8:ba67f08fb15a "G0"
273 warning: can't find ancestor for 'f1g' copied from 'f1a'!
274
265
275 Check the results of the grafts tested
266 Check the results of the grafts tested
276
267
@@ -493,7 +493,6 b' Graft with --log'
493 $ hg up -Cq 1
493 $ hg up -Cq 1
494 $ hg graft 3 --log -u foo
494 $ hg graft 3 --log -u foo
495 grafting 3:4c60f11aa304 "3"
495 grafting 3:4c60f11aa304 "3"
496 warning: can't find ancestor for 'c' copied from 'b'!
497 $ hg log --template '{rev}:{node|short} {parents} {desc}\n' -r tip
496 $ hg log --template '{rev}:{node|short} {parents} {desc}\n' -r tip
498 14:0c921c65ef1e 1:5d205f8b35b6 3
497 14:0c921c65ef1e 1:5d205f8b35b6 3
499 (grafted from 4c60f11aa304a54ae1c199feb94e7fc771e51ed8)
498 (grafted from 4c60f11aa304a54ae1c199feb94e7fc771e51ed8)
@@ -753,12 +752,7 b' Transplants of grafts can find a destina'
753 branchmerge: True, force: True, partial: False
752 branchmerge: True, force: True, partial: False
754 ancestor: b592ea63bb0c, local: 7e61b508e709+, remote: 7a4785234d87
753 ancestor: b592ea63bb0c, local: 7e61b508e709+, remote: 7a4785234d87
755 starting 4 threads for background file closing (?)
754 starting 4 threads for background file closing (?)
756 committing files:
755 note: graft of 13:7a4785234d87 created no changes to commit
757 b
758 warning: can't find ancestor for 'b' copied from 'a'!
759 reusing manifest from p1 (listed files actually unchanged)
760 committing changelog
761 updating the branch cache
762 $ hg log -r 'destination(13)'
756 $ hg log -r 'destination(13)'
763 All copies of a cset
757 All copies of a cset
764 $ hg log -r 'origin(13) or destination(origin(13))'
758 $ hg log -r 'origin(13) or destination(origin(13))'
@@ -785,12 +779,6 b' All copies of a cset'
785
779
786 changeset: 21:7e61b508e709
780 changeset: 21:7e61b508e709
787 branch: dev
781 branch: dev
788 user: foo
789 date: Thu Jan 01 00:00:00 1970 +0000
790 summary: 2
791
792 changeset: 22:3a4e92d81b97
793 branch: dev
794 tag: tip
782 tag: tip
795 user: foo
783 user: foo
796 date: Thu Jan 01 00:00:00 1970 +0000
784 date: Thu Jan 01 00:00:00 1970 +0000
@@ -809,27 +797,28 b" graft with --force (still doesn't graft "
809 $ hg graft 19 0 6
797 $ hg graft 19 0 6
810 skipping ungraftable merge revision 6
798 skipping ungraftable merge revision 6
811 skipping ancestor revision 0:68795b066622
799 skipping ancestor revision 0:68795b066622
812 skipping already grafted revision 19:9627f653b421 (22:3a4e92d81b97 also has origin 2:5c095ad7e90f)
800 grafting 19:9627f653b421 "2"
813 [255]
801 merging b
802 note: graft of 19:9627f653b421 created no changes to commit
814 $ hg graft 19 0 6 --force
803 $ hg graft 19 0 6 --force
815 skipping ungraftable merge revision 6
804 skipping ungraftable merge revision 6
816 grafting 19:9627f653b421 "2"
805 grafting 19:9627f653b421 "2"
817 merging b
806 merging b
818 warning: can't find ancestor for 'b' copied from 'a'!
807 note: graft of 19:9627f653b421 created no changes to commit
819 grafting 0:68795b066622 "0"
808 grafting 0:68795b066622 "0"
820
809
821 graft --force after backout
810 graft --force after backout
822
811
823 $ echo abc > a
812 $ echo abc > a
824 $ hg ci -m 26
813 $ hg ci -m 24
825 $ hg backout 26
814 $ hg backout 24
826 reverting a
815 reverting a
827 changeset 27:e25e17192dc4 backs out changeset 26:44f862488a35
816 changeset 25:71c4e63d4f98 backs out changeset 24:2e7ea477be26
828 $ hg graft 26
817 $ hg graft 24
829 skipping ancestor revision 26:44f862488a35
818 skipping ancestor revision 24:2e7ea477be26
830 [255]
819 [255]
831 $ hg graft 26 --force
820 $ hg graft 24 --force
832 grafting 26:44f862488a35 "26"
821 grafting 24:2e7ea477be26 "24"
833 merging a
822 merging a
834 $ cat a
823 $ cat a
835 abc
824 abc
@@ -837,9 +826,9 b' graft --force after backout'
837 graft --continue after --force
826 graft --continue after --force
838
827
839 $ echo def > a
828 $ echo def > a
840 $ hg ci -m 29
829 $ hg ci -m 27
841 $ hg graft 26 --force --tool internal:fail
830 $ hg graft 24 --force --tool internal:fail
842 grafting 26:44f862488a35 "26"
831 grafting 24:2e7ea477be26 "24"
843 abort: unresolved conflicts, can't continue
832 abort: unresolved conflicts, can't continue
844 (use 'hg resolve' and 'hg graft --continue')
833 (use 'hg resolve' and 'hg graft --continue')
845 [255]
834 [255]
@@ -852,7 +841,7 b' graft --continue after --force'
852 (no more unresolved files)
841 (no more unresolved files)
853 continue: hg graft --continue
842 continue: hg graft --continue
854 $ hg graft -c
843 $ hg graft -c
855 grafting 26:44f862488a35 "26"
844 grafting 24:2e7ea477be26 "24"
856 $ cat a
845 $ cat a
857 abc
846 abc
858
847
@@ -869,12 +858,12 b' but do some destructive editing of the r'
869
858
870 Empty graft
859 Empty graft
871
860
872 $ hg up -qr 24
861 $ hg up -qr 22
873 $ hg tag -f something
862 $ hg tag -f something
874 $ hg graft -qr 25
863 $ hg graft -qr 23
875 $ hg graft -f 25
864 $ hg graft -f 23
876 grafting 25:bd0c98709948 "26"
865 grafting 23:72d9c7c75bcc "24"
877 note: graft of 25:bd0c98709948 created no changes to commit
866 note: graft of 23:72d9c7c75bcc created no changes to commit
878
867
879 $ cd ..
868 $ cd ..
880
869
@@ -82,7 +82,6 b' https://bz.mercurial-scm.org/show_bug.cg'
82 continue: hg graft --continue
82 continue: hg graft --continue
83 $ hg graft --continue
83 $ hg graft --continue
84 grafting 1:5974126fad84 "b1"
84 grafting 1:5974126fad84 "b1"
85 warning: can't find ancestor for 'b' copied from 'a'!
86 $ hg log -f b -T 'changeset: {rev}:{node|short}\nsummary: {desc}\n\n'
85 $ hg log -f b -T 'changeset: {rev}:{node|short}\nsummary: {desc}\n\n'
87 changeset: 3:376d30ccffc0
86 changeset: 3:376d30ccffc0
88 summary: b1
87 summary: b1
General Comments 0
You need to be logged in to leave comments. Login now