author | Boris Feld <boris.feld@octobus.net> |
Mon, 10 Jul 2017 17:22:17 +0200 | |
changeset 33484 | 2a8ce4e79a47 |
parent 33153 | 4d780d510b44 |
child 33558 | 0103e7187237 |
permissions | -rw-r--r-- |
33152 | 1 |
$ cat >> $HGRCPATH<<EOF |
2 |
> [extensions] |
|
3 |
> drawdag=$TESTDIR/drawdag.py |
|
33153
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
4 |
> [experimental] |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
5 |
> evolution=all |
33152 | 6 |
> EOF |
7 |
||
8 |
$ reinit () { |
|
9 |
> rm -rf .hg && hg init |
|
10 |
> } |
|
11 |
||
12 |
$ hg init |
|
13 |
||
14 |
Test what said in drawdag.py docstring |
|
15 |
||
16 |
$ hg debugdrawdag <<'EOS' |
|
17 |
> c d |
|
18 |
> |/ |
|
19 |
> b |
|
20 |
> | |
|
21 |
> a |
|
22 |
> EOS |
|
23 |
||
24 |
$ hg log -G -T '{rev} {desc} ({tags})' |
|
25 |
o 3 d (d tip) |
|
26 |
| |
|
27 |
| o 2 c (c) |
|
28 |
|/ |
|
29 |
o 1 b (b) |
|
30 |
| |
|
31 |
o 0 a (a) |
|
32 |
||
33 |
$ hg debugdrawdag <<'EOS' |
|
34 |
> foo bar bar foo |
|
35 |
> | / | | |
|
36 |
> ancestor(c,d) a baz |
|
37 |
> EOS |
|
38 |
||
39 |
$ hg log -G -T '{desc}' |
|
40 |
o foo |
|
41 |
|\ |
|
42 |
+---o bar |
|
43 |
| | | |
|
44 |
| o | baz |
|
45 |
| / |
|
46 |
+---o d |
|
47 |
| | |
|
48 |
+---o c |
|
49 |
| | |
|
50 |
o | b |
|
51 |
|/ |
|
52 |
o a |
|
53 |
||
54 |
$ reinit |
|
55 |
||
56 |
$ hg debugdrawdag <<'EOS' |
|
57 |
> o foo |
|
58 |
> |\ |
|
59 |
> +---o bar |
|
60 |
> | | | |
|
61 |
> | o | baz |
|
62 |
> | / |
|
63 |
> +---o d |
|
64 |
> | | |
|
65 |
> +---o c |
|
66 |
> | | |
|
67 |
> o | b |
|
68 |
> |/ |
|
69 |
> o a |
|
70 |
> EOS |
|
71 |
||
72 |
$ hg log -G -T '{desc}' |
|
73 |
o foo |
|
74 |
|\ |
|
75 |
| | o d |
|
76 |
| |/ |
|
77 |
| | o c |
|
78 |
| |/ |
|
79 |
| | o bar |
|
80 |
| |/| |
|
81 |
| o | b |
|
82 |
| |/ |
|
83 |
o / baz |
|
84 |
/ |
|
85 |
o a |
|
86 |
||
87 |
$ reinit |
|
88 |
||
89 |
$ hg debugdrawdag <<'EOS' |
|
90 |
> o foo |
|
91 |
> |\ |
|
92 |
> | | o d |
|
93 |
> | |/ |
|
94 |
> | | o c |
|
95 |
> | |/ |
|
96 |
> | | o bar |
|
97 |
> | |/| |
|
98 |
> | o | b |
|
99 |
> | |/ |
|
100 |
> o / baz |
|
101 |
> / |
|
102 |
> o a |
|
103 |
> EOS |
|
104 |
||
105 |
$ hg log -G -T '{desc}' |
|
106 |
o foo |
|
107 |
|\ |
|
108 |
| | o d |
|
109 |
| |/ |
|
110 |
| | o c |
|
111 |
| |/ |
|
112 |
| | o bar |
|
113 |
| |/| |
|
114 |
| o | b |
|
115 |
| |/ |
|
116 |
o / baz |
|
117 |
/ |
|
118 |
o a |
|
119 |
||
120 |
||
121 |
Edges existed in repo are no-ops |
|
122 |
||
123 |
$ reinit |
|
124 |
$ hg debugdrawdag <<'EOS' |
|
125 |
> B C C |
|
126 |
> | | | |
|
127 |
> A A B |
|
128 |
> EOS |
|
129 |
||
130 |
$ hg log -G -T '{desc}' |
|
131 |
o C |
|
132 |
|\ |
|
133 |
| o B |
|
134 |
|/ |
|
135 |
o A |
|
136 |
||
137 |
||
138 |
$ hg debugdrawdag <<'EOS' |
|
139 |
> C D C |
|
140 |
> | | | |
|
141 |
> B B A |
|
142 |
> EOS |
|
143 |
||
144 |
$ hg log -G -T '{desc}' |
|
145 |
o D |
|
146 |
| |
|
147 |
| o C |
|
148 |
|/| |
|
149 |
o | B |
|
150 |
|/ |
|
151 |
o A |
|
152 |
||
153 |
||
154 |
Node with more than 2 parents are disallowed |
|
155 |
||
156 |
$ hg debugdrawdag <<'EOS' |
|
157 |
> A |
|
158 |
> /|\ |
|
159 |
> D B C |
|
160 |
> EOS |
|
161 |
abort: A: too many parents: C D B |
|
162 |
[255] |
|
163 |
||
164 |
Cycles are disallowed |
|
165 |
||
166 |
$ hg debugdrawdag <<'EOS' |
|
167 |
> A |
|
168 |
> | |
|
169 |
> A |
|
170 |
> EOS |
|
171 |
abort: the graph has cycles |
|
172 |
[255] |
|
173 |
||
174 |
$ hg debugdrawdag <<'EOS' |
|
175 |
> A |
|
176 |
> | |
|
177 |
> B |
|
178 |
> | |
|
179 |
> A |
|
180 |
> EOS |
|
181 |
abort: the graph has cycles |
|
182 |
[255] |
|
33153
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
183 |
|
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
184 |
Create obsmarkers via comments |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
185 |
|
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
186 |
$ reinit |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
187 |
|
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
188 |
$ hg debugdrawdag <<'EOS' |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
189 |
> G |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
190 |
> | |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
191 |
> I D C F # split: B -> E, F, G |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
192 |
> \ \| | # replace: C -> D -> H |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
193 |
> H B E # prune: F, I |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
194 |
> \|/ |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
195 |
> A |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
196 |
> EOS |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
197 |
|
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
198 |
$ hg log -r 'sort(all(), topo)' -G --hidden -T '{desc} {node}' |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
199 |
o G 711f53bbef0bebd12eb6f0511d5e2e998b984846 |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
200 |
| |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
201 |
x F 64a8289d249234b9886244d379f15e6b650b28e3 |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
202 |
| |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
203 |
o E 7fb047a69f220c21711122dfd94305a9efb60cba |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
204 |
| |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
205 |
| x D be0ef73c17ade3fc89dc41701eb9fc3a91b58282 |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
206 |
| | |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
207 |
| | x C 26805aba1e600a82e93661149f2313866a221a7b |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
208 |
| |/ |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
209 |
| x B 112478962961147124edd43549aedd1a335e44bf |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
210 |
|/ |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
211 |
| x I 58e6b987bf7045fcd9c54f496396ca1d1fc81047 |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
212 |
| | |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
213 |
| o H 575c4b5ec114d64b681d33f8792853568bfb2b2c |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
214 |
|/ |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
215 |
o A 426bada5c67598ca65036d57d9e4b64b0c1ce7a0 |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
216 |
|
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
217 |
$ hg debugobsolete |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
218 |
112478962961147124edd43549aedd1a335e44bf 7fb047a69f220c21711122dfd94305a9efb60cba 64a8289d249234b9886244d379f15e6b650b28e3 711f53bbef0bebd12eb6f0511d5e2e998b984846 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
219 |
26805aba1e600a82e93661149f2313866a221a7b be0ef73c17ade3fc89dc41701eb9fc3a91b58282 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
220 |
be0ef73c17ade3fc89dc41701eb9fc3a91b58282 575c4b5ec114d64b681d33f8792853568bfb2b2c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
221 |
64a8289d249234b9886244d379f15e6b650b28e3 0 {7fb047a69f220c21711122dfd94305a9efb60cba} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
4d780d510b44
drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents:
33152
diff
changeset
|
222 |
58e6b987bf7045fcd9c54f496396ca1d1fc81047 0 {575c4b5ec114d64b681d33f8792853568bfb2b2c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |