Show More
@@ -161,9 +161,10 b' def showbookmarks(ui, repo, fm):' | |||||
161 | ui.write(_('(no bookmarks set)\n')) |
|
161 | ui.write(_('(no bookmarks set)\n')) | |
162 | return |
|
162 | return | |
163 |
|
163 | |||
|
164 | revs = [repo[node].rev() for node in marks.values()] | |||
164 | active = repo._activebookmark |
|
165 | active = repo._activebookmark | |
165 | longestname = max(len(b) for b in marks) |
|
166 | longestname = max(len(b) for b in marks) | |
166 |
|
|
167 | nodelen = longestshortest(repo, revs) | |
167 |
|
168 | |||
168 | for bm, node in sorted(marks.items()): |
|
169 | for bm, node in sorted(marks.items()): | |
169 | fm.startitem() |
|
170 | fm.startitem() | |
@@ -172,7 +173,7 b' def showbookmarks(ui, repo, fm):' | |||||
172 | fm.write('node', fm.hexfunc(node), fm.hexfunc(node)) |
|
173 | fm.write('node', fm.hexfunc(node), fm.hexfunc(node)) | |
173 | fm.data(active=bm == active, |
|
174 | fm.data(active=bm == active, | |
174 | longestbookmarklen=longestname, |
|
175 | longestbookmarklen=longestname, | |
175 |
nodelen= |
|
176 | nodelen=nodelen) | |
176 |
|
177 | |||
177 | @showview('stack', csettopic='stack') |
|
178 | @showview('stack', csettopic='stack') | |
178 | def showstack(ui, repo, displayer): |
|
179 | def showstack(ui, repo, displayer): | |
@@ -236,6 +237,9 b' def showstack(ui, repo, displayer):' | |||||
236 | else: |
|
237 | else: | |
237 | newheads = set() |
|
238 | newheads = set() | |
238 |
|
239 | |||
|
240 | allrevs = set(stackrevs) | newheads | set([baserev]) | |||
|
241 | nodelen = longestshortest(repo, allrevs) | |||
|
242 | ||||
239 | try: |
|
243 | try: | |
240 | cmdutil.findcmd('rebase', commands.table) |
|
244 | cmdutil.findcmd('rebase', commands.table) | |
241 | haverebase = True |
|
245 | haverebase = True | |
@@ -247,7 +251,7 b' def showstack(ui, repo, displayer):' | |||||
247 | # our simplicity and the customizations required. |
|
251 | # our simplicity and the customizations required. | |
248 | # TODO use proper graph symbols from graphmod |
|
252 | # TODO use proper graph symbols from graphmod | |
249 |
|
253 | |||
250 |
shortesttmpl = formatter.maketemplater(ui, '{shortest(node, |
|
254 | shortesttmpl = formatter.maketemplater(ui, '{shortest(node, %d)}' % nodelen) | |
251 | def shortest(ctx): |
|
255 | def shortest(ctx): | |
252 | return shortesttmpl.render({'ctx': ctx, 'node': ctx.hex()}) |
|
256 | return shortesttmpl.render({'ctx': ctx, 'node': ctx.hex()}) | |
253 |
|
257 | |||
@@ -278,7 +282,7 b' def showstack(ui, repo, displayer):' | |||||
278 | ui.write(' ') |
|
282 | ui.write(' ') | |
279 |
|
283 | |||
280 | ui.write(('o ')) |
|
284 | ui.write(('o ')) | |
281 |
displayer.show(ctx, nodelen= |
|
285 | displayer.show(ctx, nodelen=nodelen) | |
282 | displayer.flush(ctx) |
|
286 | displayer.flush(ctx) | |
283 | ui.write('\n') |
|
287 | ui.write('\n') | |
284 |
|
288 | |||
@@ -318,7 +322,7 b' def showstack(ui, repo, displayer):' | |||||
318 | ui.write(' ') |
|
322 | ui.write(' ') | |
319 |
|
323 | |||
320 | ui.write(symbol, ' ') |
|
324 | ui.write(symbol, ' ') | |
321 |
displayer.show(ctx, nodelen= |
|
325 | displayer.show(ctx, nodelen=nodelen) | |
322 | displayer.flush(ctx) |
|
326 | displayer.flush(ctx) | |
323 | ui.write('\n') |
|
327 | ui.write('\n') | |
324 |
|
328 | |||
@@ -335,7 +339,7 b' def showstack(ui, repo, displayer):' | |||||
335 | ui.write(_('(stack base)'), '\n', label='stack.label') |
|
339 | ui.write(_('(stack base)'), '\n', label='stack.label') | |
336 | ui.write(('o ')) |
|
340 | ui.write(('o ')) | |
337 |
|
341 | |||
338 |
displayer.show(basectx, nodelen= |
|
342 | displayer.show(basectx, nodelen=nodelen) | |
339 | displayer.flush(basectx) |
|
343 | displayer.flush(basectx) | |
340 | ui.write('\n') |
|
344 | ui.write('\n') | |
341 |
|
345 | |||
@@ -394,12 +398,13 b' def showwork(ui, repo, displayer):' | |||||
394 | """changesets that aren't finished""" |
|
398 | """changesets that aren't finished""" | |
395 | # TODO support date-based limiting when calling revset. |
|
399 | # TODO support date-based limiting when calling revset. | |
396 | revs = repo.revs('sort(_underway(), topo)') |
|
400 | revs = repo.revs('sort(_underway(), topo)') | |
|
401 | nodelen = longestshortest(repo, revs) | |||
397 |
|
402 | |||
398 | revdag = graphmod.dagwalker(repo, revs) |
|
403 | revdag = graphmod.dagwalker(repo, revs) | |
399 |
|
404 | |||
400 | ui.setconfig('experimental', 'graphshorten', True) |
|
405 | ui.setconfig('experimental', 'graphshorten', True) | |
401 | cmdutil.displaygraph(ui, repo, revdag, displayer, graphmod.asciiedges, |
|
406 | cmdutil.displaygraph(ui, repo, revdag, displayer, graphmod.asciiedges, | |
402 |
props={'nodelen': |
|
407 | props={'nodelen': nodelen}) | |
403 |
|
408 | |||
404 | def extsetup(ui): |
|
409 | def extsetup(ui): | |
405 | # Alias `hg <prefix><view>` to `hg show <view>`. |
|
410 | # Alias `hg <prefix><view>` to `hg show <view>`. | |
@@ -420,6 +425,27 b' def extsetup(ui):' | |||||
420 |
|
425 | |||
421 | ui.setconfig('alias', name, 'show %s' % view, source='show') |
|
426 | ui.setconfig('alias', name, 'show %s' % view, source='show') | |
422 |
|
427 | |||
|
428 | def longestshortest(repo, revs, minlen=4): | |||
|
429 | """Return the length of the longest shortest node to identify revisions. | |||
|
430 | ||||
|
431 | The result of this function can be used with the ``shortest()`` template | |||
|
432 | function to ensure that a value is unique and unambiguous for a given | |||
|
433 | set of nodes. | |||
|
434 | ||||
|
435 | The number of revisions in the repo is taken into account to prevent | |||
|
436 | a numeric node prefix from conflicting with an integer revision number. | |||
|
437 | If we fail to do this, a value of e.g. ``10023`` could mean either | |||
|
438 | revision 10023 or node ``10023abc...``. | |||
|
439 | """ | |||
|
440 | tmpl = formatter.maketemplater(repo.ui, '{shortest(node, %d)}' % minlen) | |||
|
441 | lens = [minlen] | |||
|
442 | for rev in revs: | |||
|
443 | ctx = repo[rev] | |||
|
444 | shortest = tmpl.render({'ctx': ctx, 'node': ctx.hex()}) | |||
|
445 | lens.append(len(shortest)) | |||
|
446 | ||||
|
447 | return max(lens) | |||
|
448 | ||||
423 | # Adjust the docstring of the show command so it shows all registered views. |
|
449 | # Adjust the docstring of the show command so it shows all registered views. | |
424 | # This is a bit hacky because it runs at the end of module load. When moved |
|
450 | # This is a bit hacky because it runs at the end of module load. When moved | |
425 | # into core or when another extension wants to provide a view, we'll need |
|
451 | # into core or when another extension wants to provide a view, we'll need |
@@ -17,7 +17,7 b' Stack displays single draft changeset as' | |||||
17 | $ echo 0 > foo |
|
17 | $ echo 0 > foo | |
18 | $ hg -q commit -A -m 'commit 0' |
|
18 | $ hg -q commit -A -m 'commit 0' | |
19 | $ hg show stack |
|
19 | $ hg show stack | |
20 |
@ 9f17 |
|
20 | @ 9f17 commit 0 | |
21 |
|
21 | |||
22 | Stack displays multiple draft changesets |
|
22 | Stack displays multiple draft changesets | |
23 |
|
23 | |||
@@ -30,48 +30,48 b' Stack displays multiple draft changesets' | |||||
30 | $ echo 4 > foo |
|
30 | $ echo 4 > foo | |
31 | $ hg commit -m 'commit 4' |
|
31 | $ hg commit -m 'commit 4' | |
32 | $ hg show stack |
|
32 | $ hg show stack | |
33 |
@ 2737 |
|
33 | @ 2737 commit 4 | |
34 |
o d1a6 |
|
34 | o d1a6 commit 3 | |
35 |
o 128c |
|
35 | o 128c commit 2 | |
36 |
o 181c |
|
36 | o 181c commit 1 | |
37 |
o 9f17 |
|
37 | o 9f17 commit 0 | |
38 |
|
38 | |||
39 | Public parent of draft base is displayed, separated from stack |
|
39 | Public parent of draft base is displayed, separated from stack | |
40 |
|
40 | |||
41 | $ hg phase --public -r 0 |
|
41 | $ hg phase --public -r 0 | |
42 | $ hg show stack |
|
42 | $ hg show stack | |
43 |
@ 2737 |
|
43 | @ 2737 commit 4 | |
44 |
o d1a6 |
|
44 | o d1a6 commit 3 | |
45 |
o 128c |
|
45 | o 128c commit 2 | |
46 |
o 181c |
|
46 | o 181c commit 1 | |
47 | / (stack base) |
|
47 | / (stack base) | |
48 |
o 9f17 |
|
48 | o 9f17 commit 0 | |
49 |
|
49 | |||
50 | $ hg phase --public -r 1 |
|
50 | $ hg phase --public -r 1 | |
51 | $ hg show stack |
|
51 | $ hg show stack | |
52 |
@ 2737 |
|
52 | @ 2737 commit 4 | |
53 |
o d1a6 |
|
53 | o d1a6 commit 3 | |
54 |
o 128c |
|
54 | o 128c commit 2 | |
55 | / (stack base) |
|
55 | / (stack base) | |
56 |
o 181c |
|
56 | o 181c commit 1 | |
57 |
|
57 | |||
58 | Draft descendants are shown |
|
58 | Draft descendants are shown | |
59 |
|
59 | |||
60 | $ hg -q up 2 |
|
60 | $ hg -q up 2 | |
61 | $ hg show stack |
|
61 | $ hg show stack | |
62 |
o 2737 |
|
62 | o 2737 commit 4 | |
63 |
o d1a6 |
|
63 | o d1a6 commit 3 | |
64 |
@ 128c |
|
64 | @ 128c commit 2 | |
65 | / (stack base) |
|
65 | / (stack base) | |
66 |
o 181c |
|
66 | o 181c commit 1 | |
67 |
|
67 | |||
68 | $ hg -q up 3 |
|
68 | $ hg -q up 3 | |
69 | $ hg show stack |
|
69 | $ hg show stack | |
70 |
o 2737 |
|
70 | o 2737 commit 4 | |
71 |
@ d1a6 |
|
71 | @ d1a6 commit 3 | |
72 |
o 128c |
|
72 | o 128c commit 2 | |
73 | / (stack base) |
|
73 | / (stack base) | |
74 |
o 181c |
|
74 | o 181c commit 1 | |
75 |
|
75 | |||
76 | working dir on public changeset should display special message |
|
76 | working dir on public changeset should display special message | |
77 |
|
77 | |||
@@ -89,10 +89,10 b' Branch point in descendants displayed at' | |||||
89 | $ hg show stack |
|
89 | $ hg show stack | |
90 | \ / (multiple children) |
|
90 | \ / (multiple children) | |
91 | | |
|
91 | | | |
92 |
o d1a6 |
|
92 | o d1a6 commit 3 | |
93 |
@ 128c |
|
93 | @ 128c commit 2 | |
94 | / (stack base) |
|
94 | / (stack base) | |
95 |
o 181c |
|
95 | o 181c commit 1 | |
96 |
|
96 | |||
97 | $ cd .. |
|
97 | $ cd .. | |
98 |
|
98 | |||
@@ -117,9 +117,9 b' Base is stopped at merges' | |||||
117 | TODO doesn't yet handle case where wdir is a draft merge |
|
117 | TODO doesn't yet handle case where wdir is a draft merge | |
118 |
|
118 | |||
119 | $ hg show stack |
|
119 | $ hg show stack | |
120 |
@ 8ee9 |
|
120 | @ 8ee9 merge heads | |
121 | / (stack base) |
|
121 | / (stack base) | |
122 |
o 5947 |
|
122 | o 5947 head 1 | |
123 |
|
123 | |||
124 | $ echo d1 > foo |
|
124 | $ echo d1 > foo | |
125 | $ hg commit -m 'draft 1' |
|
125 | $ hg commit -m 'draft 1' | |
@@ -127,10 +127,10 b" TODO doesn't yet handle case where wdir " | |||||
127 | $ hg commit -m 'draft 2' |
|
127 | $ hg commit -m 'draft 2' | |
128 |
|
128 | |||
129 | $ hg show stack |
|
129 | $ hg show stack | |
130 |
@ 430d |
|
130 | @ 430d draft 2 | |
131 |
o 787b |
|
131 | o 787b draft 1 | |
132 | / (stack base) |
|
132 | / (stack base) | |
133 |
o 8ee9 |
|
133 | o 8ee9 merge heads | |
134 |
|
134 | |||
135 | $ cd .. |
|
135 | $ cd .. | |
136 |
|
136 | |||
@@ -156,36 +156,36 b' Now move on to stacks when there are mor' | |||||
156 | Newer draft heads don't impact output |
|
156 | Newer draft heads don't impact output | |
157 |
|
157 | |||
158 | $ hg show stack |
|
158 | $ hg show stack | |
159 |
@ eaff |
|
159 | @ eaff draft 2 | |
160 |
o 2b21 |
|
160 | o 2b21 draft 1 | |
161 | / (stack base) |
|
161 | / (stack base) | |
162 |
o b66b |
|
162 | o b66b base | |
163 |
|
163 | |||
164 | Newer public heads are rendered |
|
164 | Newer public heads are rendered | |
165 |
|
165 | |||
166 | $ hg phase --public -r '::tip' |
|
166 | $ hg phase --public -r '::tip' | |
167 |
|
167 | |||
168 | $ hg show stack |
|
168 | $ hg show stack | |
169 |
o baa4 |
|
169 | o baa4 new 2 | |
170 | / (2 commits ahead) |
|
170 | / (2 commits ahead) | |
171 | : |
|
171 | : | |
172 | : (stack head) |
|
172 | : (stack head) | |
173 |
: @ eaff |
|
173 | : @ eaff draft 2 | |
174 |
: o 2b21 |
|
174 | : o 2b21 draft 1 | |
175 | :/ (stack base) |
|
175 | :/ (stack base) | |
176 |
o b66b |
|
176 | o b66b base | |
177 |
|
177 | |||
178 | If rebase is available, we show a hint how to rebase to that head |
|
178 | If rebase is available, we show a hint how to rebase to that head | |
179 |
|
179 | |||
180 | $ hg --config extensions.rebase= show stack |
|
180 | $ hg --config extensions.rebase= show stack | |
181 |
o baa4 |
|
181 | o baa4 new 2 | |
182 |
/ (2 commits ahead; hg rebase --source 2b21 |
|
182 | / (2 commits ahead; hg rebase --source 2b21 --dest baa4) | |
183 | : |
|
183 | : | |
184 | : (stack head) |
|
184 | : (stack head) | |
185 |
: @ eaff |
|
185 | : @ eaff draft 2 | |
186 |
: o 2b21 |
|
186 | : o 2b21 draft 1 | |
187 | :/ (stack base) |
|
187 | :/ (stack base) | |
188 |
o b66b |
|
188 | o b66b base | |
189 |
|
189 | |||
190 | Similar tests but for multiple heads |
|
190 | Similar tests but for multiple heads | |
191 |
|
191 | |||
@@ -196,25 +196,25 b' Similar tests but for multiple heads' | |||||
196 | $ hg -q up 2 |
|
196 | $ hg -q up 2 | |
197 |
|
197 | |||
198 | $ hg show stack |
|
198 | $ hg show stack | |
199 |
o baa4 |
|
199 | o baa4 new 2 | |
200 | / (2 commits ahead) |
|
200 | / (2 commits ahead) | |
201 |
: o 9a84 |
|
201 | : o 9a84 new head 2 | |
202 | :/ (1 commits ahead) |
|
202 | :/ (1 commits ahead) | |
203 | : |
|
203 | : | |
204 | : (stack head) |
|
204 | : (stack head) | |
205 |
: @ eaff |
|
205 | : @ eaff draft 2 | |
206 |
: o 2b21 |
|
206 | : o 2b21 draft 1 | |
207 | :/ (stack base) |
|
207 | :/ (stack base) | |
208 |
o b66b |
|
208 | o b66b base | |
209 |
|
209 | |||
210 | $ hg --config extensions.rebase= show stack |
|
210 | $ hg --config extensions.rebase= show stack | |
211 |
o baa4 |
|
211 | o baa4 new 2 | |
212 |
/ (2 commits ahead; hg rebase --source 2b21 |
|
212 | / (2 commits ahead; hg rebase --source 2b21 --dest baa4) | |
213 |
: o 9a84 |
|
213 | : o 9a84 new head 2 | |
214 |
:/ (1 commits ahead; hg rebase --source 2b21 |
|
214 | :/ (1 commits ahead; hg rebase --source 2b21 --dest 9a84) | |
215 | : |
|
215 | : | |
216 | : (stack head) |
|
216 | : (stack head) | |
217 |
: @ eaff |
|
217 | : @ eaff draft 2 | |
218 |
: o 2b21 |
|
218 | : o 2b21 draft 1 | |
219 | :/ (stack base) |
|
219 | :/ (stack base) | |
220 |
o b66b |
|
220 | o b66b base |
@@ -16,20 +16,20 b' Single draft changeset shown' | |||||
16 | $ hg -q commit -A -m 'commit 0' |
|
16 | $ hg -q commit -A -m 'commit 0' | |
17 |
|
17 | |||
18 | $ hg show work |
|
18 | $ hg show work | |
19 |
@ 9f17 |
|
19 | @ 9f17 commit 0 | |
20 |
|
20 | |||
21 | Even when it isn't the wdir |
|
21 | Even when it isn't the wdir | |
22 |
|
22 | |||
23 | $ hg -q up null |
|
23 | $ hg -q up null | |
24 |
|
24 | |||
25 | $ hg show work |
|
25 | $ hg show work | |
26 |
o 9f17 |
|
26 | o 9f17 commit 0 | |
27 |
|
27 | |||
28 | Single changeset is still there when public because it is a head |
|
28 | Single changeset is still there when public because it is a head | |
29 |
|
29 | |||
30 | $ hg phase --public -r 0 |
|
30 | $ hg phase --public -r 0 | |
31 | $ hg show work |
|
31 | $ hg show work | |
32 |
o 9f17 |
|
32 | o 9f17 commit 0 | |
33 |
|
33 | |||
34 | A draft child will show both it and public parent |
|
34 | A draft child will show both it and public parent | |
35 |
|
35 | |||
@@ -38,8 +38,8 b' A draft child will show both it and publ' | |||||
38 | $ hg commit -m 'commit 1' |
|
38 | $ hg commit -m 'commit 1' | |
39 |
|
39 | |||
40 | $ hg show work |
|
40 | $ hg show work | |
41 |
@ 181c |
|
41 | @ 181c commit 1 | |
42 |
o 9f17 |
|
42 | o 9f17 commit 0 | |
43 |
|
43 | |||
44 | Multiple draft children will be shown |
|
44 | Multiple draft children will be shown | |
45 |
|
45 | |||
@@ -47,16 +47,16 b' Multiple draft children will be shown' | |||||
47 | $ hg commit -m 'commit 2' |
|
47 | $ hg commit -m 'commit 2' | |
48 |
|
48 | |||
49 | $ hg show work |
|
49 | $ hg show work | |
50 |
@ 128c |
|
50 | @ 128c commit 2 | |
51 |
o 181c |
|
51 | o 181c commit 1 | |
52 |
o 9f17 |
|
52 | o 9f17 commit 0 | |
53 |
|
53 | |||
54 | Bumping first draft changeset to public will hide its parent |
|
54 | Bumping first draft changeset to public will hide its parent | |
55 |
|
55 | |||
56 | $ hg phase --public -r 1 |
|
56 | $ hg phase --public -r 1 | |
57 | $ hg show work |
|
57 | $ hg show work | |
58 |
@ 128c |
|
58 | @ 128c commit 2 | |
59 |
o 181c |
|
59 | o 181c commit 1 | |
60 | | |
|
60 | | | |
61 | ~ |
|
61 | ~ | |
62 |
|
62 | |||
@@ -68,10 +68,10 b' Multiple DAG heads will be shown' | |||||
68 | created new head |
|
68 | created new head | |
69 |
|
69 | |||
70 | $ hg show work |
|
70 | $ hg show work | |
71 |
@ f0ab |
|
71 | @ f0ab commit 3 | |
72 |
| o 128c |
|
72 | | o 128c commit 2 | |
73 | |/ |
|
73 | |/ | |
74 |
o 181c |
|
74 | o 181c commit 1 | |
75 | | |
|
75 | | | |
76 | ~ |
|
76 | ~ | |
77 |
|
77 | |||
@@ -80,10 +80,10 b' Even when wdir is something else' | |||||
80 | $ hg -q up null |
|
80 | $ hg -q up null | |
81 |
|
81 | |||
82 | $ hg show work |
|
82 | $ hg show work | |
83 |
o f0ab |
|
83 | o f0ab commit 3 | |
84 |
| o 128c |
|
84 | | o 128c commit 2 | |
85 | |/ |
|
85 | |/ | |
86 |
o 181c |
|
86 | o 181c commit 1 | |
87 | | |
|
87 | | | |
88 | ~ |
|
88 | ~ | |
89 |
|
89 | |||
@@ -95,13 +95,13 b' Draft child shows public head (multiple ' | |||||
95 | created new head |
|
95 | created new head | |
96 |
|
96 | |||
97 | $ hg show work |
|
97 | $ hg show work | |
98 |
@ 668c |
|
98 | @ 668c commit 4 | |
99 |
| o f0ab |
|
99 | | o f0ab commit 3 | |
100 |
| | o 128c |
|
100 | | | o 128c commit 2 | |
101 | | |/ |
|
101 | | |/ | |
102 |
| o 181c |
|
102 | | o 181c commit 1 | |
103 | |/ |
|
103 | |/ | |
104 |
o 9f17 |
|
104 | o 9f17 commit 0 | |
105 |
|
105 | |||
106 | $ cd .. |
|
106 | $ cd .. | |
107 |
|
107 | |||
@@ -126,11 +126,11 b' Branch name appears in output' | |||||
126 | $ hg commit -m 'commit 4' |
|
126 | $ hg commit -m 'commit 4' | |
127 |
|
127 | |||
128 | $ hg show work |
|
128 | $ hg show work | |
129 |
@ f8dd |
|
129 | @ f8dd (mybranch) commit 4 | |
130 |
o 90cf |
|
130 | o 90cf (mybranch) commit 3 | |
131 |
| o 128c |
|
131 | | o 128c commit 2 | |
132 | |/ |
|
132 | |/ | |
133 |
o 181c |
|
133 | o 181c commit 1 | |
134 | | |
|
134 | | | |
135 | ~ |
|
135 | ~ | |
136 |
|
136 | |||
@@ -157,11 +157,11 b' Bookmark name appears in output' | |||||
157 | $ hg bookmark mybook |
|
157 | $ hg bookmark mybook | |
158 |
|
158 | |||
159 | $ hg show work |
|
159 | $ hg show work | |
160 |
@ cac8 |
|
160 | @ cac8 (mybook) commit 4 | |
161 |
o f0ab |
|
161 | o f0ab commit 3 | |
162 |
| o 128c |
|
162 | | o 128c (@) commit 2 | |
163 | |/ |
|
163 | |/ | |
164 |
o 181c |
|
164 | o 181c commit 1 | |
165 | | |
|
165 | | | |
166 | ~ |
|
166 | ~ | |
167 |
|
167 | |||
@@ -182,9 +182,9 b' Tags are rendered' | |||||
182 | $ hg tag 0.2 |
|
182 | $ hg tag 0.2 | |
183 |
|
183 | |||
184 | $ hg show work |
|
184 | $ hg show work | |
185 |
@ 3758 |
|
185 | @ 3758 Added tag 0.2 for changeset 6379c25b76f1 | |
186 |
o 6379 |
|
186 | o 6379 (0.2) commit 3 | |
187 |
o a2ad |
|
187 | o a2ad Added tag 0.1 for changeset 6a75536ea0b1 | |
188 | | |
|
188 | | | |
189 | ~ |
|
189 | ~ | |
190 |
|
190 | |||
@@ -205,15 +205,15 b' Multiple names on same changeset render ' | |||||
205 | $ hg commit -m 'commit 2' |
|
205 | $ hg commit -m 'commit 2' | |
206 |
|
206 | |||
207 | $ hg show work |
|
207 | $ hg show work | |
208 |
@ 3483 |
|
208 | @ 3483 (mybook) (mybranch) commit 2 | |
209 |
o 97fc |
|
209 | o 97fc commit 1 | |
210 |
|
210 | |||
211 | Multiple bookmarks on same changeset render properly |
|
211 | Multiple bookmarks on same changeset render properly | |
212 |
|
212 | |||
213 | $ hg book mybook2 |
|
213 | $ hg book mybook2 | |
214 | $ hg show work |
|
214 | $ hg show work | |
215 |
@ 3483 |
|
215 | @ 3483 (mybook mybook2) (mybranch) commit 2 | |
216 |
o 97fc |
|
216 | o 97fc commit 1 | |
217 |
|
217 | |||
218 | $ cd .. |
|
218 | $ cd .. | |
219 |
|
219 | |||
@@ -230,8 +230,38 b' Extra namespaces are rendered' | |||||
230 | $ hg commit -m 'commit 3' |
|
230 | $ hg commit -m 'commit 3' | |
231 |
|
231 | |||
232 | $ hg --config extensions.revnames=$TESTDIR/revnamesext.py show work |
|
232 | $ hg --config extensions.revnames=$TESTDIR/revnamesext.py show work | |
233 |
@ 32f3 |
|
233 | @ 32f3 (r2) commit 3 | |
234 |
o 6a75 |
|
234 | o 6a75 (r1) commit 2 | |
235 |
o 97fc |
|
235 | o 97fc (r0) commit 1 | |
236 |
|
236 | |||
237 | $ cd .. |
|
237 | $ cd .. | |
|
238 | ||||
|
239 | Prefix collision on hashes increases shortest node length | |||
|
240 | ||||
|
241 | $ hg init hashcollision | |||
|
242 | $ cd hashcollision | |||
|
243 | $ echo 0 > a | |||
|
244 | $ hg -q commit -Am 0 | |||
|
245 | $ for i in 17 1057 2857 4025; do | |||
|
246 | > hg -q up 0 | |||
|
247 | > echo $i > a | |||
|
248 | > hg -q commit -m $i | |||
|
249 | > echo 0 > a | |||
|
250 | > hg commit -m "$i commit 2" | |||
|
251 | > done | |||
|
252 | ||||
|
253 | $ hg show work | |||
|
254 | @ cfd04 4025 commit 2 | |||
|
255 | o c562d 4025 | |||
|
256 | | o 08048 2857 commit 2 | |||
|
257 | | o c5623 2857 | |||
|
258 | |/ | |||
|
259 | | o 6a6b6 1057 commit 2 | |||
|
260 | | o c5625 1057 | |||
|
261 | |/ | |||
|
262 | | o 96b4e 17 commit 2 | |||
|
263 | | o 11424 17 | |||
|
264 | |/ | |||
|
265 | o b4e73 0 | |||
|
266 | ||||
|
267 | $ cd .. |
@@ -95,8 +95,8 b' bookmarks view shows bookmarks in an ali' | |||||
95 | $ hg bookmark a-longer-bookmark |
|
95 | $ hg bookmark a-longer-bookmark | |
96 |
|
96 | |||
97 | $ hg show bookmarks |
|
97 | $ hg show bookmarks | |
98 |
* a-longer-bookmark 7b57 |
|
98 | * a-longer-bookmark 7b57 | |
99 |
book1 b757 |
|
99 | book1 b757 | |
100 |
|
100 | |||
101 | A custom bookmarks template works |
|
101 | A custom bookmarks template works | |
102 |
|
102 | |||
@@ -113,14 +113,14 b' bookmarks JSON works' | |||||
113 | "bookmark": "a-longer-bookmark", |
|
113 | "bookmark": "a-longer-bookmark", | |
114 | "longestbookmarklen": 17, |
|
114 | "longestbookmarklen": 17, | |
115 | "node": "7b5709ab64cbc34da9b4367b64afff47f2c4ee83", |
|
115 | "node": "7b5709ab64cbc34da9b4367b64afff47f2c4ee83", | |
116 |
"nodelen": |
|
116 | "nodelen": 4 | |
117 | }, |
|
117 | }, | |
118 | { |
|
118 | { | |
119 | "active": false, |
|
119 | "active": false, | |
120 | "bookmark": "book1", |
|
120 | "bookmark": "book1", | |
121 | "longestbookmarklen": 17, |
|
121 | "longestbookmarklen": 17, | |
122 | "node": "b757f780b8ffd71267c6ccb32e0882d9d32a8cc0", |
|
122 | "node": "b757f780b8ffd71267c6ccb32e0882d9d32a8cc0", | |
123 |
"nodelen": |
|
123 | "nodelen": 4 | |
124 | } |
|
124 | } | |
125 | ] |
|
125 | ] | |
126 |
|
126 | |||
@@ -138,19 +138,19 b' commands.show.aliasprefix aliases values' | |||||
138 | (no bookmarks set) |
|
138 | (no bookmarks set) | |
139 |
|
139 | |||
140 | $ hg --config commands.show.aliasprefix=sh shwork |
|
140 | $ hg --config commands.show.aliasprefix=sh shwork | |
141 |
@ 7b57 |
|
141 | @ 7b57 commit for book2 | |
142 |
o b757 |
|
142 | o b757 commit for book1 | |
143 |
o ba59 |
|
143 | o ba59 initial | |
144 |
|
144 | |||
145 | $ hg --config commands.show.aliasprefix='s sh' swork |
|
145 | $ hg --config commands.show.aliasprefix='s sh' swork | |
146 |
@ 7b57 |
|
146 | @ 7b57 commit for book2 | |
147 |
o b757 |
|
147 | o b757 commit for book1 | |
148 |
o ba59 |
|
148 | o ba59 initial | |
149 |
|
149 | |||
150 | $ hg --config commands.show.aliasprefix='s sh' shwork |
|
150 | $ hg --config commands.show.aliasprefix='s sh' shwork | |
151 |
@ 7b57 |
|
151 | @ 7b57 commit for book2 | |
152 |
o b757 |
|
152 | o b757 commit for book1 | |
153 |
o ba59 |
|
153 | o ba59 initial | |
154 |
|
154 | |||
155 | The aliases don't appear in `hg config` |
|
155 | The aliases don't appear in `hg config` | |
156 |
|
156 |
General Comments 0
You need to be logged in to leave comments.
Login now