##// END OF EJS Templates
phases: test phases tracking at the transaction level...
Boris Feld -
r33459:67a3204c default
parent child Browse files
Show More
@@ -0,0 +1,22 b''
1 # tiny extension to report phase changes during transaction
2
3 from __future__ import absolute_import
4
5 def reposetup(ui, repo):
6
7 def reportphasemove(tr):
8 for rev, move in sorted(tr.changes['phases'].iteritems()):
9 if move[0] is None:
10 ui.write(('test-debug-phase: new rev %d: x -> %d\n'
11 % (rev, move[1])))
12 else:
13 ui.write(('test-debug-phase: move rev %d: %s -> %d\n'
14 % (rev, move[0], move[1])))
15
16 class reportphaserepo(repo.__class__):
17 def transaction(self, *args, **kwargs):
18 tr = super(reportphaserepo, self).transaction(*args, **kwargs)
19 tr.addpostclose('report-phase', reportphasemove)
20 return tr
21
22 repo.__class__ = reportphaserepo
@@ -1,5 +1,10 b''
1 #require killdaemons
1 #require killdaemons
2
2
3 $ cat >> $HGRCPATH << EOF
4 > [extensions]
5 > phasereport=$TESTDIR/testlib/ext-phase-report.py
6 > EOF
7
3 $ hgph() { hg log -G --template "{rev} {phase} {desc} - {node|short}\n" $*; }
8 $ hgph() { hg log -G --template "{rev} {phase} {desc} - {node|short}\n" $*; }
4
9
5 $ mkcommit() {
10 $ mkcommit() {
@@ -13,9 +18,13 b''
13 $ hg init alpha
18 $ hg init alpha
14 $ cd alpha
19 $ cd alpha
15 $ mkcommit a-A
20 $ mkcommit a-A
21 test-debug-phase: new rev 0: x -> 1
16 $ mkcommit a-B
22 $ mkcommit a-B
23 test-debug-phase: new rev 1: x -> 1
17 $ mkcommit a-C
24 $ mkcommit a-C
25 test-debug-phase: new rev 2: x -> 1
18 $ mkcommit a-D
26 $ mkcommit a-D
27 test-debug-phase: new rev 3: x -> 1
19 $ hgph
28 $ hgph
20 @ 3 draft a-D - b555f63b6063
29 @ 3 draft a-D - b555f63b6063
21 |
30 |
@@ -34,6 +43,10 b''
34 adding manifests
43 adding manifests
35 adding file changes
44 adding file changes
36 added 2 changesets with 2 changes to 2 files
45 added 2 changesets with 2 changes to 2 files
46 test-debug-phase: new rev 0: x -> 0
47 test-debug-phase: new rev 1: x -> 0
48 test-debug-phase: move rev 0: 1 -> 0
49 test-debug-phase: move rev 1: 1 -> 0
37 $ hgph
50 $ hgph
38 @ 3 draft a-D - b555f63b6063
51 @ 3 draft a-D - b555f63b6063
39 |
52 |
@@ -52,6 +65,7 b''
52
65
53 $ hg up -q
66 $ hg up -q
54 $ mkcommit b-A
67 $ mkcommit b-A
68 test-debug-phase: new rev 2: x -> 1
55 $ hgph
69 $ hgph
56 @ 2 draft b-A - f54f1bb90ff3
70 @ 2 draft b-A - f54f1bb90ff3
57 |
71 |
@@ -66,6 +80,8 b''
66 adding manifests
80 adding manifests
67 adding file changes
81 adding file changes
68 added 2 changesets with 2 changes to 2 files (+1 heads)
82 added 2 changesets with 2 changes to 2 files (+1 heads)
83 test-debug-phase: new rev 3: x -> 0
84 test-debug-phase: new rev 4: x -> 0
69 (run 'hg heads' to see heads, 'hg merge' to merge)
85 (run 'hg heads' to see heads, 'hg merge' to merge)
70 $ hgph
86 $ hgph
71 o 4 public a-D - b555f63b6063
87 o 4 public a-D - b555f63b6063
@@ -96,6 +112,7 b' push from alpha to beta should update ph'
96 pushing to ../beta
112 pushing to ../beta
97 searching for changes
113 searching for changes
98 no changes found
114 no changes found
115 test-debug-phase: move rev 2: 1 -> 0
99 [1]
116 [1]
100 $ hgph
117 $ hgph
101 @ 3 draft a-D - b555f63b6063
118 @ 3 draft a-D - b555f63b6063
@@ -110,6 +127,7 b' push from alpha to beta should update ph'
110 pushing to ../beta
127 pushing to ../beta
111 searching for changes
128 searching for changes
112 no changes found
129 no changes found
130 test-debug-phase: move rev 3: 1 -> 0
113 [1]
131 [1]
114 $ hgph
132 $ hgph
115 @ 3 public a-D - b555f63b6063
133 @ 3 public a-D - b555f63b6063
@@ -130,6 +148,7 b' update must update phase of common chang'
130 adding manifests
148 adding manifests
131 adding file changes
149 adding file changes
132 added 1 changesets with 1 changes to 1 files (+1 heads)
150 added 1 changesets with 1 changes to 1 files (+1 heads)
151 test-debug-phase: new rev 4: x -> 0
133 (run 'hg heads' to see heads, 'hg merge' to merge)
152 (run 'hg heads' to see heads, 'hg merge' to merge)
134
153
135 $ cd ../beta
154 $ cd ../beta
@@ -148,6 +167,7 b' update must update phase of common chang'
148 pulling from ../alpha
167 pulling from ../alpha
149 searching for changes
168 searching for changes
150 no changes found
169 no changes found
170 test-debug-phase: move rev 2: 1 -> 0
151 $ hgph
171 $ hgph
152 o 4 public a-D - b555f63b6063
172 o 4 public a-D - b555f63b6063
153 |
173 |
@@ -182,6 +202,11 b' changegroup are added without phase move'
182 adding manifests
202 adding manifests
183 adding file changes
203 adding file changes
184 added 5 changesets with 5 changes to 5 files (+1 heads)
204 added 5 changesets with 5 changes to 5 files (+1 heads)
205 test-debug-phase: new rev 0: x -> 1
206 test-debug-phase: new rev 1: x -> 1
207 test-debug-phase: new rev 2: x -> 1
208 test-debug-phase: new rev 3: x -> 1
209 test-debug-phase: new rev 4: x -> 1
185 (run 'hg heads' to see heads, 'hg merge' to merge)
210 (run 'hg heads' to see heads, 'hg merge' to merge)
186 $ hgph
211 $ hgph
187 o 4 draft a-D - b555f63b6063
212 o 4 draft a-D - b555f63b6063
@@ -210,6 +235,9 b' Pulling from publish=False to publish=Fa'
210 adding manifests
235 adding manifests
211 adding file changes
236 adding file changes
212 added 3 changesets with 3 changes to 3 files
237 added 3 changesets with 3 changes to 3 files
238 test-debug-phase: new rev 0: x -> 1
239 test-debug-phase: new rev 1: x -> 1
240 test-debug-phase: new rev 2: x -> 1
213 (run 'hg update' to get a working copy)
241 (run 'hg update' to get a working copy)
214 $ hgph
242 $ hgph
215 o 2 draft a-C - 54acac6f23ab
243 o 2 draft a-C - 54acac6f23ab
@@ -228,6 +256,7 b' Even for common'
228 adding manifests
256 adding manifests
229 adding file changes
257 adding file changes
230 added 1 changesets with 1 changes to 1 files (+1 heads)
258 added 1 changesets with 1 changes to 1 files (+1 heads)
259 test-debug-phase: new rev 3: x -> 1
231 (run 'hg heads' to see heads, 'hg merge' to merge)
260 (run 'hg heads' to see heads, 'hg merge' to merge)
232 $ hgph
261 $ hgph
233 o 3 draft b-A - f54f1bb90ff3
262 o 3 draft b-A - f54f1bb90ff3
@@ -250,6 +279,10 b' we are in nu'
250 adding manifests
279 adding manifests
251 adding file changes
280 adding file changes
252 added 1 changesets with 1 changes to 1 files
281 added 1 changesets with 1 changes to 1 files
282 test-debug-phase: move rev 0: 1 -> 0
283 test-debug-phase: move rev 1: 1 -> 0
284 test-debug-phase: move rev 2: 1 -> 0
285 test-debug-phase: new rev 4: x -> 0
253 (run 'hg update' to get a working copy)
286 (run 'hg update' to get a working copy)
254 $ hgph # f54f1bb90ff3 stay draft, not ancestor of -r
287 $ hgph # f54f1bb90ff3 stay draft, not ancestor of -r
255 o 4 public a-D - b555f63b6063
288 o 4 public a-D - b555f63b6063
@@ -267,7 +300,9 b' pulling from Publish=False to publish=Fa'
267
300
268 $ hg up -q f54f1bb90ff3
301 $ hg up -q f54f1bb90ff3
269 $ mkcommit n-A
302 $ mkcommit n-A
303 test-debug-phase: new rev 5: x -> 1
270 $ mkcommit n-B
304 $ mkcommit n-B
305 test-debug-phase: new rev 6: x -> 1
271 $ hgph
306 $ hgph
272 @ 6 draft n-B - 145e75495359
307 @ 6 draft n-B - 145e75495359
273 |
308 |
@@ -291,6 +326,12 b' pulling from Publish=False to publish=Fa'
291 adding manifests
326 adding manifests
292 adding file changes
327 adding file changes
293 added 2 changesets with 2 changes to 2 files
328 added 2 changesets with 2 changes to 2 files
329 test-debug-phase: move rev 0: 1 -> 0
330 test-debug-phase: move rev 1: 1 -> 0
331 test-debug-phase: move rev 3: 1 -> 0
332 test-debug-phase: move rev 4: 1 -> 0
333 test-debug-phase: new rev 5: x -> 1
334 test-debug-phase: new rev 6: x -> 1
294 (run 'hg update' to get a working copy)
335 (run 'hg update' to get a working copy)
295 $ hgph
336 $ hgph
296 o 6 draft n-B - 145e75495359
337 o 6 draft n-B - 145e75495359
@@ -330,6 +371,8 b' pulling into publish=True'
330 adding manifests
371 adding manifests
331 adding file changes
372 adding file changes
332 added 2 changesets with 2 changes to 2 files
373 added 2 changesets with 2 changes to 2 files
374 test-debug-phase: new rev 5: x -> 1
375 test-debug-phase: new rev 6: x -> 1
333 (run 'hg update' to get a working copy)
376 (run 'hg update' to get a working copy)
334 $ hgph
377 $ hgph
335 o 6 draft n-B - 145e75495359
378 o 6 draft n-B - 145e75495359
@@ -355,6 +398,9 b' pulling back into original repo'
355 pulling from ../alpha
398 pulling from ../alpha
356 searching for changes
399 searching for changes
357 no changes found
400 no changes found
401 test-debug-phase: move rev 3: 1 -> 0
402 test-debug-phase: move rev 5: 1 -> 0
403 test-debug-phase: move rev 6: 1 -> 0
358 $ hgph
404 $ hgph
359 @ 6 public n-B - 145e75495359
405 @ 6 public n-B - 145e75495359
360 |
406 |
@@ -385,6 +431,8 b' Push back to alpha'
385 pushing to ../alpha
431 pushing to ../alpha
386 searching for changes
432 searching for changes
387 no changes found
433 no changes found
434 test-debug-phase: move rev 5: 1 -> 0
435 test-debug-phase: move rev 6: 1 -> 0
388 [1]
436 [1]
389 $ cd ..
437 $ cd ..
390 $ cd alpha
438 $ cd alpha
@@ -448,10 +496,14 b' initial setup'
448 summary: a-A
496 summary: a-A
449
497
450 $ mkcommit a-E
498 $ mkcommit a-E
499 test-debug-phase: new rev 7: x -> 1
451 $ mkcommit a-F
500 $ mkcommit a-F
501 test-debug-phase: new rev 8: x -> 1
452 $ mkcommit a-G
502 $ mkcommit a-G
503 test-debug-phase: new rev 9: x -> 1
453 $ hg up d6bcb4f74035 -q
504 $ hg up d6bcb4f74035 -q
454 $ mkcommit a-H
505 $ mkcommit a-H
506 test-debug-phase: new rev 10: x -> 1
455 created new head
507 created new head
456 $ hgph
508 $ hgph
457 @ 10 draft a-H - 967b449fbc94
509 @ 10 draft a-H - 967b449fbc94
@@ -518,6 +570,8 b' Pushing to Publish=False (unknown change'
518 adding manifests
570 adding manifests
519 adding file changes
571 adding file changes
520 added 2 changesets with 2 changes to 2 files
572 added 2 changesets with 2 changes to 2 files
573 test-debug-phase: new rev 7: x -> 1
574 test-debug-phase: new rev 8: x -> 1
521 $ hgph
575 $ hgph
522 @ 10 draft a-H - 967b449fbc94
576 @ 10 draft a-H - 967b449fbc94
523 |
577 |
@@ -573,6 +627,10 b' Pushing to Publish=True (unknown changes'
573 adding manifests
627 adding manifests
574 adding file changes
628 adding file changes
575 added 2 changesets with 2 changes to 2 files
629 added 2 changesets with 2 changes to 2 files
630 test-debug-phase: new rev 5: x -> 0
631 test-debug-phase: new rev 6: x -> 0
632 test-debug-phase: move rev 7: 1 -> 0
633 test-debug-phase: move rev 8: 1 -> 0
576 $ hgph # again f54f1bb90ff3, d6bcb4f74035 and 145e75495359 stay draft,
634 $ hgph # again f54f1bb90ff3, d6bcb4f74035 and 145e75495359 stay draft,
577 > # not ancestor of -r
635 > # not ancestor of -r
578 o 8 public a-F - b740e3e5c05d
636 o 8 public a-F - b740e3e5c05d
@@ -601,6 +659,8 b' Pushing to Publish=True (common changese'
601 pushing to ../alpha
659 pushing to ../alpha
602 searching for changes
660 searching for changes
603 no changes found
661 no changes found
662 test-debug-phase: move rev 7: 1 -> 0
663 test-debug-phase: move rev 8: 1 -> 0
604 [1]
664 [1]
605 $ hgph
665 $ hgph
606 o 6 public a-F - b740e3e5c05d
666 o 6 public a-F - b740e3e5c05d
@@ -651,6 +711,9 b' Pushing to Publish=False (common changes'
651 adding manifests
711 adding manifests
652 adding file changes
712 adding file changes
653 added 1 changesets with 1 changes to 1 files (+1 heads)
713 added 1 changesets with 1 changes to 1 files (+1 heads)
714 test-debug-phase: move rev 2: 1 -> 0
715 test-debug-phase: move rev 5: 1 -> 0
716 test-debug-phase: new rev 9: x -> 1
654 $ hgph
717 $ hgph
655 @ 10 draft a-H - 967b449fbc94
718 @ 10 draft a-H - 967b449fbc94
656 |
719 |
@@ -706,6 +769,9 b' Pushing to Publish=True (common changese'
706 pushing to ../alpha
769 pushing to ../alpha
707 searching for changes
770 searching for changes
708 no changes found
771 no changes found
772 test-debug-phase: move rev 10: 1 -> 0
773 test-debug-phase: move rev 6: 1 -> 0
774 test-debug-phase: move rev 9: 1 -> 0
709 [1]
775 [1]
710 $ hgph
776 $ hgph
711 o 9 public a-H - 967b449fbc94
777 o 9 public a-H - 967b449fbc94
@@ -760,6 +826,8 b' Bare push with next changeset and common'
760 $ hg -R ../alpha --config extensions.strip= strip --no-backup 967b449fbc94
826 $ hg -R ../alpha --config extensions.strip= strip --no-backup 967b449fbc94
761 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
827 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
762 $ hg phase --force --draft b740e3e5c05d 967b449fbc94
828 $ hg phase --force --draft b740e3e5c05d 967b449fbc94
829 test-debug-phase: move rev 8: 0 -> 1
830 test-debug-phase: move rev 9: 0 -> 1
763 $ hg push -fv ../alpha
831 $ hg push -fv ../alpha
764 pushing to ../alpha
832 pushing to ../alpha
765 searching for changes
833 searching for changes
@@ -772,6 +840,9 b' Bare push with next changeset and common'
772 adding manifests
840 adding manifests
773 adding file changes
841 adding file changes
774 added 1 changesets with 1 changes to 1 files (+1 heads)
842 added 1 changesets with 1 changes to 1 files (+1 heads)
843 test-debug-phase: new rev 10: x -> 0
844 test-debug-phase: move rev 8: 1 -> 0
845 test-debug-phase: move rev 9: 1 -> 0
775 $ hgph
846 $ hgph
776 o 9 public a-H - 967b449fbc94
847 o 9 public a-H - 967b449fbc94
777 |
848 |
@@ -826,6 +897,7 b' Discovery locally secret changeset on a '
826
897
827 $ cd ../alpha
898 $ cd ../alpha
828 $ mkcommit A-secret --config phases.new-commit=2
899 $ mkcommit A-secret --config phases.new-commit=2
900 test-debug-phase: new rev 11: x -> 2
829 $ hgph
901 $ hgph
830 @ 11 secret A-secret - 435b5d83910c
902 @ 11 secret A-secret - 435b5d83910c
831 |
903 |
@@ -858,6 +930,7 b' Discovery locally secret changeset on a '
858 adding manifests
930 adding manifests
859 adding file changes
931 adding file changes
860 added 1 changesets with 1 changes to 1 files
932 added 1 changesets with 1 changes to 1 files
933 test-debug-phase: new rev 10: x -> 1
861 (run 'hg update' to get a working copy)
934 (run 'hg update' to get a working copy)
862 $ hgph -R ../mu
935 $ hgph -R ../mu
863 o 10 draft A-secret - 435b5d83910c
936 o 10 draft A-secret - 435b5d83910c
@@ -886,6 +959,7 b' Discovery locally secret changeset on a '
886 pulling from ../mu
959 pulling from ../mu
887 searching for changes
960 searching for changes
888 no changes found
961 no changes found
962 test-debug-phase: move rev 11: 2 -> 1
889 $ hgph
963 $ hgph
890 @ 11 draft A-secret - 435b5d83910c
964 @ 11 draft A-secret - 435b5d83910c
891 |
965 |
@@ -916,6 +990,8 b' pushing a locally public and draft chang'
916 appear on the remote side.
990 appear on the remote side.
917
991
918 $ hg -R ../mu phase --secret --force 967b449fbc94
992 $ hg -R ../mu phase --secret --force 967b449fbc94
993 test-debug-phase: move rev 9: 0 -> 2
994 test-debug-phase: move rev 10: 1 -> 2
919 $ hg push -r 435b5d83910c ../mu
995 $ hg push -r 435b5d83910c ../mu
920 pushing to ../mu
996 pushing to ../mu
921 searching for changes
997 searching for changes
@@ -929,6 +1005,8 b' appear on the remote side.'
929 adding manifests
1005 adding manifests
930 adding file changes
1006 adding file changes
931 added 0 changesets with 0 changes to 2 files
1007 added 0 changesets with 0 changes to 2 files
1008 test-debug-phase: move rev 9: 2 -> 0
1009 test-debug-phase: move rev 10: 2 -> 1
932 $ hgph -R ../mu
1010 $ hgph -R ../mu
933 o 10 draft A-secret - 435b5d83910c
1011 o 10 draft A-secret - 435b5d83910c
934 |
1012 |
@@ -957,6 +1035,7 b' pull new changeset with common draft loc'
957
1035
958 $ hg up -q 967b449fbc94 # create a new root for draft
1036 $ hg up -q 967b449fbc94 # create a new root for draft
959 $ mkcommit 'alpha-more'
1037 $ mkcommit 'alpha-more'
1038 test-debug-phase: new rev 12: x -> 1
960 created new head
1039 created new head
961 $ hg push -fr . ../mu
1040 $ hg push -fr . ../mu
962 pushing to ../mu
1041 pushing to ../mu
@@ -965,10 +1044,13 b' pull new changeset with common draft loc'
965 adding manifests
1044 adding manifests
966 adding file changes
1045 adding file changes
967 added 1 changesets with 1 changes to 1 files (+1 heads)
1046 added 1 changesets with 1 changes to 1 files (+1 heads)
1047 test-debug-phase: new rev 11: x -> 1
968 $ cd ../mu
1048 $ cd ../mu
969 $ hg phase --secret --force 1c5cfd894796
1049 $ hg phase --secret --force 1c5cfd894796
1050 test-debug-phase: move rev 11: 1 -> 2
970 $ hg up -q 435b5d83910c
1051 $ hg up -q 435b5d83910c
971 $ mkcommit 'mu-more'
1052 $ mkcommit 'mu-more'
1053 test-debug-phase: new rev 12: x -> 1
972 $ cd ../alpha
1054 $ cd ../alpha
973 $ hg pull ../mu
1055 $ hg pull ../mu
974 pulling from ../mu
1056 pulling from ../mu
@@ -977,6 +1059,7 b' pull new changeset with common draft loc'
977 adding manifests
1059 adding manifests
978 adding file changes
1060 adding file changes
979 added 1 changesets with 1 changes to 1 files
1061 added 1 changesets with 1 changes to 1 files
1062 test-debug-phase: new rev 13: x -> 1
980 (run 'hg update' to get a working copy)
1063 (run 'hg update' to get a working copy)
981 $ hgph
1064 $ hgph
982 o 13 draft mu-more - 5237fb433fc8
1065 o 13 draft mu-more - 5237fb433fc8
@@ -1012,6 +1095,11 b' Test that test are properly ignored on r'
1012
1095
1013 $ cd ..
1096 $ cd ..
1014 $ hg clone -qU -r b555f63b6063 -r f54f1bb90ff3 beta gamma
1097 $ hg clone -qU -r b555f63b6063 -r f54f1bb90ff3 beta gamma
1098 test-debug-phase: new rev 0: x -> 0
1099 test-debug-phase: new rev 1: x -> 0
1100 test-debug-phase: new rev 2: x -> 0
1101 test-debug-phase: new rev 3: x -> 0
1102 test-debug-phase: new rev 4: x -> 0
1015
1103
1016 # pathological case are
1104 # pathological case are
1017 #
1105 #
@@ -1020,7 +1108,9 b' Test that test are properly ignored on r'
1020 # * repo have uncommon changeset
1108 # * repo have uncommon changeset
1021
1109
1022 $ hg -R beta phase --secret --force f54f1bb90ff3
1110 $ hg -R beta phase --secret --force f54f1bb90ff3
1111 test-debug-phase: move rev 2: 0 -> 2
1023 $ hg -R gamma phase --draft --force f54f1bb90ff3
1112 $ hg -R gamma phase --draft --force f54f1bb90ff3
1113 test-debug-phase: move rev 2: 0 -> 1
1024
1114
1025 $ cd gamma
1115 $ cd gamma
1026 $ hg pull ../beta
1116 $ hg pull ../beta
@@ -1030,6 +1120,8 b' Test that test are properly ignored on r'
1030 adding manifests
1120 adding manifests
1031 adding file changes
1121 adding file changes
1032 added 2 changesets with 2 changes to 2 files
1122 added 2 changesets with 2 changes to 2 files
1123 test-debug-phase: new rev 5: x -> 0
1124 test-debug-phase: new rev 6: x -> 0
1033 (run 'hg update' to get a working copy)
1125 (run 'hg update' to get a working copy)
1034 $ hg phase f54f1bb90ff3
1126 $ hg phase f54f1bb90ff3
1035 2: draft
1127 2: draft
@@ -1083,6 +1175,7 b' 1. cloning non-publishing repository'
1083 # make sure there is no secret so we can use a copy clone
1175 # make sure there is no secret so we can use a copy clone
1084
1176
1085 $ hg -R mu phase --draft 'secret()'
1177 $ hg -R mu phase --draft 'secret()'
1178 test-debug-phase: move rev 11: 2 -> 1
1086
1179
1087 $ hg clone -U mu Tau
1180 $ hg clone -U mu Tau
1088 $ hgph -R Tau
1181 $ hgph -R Tau
@@ -1169,11 +1262,29 b' 1. Test that push is not prevented'
1169 adding manifests
1262 adding manifests
1170 adding file changes
1263 adding file changes
1171 added 14 changesets with 14 changes to 14 files (+3 heads)
1264 added 14 changesets with 14 changes to 14 files (+3 heads)
1265 test-debug-phase: new rev 0: x -> 0
1266 test-debug-phase: new rev 1: x -> 0
1267 test-debug-phase: new rev 2: x -> 0
1268 test-debug-phase: new rev 3: x -> 0
1269 test-debug-phase: new rev 4: x -> 0
1270 test-debug-phase: new rev 5: x -> 0
1271 test-debug-phase: new rev 6: x -> 0
1272 test-debug-phase: new rev 7: x -> 0
1273 test-debug-phase: new rev 8: x -> 0
1274 test-debug-phase: new rev 9: x -> 0
1275 test-debug-phase: new rev 10: x -> 0
1276 test-debug-phase: new rev 11: x -> 0
1277 test-debug-phase: new rev 12: x -> 0
1278 test-debug-phase: new rev 13: x -> 0
1172 $ chmod -R +w .hg
1279 $ chmod -R +w .hg
1173
1280
1174 2. Test that failed phases movement are reported
1281 2. Test that failed phases movement are reported
1175
1282
1176 $ hg phase --force --draft 3
1283 $ hg phase --force --draft 3
1284 test-debug-phase: move rev 3: 0 -> 1
1285 test-debug-phase: move rev 7: 0 -> 1
1286 test-debug-phase: move rev 8: 0 -> 1
1287 test-debug-phase: move rev 9: 0 -> 1
1177 $ chmod -R -w .hg
1288 $ chmod -R -w .hg
1178 $ hg push ../Phi
1289 $ hg push ../Phi
1179 pushing to ../Phi
1290 pushing to ../Phi
@@ -1191,7 +1302,13 b' Test that clone behaves like pull and do'
1191 publish changesets as plain push does
1302 publish changesets as plain push does
1192
1303
1193 $ hg -R Upsilon phase -q --force --draft 2
1304 $ hg -R Upsilon phase -q --force --draft 2
1305 test-debug-phase: move rev 2: 0 -> 1
1194 $ hg clone -q Upsilon Pi -r 7
1306 $ hg clone -q Upsilon Pi -r 7
1307 test-debug-phase: new rev 0: x -> 0
1308 test-debug-phase: new rev 1: x -> 0
1309 test-debug-phase: new rev 2: x -> 0
1310 test-debug-phase: new rev 3: x -> 0
1311 test-debug-phase: new rev 4: x -> 0
1195 $ hgph Upsilon -r 'min(draft())'
1312 $ hgph Upsilon -r 'min(draft())'
1196 o 2 draft a-C - 54acac6f23ab
1313 o 2 draft a-C - 54acac6f23ab
1197 |
1314 |
@@ -1201,6 +1318,9 b' publish changesets as plain push does'
1201 pushing to Pi
1318 pushing to Pi
1202 searching for changes
1319 searching for changes
1203 no changes found
1320 no changes found
1321 test-debug-phase: move rev 2: 1 -> 0
1322 test-debug-phase: move rev 3: 1 -> 0
1323 test-debug-phase: move rev 7: 1 -> 0
1204 [1]
1324 [1]
1205 $ hgph Upsilon -r 'min(draft())'
1325 $ hgph Upsilon -r 'min(draft())'
1206 o 8 draft a-F - b740e3e5c05d
1326 o 8 draft a-F - b740e3e5c05d
@@ -1214,6 +1334,8 b' publish changesets as plain push does'
1214 adding manifests
1334 adding manifests
1215 adding file changes
1335 adding file changes
1216 added 1 changesets with 1 changes to 1 files
1336 added 1 changesets with 1 changes to 1 files
1337 test-debug-phase: new rev 5: x -> 0
1338 test-debug-phase: move rev 8: 1 -> 0
1217
1339
1218 $ hgph Upsilon -r 'min(draft())'
1340 $ hgph Upsilon -r 'min(draft())'
1219 o 9 draft a-G - 3e27b6f1eee1
1341 o 9 draft a-G - 3e27b6f1eee1
@@ -1,3 +1,9 b''
1
2 $ cat >> $HGRCPATH << EOF
3 > [extensions]
4 > phasereport=$TESTDIR/testlib/ext-phase-report.py
5 > EOF
6
1 $ hglog() { hg log --template "{rev} {phaseidx} {desc}\n" $*; }
7 $ hglog() { hg log --template "{rev} {phaseidx} {desc}\n" $*; }
2 $ mkcommit() {
8 $ mkcommit() {
3 > echo "$1" > "$1"
9 > echo "$1" > "$1"
@@ -19,6 +25,7 b' Cannot change null revision phase'
19 -1: public
25 -1: public
20
26
21 $ mkcommit A
27 $ mkcommit A
28 test-debug-phase: new rev 0: x -> 1
22
29
23 New commit are draft by default
30 New commit are draft by default
24
31
@@ -28,6 +35,7 b' New commit are draft by default'
28 Following commit are draft too
35 Following commit are draft too
29
36
30 $ mkcommit B
37 $ mkcommit B
38 test-debug-phase: new rev 1: x -> 1
31
39
32 $ hglog
40 $ hglog
33 1 1 B
41 1 1 B
@@ -36,6 +44,8 b' Following commit are draft too'
36 Draft commit are properly created over public one:
44 Draft commit are properly created over public one:
37
45
38 $ hg phase --public .
46 $ hg phase --public .
47 test-debug-phase: move rev 0: 1 -> 0
48 test-debug-phase: move rev 1: 1 -> 0
39 $ hg phase
49 $ hg phase
40 1: public
50 1: public
41 $ hglog
51 $ hglog
@@ -43,7 +53,9 b' Draft commit are properly created over p'
43 0 0 A
53 0 0 A
44
54
45 $ mkcommit C
55 $ mkcommit C
56 test-debug-phase: new rev 2: x -> 1
46 $ mkcommit D
57 $ mkcommit D
58 test-debug-phase: new rev 3: x -> 1
47
59
48 $ hglog
60 $ hglog
49 3 1 D
61 3 1 D
@@ -54,6 +66,7 b' Draft commit are properly created over p'
54 Test creating changeset as secret
66 Test creating changeset as secret
55
67
56 $ mkcommit E --config phases.new-commit='secret'
68 $ mkcommit E --config phases.new-commit='secret'
69 test-debug-phase: new rev 4: x -> 2
57 $ hglog
70 $ hglog
58 4 2 E
71 4 2 E
59 3 1 D
72 3 1 D
@@ -64,6 +77,7 b' Test creating changeset as secret'
64 Test the secret property is inherited
77 Test the secret property is inherited
65
78
66 $ mkcommit H
79 $ mkcommit H
80 test-debug-phase: new rev 5: x -> 2
67 $ hglog
81 $ hglog
68 5 2 H
82 5 2 H
69 4 2 E
83 4 2 E
@@ -76,6 +90,7 b' Even on merge'
76
90
77 $ hg up -q 1
91 $ hg up -q 1
78 $ mkcommit "B'"
92 $ mkcommit "B'"
93 test-debug-phase: new rev 6: x -> 1
79 created new head
94 created new head
80 $ hglog
95 $ hglog
81 6 1 B'
96 6 1 B'
@@ -92,6 +107,8 b' Even on merge'
92 6: draft
107 6: draft
93 4: secret
108 4: secret
94 $ hg ci -m "merge B' and E"
109 $ hg ci -m "merge B' and E"
110 test-debug-phase: new rev 7: x -> 2
111
95 $ hglog
112 $ hglog
96 7 2 merge B' and E
113 7 2 merge B' and E
97 6 1 B'
114 6 1 B'
@@ -133,6 +150,11 b' Test secret changeset are not pushed'
133 adding manifests
150 adding manifests
134 adding file changes
151 adding file changes
135 added 5 changesets with 5 changes to 5 files (+1 heads)
152 added 5 changesets with 5 changes to 5 files (+1 heads)
153 test-debug-phase: new rev 0: x -> 0
154 test-debug-phase: new rev 1: x -> 0
155 test-debug-phase: new rev 2: x -> 1
156 test-debug-phase: new rev 3: x -> 1
157 test-debug-phase: new rev 4: x -> 1
136 $ hglog
158 $ hglog
137 7 2 merge B' and E
159 7 2 merge B' and E
138 6 1 B'
160 6 1 B'
@@ -158,6 +180,7 b' visible shared between the initial repo '
158
180
159 $ hg up -q 4 # B'
181 $ hg up -q 4 # B'
160 $ mkcommit Z --config phases.new-commit=secret
182 $ mkcommit Z --config phases.new-commit=secret
183 test-debug-phase: new rev 5: x -> 2
161 $ hg phase .
184 $ hg phase .
162 5: secret
185 5: secret
163
186
@@ -167,6 +190,7 b' head shadowed by the remote secret head.'
167 $ cd ../initialrepo
190 $ cd ../initialrepo
168 $ hg up -q 6 #B'
191 $ hg up -q 6 #B'
169 $ mkcommit I
192 $ mkcommit I
193 test-debug-phase: new rev 8: x -> 1
170 created new head
194 created new head
171 $ hg push ../push-dest
195 $ hg push ../push-dest
172 pushing to ../push-dest
196 pushing to ../push-dest
@@ -175,6 +199,7 b' head shadowed by the remote secret head.'
175 adding manifests
199 adding manifests
176 adding file changes
200 adding file changes
177 added 1 changesets with 1 changes to 1 files (+1 heads)
201 added 1 changesets with 1 changes to 1 files (+1 heads)
202 test-debug-phase: new rev 6: x -> 1
178
203
179 :note: The "(+1 heads)" is wrong as we do not had any visible head
204 :note: The "(+1 heads)" is wrong as we do not had any visible head
180
205
@@ -222,6 +247,11 b' Test secret changeset are not pull'
222 adding manifests
247 adding manifests
223 adding file changes
248 adding file changes
224 added 5 changesets with 5 changes to 5 files (+1 heads)
249 added 5 changesets with 5 changes to 5 files (+1 heads)
250 test-debug-phase: new rev 0: x -> 0
251 test-debug-phase: new rev 1: x -> 0
252 test-debug-phase: new rev 2: x -> 0
253 test-debug-phase: new rev 3: x -> 0
254 test-debug-phase: new rev 4: x -> 0
225 (run 'hg heads' to see heads, 'hg merge' to merge)
255 (run 'hg heads' to see heads, 'hg merge' to merge)
226 $ hglog
256 $ hglog
227 4 0 B'
257 4 0 B'
@@ -242,6 +272,11 b' Test secret changeset are not cloned'
242 (during local clone)
272 (during local clone)
243
273
244 $ hg clone -qU initialrepo clone-dest
274 $ hg clone -qU initialrepo clone-dest
275 test-debug-phase: new rev 0: x -> 0
276 test-debug-phase: new rev 1: x -> 0
277 test-debug-phase: new rev 2: x -> 0
278 test-debug-phase: new rev 3: x -> 0
279 test-debug-phase: new rev 4: x -> 0
245 $ hglog -R clone-dest
280 $ hglog -R clone-dest
246 4 0 B'
281 4 0 B'
247 3 0 D
282 3 0 D
@@ -440,6 +475,7 b' move changeset forward'
440 (with -r option)
475 (with -r option)
441
476
442 $ hg phase --public -r 2
477 $ hg phase --public -r 2
478 test-debug-phase: move rev 2: 1 -> 0
443 $ hg log -G --template "{rev} {phase} {desc}\n"
479 $ hg log -G --template "{rev} {phase} {desc}\n"
444 @ 7 secret merge B' and E
480 @ 7 secret merge B' and E
445 |\
481 |\
@@ -463,6 +499,7 b' move changeset backward'
463 (without -r option)
499 (without -r option)
464
500
465 $ hg phase --draft --force 2
501 $ hg phase --draft --force 2
502 test-debug-phase: move rev 2: 0 -> 1
466 $ hg log -G --template "{rev} {phase} {desc}\n"
503 $ hg log -G --template "{rev} {phase} {desc}\n"
467 @ 7 secret merge B' and E
504 @ 7 secret merge B' and E
468 |\
505 |\
@@ -484,6 +521,8 b' move changeset backward'
484 move changeset forward and backward
521 move changeset forward and backward
485
522
486 $ hg phase --draft --force 1::4
523 $ hg phase --draft --force 1::4
524 test-debug-phase: move rev 1: 0 -> 1
525 test-debug-phase: move rev 4: 2 -> 1
487 $ hg log -G --template "{rev} {phase} {desc}\n"
526 $ hg log -G --template "{rev} {phase} {desc}\n"
488 @ 7 secret merge B' and E
527 @ 7 secret merge B' and E
489 |\
528 |\
@@ -504,7 +543,14 b' move changeset forward and backward'
504 test partial failure
543 test partial failure
505
544
506 $ hg phase --public 7
545 $ hg phase --public 7
546 test-debug-phase: move rev 1: 1 -> 0
547 test-debug-phase: move rev 2: 1 -> 0
548 test-debug-phase: move rev 3: 1 -> 0
549 test-debug-phase: move rev 4: 1 -> 0
550 test-debug-phase: move rev 6: 1 -> 0
551 test-debug-phase: move rev 7: 2 -> 0
507 $ hg phase --draft '5 or 7'
552 $ hg phase --draft '5 or 7'
553 test-debug-phase: move rev 5: 2 -> 1
508 cannot move 1 changesets to a higher phase, use --force
554 cannot move 1 changesets to a higher phase, use --force
509 phase changed for 1 changesets
555 phase changed for 1 changesets
510 [1]
556 [1]
@@ -555,6 +601,13 b' test hidden changeset are not cloned as '
555 adding manifests
601 adding manifests
556 adding file changes
602 adding file changes
557 added 7 changesets with 6 changes to 6 files
603 added 7 changesets with 6 changes to 6 files
604 test-debug-phase: new rev 0: x -> 0
605 test-debug-phase: new rev 1: x -> 0
606 test-debug-phase: new rev 2: x -> 0
607 test-debug-phase: new rev 3: x -> 0
608 test-debug-phase: new rev 4: x -> 0
609 test-debug-phase: new rev 5: x -> 0
610 test-debug-phase: new rev 6: x -> 0
558 updating to branch default
611 updating to branch default
559 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
612 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
560 $ cd clonewithobs
613 $ cd clonewithobs
General Comments 0
You need to be logged in to leave comments. Login now