##// END OF EJS Templates
templates: add 'bisect' keyword to return a cset's bisect status...
"Yann E. MORIN" -
r15155:f4a8d754 default
parent child Browse files
Show More
@@ -0,0 +1,117 b''
1 # Here we create a simple DAG which has just enough of the required
2 # topology to test all the bisection status labels:
3 #
4 # 13--14
5 # /
6 # 0--1--2--3---------9--10--11--12
7 # \ /
8 # 4--5--6--7--8
9
10
11 $ hg init
12
13 $ echo '0' >a
14 $ hg add a
15 $ hg ci -u test -d '0 0' -m '0'
16 $ echo '1' >a
17 $ hg ci -u test -d '0 1' -m '1'
18
19 branch 2-3
20
21 $ echo '2' >b
22 $ hg add b
23 $ hg ci -u test -d '0 2' -m '2'
24 $ echo '3' >b
25 $ hg ci -u test -d '0 3' -m '3'
26
27 branch 4-8
28
29 $ hg up -r 1
30 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
31 $ echo '4' >c
32 $ hg add c
33 $ hg ci -u test -d '0 4' -m '4'
34 created new head
35 $ echo '5' >c
36 $ hg ci -u test -d '0 5' -m '5'
37 $ echo '6' >c
38 $ hg ci -u test -d '0 6' -m '6'
39 $ echo '7' >c
40 $ hg ci -u test -d '0 7' -m '7'
41 $ echo '8' >c
42 $ hg ci -u test -d '0 8' -m '8'
43
44 merge
45
46 $ hg merge -r 3
47 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
48 (branch merge, don't forget to commit)
49 $ hg ci -u test -d '0 9' -m '9=8+3'
50
51 $ echo '10' >a
52 $ hg ci -u test -d '0 10' -m '10'
53 $ echo '11' >a
54 $ hg ci -u test -d '0 11' -m '11'
55 $ echo '12' >a
56 $ hg ci -u test -d '0 12' -m '12'
57
58 unrelated branch
59
60 $ hg up -r 3
61 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
62 $ echo '13' >d
63 $ hg add d
64 $ hg ci -u test -d '0 13' -m '13'
65 created new head
66 $ echo '14' >d
67 $ hg ci -u test -d '0 14' -m '14'
68
69 mark changesets
70
71 $ hg bisect --reset
72 $ hg bisect --good 4
73 $ hg bisect --good 6
74 $ hg bisect --bad 12
75 Testing changeset 9:8bcbdb072033 (6 changesets remaining, ~2 tests)
76 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
77 $ hg bisect --bad 10
78 Testing changeset 8:3cd112f87d77 (4 changesets remaining, ~2 tests)
79 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
80 $ hg bisect --skip 7
81 Testing changeset 8:3cd112f87d77 (4 changesets remaining, ~2 tests)
82 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
83
84 test template
85
86 $ hg log --template '{rev}:{node|short} {bisect}\n'
87 14:cecd84203acc
88 13:86f7c8cdb6df
89 12:a76089b5f47c bad
90 11:5c3eb122d29c bad (implicit)
91 10:b097cef2be03 bad
92 9:8bcbdb072033 untested
93 8:3cd112f87d77 untested
94 7:577e237a73bd skipped
95 6:e597fa2707c5 good
96 5:b9cea37a76bc good (implicit)
97 4:da6b357259d7 good
98 3:e7f031aee8ca ignored
99 2:b1ad1b6bcc5c ignored
100 1:37f42ae8b45e good (implicit)
101 0:b4e73ffab476 good (implicit)
102 $ hg log --template '{bisect|shortbisect} {rev}:{node|short}\n'
103 14:cecd84203acc
104 13:86f7c8cdb6df
105 B 12:a76089b5f47c
106 B 11:5c3eb122d29c
107 B 10:b097cef2be03
108 U 9:8bcbdb072033
109 U 8:3cd112f87d77
110 S 7:577e237a73bd
111 G 6:e597fa2707c5
112 G 5:b9cea37a76bc
113 G 4:da6b357259d7
114 I 3:e7f031aee8ca
115 I 2:b1ad1b6bcc5c
116 G 1:37f42ae8b45e
117 G 0:b4e73ffab476
@@ -7,6 +7,7 b''
7
7
8 import cgi, re, os, time, urllib
8 import cgi, re, os, time, urllib
9 import encoding, node, util
9 import encoding, node, util
10 import hbisect
10
11
11 def addbreaks(text):
12 def addbreaks(text):
12 """:addbreaks: Any text. Add an XHTML "<br />" tag before the end of
13 """:addbreaks: Any text. Add an XHTML "<br />" tag before the end of
@@ -268,6 +269,14 b' def short(text):'
268 """
269 """
269 return text[:12]
270 return text[:12]
270
271
272 def shortbisect(text):
273 """:shortbisect: Any text. Treats `text` as a bisection status, and
274 returns a single-character representing the status (G: good, B: bad,
275 S: skipped, U: untested, I: ignored). Returns single space if `text`
276 is not a valid bisection status.
277 """
278 return hbisect.shortlabel(text) or ' '
279
271 def shortdate(text):
280 def shortdate(text):
272 """:shortdate: Date. Returns a date like "2006-09-18"."""
281 """:shortdate: Date. Returns a date like "2006-09-18"."""
273 return util.shortdate(text)
282 return util.shortdate(text)
@@ -347,6 +356,7 b' filters = {'
347 "rfc3339date": rfc3339date,
356 "rfc3339date": rfc3339date,
348 "rfc822date": rfc822date,
357 "rfc822date": rfc822date,
349 "short": short,
358 "short": short,
359 "shortbisect": shortbisect,
350 "shortdate": shortdate,
360 "shortdate": shortdate,
351 "stringescape": stringescape,
361 "stringescape": stringescape,
352 "stringify": stringify,
362 "stringify": stringify,
@@ -7,6 +7,7 b''
7
7
8 from node import hex
8 from node import hex
9 import patch, util, error
9 import patch, util, error
10 import hbisect
10
11
11 def showlist(name, values, plural=None, **args):
12 def showlist(name, values, plural=None, **args):
12 '''expand set of values.
13 '''expand set of values.
@@ -145,6 +146,10 b' def showauthor(repo, ctx, templ, **args)'
145 """:author: String. The unmodified author of the changeset."""
146 """:author: String. The unmodified author of the changeset."""
146 return ctx.user()
147 return ctx.user()
147
148
149 def showbisect(repo, ctx, templ, **args):
150 """:bisect: String. The changeset bisection status."""
151 return hbisect.label(repo, ctx.node())
152
148 def showbranch(**args):
153 def showbranch(**args):
149 """:branch: String. The name of the branch on which the changeset was
154 """:branch: String. The name of the branch on which the changeset was
150 committed.
155 committed.
@@ -288,6 +293,7 b' def showtags(**args):'
288 # revcache - a cache dictionary for the current revision
293 # revcache - a cache dictionary for the current revision
289 keywords = {
294 keywords = {
290 'author': showauthor,
295 'author': showauthor,
296 'bisect': showbisect,
291 'branch': showbranch,
297 'branch': showbranch,
292 'branches': showbranches,
298 'branches': showbranches,
293 'bookmarks': showbookmarks,
299 'bookmarks': showbookmarks,
General Comments 0
You need to be logged in to leave comments. Login now