##// END OF EJS Templates
show: show all namespaces in "work" view...
Gregory Szorc -
r33050:0a507da7 default
parent child Browse files
Show More
@@ -1,12 +1,18 b''
1 1 # TODO there are a few deficiencies in this file:
2 2 # * The "namespace" of the labels needs to be worked out. We currently
3 3 # piggyback on existing values so color works.
4 4 # * Obsolescence isn't considered for node labels. See _cset_labels in
5 5 # map-cmdline.default.
6 6 showbookmarks = '{if(active, "*", " ")} {pad(bookmark, longestbookmarklen + 4)}{shortest(node, 5)}\n'
7 7
8 showwork = '{cset_shortnode}{cset_names} {cset_shortdesc}'
8 showwork = '{cset_shortnode}{namespaces % cset_namespace} {cset_shortdesc}'
9 9
10 10 cset_shortnode = '{label("log.changeset changeset.{phase}", shortest(node, 5))}'
11 cset_names = '{if(branches, " ({label("log.branch", branch)})")}{if(bookmarks, " ({label("log.bookmarks", bookmarks)})")}'
11
12 # Treat branch and tags specially so we don't display "default" or "tip"
13 cset_namespace = '{ifeq(namespace, "branches", names_branches, ifeq(namespace, "tags", names_tags, names_others))}'
14 names_branches = '{ifeq(branch, "default", "", " ({label('log.{colorname}', branch)})")}'
15 names_tags = '{if(names % "{ifeq(name, 'tip', '', name)}", " ({label('log.{colorname}', join(names % "{ifeq(name, 'tip', '', name)}", ' '))})")}'
16 names_others = '{if(names, " ({label('log.{colorname}', join(names, ' '))})")}'
17
12 18 cset_shortdesc = '{label("log.description", desc|firstline)}'
@@ -1,239 +1,237 b''
1 1 $ cat >> $HGRCPATH << EOF
2 2 > [extensions]
3 3 > show =
4 4 > EOF
5 5
6 6 $ hg init repo0
7 7 $ cd repo0
8 8
9 9 Command works on an empty repo
10 10
11 11 $ hg show work
12 12
13 13 Single draft changeset shown
14 14
15 15 $ echo 0 > foo
16 16 $ hg -q commit -A -m 'commit 0'
17 17
18 18 $ hg show work
19 19 @ 9f171 commit 0
20 20
21 21 Even when it isn't the wdir
22 22
23 23 $ hg -q up null
24 24
25 25 $ hg show work
26 26 o 9f171 commit 0
27 27
28 28 Single changeset is still there when public because it is a head
29 29
30 30 $ hg phase --public -r 0
31 31 $ hg show work
32 32 o 9f171 commit 0
33 33
34 34 A draft child will show both it and public parent
35 35
36 36 $ hg -q up 0
37 37 $ echo 1 > foo
38 38 $ hg commit -m 'commit 1'
39 39
40 40 $ hg show work
41 41 @ 181cc commit 1
42 42 o 9f171 commit 0
43 43
44 44 Multiple draft children will be shown
45 45
46 46 $ echo 2 > foo
47 47 $ hg commit -m 'commit 2'
48 48
49 49 $ hg show work
50 50 @ 128c8 commit 2
51 51 o 181cc commit 1
52 52 o 9f171 commit 0
53 53
54 54 Bumping first draft changeset to public will hide its parent
55 55
56 56 $ hg phase --public -r 1
57 57 $ hg show work
58 58 @ 128c8 commit 2
59 59 o 181cc commit 1
60 60 |
61 61 ~
62 62
63 63 Multiple DAG heads will be shown
64 64
65 65 $ hg -q up -r 1
66 66 $ echo 3 > foo
67 67 $ hg commit -m 'commit 3'
68 68 created new head
69 69
70 70 $ hg show work
71 71 @ f0abc commit 3
72 72 | o 128c8 commit 2
73 73 |/
74 74 o 181cc commit 1
75 75 |
76 76 ~
77 77
78 78 Even when wdir is something else
79 79
80 80 $ hg -q up null
81 81
82 82 $ hg show work
83 83 o f0abc commit 3
84 84 | o 128c8 commit 2
85 85 |/
86 86 o 181cc commit 1
87 87 |
88 88 ~
89 89
90 90 Draft child shows public head (multiple heads)
91 91
92 92 $ hg -q up 0
93 93 $ echo 4 > foo
94 94 $ hg commit -m 'commit 4'
95 95 created new head
96 96
97 97 $ hg show work
98 98 @ 668ca commit 4
99 99 | o f0abc commit 3
100 100 | | o 128c8 commit 2
101 101 | |/
102 102 | o 181cc commit 1
103 103 |/
104 104 o 9f171 commit 0
105 105
106 106 $ cd ..
107 107
108 108 Branch name appears in output
109 109
110 110 $ hg init branches
111 111 $ cd branches
112 112 $ echo 0 > foo
113 113 $ hg -q commit -A -m 'commit 0'
114 114 $ echo 1 > foo
115 115 $ hg commit -m 'commit 1'
116 116 $ echo 2 > foo
117 117 $ hg commit -m 'commit 2'
118 118 $ hg phase --public -r .
119 119 $ hg -q up -r 1
120 120 $ hg branch mybranch
121 121 marked working directory as branch mybranch
122 122 (branches are permanent and global, did you want a bookmark?)
123 123 $ echo 3 > foo
124 124 $ hg commit -m 'commit 3'
125 125 $ echo 4 > foo
126 126 $ hg commit -m 'commit 4'
127 127
128 128 $ hg show work
129 129 @ f8dd3 (mybranch) commit 4
130 130 o 90cfc (mybranch) commit 3
131 131 | o 128c8 commit 2
132 132 |/
133 133 o 181cc commit 1
134 134 |
135 135 ~
136 136
137 137 $ cd ..
138 138
139 139 Bookmark name appears in output
140 140
141 141 $ hg init bookmarks
142 142 $ cd bookmarks
143 143 $ echo 0 > foo
144 144 $ hg -q commit -A -m 'commit 0'
145 145 $ echo 1 > foo
146 146 $ hg commit -m 'commit 1'
147 147 $ echo 2 > foo
148 148 $ hg commit -m 'commit 2'
149 149 $ hg phase --public -r .
150 150 $ hg bookmark @
151 151 $ hg -q up -r 1
152 152 $ echo 3 > foo
153 153 $ hg commit -m 'commit 3'
154 154 created new head
155 155 $ echo 4 > foo
156 156 $ hg commit -m 'commit 4'
157 157 $ hg bookmark mybook
158 158
159 159 $ hg show work
160 160 @ cac82 (mybook) commit 4
161 161 o f0abc commit 3
162 162 | o 128c8 (@) commit 2
163 163 |/
164 164 o 181cc commit 1
165 165 |
166 166 ~
167 167
168 168 $ cd ..
169 169
170 170 Tags are rendered
171 171
172 172 $ hg init tags
173 173 $ cd tags
174 174 $ echo 0 > foo
175 175 $ hg -q commit -A -m 'commit 1'
176 176 $ echo 1 > foo
177 177 $ hg commit -m 'commit 2'
178 178 $ hg tag 0.1
179 179 $ hg phase --public -r .
180 180 $ echo 2 > foo
181 181 $ hg commit -m 'commit 3'
182 182 $ hg tag 0.2
183 183
184 TODO tags aren't yet rendered
185 184 $ hg show work
186 185 @ 37582 Added tag 0.2 for changeset 6379c25b76f1
187 o 6379c commit 3
186 o 6379c (0.2) commit 3
188 187 o a2ad9 Added tag 0.1 for changeset 6a75536ea0b1
189 188 |
190 189 ~
191 190
192 191 $ cd ..
193 192
194 193 Multiple names on same changeset render properly
195 194
196 195 $ hg init multiplenames
197 196 $ cd multiplenames
198 197 $ echo 0 > foo
199 198 $ hg -q commit -A -m 'commit 1'
200 199 $ hg phase --public -r .
201 200 $ hg branch mybranch
202 201 marked working directory as branch mybranch
203 202 (branches are permanent and global, did you want a bookmark?)
204 203 $ hg bookmark mybook
205 204 $ echo 1 > foo
206 205 $ hg commit -m 'commit 2'
207 206
208 207 $ hg show work
209 @ 34834 (mybranch) (mybook) commit 2
208 @ 34834 (mybook) (mybranch) commit 2
210 209 o 97fcc commit 1
211 210
212 211 Multiple bookmarks on same changeset render properly
213 212
214 213 $ hg book mybook2
215 214 $ hg show work
216 @ 34834 (mybranch) (mybook mybook2) commit 2
215 @ 34834 (mybook mybook2) (mybranch) commit 2
217 216 o 97fcc commit 1
218 217
219 218 $ cd ..
220 219
221 220 Extra namespaces are rendered
222 221
223 222 $ hg init extranamespaces
224 223 $ cd extranamespaces
225 224 $ echo 0 > foo
226 225 $ hg -q commit -A -m 'commit 1'
227 226 $ hg phase --public -r .
228 227 $ echo 1 > foo
229 228 $ hg commit -m 'commit 2'
230 229 $ echo 2 > foo
231 230 $ hg commit -m 'commit 3'
232 231
233 TODO don't yet render extra namespaces
234 232 $ hg --config extensions.revnames=$TESTDIR/revnamesext.py show work
235 @ 32f3e commit 3
236 o 6a755 commit 2
237 o 97fcc commit 1
233 @ 32f3e (r2) commit 3
234 o 6a755 (r1) commit 2
235 o 97fcc (r0) commit 1
238 236
239 237 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now