33158
|
1 |
$ cat >> $HGRCPATH<<EOF
|
|
2 |
> [extensions]
|
|
3 |
> drawdag=$TESTDIR/drawdag.py
|
|
4 |
> EOF
|
|
5 |
|
|
6 |
$ reinit () {
|
|
7 |
> rm -rf .hg && hg init
|
|
8 |
> }
|
|
9 |
|
|
10 |
$ hg init
|
|
11 |
|
|
12 |
Test what said in drawdag.py docstring
|
|
13 |
|
|
14 |
$ hg debugdrawdag <<'EOS'
|
|
15 |
> c d
|
|
16 |
> |/
|
|
17 |
> b
|
|
18 |
> |
|
|
19 |
> a
|
|
20 |
> EOS
|
|
21 |
|
|
22 |
$ hg log -G -T '{rev} {desc} ({tags})'
|
|
23 |
o 3 d (d tip)
|
|
24 |
|
|
|
25 |
| o 2 c (c)
|
|
26 |
|/
|
|
27 |
o 1 b (b)
|
|
28 |
|
|
|
29 |
o 0 a (a)
|
|
30 |
|
|
31 |
$ hg debugdrawdag <<'EOS'
|
|
32 |
> foo bar bar foo
|
|
33 |
> | / | |
|
|
34 |
> ancestor(c,d) a baz
|
|
35 |
> EOS
|
|
36 |
|
|
37 |
$ hg log -G -T '{desc}'
|
|
38 |
o foo
|
|
39 |
|\
|
|
40 |
+---o bar
|
|
41 |
| | |
|
|
42 |
| o | baz
|
|
43 |
| /
|
|
44 |
+---o d
|
|
45 |
| |
|
|
46 |
+---o c
|
|
47 |
| |
|
|
48 |
o | b
|
|
49 |
|/
|
|
50 |
o a
|
|
51 |
|
|
52 |
$ reinit
|
|
53 |
|
|
54 |
$ hg debugdrawdag <<'EOS'
|
|
55 |
> o foo
|
|
56 |
> |\
|
|
57 |
> +---o bar
|
|
58 |
> | | |
|
|
59 |
> | o | baz
|
|
60 |
> | /
|
|
61 |
> +---o d
|
|
62 |
> | |
|
|
63 |
> +---o c
|
|
64 |
> | |
|
|
65 |
> o | b
|
|
66 |
> |/
|
|
67 |
> o a
|
|
68 |
> EOS
|
|
69 |
|
|
70 |
$ hg log -G -T '{desc}'
|
|
71 |
o foo
|
|
72 |
|\
|
|
73 |
| | o d
|
|
74 |
| |/
|
|
75 |
| | o c
|
|
76 |
| |/
|
|
77 |
| | o bar
|
|
78 |
| |/|
|
|
79 |
| o | b
|
|
80 |
| |/
|
|
81 |
o / baz
|
|
82 |
/
|
|
83 |
o a
|
|
84 |
|
|
85 |
$ reinit
|
|
86 |
|
|
87 |
$ hg debugdrawdag <<'EOS'
|
|
88 |
> o foo
|
|
89 |
> |\
|
|
90 |
> | | o d
|
|
91 |
> | |/
|
|
92 |
> | | o c
|
|
93 |
> | |/
|
|
94 |
> | | o bar
|
|
95 |
> | |/|
|
|
96 |
> | o | b
|
|
97 |
> | |/
|
|
98 |
> o / baz
|
|
99 |
> /
|
|
100 |
> o a
|
|
101 |
> EOS
|
|
102 |
|
|
103 |
$ hg log -G -T '{desc}'
|
|
104 |
o foo
|
|
105 |
|\
|
|
106 |
| | o d
|
|
107 |
| |/
|
|
108 |
| | o c
|
|
109 |
| |/
|
|
110 |
| | o bar
|
|
111 |
| |/|
|
|
112 |
| o | b
|
|
113 |
| |/
|
|
114 |
o / baz
|
|
115 |
/
|
|
116 |
o a
|
|
117 |
|
|
118 |
|
|
119 |
Edges existed in repo are no-ops
|
|
120 |
|
|
121 |
$ reinit
|
|
122 |
$ hg debugdrawdag <<'EOS'
|
|
123 |
> B C C
|
|
124 |
> | | |
|
|
125 |
> A A B
|
|
126 |
> EOS
|
|
127 |
|
|
128 |
$ hg log -G -T '{desc}'
|
|
129 |
o C
|
|
130 |
|\
|
|
131 |
| o B
|
|
132 |
|/
|
|
133 |
o A
|
|
134 |
|
|
135 |
|
|
136 |
$ hg debugdrawdag <<'EOS'
|
|
137 |
> C D C
|
|
138 |
> | | |
|
|
139 |
> B B A
|
|
140 |
> EOS
|
|
141 |
|
|
142 |
$ hg log -G -T '{desc}'
|
|
143 |
o D
|
|
144 |
|
|
|
145 |
| o C
|
|
146 |
|/|
|
|
147 |
o | B
|
|
148 |
|/
|
|
149 |
o A
|
|
150 |
|
|
151 |
|
|
152 |
Node with more than 2 parents are disallowed
|
|
153 |
|
|
154 |
$ hg debugdrawdag <<'EOS'
|
|
155 |
> A
|
|
156 |
> /|\
|
|
157 |
> D B C
|
|
158 |
> EOS
|
|
159 |
abort: A: too many parents: C D B
|
|
160 |
[255]
|
|
161 |
|
|
162 |
Cycles are disallowed
|
|
163 |
|
|
164 |
$ hg debugdrawdag <<'EOS'
|
|
165 |
> A
|
|
166 |
> |
|
|
167 |
> A
|
|
168 |
> EOS
|
|
169 |
abort: the graph has cycles
|
|
170 |
[255]
|
|
171 |
|
|
172 |
$ hg debugdrawdag <<'EOS'
|
|
173 |
> A
|
|
174 |
> |
|
|
175 |
> B
|
|
176 |
> |
|
|
177 |
> A
|
|
178 |
> EOS
|
|
179 |
abort: the graph has cycles
|
|
180 |
[255]
|