Show More
@@ -1,119 +1,123 b'' | |||
|
1 | 1 | Mercurial allows you to customize output of commands through |
|
2 | 2 | templates. You can either pass in a template or select an existing |
|
3 | 3 | template-style from the command line, via the --template option. |
|
4 | 4 | |
|
5 | 5 | You can customize output for any "log-like" command: log, |
|
6 | 6 | outgoing, incoming, tip, parents, and heads. |
|
7 | 7 | |
|
8 | 8 | Some built-in styles are packaged with Mercurial. These can be listed |
|
9 | 9 | with :hg:`log --template list`. Example usage:: |
|
10 | 10 | |
|
11 | 11 | $ hg log -r1.0::1.1 --template changelog |
|
12 | 12 | |
|
13 | 13 | A template is a piece of text, with markup to invoke variable |
|
14 | 14 | expansion:: |
|
15 | 15 | |
|
16 | 16 | $ hg log -r1 --template "{node}\n" |
|
17 | 17 | b56ce7b07c52de7d5fd79fb89701ea538af65746 |
|
18 | 18 | |
|
19 | 19 | Strings in curly braces are called keywords. The availability of |
|
20 | 20 | keywords depends on the exact context of the templater. These |
|
21 | 21 | keywords are usually available for templating a log-like command: |
|
22 | 22 | |
|
23 | 23 | .. keywordsmarker |
|
24 | 24 | |
|
25 | 25 | The "date" keyword does not produce human-readable output. If you |
|
26 | 26 | want to use a date in your output, you can use a filter to process |
|
27 | 27 | it. Filters are functions which return a string based on the input |
|
28 | 28 | variable. Be sure to use the stringify filter first when you're |
|
29 | 29 | applying a string-input filter to a list-like input variable. |
|
30 | 30 | You can also use a chain of filters to get the desired output:: |
|
31 | 31 | |
|
32 | 32 | $ hg tip --template "{date|isodate}\n" |
|
33 | 33 | 2008-08-21 18:22 +0000 |
|
34 | 34 | |
|
35 | 35 | List of filters: |
|
36 | 36 | |
|
37 | 37 | .. filtersmarker |
|
38 | 38 | |
|
39 | 39 | Note that a filter is nothing more than a function call, i.e. |
|
40 | 40 | ``expr|filter`` is equivalent to ``filter(expr)``. |
|
41 | 41 | |
|
42 | 42 | In addition to filters, there are some basic built-in functions: |
|
43 | 43 | |
|
44 | 44 | .. functionsmarker |
|
45 | 45 | |
|
46 | 46 | Also, for any expression that returns a list, there is a list operator: |
|
47 | 47 | |
|
48 | 48 | - expr % "{template}" |
|
49 | 49 | |
|
50 | 50 | As seen in the above example, "{template}" is interpreted as a template. |
|
51 | 51 | To prevent it from being interpreted, you can use an escape character "\{" |
|
52 | 52 | or a raw string prefix, "r'...'". |
|
53 | 53 | |
|
54 | 54 | Some sample command line templates: |
|
55 | 55 | |
|
56 | 56 | - Format lists, e.g. files:: |
|
57 | 57 | |
|
58 | 58 | $ hg log -r 0 --template "files:\n{files % ' {file}\n'}" |
|
59 | 59 | |
|
60 | 60 | - Join the list of files with a ", ":: |
|
61 | 61 | |
|
62 | 62 | $ hg log -r 0 --template "files: {join(files, ', ')}\n" |
|
63 | 63 | |
|
64 | 64 | - Modify each line of a commit description:: |
|
65 | 65 | |
|
66 | 66 | $ hg log --template "{splitlines(desc) % '**** {line}\n'}" |
|
67 | 67 | |
|
68 | 68 | - Format date:: |
|
69 | 69 | |
|
70 | 70 | $ hg log -r 0 --template "{date(date, '%Y')}\n" |
|
71 | 71 | |
|
72 | 72 | - Display date in UTC:: |
|
73 | 73 | |
|
74 | 74 | $ hg log -r 0 --template "{localdate(date, 'UTC')|date}\n" |
|
75 | 75 | |
|
76 | 76 | - Output the description set to a fill-width of 30:: |
|
77 | 77 | |
|
78 | 78 | $ hg log -r 0 --template "{fill(desc, 30)}" |
|
79 | 79 | |
|
80 | 80 | - Use a conditional to test for the default branch:: |
|
81 | 81 | |
|
82 | 82 | $ hg log -r 0 --template "{ifeq(branch, 'default', 'on the main branch', |
|
83 | 83 | 'on branch {branch}')}\n" |
|
84 | 84 | |
|
85 | 85 | - Append a newline if not empty:: |
|
86 | 86 | |
|
87 | 87 | $ hg tip --template "{if(author, '{author}\n')}" |
|
88 | 88 | |
|
89 | 89 | - Label the output for use with the color extension:: |
|
90 | 90 | |
|
91 | 91 | $ hg log -r 0 --template "{label('changeset.{phase}', node|short)}\n" |
|
92 | 92 | |
|
93 | 93 | - Invert the firstline filter, i.e. everything but the first line:: |
|
94 | 94 | |
|
95 | 95 | $ hg log -r 0 --template "{sub(r'^.*\n?\n?', '', desc)}\n" |
|
96 | 96 | |
|
97 | 97 | - Display the contents of the 'extra' field, one per line:: |
|
98 | 98 | |
|
99 | 99 | $ hg log -r 0 --template "{join(extras, '\n')}\n" |
|
100 | 100 | |
|
101 | 101 | - Mark the active bookmark with '*':: |
|
102 | 102 | |
|
103 | 103 | $ hg log --template "{bookmarks % '{bookmark}{ifeq(bookmark, active, '*')} '}\n" |
|
104 | 104 | |
|
105 | - Find the previous release candidate tag, the distance and changes since the tag:: | |
|
106 | ||
|
107 | $ hg log -r . --template "{latesttag('re:^.*-rc$') % '{tag}, {changes}, {distance}'}\n" | |
|
108 | ||
|
105 | 109 | - Mark the working copy parent with '@':: |
|
106 | 110 | |
|
107 | 111 | $ hg log --template "{ifcontains(rev, revset('.'), '@')}\n" |
|
108 | 112 | |
|
109 | 113 | - Show details of parent revisions:: |
|
110 | 114 | |
|
111 | 115 | $ hg log --template "{revset('parents(%d)', rev) % '{desc|firstline}\n'}" |
|
112 | 116 | |
|
113 | 117 | - Show only commit descriptions that start with "template":: |
|
114 | 118 | |
|
115 | 119 | $ hg log --template "{startswith('template', firstline(desc))}\n" |
|
116 | 120 | |
|
117 | 121 | - Print the first word of each line of a commit message:: |
|
118 | 122 | |
|
119 | 123 | $ hg log --template "{word(0, desc)}\n" |
@@ -1,965 +1,979 b'' | |||
|
1 | 1 | # templater.py - template expansion for output |
|
2 | 2 | # |
|
3 | 3 | # Copyright 2005, 2006 Matt Mackall <mpm@selenic.com> |
|
4 | 4 | # |
|
5 | 5 | # This software may be used and distributed according to the terms of the |
|
6 | 6 | # GNU General Public License version 2 or any later version. |
|
7 | 7 | |
|
8 | 8 | from __future__ import absolute_import |
|
9 | 9 | |
|
10 | 10 | import os |
|
11 | 11 | import re |
|
12 | 12 | import types |
|
13 | 13 | |
|
14 | 14 | from .i18n import _ |
|
15 | 15 | from . import ( |
|
16 | 16 | config, |
|
17 | 17 | error, |
|
18 | 18 | minirst, |
|
19 | 19 | parser, |
|
20 | 20 | revset as revsetmod, |
|
21 | 21 | templatefilters, |
|
22 | 22 | templatekw, |
|
23 | 23 | util, |
|
24 | 24 | ) |
|
25 | 25 | |
|
26 | 26 | # template parsing |
|
27 | 27 | |
|
28 | 28 | elements = { |
|
29 | 29 | # token-type: binding-strength, primary, prefix, infix, suffix |
|
30 | 30 | "(": (20, None, ("group", 1, ")"), ("func", 1, ")"), None), |
|
31 | 31 | ",": (2, None, None, ("list", 2), None), |
|
32 | 32 | "|": (5, None, None, ("|", 5), None), |
|
33 | 33 | "%": (6, None, None, ("%", 6), None), |
|
34 | 34 | ")": (0, None, None, None, None), |
|
35 | 35 | "integer": (0, "integer", None, None, None), |
|
36 | 36 | "symbol": (0, "symbol", None, None, None), |
|
37 | 37 | "string": (0, "string", None, None, None), |
|
38 | 38 | "template": (0, "template", None, None, None), |
|
39 | 39 | "end": (0, None, None, None, None), |
|
40 | 40 | } |
|
41 | 41 | |
|
42 | 42 | def tokenize(program, start, end): |
|
43 | 43 | pos = start |
|
44 | 44 | while pos < end: |
|
45 | 45 | c = program[pos] |
|
46 | 46 | if c.isspace(): # skip inter-token whitespace |
|
47 | 47 | pass |
|
48 | 48 | elif c in "(,)%|": # handle simple operators |
|
49 | 49 | yield (c, None, pos) |
|
50 | 50 | elif c in '"\'': # handle quoted templates |
|
51 | 51 | s = pos + 1 |
|
52 | 52 | data, pos = _parsetemplate(program, s, end, c) |
|
53 | 53 | yield ('template', data, s) |
|
54 | 54 | pos -= 1 |
|
55 | 55 | elif c == 'r' and program[pos:pos + 2] in ("r'", 'r"'): |
|
56 | 56 | # handle quoted strings |
|
57 | 57 | c = program[pos + 1] |
|
58 | 58 | s = pos = pos + 2 |
|
59 | 59 | while pos < end: # find closing quote |
|
60 | 60 | d = program[pos] |
|
61 | 61 | if d == '\\': # skip over escaped characters |
|
62 | 62 | pos += 2 |
|
63 | 63 | continue |
|
64 | 64 | if d == c: |
|
65 | 65 | yield ('string', program[s:pos], s) |
|
66 | 66 | break |
|
67 | 67 | pos += 1 |
|
68 | 68 | else: |
|
69 | 69 | raise error.ParseError(_("unterminated string"), s) |
|
70 | 70 | elif c.isdigit() or c == '-': |
|
71 | 71 | s = pos |
|
72 | 72 | if c == '-': # simply take negate operator as part of integer |
|
73 | 73 | pos += 1 |
|
74 | 74 | if pos >= end or not program[pos].isdigit(): |
|
75 | 75 | raise error.ParseError(_("integer literal without digits"), s) |
|
76 | 76 | pos += 1 |
|
77 | 77 | while pos < end: |
|
78 | 78 | d = program[pos] |
|
79 | 79 | if not d.isdigit(): |
|
80 | 80 | break |
|
81 | 81 | pos += 1 |
|
82 | 82 | yield ('integer', program[s:pos], s) |
|
83 | 83 | pos -= 1 |
|
84 | 84 | elif (c == '\\' and program[pos:pos + 2] in (r"\'", r'\"') |
|
85 | 85 | or c == 'r' and program[pos:pos + 3] in (r"r\'", r'r\"')): |
|
86 | 86 | # handle escaped quoted strings for compatibility with 2.9.2-3.4, |
|
87 | 87 | # where some of nested templates were preprocessed as strings and |
|
88 | 88 | # then compiled. therefore, \"...\" was allowed. (issue4733) |
|
89 | 89 | # |
|
90 | 90 | # processing flow of _evalifliteral() at 5ab28a2e9962: |
|
91 | 91 | # outer template string -> stringify() -> compiletemplate() |
|
92 | 92 | # ------------------------ ------------ ------------------ |
|
93 | 93 | # {f("\\\\ {g(\"\\\"\")}"} \\ {g("\"")} [r'\\', {g("\"")}] |
|
94 | 94 | # ~~~~~~~~ |
|
95 | 95 | # escaped quoted string |
|
96 | 96 | if c == 'r': |
|
97 | 97 | pos += 1 |
|
98 | 98 | token = 'string' |
|
99 | 99 | else: |
|
100 | 100 | token = 'template' |
|
101 | 101 | quote = program[pos:pos + 2] |
|
102 | 102 | s = pos = pos + 2 |
|
103 | 103 | while pos < end: # find closing escaped quote |
|
104 | 104 | if program.startswith('\\\\\\', pos, end): |
|
105 | 105 | pos += 4 # skip over double escaped characters |
|
106 | 106 | continue |
|
107 | 107 | if program.startswith(quote, pos, end): |
|
108 | 108 | # interpret as if it were a part of an outer string |
|
109 | 109 | data = parser.unescapestr(program[s:pos]) |
|
110 | 110 | if token == 'template': |
|
111 | 111 | data = _parsetemplate(data, 0, len(data))[0] |
|
112 | 112 | yield (token, data, s) |
|
113 | 113 | pos += 1 |
|
114 | 114 | break |
|
115 | 115 | pos += 1 |
|
116 | 116 | else: |
|
117 | 117 | raise error.ParseError(_("unterminated string"), s) |
|
118 | 118 | elif c.isalnum() or c in '_': |
|
119 | 119 | s = pos |
|
120 | 120 | pos += 1 |
|
121 | 121 | while pos < end: # find end of symbol |
|
122 | 122 | d = program[pos] |
|
123 | 123 | if not (d.isalnum() or d == "_"): |
|
124 | 124 | break |
|
125 | 125 | pos += 1 |
|
126 | 126 | sym = program[s:pos] |
|
127 | 127 | yield ('symbol', sym, s) |
|
128 | 128 | pos -= 1 |
|
129 | 129 | elif c == '}': |
|
130 | 130 | yield ('end', None, pos + 1) |
|
131 | 131 | return |
|
132 | 132 | else: |
|
133 | 133 | raise error.ParseError(_("syntax error"), pos) |
|
134 | 134 | pos += 1 |
|
135 | 135 | raise error.ParseError(_("unterminated template expansion"), start) |
|
136 | 136 | |
|
137 | 137 | def _parsetemplate(tmpl, start, stop, quote=''): |
|
138 | 138 | r""" |
|
139 | 139 | >>> _parsetemplate('foo{bar}"baz', 0, 12) |
|
140 | 140 | ([('string', 'foo'), ('symbol', 'bar'), ('string', '"baz')], 12) |
|
141 | 141 | >>> _parsetemplate('foo{bar}"baz', 0, 12, quote='"') |
|
142 | 142 | ([('string', 'foo'), ('symbol', 'bar')], 9) |
|
143 | 143 | >>> _parsetemplate('foo"{bar}', 0, 9, quote='"') |
|
144 | 144 | ([('string', 'foo')], 4) |
|
145 | 145 | >>> _parsetemplate(r'foo\"bar"baz', 0, 12, quote='"') |
|
146 | 146 | ([('string', 'foo"'), ('string', 'bar')], 9) |
|
147 | 147 | >>> _parsetemplate(r'foo\\"bar', 0, 10, quote='"') |
|
148 | 148 | ([('string', 'foo\\')], 6) |
|
149 | 149 | """ |
|
150 | 150 | parsed = [] |
|
151 | 151 | sepchars = '{' + quote |
|
152 | 152 | pos = start |
|
153 | 153 | p = parser.parser(elements) |
|
154 | 154 | while pos < stop: |
|
155 | 155 | n = min((tmpl.find(c, pos, stop) for c in sepchars), |
|
156 | 156 | key=lambda n: (n < 0, n)) |
|
157 | 157 | if n < 0: |
|
158 | 158 | parsed.append(('string', parser.unescapestr(tmpl[pos:stop]))) |
|
159 | 159 | pos = stop |
|
160 | 160 | break |
|
161 | 161 | c = tmpl[n] |
|
162 | 162 | bs = (n - pos) - len(tmpl[pos:n].rstrip('\\')) |
|
163 | 163 | if bs % 2 == 1: |
|
164 | 164 | # escaped (e.g. '\{', '\\\{', but not '\\{') |
|
165 | 165 | parsed.append(('string', parser.unescapestr(tmpl[pos:n - 1]) + c)) |
|
166 | 166 | pos = n + 1 |
|
167 | 167 | continue |
|
168 | 168 | if n > pos: |
|
169 | 169 | parsed.append(('string', parser.unescapestr(tmpl[pos:n]))) |
|
170 | 170 | if c == quote: |
|
171 | 171 | return parsed, n + 1 |
|
172 | 172 | |
|
173 | 173 | parseres, pos = p.parse(tokenize(tmpl, n + 1, stop)) |
|
174 | 174 | parsed.append(parseres) |
|
175 | 175 | |
|
176 | 176 | if quote: |
|
177 | 177 | raise error.ParseError(_("unterminated string"), start) |
|
178 | 178 | return parsed, pos |
|
179 | 179 | |
|
180 | 180 | def compiletemplate(tmpl, context): |
|
181 | 181 | parsed, pos = _parsetemplate(tmpl, 0, len(tmpl)) |
|
182 | 182 | return [compileexp(e, context, methods) for e in parsed] |
|
183 | 183 | |
|
184 | 184 | def compileexp(exp, context, curmethods): |
|
185 | 185 | t = exp[0] |
|
186 | 186 | if t in curmethods: |
|
187 | 187 | return curmethods[t](exp, context) |
|
188 | 188 | raise error.ParseError(_("unknown method '%s'") % t) |
|
189 | 189 | |
|
190 | 190 | # template evaluation |
|
191 | 191 | |
|
192 | 192 | def getsymbol(exp): |
|
193 | 193 | if exp[0] == 'symbol': |
|
194 | 194 | return exp[1] |
|
195 | 195 | raise error.ParseError(_("expected a symbol, got '%s'") % exp[0]) |
|
196 | 196 | |
|
197 | 197 | def getlist(x): |
|
198 | 198 | if not x: |
|
199 | 199 | return [] |
|
200 | 200 | if x[0] == 'list': |
|
201 | 201 | return getlist(x[1]) + [x[2]] |
|
202 | 202 | return [x] |
|
203 | 203 | |
|
204 | 204 | def gettemplate(exp, context): |
|
205 | 205 | if exp[0] == 'template': |
|
206 | 206 | return [compileexp(e, context, methods) for e in exp[1]] |
|
207 | 207 | if exp[0] == 'symbol': |
|
208 | 208 | # unlike runsymbol(), here 'symbol' is always taken as template name |
|
209 | 209 | # even if it exists in mapping. this allows us to override mapping |
|
210 | 210 | # by web templates, e.g. 'changelogtag' is redefined in map file. |
|
211 | 211 | return context._load(exp[1]) |
|
212 | 212 | raise error.ParseError(_("expected template specifier")) |
|
213 | 213 | |
|
214 | 214 | def evalfuncarg(context, mapping, arg): |
|
215 | 215 | func, data = arg |
|
216 | 216 | # func() may return string, generator of strings or arbitrary object such |
|
217 | 217 | # as date tuple, but filter does not want generator. |
|
218 | 218 | thing = func(context, mapping, data) |
|
219 | 219 | if isinstance(thing, types.GeneratorType): |
|
220 | 220 | thing = stringify(thing) |
|
221 | 221 | return thing |
|
222 | 222 | |
|
223 | 223 | def runinteger(context, mapping, data): |
|
224 | 224 | return int(data) |
|
225 | 225 | |
|
226 | 226 | def runstring(context, mapping, data): |
|
227 | 227 | return data |
|
228 | 228 | |
|
229 | 229 | def runsymbol(context, mapping, key): |
|
230 | 230 | v = mapping.get(key) |
|
231 | 231 | if v is None: |
|
232 | 232 | v = context._defaults.get(key) |
|
233 | 233 | if v is None: |
|
234 | 234 | try: |
|
235 | 235 | v = context.process(key, mapping) |
|
236 | 236 | except TemplateNotFound: |
|
237 | 237 | v = '' |
|
238 | 238 | if callable(v): |
|
239 | 239 | return v(**mapping) |
|
240 | 240 | if isinstance(v, types.GeneratorType): |
|
241 | 241 | v = list(v) |
|
242 | 242 | return v |
|
243 | 243 | |
|
244 | 244 | def buildtemplate(exp, context): |
|
245 | 245 | ctmpl = [compileexp(e, context, methods) for e in exp[1]] |
|
246 | 246 | if len(ctmpl) == 1: |
|
247 | 247 | return ctmpl[0] # fast path for string with no template fragment |
|
248 | 248 | return (runtemplate, ctmpl) |
|
249 | 249 | |
|
250 | 250 | def runtemplate(context, mapping, template): |
|
251 | 251 | for func, data in template: |
|
252 | 252 | yield func(context, mapping, data) |
|
253 | 253 | |
|
254 | 254 | def buildfilter(exp, context): |
|
255 | 255 | arg = compileexp(exp[1], context, methods) |
|
256 | 256 | n = getsymbol(exp[2]) |
|
257 | 257 | if n in context._filters: |
|
258 | 258 | filt = context._filters[n] |
|
259 | 259 | return (runfilter, (arg, filt)) |
|
260 | 260 | if n in funcs: |
|
261 | 261 | f = funcs[n] |
|
262 | 262 | return (f, [arg]) |
|
263 | 263 | raise error.ParseError(_("unknown function '%s'") % n) |
|
264 | 264 | |
|
265 | 265 | def runfilter(context, mapping, data): |
|
266 | 266 | arg, filt = data |
|
267 | 267 | thing = evalfuncarg(context, mapping, arg) |
|
268 | 268 | try: |
|
269 | 269 | return filt(thing) |
|
270 | 270 | except (ValueError, AttributeError, TypeError): |
|
271 | 271 | if isinstance(arg[1], tuple): |
|
272 | 272 | dt = arg[1][1] |
|
273 | 273 | else: |
|
274 | 274 | dt = arg[1] |
|
275 | 275 | raise util.Abort(_("template filter '%s' is not compatible with " |
|
276 | 276 | "keyword '%s'") % (filt.func_name, dt)) |
|
277 | 277 | |
|
278 | 278 | def buildmap(exp, context): |
|
279 | 279 | func, data = compileexp(exp[1], context, methods) |
|
280 | 280 | ctmpl = gettemplate(exp[2], context) |
|
281 | 281 | return (runmap, (func, data, ctmpl)) |
|
282 | 282 | |
|
283 | 283 | def runmap(context, mapping, data): |
|
284 | 284 | func, data, ctmpl = data |
|
285 | 285 | d = func(context, mapping, data) |
|
286 | 286 | if callable(d): |
|
287 | 287 | d = d() |
|
288 | 288 | |
|
289 | 289 | lm = mapping.copy() |
|
290 | 290 | |
|
291 | 291 | for i in d: |
|
292 | 292 | if isinstance(i, dict): |
|
293 | 293 | lm.update(i) |
|
294 | 294 | lm['originalnode'] = mapping.get('node') |
|
295 | 295 | yield runtemplate(context, lm, ctmpl) |
|
296 | 296 | else: |
|
297 | 297 | # v is not an iterable of dicts, this happen when 'key' |
|
298 | 298 | # has been fully expanded already and format is useless. |
|
299 | 299 | # If so, return the expanded value. |
|
300 | 300 | yield i |
|
301 | 301 | |
|
302 | 302 | def buildfunc(exp, context): |
|
303 | 303 | n = getsymbol(exp[1]) |
|
304 | 304 | args = [compileexp(x, context, exprmethods) for x in getlist(exp[2])] |
|
305 | 305 | if n in funcs: |
|
306 | 306 | f = funcs[n] |
|
307 | 307 | return (f, args) |
|
308 | 308 | if n in context._filters: |
|
309 | 309 | if len(args) != 1: |
|
310 | 310 | raise error.ParseError(_("filter %s expects one argument") % n) |
|
311 | 311 | f = context._filters[n] |
|
312 | 312 | return (runfilter, (args[0], f)) |
|
313 | 313 | raise error.ParseError(_("unknown function '%s'") % n) |
|
314 | 314 | |
|
315 | 315 | def date(context, mapping, args): |
|
316 | 316 | """:date(date[, fmt]): Format a date. See :hg:`help dates` for formatting |
|
317 | 317 | strings. The default is a Unix date format, including the timezone: |
|
318 | 318 | "Mon Sep 04 15:13:13 2006 0700".""" |
|
319 | 319 | if not (1 <= len(args) <= 2): |
|
320 | 320 | # i18n: "date" is a keyword |
|
321 | 321 | raise error.ParseError(_("date expects one or two arguments")) |
|
322 | 322 | |
|
323 | 323 | date = args[0][0](context, mapping, args[0][1]) |
|
324 | 324 | fmt = None |
|
325 | 325 | if len(args) == 2: |
|
326 | 326 | fmt = stringify(args[1][0](context, mapping, args[1][1])) |
|
327 | 327 | try: |
|
328 | 328 | if fmt is None: |
|
329 | 329 | return util.datestr(date) |
|
330 | 330 | else: |
|
331 | 331 | return util.datestr(date, fmt) |
|
332 | 332 | except (TypeError, ValueError): |
|
333 | 333 | # i18n: "date" is a keyword |
|
334 | 334 | raise error.ParseError(_("date expects a date information")) |
|
335 | 335 | |
|
336 | 336 | def diff(context, mapping, args): |
|
337 | 337 | """:diff([includepattern [, excludepattern]]): Show a diff, optionally |
|
338 | 338 | specifying files to include or exclude.""" |
|
339 | 339 | if len(args) > 2: |
|
340 | 340 | # i18n: "diff" is a keyword |
|
341 | 341 | raise error.ParseError(_("diff expects one, two or no arguments")) |
|
342 | 342 | |
|
343 | 343 | def getpatterns(i): |
|
344 | 344 | if i < len(args): |
|
345 | 345 | s = stringify(args[i][0](context, mapping, args[i][1])).strip() |
|
346 | 346 | if s: |
|
347 | 347 | return [s] |
|
348 | 348 | return [] |
|
349 | 349 | |
|
350 | 350 | ctx = mapping['ctx'] |
|
351 | 351 | chunks = ctx.diff(match=ctx.match([], getpatterns(0), getpatterns(1))) |
|
352 | 352 | |
|
353 | 353 | return ''.join(chunks) |
|
354 | 354 | |
|
355 | 355 | def fill(context, mapping, args): |
|
356 | 356 | """:fill(text[, width[, initialident[, hangindent]]]): Fill many |
|
357 | 357 | paragraphs with optional indentation. See the "fill" filter.""" |
|
358 | 358 | if not (1 <= len(args) <= 4): |
|
359 | 359 | # i18n: "fill" is a keyword |
|
360 | 360 | raise error.ParseError(_("fill expects one to four arguments")) |
|
361 | 361 | |
|
362 | 362 | text = stringify(args[0][0](context, mapping, args[0][1])) |
|
363 | 363 | width = 76 |
|
364 | 364 | initindent = '' |
|
365 | 365 | hangindent = '' |
|
366 | 366 | if 2 <= len(args) <= 4: |
|
367 | 367 | try: |
|
368 | 368 | width = int(stringify(args[1][0](context, mapping, args[1][1]))) |
|
369 | 369 | except ValueError: |
|
370 | 370 | # i18n: "fill" is a keyword |
|
371 | 371 | raise error.ParseError(_("fill expects an integer width")) |
|
372 | 372 | try: |
|
373 | 373 | initindent = stringify(args[2][0](context, mapping, args[2][1])) |
|
374 | 374 | hangindent = stringify(args[3][0](context, mapping, args[3][1])) |
|
375 | 375 | except IndexError: |
|
376 | 376 | pass |
|
377 | 377 | |
|
378 | 378 | return templatefilters.fill(text, width, initindent, hangindent) |
|
379 | 379 | |
|
380 | 380 | def pad(context, mapping, args): |
|
381 | 381 | """:pad(text, width[, fillchar=' '[, right=False]]): Pad text with a |
|
382 | 382 | fill character.""" |
|
383 | 383 | if not (2 <= len(args) <= 4): |
|
384 | 384 | # i18n: "pad" is a keyword |
|
385 | 385 | raise error.ParseError(_("pad() expects two to four arguments")) |
|
386 | 386 | |
|
387 | 387 | width = int(args[1][1]) |
|
388 | 388 | |
|
389 | 389 | text = stringify(args[0][0](context, mapping, args[0][1])) |
|
390 | 390 | |
|
391 | 391 | right = False |
|
392 | 392 | fillchar = ' ' |
|
393 | 393 | if len(args) > 2: |
|
394 | 394 | fillchar = stringify(args[2][0](context, mapping, args[2][1])) |
|
395 | 395 | if len(args) > 3: |
|
396 | 396 | right = util.parsebool(args[3][1]) |
|
397 | 397 | |
|
398 | 398 | if right: |
|
399 | 399 | return text.rjust(width, fillchar) |
|
400 | 400 | else: |
|
401 | 401 | return text.ljust(width, fillchar) |
|
402 | 402 | |
|
403 | 403 | def indent(context, mapping, args): |
|
404 | 404 | """:indent(text, indentchars[, firstline]): Indents all non-empty lines |
|
405 | 405 | with the characters given in the indentchars string. An optional |
|
406 | 406 | third parameter will override the indent for the first line only |
|
407 | 407 | if present.""" |
|
408 | 408 | if not (2 <= len(args) <= 3): |
|
409 | 409 | # i18n: "indent" is a keyword |
|
410 | 410 | raise error.ParseError(_("indent() expects two or three arguments")) |
|
411 | 411 | |
|
412 | 412 | text = stringify(args[0][0](context, mapping, args[0][1])) |
|
413 | 413 | indent = stringify(args[1][0](context, mapping, args[1][1])) |
|
414 | 414 | |
|
415 | 415 | if len(args) == 3: |
|
416 | 416 | firstline = stringify(args[2][0](context, mapping, args[2][1])) |
|
417 | 417 | else: |
|
418 | 418 | firstline = indent |
|
419 | 419 | |
|
420 | 420 | # the indent function doesn't indent the first line, so we do it here |
|
421 | 421 | return templatefilters.indent(firstline + text, indent) |
|
422 | 422 | |
|
423 | 423 | def get(context, mapping, args): |
|
424 | 424 | """:get(dict, key): Get an attribute/key from an object. Some keywords |
|
425 | 425 | are complex types. This function allows you to obtain the value of an |
|
426 | 426 | attribute on these types.""" |
|
427 | 427 | if len(args) != 2: |
|
428 | 428 | # i18n: "get" is a keyword |
|
429 | 429 | raise error.ParseError(_("get() expects two arguments")) |
|
430 | 430 | |
|
431 | 431 | dictarg = args[0][0](context, mapping, args[0][1]) |
|
432 | 432 | if not util.safehasattr(dictarg, 'get'): |
|
433 | 433 | # i18n: "get" is a keyword |
|
434 | 434 | raise error.ParseError(_("get() expects a dict as first argument")) |
|
435 | 435 | |
|
436 | 436 | key = args[1][0](context, mapping, args[1][1]) |
|
437 | 437 | yield dictarg.get(key) |
|
438 | 438 | |
|
439 | 439 | def if_(context, mapping, args): |
|
440 | 440 | """:if(expr, then[, else]): Conditionally execute based on the result of |
|
441 | 441 | an expression.""" |
|
442 | 442 | if not (2 <= len(args) <= 3): |
|
443 | 443 | # i18n: "if" is a keyword |
|
444 | 444 | raise error.ParseError(_("if expects two or three arguments")) |
|
445 | 445 | |
|
446 | 446 | test = stringify(args[0][0](context, mapping, args[0][1])) |
|
447 | 447 | if test: |
|
448 | 448 | yield args[1][0](context, mapping, args[1][1]) |
|
449 | 449 | elif len(args) == 3: |
|
450 | 450 | yield args[2][0](context, mapping, args[2][1]) |
|
451 | 451 | |
|
452 | 452 | def ifcontains(context, mapping, args): |
|
453 | 453 | """:ifcontains(search, thing, then[, else]): Conditionally execute based |
|
454 | 454 | on whether the item "search" is in "thing".""" |
|
455 | 455 | if not (3 <= len(args) <= 4): |
|
456 | 456 | # i18n: "ifcontains" is a keyword |
|
457 | 457 | raise error.ParseError(_("ifcontains expects three or four arguments")) |
|
458 | 458 | |
|
459 | 459 | item = stringify(args[0][0](context, mapping, args[0][1])) |
|
460 | 460 | items = args[1][0](context, mapping, args[1][1]) |
|
461 | 461 | |
|
462 | 462 | if item in items: |
|
463 | 463 | yield args[2][0](context, mapping, args[2][1]) |
|
464 | 464 | elif len(args) == 4: |
|
465 | 465 | yield args[3][0](context, mapping, args[3][1]) |
|
466 | 466 | |
|
467 | 467 | def ifeq(context, mapping, args): |
|
468 | 468 | """:ifeq(expr1, expr2, then[, else]): Conditionally execute based on |
|
469 | 469 | whether 2 items are equivalent.""" |
|
470 | 470 | if not (3 <= len(args) <= 4): |
|
471 | 471 | # i18n: "ifeq" is a keyword |
|
472 | 472 | raise error.ParseError(_("ifeq expects three or four arguments")) |
|
473 | 473 | |
|
474 | 474 | test = stringify(args[0][0](context, mapping, args[0][1])) |
|
475 | 475 | match = stringify(args[1][0](context, mapping, args[1][1])) |
|
476 | 476 | if test == match: |
|
477 | 477 | yield args[2][0](context, mapping, args[2][1]) |
|
478 | 478 | elif len(args) == 4: |
|
479 | 479 | yield args[3][0](context, mapping, args[3][1]) |
|
480 | 480 | |
|
481 | 481 | def join(context, mapping, args): |
|
482 | 482 | """:join(list, sep): Join items in a list with a delimiter.""" |
|
483 | 483 | if not (1 <= len(args) <= 2): |
|
484 | 484 | # i18n: "join" is a keyword |
|
485 | 485 | raise error.ParseError(_("join expects one or two arguments")) |
|
486 | 486 | |
|
487 | 487 | joinset = args[0][0](context, mapping, args[0][1]) |
|
488 | 488 | if callable(joinset): |
|
489 | 489 | jf = joinset.joinfmt |
|
490 | 490 | joinset = [jf(x) for x in joinset()] |
|
491 | 491 | |
|
492 | 492 | joiner = " " |
|
493 | 493 | if len(args) > 1: |
|
494 | 494 | joiner = stringify(args[1][0](context, mapping, args[1][1])) |
|
495 | 495 | |
|
496 | 496 | first = True |
|
497 | 497 | for x in joinset: |
|
498 | 498 | if first: |
|
499 | 499 | first = False |
|
500 | 500 | else: |
|
501 | 501 | yield joiner |
|
502 | 502 | yield x |
|
503 | 503 | |
|
504 | 504 | def label(context, mapping, args): |
|
505 | 505 | """:label(label, expr): Apply a label to generated content. Content with |
|
506 | 506 | a label applied can result in additional post-processing, such as |
|
507 | 507 | automatic colorization.""" |
|
508 | 508 | if len(args) != 2: |
|
509 | 509 | # i18n: "label" is a keyword |
|
510 | 510 | raise error.ParseError(_("label expects two arguments")) |
|
511 | 511 | |
|
512 | 512 | # ignore args[0] (the label string) since this is supposed to be a a no-op |
|
513 | 513 | yield args[1][0](context, mapping, args[1][1]) |
|
514 | 514 | |
|
515 | def latesttag(context, mapping, args): | |
|
516 | """:latesttag([pattern]): The global tags matching the given pattern on the | |
|
517 | most recent globally tagged ancestor of this changeset.""" | |
|
518 | if len(args) > 1: | |
|
519 | # i18n: "latesttag" is a keyword | |
|
520 | raise error.ParseError(_("latesttag expects at most one argument")) | |
|
521 | ||
|
522 | pattern = None | |
|
523 | if len(args) == 1: | |
|
524 | pattern = stringify(args[0][0](context, mapping, args[0][1])) | |
|
525 | ||
|
526 | return templatekw.showlatesttags(pattern, **mapping) | |
|
527 | ||
|
515 | 528 | def localdate(context, mapping, args): |
|
516 | 529 | """:localdate(date[, tz]): Converts a date to the specified timezone. |
|
517 | 530 | The default is local date.""" |
|
518 | 531 | if not (1 <= len(args) <= 2): |
|
519 | 532 | # i18n: "localdate" is a keyword |
|
520 | 533 | raise error.ParseError(_("localdate expects one or two arguments")) |
|
521 | 534 | |
|
522 | 535 | date = evalfuncarg(context, mapping, args[0]) |
|
523 | 536 | try: |
|
524 | 537 | date = util.parsedate(date) |
|
525 | 538 | except AttributeError: # not str nor date tuple |
|
526 | 539 | # i18n: "localdate" is a keyword |
|
527 | 540 | raise error.ParseError(_("localdate expects a date information")) |
|
528 | 541 | if len(args) >= 2: |
|
529 | 542 | tzoffset = None |
|
530 | 543 | tz = evalfuncarg(context, mapping, args[1]) |
|
531 | 544 | if isinstance(tz, str): |
|
532 | 545 | tzoffset = util.parsetimezone(tz) |
|
533 | 546 | if tzoffset is None: |
|
534 | 547 | try: |
|
535 | 548 | tzoffset = int(tz) |
|
536 | 549 | except (TypeError, ValueError): |
|
537 | 550 | # i18n: "localdate" is a keyword |
|
538 | 551 | raise error.ParseError(_("localdate expects a timezone")) |
|
539 | 552 | else: |
|
540 | 553 | tzoffset = util.makedate()[1] |
|
541 | 554 | return (date[0], tzoffset) |
|
542 | 555 | |
|
543 | 556 | def revset(context, mapping, args): |
|
544 | 557 | """:revset(query[, formatargs...]): Execute a revision set query. See |
|
545 | 558 | :hg:`help revset`.""" |
|
546 | 559 | if not len(args) > 0: |
|
547 | 560 | # i18n: "revset" is a keyword |
|
548 | 561 | raise error.ParseError(_("revset expects one or more arguments")) |
|
549 | 562 | |
|
550 | 563 | raw = stringify(args[0][0](context, mapping, args[0][1])) |
|
551 | 564 | ctx = mapping['ctx'] |
|
552 | 565 | repo = ctx.repo() |
|
553 | 566 | |
|
554 | 567 | def query(expr): |
|
555 | 568 | m = revsetmod.match(repo.ui, expr) |
|
556 | 569 | return m(repo) |
|
557 | 570 | |
|
558 | 571 | if len(args) > 1: |
|
559 | 572 | formatargs = list([a[0](context, mapping, a[1]) for a in args[1:]]) |
|
560 | 573 | revs = query(revsetmod.formatspec(raw, *formatargs)) |
|
561 | 574 | revs = list([str(r) for r in revs]) |
|
562 | 575 | else: |
|
563 | 576 | revsetcache = mapping['cache'].setdefault("revsetcache", {}) |
|
564 | 577 | if raw in revsetcache: |
|
565 | 578 | revs = revsetcache[raw] |
|
566 | 579 | else: |
|
567 | 580 | revs = query(raw) |
|
568 | 581 | revs = list([str(r) for r in revs]) |
|
569 | 582 | revsetcache[raw] = revs |
|
570 | 583 | |
|
571 | 584 | return templatekw.showrevslist("revision", revs, **mapping) |
|
572 | 585 | |
|
573 | 586 | def rstdoc(context, mapping, args): |
|
574 | 587 | """:rstdoc(text, style): Format ReStructuredText.""" |
|
575 | 588 | if len(args) != 2: |
|
576 | 589 | # i18n: "rstdoc" is a keyword |
|
577 | 590 | raise error.ParseError(_("rstdoc expects two arguments")) |
|
578 | 591 | |
|
579 | 592 | text = stringify(args[0][0](context, mapping, args[0][1])) |
|
580 | 593 | style = stringify(args[1][0](context, mapping, args[1][1])) |
|
581 | 594 | |
|
582 | 595 | return minirst.format(text, style=style, keep=['verbose']) |
|
583 | 596 | |
|
584 | 597 | def shortest(context, mapping, args): |
|
585 | 598 | """:shortest(node, minlength=4): Obtain the shortest representation of |
|
586 | 599 | a node.""" |
|
587 | 600 | if not (1 <= len(args) <= 2): |
|
588 | 601 | # i18n: "shortest" is a keyword |
|
589 | 602 | raise error.ParseError(_("shortest() expects one or two arguments")) |
|
590 | 603 | |
|
591 | 604 | node = stringify(args[0][0](context, mapping, args[0][1])) |
|
592 | 605 | |
|
593 | 606 | minlength = 4 |
|
594 | 607 | if len(args) > 1: |
|
595 | 608 | minlength = int(args[1][1]) |
|
596 | 609 | |
|
597 | 610 | cl = mapping['ctx']._repo.changelog |
|
598 | 611 | def isvalid(test): |
|
599 | 612 | try: |
|
600 | 613 | try: |
|
601 | 614 | cl.index.partialmatch(test) |
|
602 | 615 | except AttributeError: |
|
603 | 616 | # Pure mercurial doesn't support partialmatch on the index. |
|
604 | 617 | # Fallback to the slow way. |
|
605 | 618 | if cl._partialmatch(test) is None: |
|
606 | 619 | return False |
|
607 | 620 | |
|
608 | 621 | try: |
|
609 | 622 | i = int(test) |
|
610 | 623 | # if we are a pure int, then starting with zero will not be |
|
611 | 624 | # confused as a rev; or, obviously, if the int is larger than |
|
612 | 625 | # the value of the tip rev |
|
613 | 626 | if test[0] == '0' or i > len(cl): |
|
614 | 627 | return True |
|
615 | 628 | return False |
|
616 | 629 | except ValueError: |
|
617 | 630 | return True |
|
618 | 631 | except error.RevlogError: |
|
619 | 632 | return False |
|
620 | 633 | |
|
621 | 634 | shortest = node |
|
622 | 635 | startlength = max(6, minlength) |
|
623 | 636 | length = startlength |
|
624 | 637 | while True: |
|
625 | 638 | test = node[:length] |
|
626 | 639 | if isvalid(test): |
|
627 | 640 | shortest = test |
|
628 | 641 | if length == minlength or length > startlength: |
|
629 | 642 | return shortest |
|
630 | 643 | length -= 1 |
|
631 | 644 | else: |
|
632 | 645 | length += 1 |
|
633 | 646 | if len(shortest) <= length: |
|
634 | 647 | return shortest |
|
635 | 648 | |
|
636 | 649 | def strip(context, mapping, args): |
|
637 | 650 | """:strip(text[, chars]): Strip characters from a string. By default, |
|
638 | 651 | strips all leading and trailing whitespace.""" |
|
639 | 652 | if not (1 <= len(args) <= 2): |
|
640 | 653 | # i18n: "strip" is a keyword |
|
641 | 654 | raise error.ParseError(_("strip expects one or two arguments")) |
|
642 | 655 | |
|
643 | 656 | text = stringify(args[0][0](context, mapping, args[0][1])) |
|
644 | 657 | if len(args) == 2: |
|
645 | 658 | chars = stringify(args[1][0](context, mapping, args[1][1])) |
|
646 | 659 | return text.strip(chars) |
|
647 | 660 | return text.strip() |
|
648 | 661 | |
|
649 | 662 | def sub(context, mapping, args): |
|
650 | 663 | """:sub(pattern, replacement, expression): Perform text substitution |
|
651 | 664 | using regular expressions.""" |
|
652 | 665 | if len(args) != 3: |
|
653 | 666 | # i18n: "sub" is a keyword |
|
654 | 667 | raise error.ParseError(_("sub expects three arguments")) |
|
655 | 668 | |
|
656 | 669 | pat = stringify(args[0][0](context, mapping, args[0][1])) |
|
657 | 670 | rpl = stringify(args[1][0](context, mapping, args[1][1])) |
|
658 | 671 | src = stringify(args[2][0](context, mapping, args[2][1])) |
|
659 | 672 | try: |
|
660 | 673 | patre = re.compile(pat) |
|
661 | 674 | except re.error: |
|
662 | 675 | # i18n: "sub" is a keyword |
|
663 | 676 | raise error.ParseError(_("sub got an invalid pattern: %s") % pat) |
|
664 | 677 | try: |
|
665 | 678 | yield patre.sub(rpl, src) |
|
666 | 679 | except re.error: |
|
667 | 680 | # i18n: "sub" is a keyword |
|
668 | 681 | raise error.ParseError(_("sub got an invalid replacement: %s") % rpl) |
|
669 | 682 | |
|
670 | 683 | def startswith(context, mapping, args): |
|
671 | 684 | """:startswith(pattern, text): Returns the value from the "text" argument |
|
672 | 685 | if it begins with the content from the "pattern" argument.""" |
|
673 | 686 | if len(args) != 2: |
|
674 | 687 | # i18n: "startswith" is a keyword |
|
675 | 688 | raise error.ParseError(_("startswith expects two arguments")) |
|
676 | 689 | |
|
677 | 690 | patn = stringify(args[0][0](context, mapping, args[0][1])) |
|
678 | 691 | text = stringify(args[1][0](context, mapping, args[1][1])) |
|
679 | 692 | if text.startswith(patn): |
|
680 | 693 | return text |
|
681 | 694 | return '' |
|
682 | 695 | |
|
683 | 696 | |
|
684 | 697 | def word(context, mapping, args): |
|
685 | 698 | """:word(number, text[, separator]): Return the nth word from a string.""" |
|
686 | 699 | if not (2 <= len(args) <= 3): |
|
687 | 700 | # i18n: "word" is a keyword |
|
688 | 701 | raise error.ParseError(_("word expects two or three arguments, got %d") |
|
689 | 702 | % len(args)) |
|
690 | 703 | |
|
691 | 704 | try: |
|
692 | 705 | num = int(stringify(args[0][0](context, mapping, args[0][1]))) |
|
693 | 706 | except ValueError: |
|
694 | 707 | # i18n: "word" is a keyword |
|
695 | 708 | raise error.ParseError(_("word expects an integer index")) |
|
696 | 709 | text = stringify(args[1][0](context, mapping, args[1][1])) |
|
697 | 710 | if len(args) == 3: |
|
698 | 711 | splitter = stringify(args[2][0](context, mapping, args[2][1])) |
|
699 | 712 | else: |
|
700 | 713 | splitter = None |
|
701 | 714 | |
|
702 | 715 | tokens = text.split(splitter) |
|
703 | 716 | if num >= len(tokens): |
|
704 | 717 | return '' |
|
705 | 718 | else: |
|
706 | 719 | return tokens[num] |
|
707 | 720 | |
|
708 | 721 | # methods to interpret function arguments or inner expressions (e.g. {_(x)}) |
|
709 | 722 | exprmethods = { |
|
710 | 723 | "integer": lambda e, c: (runinteger, e[1]), |
|
711 | 724 | "string": lambda e, c: (runstring, e[1]), |
|
712 | 725 | "symbol": lambda e, c: (runsymbol, e[1]), |
|
713 | 726 | "template": buildtemplate, |
|
714 | 727 | "group": lambda e, c: compileexp(e[1], c, exprmethods), |
|
715 | 728 | # ".": buildmember, |
|
716 | 729 | "|": buildfilter, |
|
717 | 730 | "%": buildmap, |
|
718 | 731 | "func": buildfunc, |
|
719 | 732 | } |
|
720 | 733 | |
|
721 | 734 | # methods to interpret top-level template (e.g. {x}, {x|_}, {x % "y"}) |
|
722 | 735 | methods = exprmethods.copy() |
|
723 | 736 | methods["integer"] = exprmethods["symbol"] # '{1}' as variable |
|
724 | 737 | |
|
725 | 738 | funcs = { |
|
726 | 739 | "date": date, |
|
727 | 740 | "diff": diff, |
|
728 | 741 | "fill": fill, |
|
729 | 742 | "get": get, |
|
730 | 743 | "if": if_, |
|
731 | 744 | "ifcontains": ifcontains, |
|
732 | 745 | "ifeq": ifeq, |
|
733 | 746 | "indent": indent, |
|
734 | 747 | "join": join, |
|
735 | 748 | "label": label, |
|
749 | "latesttag": latesttag, | |
|
736 | 750 | "localdate": localdate, |
|
737 | 751 | "pad": pad, |
|
738 | 752 | "revset": revset, |
|
739 | 753 | "rstdoc": rstdoc, |
|
740 | 754 | "shortest": shortest, |
|
741 | 755 | "startswith": startswith, |
|
742 | 756 | "strip": strip, |
|
743 | 757 | "sub": sub, |
|
744 | 758 | "word": word, |
|
745 | 759 | } |
|
746 | 760 | |
|
747 | 761 | # template engine |
|
748 | 762 | |
|
749 | 763 | stringify = templatefilters.stringify |
|
750 | 764 | |
|
751 | 765 | def _flatten(thing): |
|
752 | 766 | '''yield a single stream from a possibly nested set of iterators''' |
|
753 | 767 | if isinstance(thing, str): |
|
754 | 768 | yield thing |
|
755 | 769 | elif not util.safehasattr(thing, '__iter__'): |
|
756 | 770 | if thing is not None: |
|
757 | 771 | yield str(thing) |
|
758 | 772 | else: |
|
759 | 773 | for i in thing: |
|
760 | 774 | if isinstance(i, str): |
|
761 | 775 | yield i |
|
762 | 776 | elif not util.safehasattr(i, '__iter__'): |
|
763 | 777 | if i is not None: |
|
764 | 778 | yield str(i) |
|
765 | 779 | elif i is not None: |
|
766 | 780 | for j in _flatten(i): |
|
767 | 781 | yield j |
|
768 | 782 | |
|
769 | 783 | def unquotestring(s): |
|
770 | 784 | '''unwrap quotes''' |
|
771 | 785 | if len(s) < 2 or s[0] != s[-1]: |
|
772 | 786 | raise SyntaxError(_('unmatched quotes')) |
|
773 | 787 | return s[1:-1] |
|
774 | 788 | |
|
775 | 789 | class engine(object): |
|
776 | 790 | '''template expansion engine. |
|
777 | 791 | |
|
778 | 792 | template expansion works like this. a map file contains key=value |
|
779 | 793 | pairs. if value is quoted, it is treated as string. otherwise, it |
|
780 | 794 | is treated as name of template file. |
|
781 | 795 | |
|
782 | 796 | templater is asked to expand a key in map. it looks up key, and |
|
783 | 797 | looks for strings like this: {foo}. it expands {foo} by looking up |
|
784 | 798 | foo in map, and substituting it. expansion is recursive: it stops |
|
785 | 799 | when there is no more {foo} to replace. |
|
786 | 800 | |
|
787 | 801 | expansion also allows formatting and filtering. |
|
788 | 802 | |
|
789 | 803 | format uses key to expand each item in list. syntax is |
|
790 | 804 | {key%format}. |
|
791 | 805 | |
|
792 | 806 | filter uses function to transform value. syntax is |
|
793 | 807 | {key|filter1|filter2|...}.''' |
|
794 | 808 | |
|
795 | 809 | def __init__(self, loader, filters=None, defaults=None): |
|
796 | 810 | self._loader = loader |
|
797 | 811 | if filters is None: |
|
798 | 812 | filters = {} |
|
799 | 813 | self._filters = filters |
|
800 | 814 | if defaults is None: |
|
801 | 815 | defaults = {} |
|
802 | 816 | self._defaults = defaults |
|
803 | 817 | self._cache = {} |
|
804 | 818 | |
|
805 | 819 | def _load(self, t): |
|
806 | 820 | '''load, parse, and cache a template''' |
|
807 | 821 | if t not in self._cache: |
|
808 | 822 | self._cache[t] = compiletemplate(self._loader(t), self) |
|
809 | 823 | return self._cache[t] |
|
810 | 824 | |
|
811 | 825 | def process(self, t, mapping): |
|
812 | 826 | '''Perform expansion. t is name of map element to expand. |
|
813 | 827 | mapping contains added elements for use during expansion. Is a |
|
814 | 828 | generator.''' |
|
815 | 829 | return _flatten(runtemplate(self, mapping, self._load(t))) |
|
816 | 830 | |
|
817 | 831 | engines = {'default': engine} |
|
818 | 832 | |
|
819 | 833 | def stylelist(): |
|
820 | 834 | paths = templatepaths() |
|
821 | 835 | if not paths: |
|
822 | 836 | return _('no templates found, try `hg debuginstall` for more info') |
|
823 | 837 | dirlist = os.listdir(paths[0]) |
|
824 | 838 | stylelist = [] |
|
825 | 839 | for file in dirlist: |
|
826 | 840 | split = file.split(".") |
|
827 | 841 | if split[0] == "map-cmdline": |
|
828 | 842 | stylelist.append(split[1]) |
|
829 | 843 | return ", ".join(sorted(stylelist)) |
|
830 | 844 | |
|
831 | 845 | class TemplateNotFound(util.Abort): |
|
832 | 846 | pass |
|
833 | 847 | |
|
834 | 848 | class templater(object): |
|
835 | 849 | |
|
836 | 850 | def __init__(self, mapfile, filters=None, defaults=None, cache=None, |
|
837 | 851 | minchunk=1024, maxchunk=65536): |
|
838 | 852 | '''set up template engine. |
|
839 | 853 | mapfile is name of file to read map definitions from. |
|
840 | 854 | filters is dict of functions. each transforms a value into another. |
|
841 | 855 | defaults is dict of default map definitions.''' |
|
842 | 856 | if filters is None: |
|
843 | 857 | filters = {} |
|
844 | 858 | if defaults is None: |
|
845 | 859 | defaults = {} |
|
846 | 860 | if cache is None: |
|
847 | 861 | cache = {} |
|
848 | 862 | self.mapfile = mapfile or 'template' |
|
849 | 863 | self.cache = cache.copy() |
|
850 | 864 | self.map = {} |
|
851 | 865 | if mapfile: |
|
852 | 866 | self.base = os.path.dirname(mapfile) |
|
853 | 867 | else: |
|
854 | 868 | self.base = '' |
|
855 | 869 | self.filters = templatefilters.filters.copy() |
|
856 | 870 | self.filters.update(filters) |
|
857 | 871 | self.defaults = defaults |
|
858 | 872 | self.minchunk, self.maxchunk = minchunk, maxchunk |
|
859 | 873 | self.ecache = {} |
|
860 | 874 | |
|
861 | 875 | if not mapfile: |
|
862 | 876 | return |
|
863 | 877 | if not os.path.exists(mapfile): |
|
864 | 878 | raise util.Abort(_("style '%s' not found") % mapfile, |
|
865 | 879 | hint=_("available styles: %s") % stylelist()) |
|
866 | 880 | |
|
867 | 881 | conf = config.config(includepaths=templatepaths()) |
|
868 | 882 | conf.read(mapfile) |
|
869 | 883 | |
|
870 | 884 | for key, val in conf[''].items(): |
|
871 | 885 | if not val: |
|
872 | 886 | raise SyntaxError(_('%s: missing value') % conf.source('', key)) |
|
873 | 887 | if val[0] in "'\"": |
|
874 | 888 | try: |
|
875 | 889 | self.cache[key] = unquotestring(val) |
|
876 | 890 | except SyntaxError as inst: |
|
877 | 891 | raise SyntaxError('%s: %s' % |
|
878 | 892 | (conf.source('', key), inst.args[0])) |
|
879 | 893 | else: |
|
880 | 894 | val = 'default', val |
|
881 | 895 | if ':' in val[1]: |
|
882 | 896 | val = val[1].split(':', 1) |
|
883 | 897 | self.map[key] = val[0], os.path.join(self.base, val[1]) |
|
884 | 898 | |
|
885 | 899 | def __contains__(self, key): |
|
886 | 900 | return key in self.cache or key in self.map |
|
887 | 901 | |
|
888 | 902 | def load(self, t): |
|
889 | 903 | '''Get the template for the given template name. Use a local cache.''' |
|
890 | 904 | if t not in self.cache: |
|
891 | 905 | try: |
|
892 | 906 | self.cache[t] = util.readfile(self.map[t][1]) |
|
893 | 907 | except KeyError as inst: |
|
894 | 908 | raise TemplateNotFound(_('"%s" not in template map') % |
|
895 | 909 | inst.args[0]) |
|
896 | 910 | except IOError as inst: |
|
897 | 911 | raise IOError(inst.args[0], _('template file %s: %s') % |
|
898 | 912 | (self.map[t][1], inst.args[1])) |
|
899 | 913 | return self.cache[t] |
|
900 | 914 | |
|
901 | 915 | def __call__(self, t, **mapping): |
|
902 | 916 | ttype = t in self.map and self.map[t][0] or 'default' |
|
903 | 917 | if ttype not in self.ecache: |
|
904 | 918 | self.ecache[ttype] = engines[ttype](self.load, |
|
905 | 919 | self.filters, self.defaults) |
|
906 | 920 | proc = self.ecache[ttype] |
|
907 | 921 | |
|
908 | 922 | stream = proc.process(t, mapping) |
|
909 | 923 | if self.minchunk: |
|
910 | 924 | stream = util.increasingchunks(stream, min=self.minchunk, |
|
911 | 925 | max=self.maxchunk) |
|
912 | 926 | return stream |
|
913 | 927 | |
|
914 | 928 | def templatepaths(): |
|
915 | 929 | '''return locations used for template files.''' |
|
916 | 930 | pathsrel = ['templates'] |
|
917 | 931 | paths = [os.path.normpath(os.path.join(util.datapath, f)) |
|
918 | 932 | for f in pathsrel] |
|
919 | 933 | return [p for p in paths if os.path.isdir(p)] |
|
920 | 934 | |
|
921 | 935 | def templatepath(name): |
|
922 | 936 | '''return location of template file. returns None if not found.''' |
|
923 | 937 | for p in templatepaths(): |
|
924 | 938 | f = os.path.join(p, name) |
|
925 | 939 | if os.path.exists(f): |
|
926 | 940 | return f |
|
927 | 941 | return None |
|
928 | 942 | |
|
929 | 943 | def stylemap(styles, paths=None): |
|
930 | 944 | """Return path to mapfile for a given style. |
|
931 | 945 | |
|
932 | 946 | Searches mapfile in the following locations: |
|
933 | 947 | 1. templatepath/style/map |
|
934 | 948 | 2. templatepath/map-style |
|
935 | 949 | 3. templatepath/map |
|
936 | 950 | """ |
|
937 | 951 | |
|
938 | 952 | if paths is None: |
|
939 | 953 | paths = templatepaths() |
|
940 | 954 | elif isinstance(paths, str): |
|
941 | 955 | paths = [paths] |
|
942 | 956 | |
|
943 | 957 | if isinstance(styles, str): |
|
944 | 958 | styles = [styles] |
|
945 | 959 | |
|
946 | 960 | for style in styles: |
|
947 | 961 | # only plain name is allowed to honor template paths |
|
948 | 962 | if (not style |
|
949 | 963 | or style in (os.curdir, os.pardir) |
|
950 | 964 | or os.sep in style |
|
951 | 965 | or os.altsep and os.altsep in style): |
|
952 | 966 | continue |
|
953 | 967 | locations = [os.path.join(style, 'map'), 'map-' + style] |
|
954 | 968 | locations.append('map') |
|
955 | 969 | |
|
956 | 970 | for path in paths: |
|
957 | 971 | for location in locations: |
|
958 | 972 | mapfile = os.path.join(path, location) |
|
959 | 973 | if os.path.isfile(mapfile): |
|
960 | 974 | return style, mapfile |
|
961 | 975 | |
|
962 | 976 | raise RuntimeError("No hgweb templates found in %r" % paths) |
|
963 | 977 | |
|
964 | 978 | # tell hggettext to extract docstrings from these functions: |
|
965 | 979 | i18nfunctions = funcs.values() |
@@ -1,3450 +1,3463 b'' | |||
|
1 | 1 | $ hg init a |
|
2 | 2 | $ cd a |
|
3 | 3 | $ echo a > a |
|
4 | 4 | $ hg add a |
|
5 | 5 | $ echo line 1 > b |
|
6 | 6 | $ echo line 2 >> b |
|
7 | 7 | $ hg commit -l b -d '1000000 0' -u 'User Name <user@hostname>' |
|
8 | 8 | |
|
9 | 9 | $ hg add b |
|
10 | 10 | $ echo other 1 > c |
|
11 | 11 | $ echo other 2 >> c |
|
12 | 12 | $ echo >> c |
|
13 | 13 | $ echo other 3 >> c |
|
14 | 14 | $ hg commit -l c -d '1100000 0' -u 'A. N. Other <other@place>' |
|
15 | 15 | |
|
16 | 16 | $ hg add c |
|
17 | 17 | $ hg commit -m 'no person' -d '1200000 0' -u 'other@place' |
|
18 | 18 | $ echo c >> c |
|
19 | 19 | $ hg commit -m 'no user, no domain' -d '1300000 0' -u 'person' |
|
20 | 20 | |
|
21 | 21 | $ echo foo > .hg/branch |
|
22 | 22 | $ hg commit -m 'new branch' -d '1400000 0' -u 'person' |
|
23 | 23 | |
|
24 | 24 | $ hg co -q 3 |
|
25 | 25 | $ echo other 4 >> d |
|
26 | 26 | $ hg add d |
|
27 | 27 | $ hg commit -m 'new head' -d '1500000 0' -u 'person' |
|
28 | 28 | |
|
29 | 29 | $ hg merge -q foo |
|
30 | 30 | $ hg commit -m 'merge' -d '1500001 0' -u 'person' |
|
31 | 31 | |
|
32 | 32 | Second branch starting at nullrev: |
|
33 | 33 | |
|
34 | 34 | $ hg update null |
|
35 | 35 | 0 files updated, 0 files merged, 4 files removed, 0 files unresolved |
|
36 | 36 | $ echo second > second |
|
37 | 37 | $ hg add second |
|
38 | 38 | $ hg commit -m second -d '1000000 0' -u 'User Name <user@hostname>' |
|
39 | 39 | created new head |
|
40 | 40 | |
|
41 | 41 | $ echo third > third |
|
42 | 42 | $ hg add third |
|
43 | 43 | $ hg mv second fourth |
|
44 | 44 | $ hg commit -m third -d "2020-01-01 10:01" |
|
45 | 45 | |
|
46 | 46 | $ hg log --template '{join(file_copies, ",\n")}\n' -r . |
|
47 | 47 | fourth (second) |
|
48 | 48 | $ hg log -T '{file_copies % "{source} -> {name}\n"}' -r . |
|
49 | 49 | second -> fourth |
|
50 | 50 | $ hg log -T '{rev} {ifcontains("fourth", file_copies, "t", "f")}\n' -r .:7 |
|
51 | 51 | 8 t |
|
52 | 52 | 7 f |
|
53 | 53 | |
|
54 | 54 | Working-directory revision has special identifiers, though they are still |
|
55 | 55 | experimental: |
|
56 | 56 | |
|
57 | 57 | $ hg log -r 'wdir()' -T '{rev}:{node}\n' |
|
58 | 58 | 2147483647:ffffffffffffffffffffffffffffffffffffffff |
|
59 | 59 | |
|
60 | 60 | Some keywords are invalid for working-directory revision, but they should |
|
61 | 61 | never cause crash: |
|
62 | 62 | |
|
63 | 63 | $ hg log -r 'wdir()' -T '{manifest}\n' |
|
64 | 64 | |
|
65 | 65 | |
|
66 | 66 | Quoting for ui.logtemplate |
|
67 | 67 | |
|
68 | 68 | $ hg tip --config "ui.logtemplate={rev}\n" |
|
69 | 69 | 8 |
|
70 | 70 | $ hg tip --config "ui.logtemplate='{rev}\n'" |
|
71 | 71 | 8 |
|
72 | 72 | $ hg tip --config 'ui.logtemplate="{rev}\n"' |
|
73 | 73 | 8 |
|
74 | 74 | |
|
75 | 75 | Make sure user/global hgrc does not affect tests |
|
76 | 76 | |
|
77 | 77 | $ echo '[ui]' > .hg/hgrc |
|
78 | 78 | $ echo 'logtemplate =' >> .hg/hgrc |
|
79 | 79 | $ echo 'style =' >> .hg/hgrc |
|
80 | 80 | |
|
81 | 81 | Add some simple styles to settings |
|
82 | 82 | |
|
83 | 83 | $ echo '[templates]' >> .hg/hgrc |
|
84 | 84 | $ printf 'simple = "{rev}\\n"\n' >> .hg/hgrc |
|
85 | 85 | $ printf 'simple2 = {rev}\\n\n' >> .hg/hgrc |
|
86 | 86 | |
|
87 | 87 | $ hg log -l1 -Tsimple |
|
88 | 88 | 8 |
|
89 | 89 | $ hg log -l1 -Tsimple2 |
|
90 | 90 | 8 |
|
91 | 91 | |
|
92 | 92 | Test templates and style maps in files: |
|
93 | 93 | |
|
94 | 94 | $ echo "{rev}" > tmpl |
|
95 | 95 | $ hg log -l1 -T./tmpl |
|
96 | 96 | 8 |
|
97 | 97 | $ hg log -l1 -Tblah/blah |
|
98 | 98 | blah/blah (no-eol) |
|
99 | 99 | |
|
100 | 100 | $ printf 'changeset = "{rev}\\n"\n' > map-simple |
|
101 | 101 | $ hg log -l1 -T./map-simple |
|
102 | 102 | 8 |
|
103 | 103 | |
|
104 | 104 | Template should precede style option |
|
105 | 105 | |
|
106 | 106 | $ hg log -l1 --style default -T '{rev}\n' |
|
107 | 107 | 8 |
|
108 | 108 | |
|
109 | 109 | Add a commit with empty description, to ensure that the templates |
|
110 | 110 | below will omit the description line. |
|
111 | 111 | |
|
112 | 112 | $ echo c >> c |
|
113 | 113 | $ hg add c |
|
114 | 114 | $ hg commit -qm ' ' |
|
115 | 115 | |
|
116 | 116 | Default style is like normal output. Phases style should be the same |
|
117 | 117 | as default style, except for extra phase lines. |
|
118 | 118 | |
|
119 | 119 | $ hg log > log.out |
|
120 | 120 | $ hg log --style default > style.out |
|
121 | 121 | $ cmp log.out style.out || diff -u log.out style.out |
|
122 | 122 | $ hg log -T phases > phases.out |
|
123 | 123 | $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@' |
|
124 | 124 | +phase: draft |
|
125 | 125 | +phase: draft |
|
126 | 126 | +phase: draft |
|
127 | 127 | +phase: draft |
|
128 | 128 | +phase: draft |
|
129 | 129 | +phase: draft |
|
130 | 130 | +phase: draft |
|
131 | 131 | +phase: draft |
|
132 | 132 | +phase: draft |
|
133 | 133 | +phase: draft |
|
134 | 134 | |
|
135 | 135 | $ hg log -v > log.out |
|
136 | 136 | $ hg log -v --style default > style.out |
|
137 | 137 | $ cmp log.out style.out || diff -u log.out style.out |
|
138 | 138 | $ hg log -v -T phases > phases.out |
|
139 | 139 | $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@' |
|
140 | 140 | +phase: draft |
|
141 | 141 | +phase: draft |
|
142 | 142 | +phase: draft |
|
143 | 143 | +phase: draft |
|
144 | 144 | +phase: draft |
|
145 | 145 | +phase: draft |
|
146 | 146 | +phase: draft |
|
147 | 147 | +phase: draft |
|
148 | 148 | +phase: draft |
|
149 | 149 | +phase: draft |
|
150 | 150 | |
|
151 | 151 | $ hg log -q > log.out |
|
152 | 152 | $ hg log -q --style default > style.out |
|
153 | 153 | $ cmp log.out style.out || diff -u log.out style.out |
|
154 | 154 | $ hg log -q -T phases > phases.out |
|
155 | 155 | $ cmp log.out phases.out || diff -u log.out phases.out |
|
156 | 156 | |
|
157 | 157 | $ hg log --debug > log.out |
|
158 | 158 | $ hg log --debug --style default > style.out |
|
159 | 159 | $ cmp log.out style.out || diff -u log.out style.out |
|
160 | 160 | $ hg log --debug -T phases > phases.out |
|
161 | 161 | $ cmp log.out phases.out || diff -u log.out phases.out |
|
162 | 162 | |
|
163 | 163 | Default style of working-directory revision should also be the same (but |
|
164 | 164 | date may change while running tests): |
|
165 | 165 | |
|
166 | 166 | $ hg log -r 'wdir()' | sed 's|^date:.*|date:|' > log.out |
|
167 | 167 | $ hg log -r 'wdir()' --style default | sed 's|^date:.*|date:|' > style.out |
|
168 | 168 | $ cmp log.out style.out || diff -u log.out style.out |
|
169 | 169 | |
|
170 | 170 | $ hg log -r 'wdir()' -v | sed 's|^date:.*|date:|' > log.out |
|
171 | 171 | $ hg log -r 'wdir()' -v --style default | sed 's|^date:.*|date:|' > style.out |
|
172 | 172 | $ cmp log.out style.out || diff -u log.out style.out |
|
173 | 173 | |
|
174 | 174 | $ hg log -r 'wdir()' -q > log.out |
|
175 | 175 | $ hg log -r 'wdir()' -q --style default > style.out |
|
176 | 176 | $ cmp log.out style.out || diff -u log.out style.out |
|
177 | 177 | |
|
178 | 178 | $ hg log -r 'wdir()' --debug | sed 's|^date:.*|date:|' > log.out |
|
179 | 179 | $ hg log -r 'wdir()' --debug --style default \ |
|
180 | 180 | > | sed 's|^date:.*|date:|' > style.out |
|
181 | 181 | $ cmp log.out style.out || diff -u log.out style.out |
|
182 | 182 | |
|
183 | 183 | Default style should also preserve color information (issue2866): |
|
184 | 184 | |
|
185 | 185 | $ cp $HGRCPATH $HGRCPATH-bak |
|
186 | 186 | $ cat <<EOF >> $HGRCPATH |
|
187 | 187 | > [extensions] |
|
188 | 188 | > color= |
|
189 | 189 | > EOF |
|
190 | 190 | |
|
191 | 191 | $ hg --color=debug log > log.out |
|
192 | 192 | $ hg --color=debug log --style default > style.out |
|
193 | 193 | $ cmp log.out style.out || diff -u log.out style.out |
|
194 | 194 | $ hg --color=debug log -T phases > phases.out |
|
195 | 195 | $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@' |
|
196 | 196 | +[log.phase|phase: draft] |
|
197 | 197 | +[log.phase|phase: draft] |
|
198 | 198 | +[log.phase|phase: draft] |
|
199 | 199 | +[log.phase|phase: draft] |
|
200 | 200 | +[log.phase|phase: draft] |
|
201 | 201 | +[log.phase|phase: draft] |
|
202 | 202 | +[log.phase|phase: draft] |
|
203 | 203 | +[log.phase|phase: draft] |
|
204 | 204 | +[log.phase|phase: draft] |
|
205 | 205 | +[log.phase|phase: draft] |
|
206 | 206 | |
|
207 | 207 | $ hg --color=debug -v log > log.out |
|
208 | 208 | $ hg --color=debug -v log --style default > style.out |
|
209 | 209 | $ cmp log.out style.out || diff -u log.out style.out |
|
210 | 210 | $ hg --color=debug -v log -T phases > phases.out |
|
211 | 211 | $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@' |
|
212 | 212 | +[log.phase|phase: draft] |
|
213 | 213 | +[log.phase|phase: draft] |
|
214 | 214 | +[log.phase|phase: draft] |
|
215 | 215 | +[log.phase|phase: draft] |
|
216 | 216 | +[log.phase|phase: draft] |
|
217 | 217 | +[log.phase|phase: draft] |
|
218 | 218 | +[log.phase|phase: draft] |
|
219 | 219 | +[log.phase|phase: draft] |
|
220 | 220 | +[log.phase|phase: draft] |
|
221 | 221 | +[log.phase|phase: draft] |
|
222 | 222 | |
|
223 | 223 | $ hg --color=debug -q log > log.out |
|
224 | 224 | $ hg --color=debug -q log --style default > style.out |
|
225 | 225 | $ cmp log.out style.out || diff -u log.out style.out |
|
226 | 226 | $ hg --color=debug -q log -T phases > phases.out |
|
227 | 227 | $ cmp log.out phases.out || diff -u log.out phases.out |
|
228 | 228 | |
|
229 | 229 | $ hg --color=debug --debug log > log.out |
|
230 | 230 | $ hg --color=debug --debug log --style default > style.out |
|
231 | 231 | $ cmp log.out style.out || diff -u log.out style.out |
|
232 | 232 | $ hg --color=debug --debug log -T phases > phases.out |
|
233 | 233 | $ cmp log.out phases.out || diff -u log.out phases.out |
|
234 | 234 | |
|
235 | 235 | $ mv $HGRCPATH-bak $HGRCPATH |
|
236 | 236 | |
|
237 | 237 | Remove commit with empty commit message, so as to not pollute further |
|
238 | 238 | tests. |
|
239 | 239 | |
|
240 | 240 | $ hg --config extensions.strip= strip -q . |
|
241 | 241 | |
|
242 | 242 | Revision with no copies (used to print a traceback): |
|
243 | 243 | |
|
244 | 244 | $ hg tip -v --template '\n' |
|
245 | 245 | |
|
246 | 246 | |
|
247 | 247 | Compact style works: |
|
248 | 248 | |
|
249 | 249 | $ hg log -Tcompact |
|
250 | 250 | 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test |
|
251 | 251 | third |
|
252 | 252 | |
|
253 | 253 | 7:-1 29114dbae42b 1970-01-12 13:46 +0000 user |
|
254 | 254 | second |
|
255 | 255 | |
|
256 | 256 | 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person |
|
257 | 257 | merge |
|
258 | 258 | |
|
259 | 259 | 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person |
|
260 | 260 | new head |
|
261 | 261 | |
|
262 | 262 | 4 bbe44766e73d 1970-01-17 04:53 +0000 person |
|
263 | 263 | new branch |
|
264 | 264 | |
|
265 | 265 | 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person |
|
266 | 266 | no user, no domain |
|
267 | 267 | |
|
268 | 268 | 2 97054abb4ab8 1970-01-14 21:20 +0000 other |
|
269 | 269 | no person |
|
270 | 270 | |
|
271 | 271 | 1 b608e9d1a3f0 1970-01-13 17:33 +0000 other |
|
272 | 272 | other 1 |
|
273 | 273 | |
|
274 | 274 | 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 user |
|
275 | 275 | line 1 |
|
276 | 276 | |
|
277 | 277 | |
|
278 | 278 | $ hg log -v --style compact |
|
279 | 279 | 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test |
|
280 | 280 | third |
|
281 | 281 | |
|
282 | 282 | 7:-1 29114dbae42b 1970-01-12 13:46 +0000 User Name <user@hostname> |
|
283 | 283 | second |
|
284 | 284 | |
|
285 | 285 | 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person |
|
286 | 286 | merge |
|
287 | 287 | |
|
288 | 288 | 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person |
|
289 | 289 | new head |
|
290 | 290 | |
|
291 | 291 | 4 bbe44766e73d 1970-01-17 04:53 +0000 person |
|
292 | 292 | new branch |
|
293 | 293 | |
|
294 | 294 | 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person |
|
295 | 295 | no user, no domain |
|
296 | 296 | |
|
297 | 297 | 2 97054abb4ab8 1970-01-14 21:20 +0000 other@place |
|
298 | 298 | no person |
|
299 | 299 | |
|
300 | 300 | 1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other <other@place> |
|
301 | 301 | other 1 |
|
302 | 302 | other 2 |
|
303 | 303 | |
|
304 | 304 | other 3 |
|
305 | 305 | |
|
306 | 306 | 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name <user@hostname> |
|
307 | 307 | line 1 |
|
308 | 308 | line 2 |
|
309 | 309 | |
|
310 | 310 | |
|
311 | 311 | $ hg log --debug --style compact |
|
312 | 312 | 8[tip]:7,-1 95c24699272e 2020-01-01 10:01 +0000 test |
|
313 | 313 | third |
|
314 | 314 | |
|
315 | 315 | 7:-1,-1 29114dbae42b 1970-01-12 13:46 +0000 User Name <user@hostname> |
|
316 | 316 | second |
|
317 | 317 | |
|
318 | 318 | 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person |
|
319 | 319 | merge |
|
320 | 320 | |
|
321 | 321 | 5:3,-1 13207e5a10d9 1970-01-18 08:40 +0000 person |
|
322 | 322 | new head |
|
323 | 323 | |
|
324 | 324 | 4:3,-1 bbe44766e73d 1970-01-17 04:53 +0000 person |
|
325 | 325 | new branch |
|
326 | 326 | |
|
327 | 327 | 3:2,-1 10e46f2dcbf4 1970-01-16 01:06 +0000 person |
|
328 | 328 | no user, no domain |
|
329 | 329 | |
|
330 | 330 | 2:1,-1 97054abb4ab8 1970-01-14 21:20 +0000 other@place |
|
331 | 331 | no person |
|
332 | 332 | |
|
333 | 333 | 1:0,-1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other <other@place> |
|
334 | 334 | other 1 |
|
335 | 335 | other 2 |
|
336 | 336 | |
|
337 | 337 | other 3 |
|
338 | 338 | |
|
339 | 339 | 0:-1,-1 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name <user@hostname> |
|
340 | 340 | line 1 |
|
341 | 341 | line 2 |
|
342 | 342 | |
|
343 | 343 | |
|
344 | 344 | Test xml styles: |
|
345 | 345 | |
|
346 | 346 | $ hg log --style xml -r 'not all()' |
|
347 | 347 | <?xml version="1.0"?> |
|
348 | 348 | <log> |
|
349 | 349 | </log> |
|
350 | 350 | |
|
351 | 351 | $ hg log --style xml |
|
352 | 352 | <?xml version="1.0"?> |
|
353 | 353 | <log> |
|
354 | 354 | <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a"> |
|
355 | 355 | <tag>tip</tag> |
|
356 | 356 | <author email="test">test</author> |
|
357 | 357 | <date>2020-01-01T10:01:00+00:00</date> |
|
358 | 358 | <msg xml:space="preserve">third</msg> |
|
359 | 359 | </logentry> |
|
360 | 360 | <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453"> |
|
361 | 361 | <parent revision="-1" node="0000000000000000000000000000000000000000" /> |
|
362 | 362 | <author email="user@hostname">User Name</author> |
|
363 | 363 | <date>1970-01-12T13:46:40+00:00</date> |
|
364 | 364 | <msg xml:space="preserve">second</msg> |
|
365 | 365 | </logentry> |
|
366 | 366 | <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b"> |
|
367 | 367 | <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" /> |
|
368 | 368 | <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" /> |
|
369 | 369 | <author email="person">person</author> |
|
370 | 370 | <date>1970-01-18T08:40:01+00:00</date> |
|
371 | 371 | <msg xml:space="preserve">merge</msg> |
|
372 | 372 | </logentry> |
|
373 | 373 | <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f"> |
|
374 | 374 | <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" /> |
|
375 | 375 | <author email="person">person</author> |
|
376 | 376 | <date>1970-01-18T08:40:00+00:00</date> |
|
377 | 377 | <msg xml:space="preserve">new head</msg> |
|
378 | 378 | </logentry> |
|
379 | 379 | <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74"> |
|
380 | 380 | <branch>foo</branch> |
|
381 | 381 | <author email="person">person</author> |
|
382 | 382 | <date>1970-01-17T04:53:20+00:00</date> |
|
383 | 383 | <msg xml:space="preserve">new branch</msg> |
|
384 | 384 | </logentry> |
|
385 | 385 | <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47"> |
|
386 | 386 | <author email="person">person</author> |
|
387 | 387 | <date>1970-01-16T01:06:40+00:00</date> |
|
388 | 388 | <msg xml:space="preserve">no user, no domain</msg> |
|
389 | 389 | </logentry> |
|
390 | 390 | <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465"> |
|
391 | 391 | <author email="other@place">other</author> |
|
392 | 392 | <date>1970-01-14T21:20:00+00:00</date> |
|
393 | 393 | <msg xml:space="preserve">no person</msg> |
|
394 | 394 | </logentry> |
|
395 | 395 | <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965"> |
|
396 | 396 | <author email="other@place">A. N. Other</author> |
|
397 | 397 | <date>1970-01-13T17:33:20+00:00</date> |
|
398 | 398 | <msg xml:space="preserve">other 1 |
|
399 | 399 | other 2 |
|
400 | 400 | |
|
401 | 401 | other 3</msg> |
|
402 | 402 | </logentry> |
|
403 | 403 | <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f"> |
|
404 | 404 | <author email="user@hostname">User Name</author> |
|
405 | 405 | <date>1970-01-12T13:46:40+00:00</date> |
|
406 | 406 | <msg xml:space="preserve">line 1 |
|
407 | 407 | line 2</msg> |
|
408 | 408 | </logentry> |
|
409 | 409 | </log> |
|
410 | 410 | |
|
411 | 411 | $ hg log -v --style xml |
|
412 | 412 | <?xml version="1.0"?> |
|
413 | 413 | <log> |
|
414 | 414 | <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a"> |
|
415 | 415 | <tag>tip</tag> |
|
416 | 416 | <author email="test">test</author> |
|
417 | 417 | <date>2020-01-01T10:01:00+00:00</date> |
|
418 | 418 | <msg xml:space="preserve">third</msg> |
|
419 | 419 | <paths> |
|
420 | 420 | <path action="A">fourth</path> |
|
421 | 421 | <path action="A">third</path> |
|
422 | 422 | <path action="R">second</path> |
|
423 | 423 | </paths> |
|
424 | 424 | <copies> |
|
425 | 425 | <copy source="second">fourth</copy> |
|
426 | 426 | </copies> |
|
427 | 427 | </logentry> |
|
428 | 428 | <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453"> |
|
429 | 429 | <parent revision="-1" node="0000000000000000000000000000000000000000" /> |
|
430 | 430 | <author email="user@hostname">User Name</author> |
|
431 | 431 | <date>1970-01-12T13:46:40+00:00</date> |
|
432 | 432 | <msg xml:space="preserve">second</msg> |
|
433 | 433 | <paths> |
|
434 | 434 | <path action="A">second</path> |
|
435 | 435 | </paths> |
|
436 | 436 | </logentry> |
|
437 | 437 | <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b"> |
|
438 | 438 | <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" /> |
|
439 | 439 | <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" /> |
|
440 | 440 | <author email="person">person</author> |
|
441 | 441 | <date>1970-01-18T08:40:01+00:00</date> |
|
442 | 442 | <msg xml:space="preserve">merge</msg> |
|
443 | 443 | <paths> |
|
444 | 444 | </paths> |
|
445 | 445 | </logentry> |
|
446 | 446 | <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f"> |
|
447 | 447 | <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" /> |
|
448 | 448 | <author email="person">person</author> |
|
449 | 449 | <date>1970-01-18T08:40:00+00:00</date> |
|
450 | 450 | <msg xml:space="preserve">new head</msg> |
|
451 | 451 | <paths> |
|
452 | 452 | <path action="A">d</path> |
|
453 | 453 | </paths> |
|
454 | 454 | </logentry> |
|
455 | 455 | <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74"> |
|
456 | 456 | <branch>foo</branch> |
|
457 | 457 | <author email="person">person</author> |
|
458 | 458 | <date>1970-01-17T04:53:20+00:00</date> |
|
459 | 459 | <msg xml:space="preserve">new branch</msg> |
|
460 | 460 | <paths> |
|
461 | 461 | </paths> |
|
462 | 462 | </logentry> |
|
463 | 463 | <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47"> |
|
464 | 464 | <author email="person">person</author> |
|
465 | 465 | <date>1970-01-16T01:06:40+00:00</date> |
|
466 | 466 | <msg xml:space="preserve">no user, no domain</msg> |
|
467 | 467 | <paths> |
|
468 | 468 | <path action="M">c</path> |
|
469 | 469 | </paths> |
|
470 | 470 | </logentry> |
|
471 | 471 | <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465"> |
|
472 | 472 | <author email="other@place">other</author> |
|
473 | 473 | <date>1970-01-14T21:20:00+00:00</date> |
|
474 | 474 | <msg xml:space="preserve">no person</msg> |
|
475 | 475 | <paths> |
|
476 | 476 | <path action="A">c</path> |
|
477 | 477 | </paths> |
|
478 | 478 | </logentry> |
|
479 | 479 | <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965"> |
|
480 | 480 | <author email="other@place">A. N. Other</author> |
|
481 | 481 | <date>1970-01-13T17:33:20+00:00</date> |
|
482 | 482 | <msg xml:space="preserve">other 1 |
|
483 | 483 | other 2 |
|
484 | 484 | |
|
485 | 485 | other 3</msg> |
|
486 | 486 | <paths> |
|
487 | 487 | <path action="A">b</path> |
|
488 | 488 | </paths> |
|
489 | 489 | </logentry> |
|
490 | 490 | <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f"> |
|
491 | 491 | <author email="user@hostname">User Name</author> |
|
492 | 492 | <date>1970-01-12T13:46:40+00:00</date> |
|
493 | 493 | <msg xml:space="preserve">line 1 |
|
494 | 494 | line 2</msg> |
|
495 | 495 | <paths> |
|
496 | 496 | <path action="A">a</path> |
|
497 | 497 | </paths> |
|
498 | 498 | </logentry> |
|
499 | 499 | </log> |
|
500 | 500 | |
|
501 | 501 | $ hg log --debug --style xml |
|
502 | 502 | <?xml version="1.0"?> |
|
503 | 503 | <log> |
|
504 | 504 | <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a"> |
|
505 | 505 | <tag>tip</tag> |
|
506 | 506 | <parent revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453" /> |
|
507 | 507 | <parent revision="-1" node="0000000000000000000000000000000000000000" /> |
|
508 | 508 | <author email="test">test</author> |
|
509 | 509 | <date>2020-01-01T10:01:00+00:00</date> |
|
510 | 510 | <msg xml:space="preserve">third</msg> |
|
511 | 511 | <paths> |
|
512 | 512 | <path action="A">fourth</path> |
|
513 | 513 | <path action="A">third</path> |
|
514 | 514 | <path action="R">second</path> |
|
515 | 515 | </paths> |
|
516 | 516 | <copies> |
|
517 | 517 | <copy source="second">fourth</copy> |
|
518 | 518 | </copies> |
|
519 | 519 | <extra key="branch">default</extra> |
|
520 | 520 | </logentry> |
|
521 | 521 | <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453"> |
|
522 | 522 | <parent revision="-1" node="0000000000000000000000000000000000000000" /> |
|
523 | 523 | <parent revision="-1" node="0000000000000000000000000000000000000000" /> |
|
524 | 524 | <author email="user@hostname">User Name</author> |
|
525 | 525 | <date>1970-01-12T13:46:40+00:00</date> |
|
526 | 526 | <msg xml:space="preserve">second</msg> |
|
527 | 527 | <paths> |
|
528 | 528 | <path action="A">second</path> |
|
529 | 529 | </paths> |
|
530 | 530 | <extra key="branch">default</extra> |
|
531 | 531 | </logentry> |
|
532 | 532 | <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b"> |
|
533 | 533 | <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" /> |
|
534 | 534 | <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" /> |
|
535 | 535 | <author email="person">person</author> |
|
536 | 536 | <date>1970-01-18T08:40:01+00:00</date> |
|
537 | 537 | <msg xml:space="preserve">merge</msg> |
|
538 | 538 | <paths> |
|
539 | 539 | </paths> |
|
540 | 540 | <extra key="branch">default</extra> |
|
541 | 541 | </logentry> |
|
542 | 542 | <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f"> |
|
543 | 543 | <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" /> |
|
544 | 544 | <parent revision="-1" node="0000000000000000000000000000000000000000" /> |
|
545 | 545 | <author email="person">person</author> |
|
546 | 546 | <date>1970-01-18T08:40:00+00:00</date> |
|
547 | 547 | <msg xml:space="preserve">new head</msg> |
|
548 | 548 | <paths> |
|
549 | 549 | <path action="A">d</path> |
|
550 | 550 | </paths> |
|
551 | 551 | <extra key="branch">default</extra> |
|
552 | 552 | </logentry> |
|
553 | 553 | <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74"> |
|
554 | 554 | <branch>foo</branch> |
|
555 | 555 | <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" /> |
|
556 | 556 | <parent revision="-1" node="0000000000000000000000000000000000000000" /> |
|
557 | 557 | <author email="person">person</author> |
|
558 | 558 | <date>1970-01-17T04:53:20+00:00</date> |
|
559 | 559 | <msg xml:space="preserve">new branch</msg> |
|
560 | 560 | <paths> |
|
561 | 561 | </paths> |
|
562 | 562 | <extra key="branch">foo</extra> |
|
563 | 563 | </logentry> |
|
564 | 564 | <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47"> |
|
565 | 565 | <parent revision="2" node="97054abb4ab824450e9164180baf491ae0078465" /> |
|
566 | 566 | <parent revision="-1" node="0000000000000000000000000000000000000000" /> |
|
567 | 567 | <author email="person">person</author> |
|
568 | 568 | <date>1970-01-16T01:06:40+00:00</date> |
|
569 | 569 | <msg xml:space="preserve">no user, no domain</msg> |
|
570 | 570 | <paths> |
|
571 | 571 | <path action="M">c</path> |
|
572 | 572 | </paths> |
|
573 | 573 | <extra key="branch">default</extra> |
|
574 | 574 | </logentry> |
|
575 | 575 | <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465"> |
|
576 | 576 | <parent revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965" /> |
|
577 | 577 | <parent revision="-1" node="0000000000000000000000000000000000000000" /> |
|
578 | 578 | <author email="other@place">other</author> |
|
579 | 579 | <date>1970-01-14T21:20:00+00:00</date> |
|
580 | 580 | <msg xml:space="preserve">no person</msg> |
|
581 | 581 | <paths> |
|
582 | 582 | <path action="A">c</path> |
|
583 | 583 | </paths> |
|
584 | 584 | <extra key="branch">default</extra> |
|
585 | 585 | </logentry> |
|
586 | 586 | <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965"> |
|
587 | 587 | <parent revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f" /> |
|
588 | 588 | <parent revision="-1" node="0000000000000000000000000000000000000000" /> |
|
589 | 589 | <author email="other@place">A. N. Other</author> |
|
590 | 590 | <date>1970-01-13T17:33:20+00:00</date> |
|
591 | 591 | <msg xml:space="preserve">other 1 |
|
592 | 592 | other 2 |
|
593 | 593 | |
|
594 | 594 | other 3</msg> |
|
595 | 595 | <paths> |
|
596 | 596 | <path action="A">b</path> |
|
597 | 597 | </paths> |
|
598 | 598 | <extra key="branch">default</extra> |
|
599 | 599 | </logentry> |
|
600 | 600 | <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f"> |
|
601 | 601 | <parent revision="-1" node="0000000000000000000000000000000000000000" /> |
|
602 | 602 | <parent revision="-1" node="0000000000000000000000000000000000000000" /> |
|
603 | 603 | <author email="user@hostname">User Name</author> |
|
604 | 604 | <date>1970-01-12T13:46:40+00:00</date> |
|
605 | 605 | <msg xml:space="preserve">line 1 |
|
606 | 606 | line 2</msg> |
|
607 | 607 | <paths> |
|
608 | 608 | <path action="A">a</path> |
|
609 | 609 | </paths> |
|
610 | 610 | <extra key="branch">default</extra> |
|
611 | 611 | </logentry> |
|
612 | 612 | </log> |
|
613 | 613 | |
|
614 | 614 | |
|
615 | 615 | Test JSON style: |
|
616 | 616 | |
|
617 | 617 | $ hg log -k nosuch -Tjson |
|
618 | 618 | [] |
|
619 | 619 | |
|
620 | 620 | $ hg log -qr . -Tjson |
|
621 | 621 | [ |
|
622 | 622 | { |
|
623 | 623 | "rev": 8, |
|
624 | 624 | "node": "95c24699272ef57d062b8bccc32c878bf841784a" |
|
625 | 625 | } |
|
626 | 626 | ] |
|
627 | 627 | |
|
628 | 628 | $ hg log -vpr . -Tjson --stat |
|
629 | 629 | [ |
|
630 | 630 | { |
|
631 | 631 | "rev": 8, |
|
632 | 632 | "node": "95c24699272ef57d062b8bccc32c878bf841784a", |
|
633 | 633 | "branch": "default", |
|
634 | 634 | "phase": "draft", |
|
635 | 635 | "user": "test", |
|
636 | 636 | "date": [1577872860, 0], |
|
637 | 637 | "desc": "third", |
|
638 | 638 | "bookmarks": [], |
|
639 | 639 | "tags": ["tip"], |
|
640 | 640 | "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"], |
|
641 | 641 | "files": ["fourth", "second", "third"], |
|
642 | 642 | "diffstat": " fourth | 1 +\n second | 1 -\n third | 1 +\n 3 files changed, 2 insertions(+), 1 deletions(-)\n", |
|
643 | 643 | "diff": "diff -r 29114dbae42b -r 95c24699272e fourth\n--- /dev/null\tThu Jan 01 00:00:00 1970 +0000\n+++ b/fourth\tWed Jan 01 10:01:00 2020 +0000\n@@ -0,0 +1,1 @@\n+second\ndiff -r 29114dbae42b -r 95c24699272e second\n--- a/second\tMon Jan 12 13:46:40 1970 +0000\n+++ /dev/null\tThu Jan 01 00:00:00 1970 +0000\n@@ -1,1 +0,0 @@\n-second\ndiff -r 29114dbae42b -r 95c24699272e third\n--- /dev/null\tThu Jan 01 00:00:00 1970 +0000\n+++ b/third\tWed Jan 01 10:01:00 2020 +0000\n@@ -0,0 +1,1 @@\n+third\n" |
|
644 | 644 | } |
|
645 | 645 | ] |
|
646 | 646 | |
|
647 | 647 | honor --git but not format-breaking diffopts |
|
648 | 648 | $ hg --config diff.noprefix=True log --git -vpr . -Tjson |
|
649 | 649 | [ |
|
650 | 650 | { |
|
651 | 651 | "rev": 8, |
|
652 | 652 | "node": "95c24699272ef57d062b8bccc32c878bf841784a", |
|
653 | 653 | "branch": "default", |
|
654 | 654 | "phase": "draft", |
|
655 | 655 | "user": "test", |
|
656 | 656 | "date": [1577872860, 0], |
|
657 | 657 | "desc": "third", |
|
658 | 658 | "bookmarks": [], |
|
659 | 659 | "tags": ["tip"], |
|
660 | 660 | "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"], |
|
661 | 661 | "files": ["fourth", "second", "third"], |
|
662 | 662 | "diff": "diff --git a/second b/fourth\nrename from second\nrename to fourth\ndiff --git a/third b/third\nnew file mode 100644\n--- /dev/null\n+++ b/third\n@@ -0,0 +1,1 @@\n+third\n" |
|
663 | 663 | } |
|
664 | 664 | ] |
|
665 | 665 | |
|
666 | 666 | $ hg log -T json |
|
667 | 667 | [ |
|
668 | 668 | { |
|
669 | 669 | "rev": 8, |
|
670 | 670 | "node": "95c24699272ef57d062b8bccc32c878bf841784a", |
|
671 | 671 | "branch": "default", |
|
672 | 672 | "phase": "draft", |
|
673 | 673 | "user": "test", |
|
674 | 674 | "date": [1577872860, 0], |
|
675 | 675 | "desc": "third", |
|
676 | 676 | "bookmarks": [], |
|
677 | 677 | "tags": ["tip"], |
|
678 | 678 | "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"] |
|
679 | 679 | }, |
|
680 | 680 | { |
|
681 | 681 | "rev": 7, |
|
682 | 682 | "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453", |
|
683 | 683 | "branch": "default", |
|
684 | 684 | "phase": "draft", |
|
685 | 685 | "user": "User Name <user@hostname>", |
|
686 | 686 | "date": [1000000, 0], |
|
687 | 687 | "desc": "second", |
|
688 | 688 | "bookmarks": [], |
|
689 | 689 | "tags": [], |
|
690 | 690 | "parents": ["0000000000000000000000000000000000000000"] |
|
691 | 691 | }, |
|
692 | 692 | { |
|
693 | 693 | "rev": 6, |
|
694 | 694 | "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b", |
|
695 | 695 | "branch": "default", |
|
696 | 696 | "phase": "draft", |
|
697 | 697 | "user": "person", |
|
698 | 698 | "date": [1500001, 0], |
|
699 | 699 | "desc": "merge", |
|
700 | 700 | "bookmarks": [], |
|
701 | 701 | "tags": [], |
|
702 | 702 | "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"] |
|
703 | 703 | }, |
|
704 | 704 | { |
|
705 | 705 | "rev": 5, |
|
706 | 706 | "node": "13207e5a10d9fd28ec424934298e176197f2c67f", |
|
707 | 707 | "branch": "default", |
|
708 | 708 | "phase": "draft", |
|
709 | 709 | "user": "person", |
|
710 | 710 | "date": [1500000, 0], |
|
711 | 711 | "desc": "new head", |
|
712 | 712 | "bookmarks": [], |
|
713 | 713 | "tags": [], |
|
714 | 714 | "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"] |
|
715 | 715 | }, |
|
716 | 716 | { |
|
717 | 717 | "rev": 4, |
|
718 | 718 | "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74", |
|
719 | 719 | "branch": "foo", |
|
720 | 720 | "phase": "draft", |
|
721 | 721 | "user": "person", |
|
722 | 722 | "date": [1400000, 0], |
|
723 | 723 | "desc": "new branch", |
|
724 | 724 | "bookmarks": [], |
|
725 | 725 | "tags": [], |
|
726 | 726 | "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"] |
|
727 | 727 | }, |
|
728 | 728 | { |
|
729 | 729 | "rev": 3, |
|
730 | 730 | "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47", |
|
731 | 731 | "branch": "default", |
|
732 | 732 | "phase": "draft", |
|
733 | 733 | "user": "person", |
|
734 | 734 | "date": [1300000, 0], |
|
735 | 735 | "desc": "no user, no domain", |
|
736 | 736 | "bookmarks": [], |
|
737 | 737 | "tags": [], |
|
738 | 738 | "parents": ["97054abb4ab824450e9164180baf491ae0078465"] |
|
739 | 739 | }, |
|
740 | 740 | { |
|
741 | 741 | "rev": 2, |
|
742 | 742 | "node": "97054abb4ab824450e9164180baf491ae0078465", |
|
743 | 743 | "branch": "default", |
|
744 | 744 | "phase": "draft", |
|
745 | 745 | "user": "other@place", |
|
746 | 746 | "date": [1200000, 0], |
|
747 | 747 | "desc": "no person", |
|
748 | 748 | "bookmarks": [], |
|
749 | 749 | "tags": [], |
|
750 | 750 | "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"] |
|
751 | 751 | }, |
|
752 | 752 | { |
|
753 | 753 | "rev": 1, |
|
754 | 754 | "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965", |
|
755 | 755 | "branch": "default", |
|
756 | 756 | "phase": "draft", |
|
757 | 757 | "user": "A. N. Other <other@place>", |
|
758 | 758 | "date": [1100000, 0], |
|
759 | 759 | "desc": "other 1\nother 2\n\nother 3", |
|
760 | 760 | "bookmarks": [], |
|
761 | 761 | "tags": [], |
|
762 | 762 | "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"] |
|
763 | 763 | }, |
|
764 | 764 | { |
|
765 | 765 | "rev": 0, |
|
766 | 766 | "node": "1e4e1b8f71e05681d422154f5421e385fec3454f", |
|
767 | 767 | "branch": "default", |
|
768 | 768 | "phase": "draft", |
|
769 | 769 | "user": "User Name <user@hostname>", |
|
770 | 770 | "date": [1000000, 0], |
|
771 | 771 | "desc": "line 1\nline 2", |
|
772 | 772 | "bookmarks": [], |
|
773 | 773 | "tags": [], |
|
774 | 774 | "parents": ["0000000000000000000000000000000000000000"] |
|
775 | 775 | } |
|
776 | 776 | ] |
|
777 | 777 | |
|
778 | 778 | $ hg heads -v -Tjson |
|
779 | 779 | [ |
|
780 | 780 | { |
|
781 | 781 | "rev": 8, |
|
782 | 782 | "node": "95c24699272ef57d062b8bccc32c878bf841784a", |
|
783 | 783 | "branch": "default", |
|
784 | 784 | "phase": "draft", |
|
785 | 785 | "user": "test", |
|
786 | 786 | "date": [1577872860, 0], |
|
787 | 787 | "desc": "third", |
|
788 | 788 | "bookmarks": [], |
|
789 | 789 | "tags": ["tip"], |
|
790 | 790 | "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"], |
|
791 | 791 | "files": ["fourth", "second", "third"] |
|
792 | 792 | }, |
|
793 | 793 | { |
|
794 | 794 | "rev": 6, |
|
795 | 795 | "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b", |
|
796 | 796 | "branch": "default", |
|
797 | 797 | "phase": "draft", |
|
798 | 798 | "user": "person", |
|
799 | 799 | "date": [1500001, 0], |
|
800 | 800 | "desc": "merge", |
|
801 | 801 | "bookmarks": [], |
|
802 | 802 | "tags": [], |
|
803 | 803 | "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"], |
|
804 | 804 | "files": [] |
|
805 | 805 | }, |
|
806 | 806 | { |
|
807 | 807 | "rev": 4, |
|
808 | 808 | "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74", |
|
809 | 809 | "branch": "foo", |
|
810 | 810 | "phase": "draft", |
|
811 | 811 | "user": "person", |
|
812 | 812 | "date": [1400000, 0], |
|
813 | 813 | "desc": "new branch", |
|
814 | 814 | "bookmarks": [], |
|
815 | 815 | "tags": [], |
|
816 | 816 | "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"], |
|
817 | 817 | "files": [] |
|
818 | 818 | } |
|
819 | 819 | ] |
|
820 | 820 | |
|
821 | 821 | $ hg log --debug -Tjson |
|
822 | 822 | [ |
|
823 | 823 | { |
|
824 | 824 | "rev": 8, |
|
825 | 825 | "node": "95c24699272ef57d062b8bccc32c878bf841784a", |
|
826 | 826 | "branch": "default", |
|
827 | 827 | "phase": "draft", |
|
828 | 828 | "user": "test", |
|
829 | 829 | "date": [1577872860, 0], |
|
830 | 830 | "desc": "third", |
|
831 | 831 | "bookmarks": [], |
|
832 | 832 | "tags": ["tip"], |
|
833 | 833 | "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"], |
|
834 | 834 | "manifest": "94961b75a2da554b4df6fb599e5bfc7d48de0c64", |
|
835 | 835 | "extra": {"branch": "default"}, |
|
836 | 836 | "modified": [], |
|
837 | 837 | "added": ["fourth", "third"], |
|
838 | 838 | "removed": ["second"] |
|
839 | 839 | }, |
|
840 | 840 | { |
|
841 | 841 | "rev": 7, |
|
842 | 842 | "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453", |
|
843 | 843 | "branch": "default", |
|
844 | 844 | "phase": "draft", |
|
845 | 845 | "user": "User Name <user@hostname>", |
|
846 | 846 | "date": [1000000, 0], |
|
847 | 847 | "desc": "second", |
|
848 | 848 | "bookmarks": [], |
|
849 | 849 | "tags": [], |
|
850 | 850 | "parents": ["0000000000000000000000000000000000000000"], |
|
851 | 851 | "manifest": "f2dbc354b94e5ec0b4f10680ee0cee816101d0bf", |
|
852 | 852 | "extra": {"branch": "default"}, |
|
853 | 853 | "modified": [], |
|
854 | 854 | "added": ["second"], |
|
855 | 855 | "removed": [] |
|
856 | 856 | }, |
|
857 | 857 | { |
|
858 | 858 | "rev": 6, |
|
859 | 859 | "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b", |
|
860 | 860 | "branch": "default", |
|
861 | 861 | "phase": "draft", |
|
862 | 862 | "user": "person", |
|
863 | 863 | "date": [1500001, 0], |
|
864 | 864 | "desc": "merge", |
|
865 | 865 | "bookmarks": [], |
|
866 | 866 | "tags": [], |
|
867 | 867 | "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"], |
|
868 | 868 | "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216", |
|
869 | 869 | "extra": {"branch": "default"}, |
|
870 | 870 | "modified": [], |
|
871 | 871 | "added": [], |
|
872 | 872 | "removed": [] |
|
873 | 873 | }, |
|
874 | 874 | { |
|
875 | 875 | "rev": 5, |
|
876 | 876 | "node": "13207e5a10d9fd28ec424934298e176197f2c67f", |
|
877 | 877 | "branch": "default", |
|
878 | 878 | "phase": "draft", |
|
879 | 879 | "user": "person", |
|
880 | 880 | "date": [1500000, 0], |
|
881 | 881 | "desc": "new head", |
|
882 | 882 | "bookmarks": [], |
|
883 | 883 | "tags": [], |
|
884 | 884 | "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"], |
|
885 | 885 | "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216", |
|
886 | 886 | "extra": {"branch": "default"}, |
|
887 | 887 | "modified": [], |
|
888 | 888 | "added": ["d"], |
|
889 | 889 | "removed": [] |
|
890 | 890 | }, |
|
891 | 891 | { |
|
892 | 892 | "rev": 4, |
|
893 | 893 | "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74", |
|
894 | 894 | "branch": "foo", |
|
895 | 895 | "phase": "draft", |
|
896 | 896 | "user": "person", |
|
897 | 897 | "date": [1400000, 0], |
|
898 | 898 | "desc": "new branch", |
|
899 | 899 | "bookmarks": [], |
|
900 | 900 | "tags": [], |
|
901 | 901 | "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"], |
|
902 | 902 | "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc", |
|
903 | 903 | "extra": {"branch": "foo"}, |
|
904 | 904 | "modified": [], |
|
905 | 905 | "added": [], |
|
906 | 906 | "removed": [] |
|
907 | 907 | }, |
|
908 | 908 | { |
|
909 | 909 | "rev": 3, |
|
910 | 910 | "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47", |
|
911 | 911 | "branch": "default", |
|
912 | 912 | "phase": "draft", |
|
913 | 913 | "user": "person", |
|
914 | 914 | "date": [1300000, 0], |
|
915 | 915 | "desc": "no user, no domain", |
|
916 | 916 | "bookmarks": [], |
|
917 | 917 | "tags": [], |
|
918 | 918 | "parents": ["97054abb4ab824450e9164180baf491ae0078465"], |
|
919 | 919 | "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc", |
|
920 | 920 | "extra": {"branch": "default"}, |
|
921 | 921 | "modified": ["c"], |
|
922 | 922 | "added": [], |
|
923 | 923 | "removed": [] |
|
924 | 924 | }, |
|
925 | 925 | { |
|
926 | 926 | "rev": 2, |
|
927 | 927 | "node": "97054abb4ab824450e9164180baf491ae0078465", |
|
928 | 928 | "branch": "default", |
|
929 | 929 | "phase": "draft", |
|
930 | 930 | "user": "other@place", |
|
931 | 931 | "date": [1200000, 0], |
|
932 | 932 | "desc": "no person", |
|
933 | 933 | "bookmarks": [], |
|
934 | 934 | "tags": [], |
|
935 | 935 | "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"], |
|
936 | 936 | "manifest": "6e0e82995c35d0d57a52aca8da4e56139e06b4b1", |
|
937 | 937 | "extra": {"branch": "default"}, |
|
938 | 938 | "modified": [], |
|
939 | 939 | "added": ["c"], |
|
940 | 940 | "removed": [] |
|
941 | 941 | }, |
|
942 | 942 | { |
|
943 | 943 | "rev": 1, |
|
944 | 944 | "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965", |
|
945 | 945 | "branch": "default", |
|
946 | 946 | "phase": "draft", |
|
947 | 947 | "user": "A. N. Other <other@place>", |
|
948 | 948 | "date": [1100000, 0], |
|
949 | 949 | "desc": "other 1\nother 2\n\nother 3", |
|
950 | 950 | "bookmarks": [], |
|
951 | 951 | "tags": [], |
|
952 | 952 | "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"], |
|
953 | 953 | "manifest": "4e8d705b1e53e3f9375e0e60dc7b525d8211fe55", |
|
954 | 954 | "extra": {"branch": "default"}, |
|
955 | 955 | "modified": [], |
|
956 | 956 | "added": ["b"], |
|
957 | 957 | "removed": [] |
|
958 | 958 | }, |
|
959 | 959 | { |
|
960 | 960 | "rev": 0, |
|
961 | 961 | "node": "1e4e1b8f71e05681d422154f5421e385fec3454f", |
|
962 | 962 | "branch": "default", |
|
963 | 963 | "phase": "draft", |
|
964 | 964 | "user": "User Name <user@hostname>", |
|
965 | 965 | "date": [1000000, 0], |
|
966 | 966 | "desc": "line 1\nline 2", |
|
967 | 967 | "bookmarks": [], |
|
968 | 968 | "tags": [], |
|
969 | 969 | "parents": ["0000000000000000000000000000000000000000"], |
|
970 | 970 | "manifest": "a0c8bcbbb45c63b90b70ad007bf38961f64f2af0", |
|
971 | 971 | "extra": {"branch": "default"}, |
|
972 | 972 | "modified": [], |
|
973 | 973 | "added": ["a"], |
|
974 | 974 | "removed": [] |
|
975 | 975 | } |
|
976 | 976 | ] |
|
977 | 977 | |
|
978 | 978 | Error if style not readable: |
|
979 | 979 | |
|
980 | 980 | #if unix-permissions no-root |
|
981 | 981 | $ touch q |
|
982 | 982 | $ chmod 0 q |
|
983 | 983 | $ hg log --style ./q |
|
984 | 984 | abort: Permission denied: ./q |
|
985 | 985 | [255] |
|
986 | 986 | #endif |
|
987 | 987 | |
|
988 | 988 | Error if no style: |
|
989 | 989 | |
|
990 | 990 | $ hg log --style notexist |
|
991 | 991 | abort: style 'notexist' not found |
|
992 | 992 | (available styles: bisect, changelog, compact, default, phases, status, xml) |
|
993 | 993 | [255] |
|
994 | 994 | |
|
995 | 995 | $ hg log -T list |
|
996 | 996 | available styles: bisect, changelog, compact, default, phases, status, xml |
|
997 | 997 | abort: specify a template |
|
998 | 998 | [255] |
|
999 | 999 | |
|
1000 | 1000 | Error if style missing key: |
|
1001 | 1001 | |
|
1002 | 1002 | $ echo 'q = q' > t |
|
1003 | 1003 | $ hg log --style ./t |
|
1004 | 1004 | abort: "changeset" not in template map |
|
1005 | 1005 | [255] |
|
1006 | 1006 | |
|
1007 | 1007 | Error if style missing value: |
|
1008 | 1008 | |
|
1009 | 1009 | $ echo 'changeset =' > t |
|
1010 | 1010 | $ hg log --style t |
|
1011 | 1011 | abort: t:1: missing value |
|
1012 | 1012 | [255] |
|
1013 | 1013 | |
|
1014 | 1014 | Error if include fails: |
|
1015 | 1015 | |
|
1016 | 1016 | $ echo 'changeset = q' >> t |
|
1017 | 1017 | #if unix-permissions no-root |
|
1018 | 1018 | $ hg log --style ./t |
|
1019 | 1019 | abort: template file ./q: Permission denied |
|
1020 | 1020 | [255] |
|
1021 | 1021 | $ rm q |
|
1022 | 1022 | #endif |
|
1023 | 1023 | |
|
1024 | 1024 | Include works: |
|
1025 | 1025 | |
|
1026 | 1026 | $ echo '{rev}' > q |
|
1027 | 1027 | $ hg log --style ./t |
|
1028 | 1028 | 8 |
|
1029 | 1029 | 7 |
|
1030 | 1030 | 6 |
|
1031 | 1031 | 5 |
|
1032 | 1032 | 4 |
|
1033 | 1033 | 3 |
|
1034 | 1034 | 2 |
|
1035 | 1035 | 1 |
|
1036 | 1036 | 0 |
|
1037 | 1037 | |
|
1038 | 1038 | Check that {phase} works correctly on parents: |
|
1039 | 1039 | |
|
1040 | 1040 | $ cat << EOF > parentphase |
|
1041 | 1041 | > changeset_debug = '{rev} ({phase}):{parents}\n' |
|
1042 | 1042 | > parent = ' {rev} ({phase})' |
|
1043 | 1043 | > EOF |
|
1044 | 1044 | $ hg phase -r 5 --public |
|
1045 | 1045 | $ hg phase -r 7 --secret --force |
|
1046 | 1046 | $ hg log --debug -G --style ./parentphase |
|
1047 | 1047 | @ 8 (secret): 7 (secret) -1 (public) |
|
1048 | 1048 | | |
|
1049 | 1049 | o 7 (secret): -1 (public) -1 (public) |
|
1050 | 1050 | |
|
1051 | 1051 | o 6 (draft): 5 (public) 4 (draft) |
|
1052 | 1052 | |\ |
|
1053 | 1053 | | o 5 (public): 3 (public) -1 (public) |
|
1054 | 1054 | | | |
|
1055 | 1055 | o | 4 (draft): 3 (public) -1 (public) |
|
1056 | 1056 | |/ |
|
1057 | 1057 | o 3 (public): 2 (public) -1 (public) |
|
1058 | 1058 | | |
|
1059 | 1059 | o 2 (public): 1 (public) -1 (public) |
|
1060 | 1060 | | |
|
1061 | 1061 | o 1 (public): 0 (public) -1 (public) |
|
1062 | 1062 | | |
|
1063 | 1063 | o 0 (public): -1 (public) -1 (public) |
|
1064 | 1064 | |
|
1065 | 1065 | |
|
1066 | 1066 | Missing non-standard names give no error (backward compatibility): |
|
1067 | 1067 | |
|
1068 | 1068 | $ echo "changeset = '{c}'" > t |
|
1069 | 1069 | $ hg log --style ./t |
|
1070 | 1070 | |
|
1071 | 1071 | Defining non-standard name works: |
|
1072 | 1072 | |
|
1073 | 1073 | $ cat <<EOF > t |
|
1074 | 1074 | > changeset = '{c}' |
|
1075 | 1075 | > c = q |
|
1076 | 1076 | > EOF |
|
1077 | 1077 | $ hg log --style ./t |
|
1078 | 1078 | 8 |
|
1079 | 1079 | 7 |
|
1080 | 1080 | 6 |
|
1081 | 1081 | 5 |
|
1082 | 1082 | 4 |
|
1083 | 1083 | 3 |
|
1084 | 1084 | 2 |
|
1085 | 1085 | 1 |
|
1086 | 1086 | 0 |
|
1087 | 1087 | |
|
1088 | 1088 | ui.style works: |
|
1089 | 1089 | |
|
1090 | 1090 | $ echo '[ui]' > .hg/hgrc |
|
1091 | 1091 | $ echo 'style = t' >> .hg/hgrc |
|
1092 | 1092 | $ hg log |
|
1093 | 1093 | 8 |
|
1094 | 1094 | 7 |
|
1095 | 1095 | 6 |
|
1096 | 1096 | 5 |
|
1097 | 1097 | 4 |
|
1098 | 1098 | 3 |
|
1099 | 1099 | 2 |
|
1100 | 1100 | 1 |
|
1101 | 1101 | 0 |
|
1102 | 1102 | |
|
1103 | 1103 | |
|
1104 | 1104 | Issue338: |
|
1105 | 1105 | |
|
1106 | 1106 | $ hg log --style=changelog > changelog |
|
1107 | 1107 | |
|
1108 | 1108 | $ cat changelog |
|
1109 | 1109 | 2020-01-01 test <test> |
|
1110 | 1110 | |
|
1111 | 1111 | * fourth, second, third: |
|
1112 | 1112 | third |
|
1113 | 1113 | [95c24699272e] [tip] |
|
1114 | 1114 | |
|
1115 | 1115 | 1970-01-12 User Name <user@hostname> |
|
1116 | 1116 | |
|
1117 | 1117 | * second: |
|
1118 | 1118 | second |
|
1119 | 1119 | [29114dbae42b] |
|
1120 | 1120 | |
|
1121 | 1121 | 1970-01-18 person <person> |
|
1122 | 1122 | |
|
1123 | 1123 | * merge |
|
1124 | 1124 | [d41e714fe50d] |
|
1125 | 1125 | |
|
1126 | 1126 | * d: |
|
1127 | 1127 | new head |
|
1128 | 1128 | [13207e5a10d9] |
|
1129 | 1129 | |
|
1130 | 1130 | 1970-01-17 person <person> |
|
1131 | 1131 | |
|
1132 | 1132 | * new branch |
|
1133 | 1133 | [bbe44766e73d] <foo> |
|
1134 | 1134 | |
|
1135 | 1135 | 1970-01-16 person <person> |
|
1136 | 1136 | |
|
1137 | 1137 | * c: |
|
1138 | 1138 | no user, no domain |
|
1139 | 1139 | [10e46f2dcbf4] |
|
1140 | 1140 | |
|
1141 | 1141 | 1970-01-14 other <other@place> |
|
1142 | 1142 | |
|
1143 | 1143 | * c: |
|
1144 | 1144 | no person |
|
1145 | 1145 | [97054abb4ab8] |
|
1146 | 1146 | |
|
1147 | 1147 | 1970-01-13 A. N. Other <other@place> |
|
1148 | 1148 | |
|
1149 | 1149 | * b: |
|
1150 | 1150 | other 1 other 2 |
|
1151 | 1151 | |
|
1152 | 1152 | other 3 |
|
1153 | 1153 | [b608e9d1a3f0] |
|
1154 | 1154 | |
|
1155 | 1155 | 1970-01-12 User Name <user@hostname> |
|
1156 | 1156 | |
|
1157 | 1157 | * a: |
|
1158 | 1158 | line 1 line 2 |
|
1159 | 1159 | [1e4e1b8f71e0] |
|
1160 | 1160 | |
|
1161 | 1161 | |
|
1162 | 1162 | Issue2130: xml output for 'hg heads' is malformed |
|
1163 | 1163 | |
|
1164 | 1164 | $ hg heads --style changelog |
|
1165 | 1165 | 2020-01-01 test <test> |
|
1166 | 1166 | |
|
1167 | 1167 | * fourth, second, third: |
|
1168 | 1168 | third |
|
1169 | 1169 | [95c24699272e] [tip] |
|
1170 | 1170 | |
|
1171 | 1171 | 1970-01-18 person <person> |
|
1172 | 1172 | |
|
1173 | 1173 | * merge |
|
1174 | 1174 | [d41e714fe50d] |
|
1175 | 1175 | |
|
1176 | 1176 | 1970-01-17 person <person> |
|
1177 | 1177 | |
|
1178 | 1178 | * new branch |
|
1179 | 1179 | [bbe44766e73d] <foo> |
|
1180 | 1180 | |
|
1181 | 1181 | |
|
1182 | 1182 | Keys work: |
|
1183 | 1183 | |
|
1184 | 1184 | $ for key in author branch branches date desc file_adds file_dels file_mods \ |
|
1185 | 1185 | > file_copies file_copies_switch files \ |
|
1186 | 1186 | > manifest node parents rev tags diffstat extras \ |
|
1187 | 1187 | > p1rev p2rev p1node p2node; do |
|
1188 | 1188 | > for mode in '' --verbose --debug; do |
|
1189 | 1189 | > hg log $mode --template "$key$mode: {$key}\n" |
|
1190 | 1190 | > done |
|
1191 | 1191 | > done |
|
1192 | 1192 | author: test |
|
1193 | 1193 | author: User Name <user@hostname> |
|
1194 | 1194 | author: person |
|
1195 | 1195 | author: person |
|
1196 | 1196 | author: person |
|
1197 | 1197 | author: person |
|
1198 | 1198 | author: other@place |
|
1199 | 1199 | author: A. N. Other <other@place> |
|
1200 | 1200 | author: User Name <user@hostname> |
|
1201 | 1201 | author--verbose: test |
|
1202 | 1202 | author--verbose: User Name <user@hostname> |
|
1203 | 1203 | author--verbose: person |
|
1204 | 1204 | author--verbose: person |
|
1205 | 1205 | author--verbose: person |
|
1206 | 1206 | author--verbose: person |
|
1207 | 1207 | author--verbose: other@place |
|
1208 | 1208 | author--verbose: A. N. Other <other@place> |
|
1209 | 1209 | author--verbose: User Name <user@hostname> |
|
1210 | 1210 | author--debug: test |
|
1211 | 1211 | author--debug: User Name <user@hostname> |
|
1212 | 1212 | author--debug: person |
|
1213 | 1213 | author--debug: person |
|
1214 | 1214 | author--debug: person |
|
1215 | 1215 | author--debug: person |
|
1216 | 1216 | author--debug: other@place |
|
1217 | 1217 | author--debug: A. N. Other <other@place> |
|
1218 | 1218 | author--debug: User Name <user@hostname> |
|
1219 | 1219 | branch: default |
|
1220 | 1220 | branch: default |
|
1221 | 1221 | branch: default |
|
1222 | 1222 | branch: default |
|
1223 | 1223 | branch: foo |
|
1224 | 1224 | branch: default |
|
1225 | 1225 | branch: default |
|
1226 | 1226 | branch: default |
|
1227 | 1227 | branch: default |
|
1228 | 1228 | branch--verbose: default |
|
1229 | 1229 | branch--verbose: default |
|
1230 | 1230 | branch--verbose: default |
|
1231 | 1231 | branch--verbose: default |
|
1232 | 1232 | branch--verbose: foo |
|
1233 | 1233 | branch--verbose: default |
|
1234 | 1234 | branch--verbose: default |
|
1235 | 1235 | branch--verbose: default |
|
1236 | 1236 | branch--verbose: default |
|
1237 | 1237 | branch--debug: default |
|
1238 | 1238 | branch--debug: default |
|
1239 | 1239 | branch--debug: default |
|
1240 | 1240 | branch--debug: default |
|
1241 | 1241 | branch--debug: foo |
|
1242 | 1242 | branch--debug: default |
|
1243 | 1243 | branch--debug: default |
|
1244 | 1244 | branch--debug: default |
|
1245 | 1245 | branch--debug: default |
|
1246 | 1246 | branches: |
|
1247 | 1247 | branches: |
|
1248 | 1248 | branches: |
|
1249 | 1249 | branches: |
|
1250 | 1250 | branches: foo |
|
1251 | 1251 | branches: |
|
1252 | 1252 | branches: |
|
1253 | 1253 | branches: |
|
1254 | 1254 | branches: |
|
1255 | 1255 | branches--verbose: |
|
1256 | 1256 | branches--verbose: |
|
1257 | 1257 | branches--verbose: |
|
1258 | 1258 | branches--verbose: |
|
1259 | 1259 | branches--verbose: foo |
|
1260 | 1260 | branches--verbose: |
|
1261 | 1261 | branches--verbose: |
|
1262 | 1262 | branches--verbose: |
|
1263 | 1263 | branches--verbose: |
|
1264 | 1264 | branches--debug: |
|
1265 | 1265 | branches--debug: |
|
1266 | 1266 | branches--debug: |
|
1267 | 1267 | branches--debug: |
|
1268 | 1268 | branches--debug: foo |
|
1269 | 1269 | branches--debug: |
|
1270 | 1270 | branches--debug: |
|
1271 | 1271 | branches--debug: |
|
1272 | 1272 | branches--debug: |
|
1273 | 1273 | date: 1577872860.00 |
|
1274 | 1274 | date: 1000000.00 |
|
1275 | 1275 | date: 1500001.00 |
|
1276 | 1276 | date: 1500000.00 |
|
1277 | 1277 | date: 1400000.00 |
|
1278 | 1278 | date: 1300000.00 |
|
1279 | 1279 | date: 1200000.00 |
|
1280 | 1280 | date: 1100000.00 |
|
1281 | 1281 | date: 1000000.00 |
|
1282 | 1282 | date--verbose: 1577872860.00 |
|
1283 | 1283 | date--verbose: 1000000.00 |
|
1284 | 1284 | date--verbose: 1500001.00 |
|
1285 | 1285 | date--verbose: 1500000.00 |
|
1286 | 1286 | date--verbose: 1400000.00 |
|
1287 | 1287 | date--verbose: 1300000.00 |
|
1288 | 1288 | date--verbose: 1200000.00 |
|
1289 | 1289 | date--verbose: 1100000.00 |
|
1290 | 1290 | date--verbose: 1000000.00 |
|
1291 | 1291 | date--debug: 1577872860.00 |
|
1292 | 1292 | date--debug: 1000000.00 |
|
1293 | 1293 | date--debug: 1500001.00 |
|
1294 | 1294 | date--debug: 1500000.00 |
|
1295 | 1295 | date--debug: 1400000.00 |
|
1296 | 1296 | date--debug: 1300000.00 |
|
1297 | 1297 | date--debug: 1200000.00 |
|
1298 | 1298 | date--debug: 1100000.00 |
|
1299 | 1299 | date--debug: 1000000.00 |
|
1300 | 1300 | desc: third |
|
1301 | 1301 | desc: second |
|
1302 | 1302 | desc: merge |
|
1303 | 1303 | desc: new head |
|
1304 | 1304 | desc: new branch |
|
1305 | 1305 | desc: no user, no domain |
|
1306 | 1306 | desc: no person |
|
1307 | 1307 | desc: other 1 |
|
1308 | 1308 | other 2 |
|
1309 | 1309 | |
|
1310 | 1310 | other 3 |
|
1311 | 1311 | desc: line 1 |
|
1312 | 1312 | line 2 |
|
1313 | 1313 | desc--verbose: third |
|
1314 | 1314 | desc--verbose: second |
|
1315 | 1315 | desc--verbose: merge |
|
1316 | 1316 | desc--verbose: new head |
|
1317 | 1317 | desc--verbose: new branch |
|
1318 | 1318 | desc--verbose: no user, no domain |
|
1319 | 1319 | desc--verbose: no person |
|
1320 | 1320 | desc--verbose: other 1 |
|
1321 | 1321 | other 2 |
|
1322 | 1322 | |
|
1323 | 1323 | other 3 |
|
1324 | 1324 | desc--verbose: line 1 |
|
1325 | 1325 | line 2 |
|
1326 | 1326 | desc--debug: third |
|
1327 | 1327 | desc--debug: second |
|
1328 | 1328 | desc--debug: merge |
|
1329 | 1329 | desc--debug: new head |
|
1330 | 1330 | desc--debug: new branch |
|
1331 | 1331 | desc--debug: no user, no domain |
|
1332 | 1332 | desc--debug: no person |
|
1333 | 1333 | desc--debug: other 1 |
|
1334 | 1334 | other 2 |
|
1335 | 1335 | |
|
1336 | 1336 | other 3 |
|
1337 | 1337 | desc--debug: line 1 |
|
1338 | 1338 | line 2 |
|
1339 | 1339 | file_adds: fourth third |
|
1340 | 1340 | file_adds: second |
|
1341 | 1341 | file_adds: |
|
1342 | 1342 | file_adds: d |
|
1343 | 1343 | file_adds: |
|
1344 | 1344 | file_adds: |
|
1345 | 1345 | file_adds: c |
|
1346 | 1346 | file_adds: b |
|
1347 | 1347 | file_adds: a |
|
1348 | 1348 | file_adds--verbose: fourth third |
|
1349 | 1349 | file_adds--verbose: second |
|
1350 | 1350 | file_adds--verbose: |
|
1351 | 1351 | file_adds--verbose: d |
|
1352 | 1352 | file_adds--verbose: |
|
1353 | 1353 | file_adds--verbose: |
|
1354 | 1354 | file_adds--verbose: c |
|
1355 | 1355 | file_adds--verbose: b |
|
1356 | 1356 | file_adds--verbose: a |
|
1357 | 1357 | file_adds--debug: fourth third |
|
1358 | 1358 | file_adds--debug: second |
|
1359 | 1359 | file_adds--debug: |
|
1360 | 1360 | file_adds--debug: d |
|
1361 | 1361 | file_adds--debug: |
|
1362 | 1362 | file_adds--debug: |
|
1363 | 1363 | file_adds--debug: c |
|
1364 | 1364 | file_adds--debug: b |
|
1365 | 1365 | file_adds--debug: a |
|
1366 | 1366 | file_dels: second |
|
1367 | 1367 | file_dels: |
|
1368 | 1368 | file_dels: |
|
1369 | 1369 | file_dels: |
|
1370 | 1370 | file_dels: |
|
1371 | 1371 | file_dels: |
|
1372 | 1372 | file_dels: |
|
1373 | 1373 | file_dels: |
|
1374 | 1374 | file_dels: |
|
1375 | 1375 | file_dels--verbose: second |
|
1376 | 1376 | file_dels--verbose: |
|
1377 | 1377 | file_dels--verbose: |
|
1378 | 1378 | file_dels--verbose: |
|
1379 | 1379 | file_dels--verbose: |
|
1380 | 1380 | file_dels--verbose: |
|
1381 | 1381 | file_dels--verbose: |
|
1382 | 1382 | file_dels--verbose: |
|
1383 | 1383 | file_dels--verbose: |
|
1384 | 1384 | file_dels--debug: second |
|
1385 | 1385 | file_dels--debug: |
|
1386 | 1386 | file_dels--debug: |
|
1387 | 1387 | file_dels--debug: |
|
1388 | 1388 | file_dels--debug: |
|
1389 | 1389 | file_dels--debug: |
|
1390 | 1390 | file_dels--debug: |
|
1391 | 1391 | file_dels--debug: |
|
1392 | 1392 | file_dels--debug: |
|
1393 | 1393 | file_mods: |
|
1394 | 1394 | file_mods: |
|
1395 | 1395 | file_mods: |
|
1396 | 1396 | file_mods: |
|
1397 | 1397 | file_mods: |
|
1398 | 1398 | file_mods: c |
|
1399 | 1399 | file_mods: |
|
1400 | 1400 | file_mods: |
|
1401 | 1401 | file_mods: |
|
1402 | 1402 | file_mods--verbose: |
|
1403 | 1403 | file_mods--verbose: |
|
1404 | 1404 | file_mods--verbose: |
|
1405 | 1405 | file_mods--verbose: |
|
1406 | 1406 | file_mods--verbose: |
|
1407 | 1407 | file_mods--verbose: c |
|
1408 | 1408 | file_mods--verbose: |
|
1409 | 1409 | file_mods--verbose: |
|
1410 | 1410 | file_mods--verbose: |
|
1411 | 1411 | file_mods--debug: |
|
1412 | 1412 | file_mods--debug: |
|
1413 | 1413 | file_mods--debug: |
|
1414 | 1414 | file_mods--debug: |
|
1415 | 1415 | file_mods--debug: |
|
1416 | 1416 | file_mods--debug: c |
|
1417 | 1417 | file_mods--debug: |
|
1418 | 1418 | file_mods--debug: |
|
1419 | 1419 | file_mods--debug: |
|
1420 | 1420 | file_copies: fourth (second) |
|
1421 | 1421 | file_copies: |
|
1422 | 1422 | file_copies: |
|
1423 | 1423 | file_copies: |
|
1424 | 1424 | file_copies: |
|
1425 | 1425 | file_copies: |
|
1426 | 1426 | file_copies: |
|
1427 | 1427 | file_copies: |
|
1428 | 1428 | file_copies: |
|
1429 | 1429 | file_copies--verbose: fourth (second) |
|
1430 | 1430 | file_copies--verbose: |
|
1431 | 1431 | file_copies--verbose: |
|
1432 | 1432 | file_copies--verbose: |
|
1433 | 1433 | file_copies--verbose: |
|
1434 | 1434 | file_copies--verbose: |
|
1435 | 1435 | file_copies--verbose: |
|
1436 | 1436 | file_copies--verbose: |
|
1437 | 1437 | file_copies--verbose: |
|
1438 | 1438 | file_copies--debug: fourth (second) |
|
1439 | 1439 | file_copies--debug: |
|
1440 | 1440 | file_copies--debug: |
|
1441 | 1441 | file_copies--debug: |
|
1442 | 1442 | file_copies--debug: |
|
1443 | 1443 | file_copies--debug: |
|
1444 | 1444 | file_copies--debug: |
|
1445 | 1445 | file_copies--debug: |
|
1446 | 1446 | file_copies--debug: |
|
1447 | 1447 | file_copies_switch: |
|
1448 | 1448 | file_copies_switch: |
|
1449 | 1449 | file_copies_switch: |
|
1450 | 1450 | file_copies_switch: |
|
1451 | 1451 | file_copies_switch: |
|
1452 | 1452 | file_copies_switch: |
|
1453 | 1453 | file_copies_switch: |
|
1454 | 1454 | file_copies_switch: |
|
1455 | 1455 | file_copies_switch: |
|
1456 | 1456 | file_copies_switch--verbose: |
|
1457 | 1457 | file_copies_switch--verbose: |
|
1458 | 1458 | file_copies_switch--verbose: |
|
1459 | 1459 | file_copies_switch--verbose: |
|
1460 | 1460 | file_copies_switch--verbose: |
|
1461 | 1461 | file_copies_switch--verbose: |
|
1462 | 1462 | file_copies_switch--verbose: |
|
1463 | 1463 | file_copies_switch--verbose: |
|
1464 | 1464 | file_copies_switch--verbose: |
|
1465 | 1465 | file_copies_switch--debug: |
|
1466 | 1466 | file_copies_switch--debug: |
|
1467 | 1467 | file_copies_switch--debug: |
|
1468 | 1468 | file_copies_switch--debug: |
|
1469 | 1469 | file_copies_switch--debug: |
|
1470 | 1470 | file_copies_switch--debug: |
|
1471 | 1471 | file_copies_switch--debug: |
|
1472 | 1472 | file_copies_switch--debug: |
|
1473 | 1473 | file_copies_switch--debug: |
|
1474 | 1474 | files: fourth second third |
|
1475 | 1475 | files: second |
|
1476 | 1476 | files: |
|
1477 | 1477 | files: d |
|
1478 | 1478 | files: |
|
1479 | 1479 | files: c |
|
1480 | 1480 | files: c |
|
1481 | 1481 | files: b |
|
1482 | 1482 | files: a |
|
1483 | 1483 | files--verbose: fourth second third |
|
1484 | 1484 | files--verbose: second |
|
1485 | 1485 | files--verbose: |
|
1486 | 1486 | files--verbose: d |
|
1487 | 1487 | files--verbose: |
|
1488 | 1488 | files--verbose: c |
|
1489 | 1489 | files--verbose: c |
|
1490 | 1490 | files--verbose: b |
|
1491 | 1491 | files--verbose: a |
|
1492 | 1492 | files--debug: fourth second third |
|
1493 | 1493 | files--debug: second |
|
1494 | 1494 | files--debug: |
|
1495 | 1495 | files--debug: d |
|
1496 | 1496 | files--debug: |
|
1497 | 1497 | files--debug: c |
|
1498 | 1498 | files--debug: c |
|
1499 | 1499 | files--debug: b |
|
1500 | 1500 | files--debug: a |
|
1501 | 1501 | manifest: 6:94961b75a2da |
|
1502 | 1502 | manifest: 5:f2dbc354b94e |
|
1503 | 1503 | manifest: 4:4dc3def4f9b4 |
|
1504 | 1504 | manifest: 4:4dc3def4f9b4 |
|
1505 | 1505 | manifest: 3:cb5a1327723b |
|
1506 | 1506 | manifest: 3:cb5a1327723b |
|
1507 | 1507 | manifest: 2:6e0e82995c35 |
|
1508 | 1508 | manifest: 1:4e8d705b1e53 |
|
1509 | 1509 | manifest: 0:a0c8bcbbb45c |
|
1510 | 1510 | manifest--verbose: 6:94961b75a2da |
|
1511 | 1511 | manifest--verbose: 5:f2dbc354b94e |
|
1512 | 1512 | manifest--verbose: 4:4dc3def4f9b4 |
|
1513 | 1513 | manifest--verbose: 4:4dc3def4f9b4 |
|
1514 | 1514 | manifest--verbose: 3:cb5a1327723b |
|
1515 | 1515 | manifest--verbose: 3:cb5a1327723b |
|
1516 | 1516 | manifest--verbose: 2:6e0e82995c35 |
|
1517 | 1517 | manifest--verbose: 1:4e8d705b1e53 |
|
1518 | 1518 | manifest--verbose: 0:a0c8bcbbb45c |
|
1519 | 1519 | manifest--debug: 6:94961b75a2da554b4df6fb599e5bfc7d48de0c64 |
|
1520 | 1520 | manifest--debug: 5:f2dbc354b94e5ec0b4f10680ee0cee816101d0bf |
|
1521 | 1521 | manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216 |
|
1522 | 1522 | manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216 |
|
1523 | 1523 | manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc |
|
1524 | 1524 | manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc |
|
1525 | 1525 | manifest--debug: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1 |
|
1526 | 1526 | manifest--debug: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55 |
|
1527 | 1527 | manifest--debug: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 |
|
1528 | 1528 | node: 95c24699272ef57d062b8bccc32c878bf841784a |
|
1529 | 1529 | node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453 |
|
1530 | 1530 | node: d41e714fe50d9e4a5f11b4d595d543481b5f980b |
|
1531 | 1531 | node: 13207e5a10d9fd28ec424934298e176197f2c67f |
|
1532 | 1532 | node: bbe44766e73d5f11ed2177f1838de10c53ef3e74 |
|
1533 | 1533 | node: 10e46f2dcbf4823578cf180f33ecf0b957964c47 |
|
1534 | 1534 | node: 97054abb4ab824450e9164180baf491ae0078465 |
|
1535 | 1535 | node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965 |
|
1536 | 1536 | node: 1e4e1b8f71e05681d422154f5421e385fec3454f |
|
1537 | 1537 | node--verbose: 95c24699272ef57d062b8bccc32c878bf841784a |
|
1538 | 1538 | node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453 |
|
1539 | 1539 | node--verbose: d41e714fe50d9e4a5f11b4d595d543481b5f980b |
|
1540 | 1540 | node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f |
|
1541 | 1541 | node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74 |
|
1542 | 1542 | node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47 |
|
1543 | 1543 | node--verbose: 97054abb4ab824450e9164180baf491ae0078465 |
|
1544 | 1544 | node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965 |
|
1545 | 1545 | node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f |
|
1546 | 1546 | node--debug: 95c24699272ef57d062b8bccc32c878bf841784a |
|
1547 | 1547 | node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453 |
|
1548 | 1548 | node--debug: d41e714fe50d9e4a5f11b4d595d543481b5f980b |
|
1549 | 1549 | node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f |
|
1550 | 1550 | node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74 |
|
1551 | 1551 | node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47 |
|
1552 | 1552 | node--debug: 97054abb4ab824450e9164180baf491ae0078465 |
|
1553 | 1553 | node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965 |
|
1554 | 1554 | node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f |
|
1555 | 1555 | parents: |
|
1556 | 1556 | parents: -1:000000000000 |
|
1557 | 1557 | parents: 5:13207e5a10d9 4:bbe44766e73d |
|
1558 | 1558 | parents: 3:10e46f2dcbf4 |
|
1559 | 1559 | parents: |
|
1560 | 1560 | parents: |
|
1561 | 1561 | parents: |
|
1562 | 1562 | parents: |
|
1563 | 1563 | parents: |
|
1564 | 1564 | parents--verbose: |
|
1565 | 1565 | parents--verbose: -1:000000000000 |
|
1566 | 1566 | parents--verbose: 5:13207e5a10d9 4:bbe44766e73d |
|
1567 | 1567 | parents--verbose: 3:10e46f2dcbf4 |
|
1568 | 1568 | parents--verbose: |
|
1569 | 1569 | parents--verbose: |
|
1570 | 1570 | parents--verbose: |
|
1571 | 1571 | parents--verbose: |
|
1572 | 1572 | parents--verbose: |
|
1573 | 1573 | parents--debug: 7:29114dbae42b9f078cf2714dbe3a86bba8ec7453 -1:0000000000000000000000000000000000000000 |
|
1574 | 1574 | parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000 |
|
1575 | 1575 | parents--debug: 5:13207e5a10d9fd28ec424934298e176197f2c67f 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74 |
|
1576 | 1576 | parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000 |
|
1577 | 1577 | parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000 |
|
1578 | 1578 | parents--debug: 2:97054abb4ab824450e9164180baf491ae0078465 -1:0000000000000000000000000000000000000000 |
|
1579 | 1579 | parents--debug: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965 -1:0000000000000000000000000000000000000000 |
|
1580 | 1580 | parents--debug: 0:1e4e1b8f71e05681d422154f5421e385fec3454f -1:0000000000000000000000000000000000000000 |
|
1581 | 1581 | parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000 |
|
1582 | 1582 | rev: 8 |
|
1583 | 1583 | rev: 7 |
|
1584 | 1584 | rev: 6 |
|
1585 | 1585 | rev: 5 |
|
1586 | 1586 | rev: 4 |
|
1587 | 1587 | rev: 3 |
|
1588 | 1588 | rev: 2 |
|
1589 | 1589 | rev: 1 |
|
1590 | 1590 | rev: 0 |
|
1591 | 1591 | rev--verbose: 8 |
|
1592 | 1592 | rev--verbose: 7 |
|
1593 | 1593 | rev--verbose: 6 |
|
1594 | 1594 | rev--verbose: 5 |
|
1595 | 1595 | rev--verbose: 4 |
|
1596 | 1596 | rev--verbose: 3 |
|
1597 | 1597 | rev--verbose: 2 |
|
1598 | 1598 | rev--verbose: 1 |
|
1599 | 1599 | rev--verbose: 0 |
|
1600 | 1600 | rev--debug: 8 |
|
1601 | 1601 | rev--debug: 7 |
|
1602 | 1602 | rev--debug: 6 |
|
1603 | 1603 | rev--debug: 5 |
|
1604 | 1604 | rev--debug: 4 |
|
1605 | 1605 | rev--debug: 3 |
|
1606 | 1606 | rev--debug: 2 |
|
1607 | 1607 | rev--debug: 1 |
|
1608 | 1608 | rev--debug: 0 |
|
1609 | 1609 | tags: tip |
|
1610 | 1610 | tags: |
|
1611 | 1611 | tags: |
|
1612 | 1612 | tags: |
|
1613 | 1613 | tags: |
|
1614 | 1614 | tags: |
|
1615 | 1615 | tags: |
|
1616 | 1616 | tags: |
|
1617 | 1617 | tags: |
|
1618 | 1618 | tags--verbose: tip |
|
1619 | 1619 | tags--verbose: |
|
1620 | 1620 | tags--verbose: |
|
1621 | 1621 | tags--verbose: |
|
1622 | 1622 | tags--verbose: |
|
1623 | 1623 | tags--verbose: |
|
1624 | 1624 | tags--verbose: |
|
1625 | 1625 | tags--verbose: |
|
1626 | 1626 | tags--verbose: |
|
1627 | 1627 | tags--debug: tip |
|
1628 | 1628 | tags--debug: |
|
1629 | 1629 | tags--debug: |
|
1630 | 1630 | tags--debug: |
|
1631 | 1631 | tags--debug: |
|
1632 | 1632 | tags--debug: |
|
1633 | 1633 | tags--debug: |
|
1634 | 1634 | tags--debug: |
|
1635 | 1635 | tags--debug: |
|
1636 | 1636 | diffstat: 3: +2/-1 |
|
1637 | 1637 | diffstat: 1: +1/-0 |
|
1638 | 1638 | diffstat: 0: +0/-0 |
|
1639 | 1639 | diffstat: 1: +1/-0 |
|
1640 | 1640 | diffstat: 0: +0/-0 |
|
1641 | 1641 | diffstat: 1: +1/-0 |
|
1642 | 1642 | diffstat: 1: +4/-0 |
|
1643 | 1643 | diffstat: 1: +2/-0 |
|
1644 | 1644 | diffstat: 1: +1/-0 |
|
1645 | 1645 | diffstat--verbose: 3: +2/-1 |
|
1646 | 1646 | diffstat--verbose: 1: +1/-0 |
|
1647 | 1647 | diffstat--verbose: 0: +0/-0 |
|
1648 | 1648 | diffstat--verbose: 1: +1/-0 |
|
1649 | 1649 | diffstat--verbose: 0: +0/-0 |
|
1650 | 1650 | diffstat--verbose: 1: +1/-0 |
|
1651 | 1651 | diffstat--verbose: 1: +4/-0 |
|
1652 | 1652 | diffstat--verbose: 1: +2/-0 |
|
1653 | 1653 | diffstat--verbose: 1: +1/-0 |
|
1654 | 1654 | diffstat--debug: 3: +2/-1 |
|
1655 | 1655 | diffstat--debug: 1: +1/-0 |
|
1656 | 1656 | diffstat--debug: 0: +0/-0 |
|
1657 | 1657 | diffstat--debug: 1: +1/-0 |
|
1658 | 1658 | diffstat--debug: 0: +0/-0 |
|
1659 | 1659 | diffstat--debug: 1: +1/-0 |
|
1660 | 1660 | diffstat--debug: 1: +4/-0 |
|
1661 | 1661 | diffstat--debug: 1: +2/-0 |
|
1662 | 1662 | diffstat--debug: 1: +1/-0 |
|
1663 | 1663 | extras: branch=default |
|
1664 | 1664 | extras: branch=default |
|
1665 | 1665 | extras: branch=default |
|
1666 | 1666 | extras: branch=default |
|
1667 | 1667 | extras: branch=foo |
|
1668 | 1668 | extras: branch=default |
|
1669 | 1669 | extras: branch=default |
|
1670 | 1670 | extras: branch=default |
|
1671 | 1671 | extras: branch=default |
|
1672 | 1672 | extras--verbose: branch=default |
|
1673 | 1673 | extras--verbose: branch=default |
|
1674 | 1674 | extras--verbose: branch=default |
|
1675 | 1675 | extras--verbose: branch=default |
|
1676 | 1676 | extras--verbose: branch=foo |
|
1677 | 1677 | extras--verbose: branch=default |
|
1678 | 1678 | extras--verbose: branch=default |
|
1679 | 1679 | extras--verbose: branch=default |
|
1680 | 1680 | extras--verbose: branch=default |
|
1681 | 1681 | extras--debug: branch=default |
|
1682 | 1682 | extras--debug: branch=default |
|
1683 | 1683 | extras--debug: branch=default |
|
1684 | 1684 | extras--debug: branch=default |
|
1685 | 1685 | extras--debug: branch=foo |
|
1686 | 1686 | extras--debug: branch=default |
|
1687 | 1687 | extras--debug: branch=default |
|
1688 | 1688 | extras--debug: branch=default |
|
1689 | 1689 | extras--debug: branch=default |
|
1690 | 1690 | p1rev: 7 |
|
1691 | 1691 | p1rev: -1 |
|
1692 | 1692 | p1rev: 5 |
|
1693 | 1693 | p1rev: 3 |
|
1694 | 1694 | p1rev: 3 |
|
1695 | 1695 | p1rev: 2 |
|
1696 | 1696 | p1rev: 1 |
|
1697 | 1697 | p1rev: 0 |
|
1698 | 1698 | p1rev: -1 |
|
1699 | 1699 | p1rev--verbose: 7 |
|
1700 | 1700 | p1rev--verbose: -1 |
|
1701 | 1701 | p1rev--verbose: 5 |
|
1702 | 1702 | p1rev--verbose: 3 |
|
1703 | 1703 | p1rev--verbose: 3 |
|
1704 | 1704 | p1rev--verbose: 2 |
|
1705 | 1705 | p1rev--verbose: 1 |
|
1706 | 1706 | p1rev--verbose: 0 |
|
1707 | 1707 | p1rev--verbose: -1 |
|
1708 | 1708 | p1rev--debug: 7 |
|
1709 | 1709 | p1rev--debug: -1 |
|
1710 | 1710 | p1rev--debug: 5 |
|
1711 | 1711 | p1rev--debug: 3 |
|
1712 | 1712 | p1rev--debug: 3 |
|
1713 | 1713 | p1rev--debug: 2 |
|
1714 | 1714 | p1rev--debug: 1 |
|
1715 | 1715 | p1rev--debug: 0 |
|
1716 | 1716 | p1rev--debug: -1 |
|
1717 | 1717 | p2rev: -1 |
|
1718 | 1718 | p2rev: -1 |
|
1719 | 1719 | p2rev: 4 |
|
1720 | 1720 | p2rev: -1 |
|
1721 | 1721 | p2rev: -1 |
|
1722 | 1722 | p2rev: -1 |
|
1723 | 1723 | p2rev: -1 |
|
1724 | 1724 | p2rev: -1 |
|
1725 | 1725 | p2rev: -1 |
|
1726 | 1726 | p2rev--verbose: -1 |
|
1727 | 1727 | p2rev--verbose: -1 |
|
1728 | 1728 | p2rev--verbose: 4 |
|
1729 | 1729 | p2rev--verbose: -1 |
|
1730 | 1730 | p2rev--verbose: -1 |
|
1731 | 1731 | p2rev--verbose: -1 |
|
1732 | 1732 | p2rev--verbose: -1 |
|
1733 | 1733 | p2rev--verbose: -1 |
|
1734 | 1734 | p2rev--verbose: -1 |
|
1735 | 1735 | p2rev--debug: -1 |
|
1736 | 1736 | p2rev--debug: -1 |
|
1737 | 1737 | p2rev--debug: 4 |
|
1738 | 1738 | p2rev--debug: -1 |
|
1739 | 1739 | p2rev--debug: -1 |
|
1740 | 1740 | p2rev--debug: -1 |
|
1741 | 1741 | p2rev--debug: -1 |
|
1742 | 1742 | p2rev--debug: -1 |
|
1743 | 1743 | p2rev--debug: -1 |
|
1744 | 1744 | p1node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453 |
|
1745 | 1745 | p1node: 0000000000000000000000000000000000000000 |
|
1746 | 1746 | p1node: 13207e5a10d9fd28ec424934298e176197f2c67f |
|
1747 | 1747 | p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47 |
|
1748 | 1748 | p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47 |
|
1749 | 1749 | p1node: 97054abb4ab824450e9164180baf491ae0078465 |
|
1750 | 1750 | p1node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965 |
|
1751 | 1751 | p1node: 1e4e1b8f71e05681d422154f5421e385fec3454f |
|
1752 | 1752 | p1node: 0000000000000000000000000000000000000000 |
|
1753 | 1753 | p1node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453 |
|
1754 | 1754 | p1node--verbose: 0000000000000000000000000000000000000000 |
|
1755 | 1755 | p1node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f |
|
1756 | 1756 | p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47 |
|
1757 | 1757 | p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47 |
|
1758 | 1758 | p1node--verbose: 97054abb4ab824450e9164180baf491ae0078465 |
|
1759 | 1759 | p1node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965 |
|
1760 | 1760 | p1node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f |
|
1761 | 1761 | p1node--verbose: 0000000000000000000000000000000000000000 |
|
1762 | 1762 | p1node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453 |
|
1763 | 1763 | p1node--debug: 0000000000000000000000000000000000000000 |
|
1764 | 1764 | p1node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f |
|
1765 | 1765 | p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47 |
|
1766 | 1766 | p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47 |
|
1767 | 1767 | p1node--debug: 97054abb4ab824450e9164180baf491ae0078465 |
|
1768 | 1768 | p1node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965 |
|
1769 | 1769 | p1node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f |
|
1770 | 1770 | p1node--debug: 0000000000000000000000000000000000000000 |
|
1771 | 1771 | p2node: 0000000000000000000000000000000000000000 |
|
1772 | 1772 | p2node: 0000000000000000000000000000000000000000 |
|
1773 | 1773 | p2node: bbe44766e73d5f11ed2177f1838de10c53ef3e74 |
|
1774 | 1774 | p2node: 0000000000000000000000000000000000000000 |
|
1775 | 1775 | p2node: 0000000000000000000000000000000000000000 |
|
1776 | 1776 | p2node: 0000000000000000000000000000000000000000 |
|
1777 | 1777 | p2node: 0000000000000000000000000000000000000000 |
|
1778 | 1778 | p2node: 0000000000000000000000000000000000000000 |
|
1779 | 1779 | p2node: 0000000000000000000000000000000000000000 |
|
1780 | 1780 | p2node--verbose: 0000000000000000000000000000000000000000 |
|
1781 | 1781 | p2node--verbose: 0000000000000000000000000000000000000000 |
|
1782 | 1782 | p2node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74 |
|
1783 | 1783 | p2node--verbose: 0000000000000000000000000000000000000000 |
|
1784 | 1784 | p2node--verbose: 0000000000000000000000000000000000000000 |
|
1785 | 1785 | p2node--verbose: 0000000000000000000000000000000000000000 |
|
1786 | 1786 | p2node--verbose: 0000000000000000000000000000000000000000 |
|
1787 | 1787 | p2node--verbose: 0000000000000000000000000000000000000000 |
|
1788 | 1788 | p2node--verbose: 0000000000000000000000000000000000000000 |
|
1789 | 1789 | p2node--debug: 0000000000000000000000000000000000000000 |
|
1790 | 1790 | p2node--debug: 0000000000000000000000000000000000000000 |
|
1791 | 1791 | p2node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74 |
|
1792 | 1792 | p2node--debug: 0000000000000000000000000000000000000000 |
|
1793 | 1793 | p2node--debug: 0000000000000000000000000000000000000000 |
|
1794 | 1794 | p2node--debug: 0000000000000000000000000000000000000000 |
|
1795 | 1795 | p2node--debug: 0000000000000000000000000000000000000000 |
|
1796 | 1796 | p2node--debug: 0000000000000000000000000000000000000000 |
|
1797 | 1797 | p2node--debug: 0000000000000000000000000000000000000000 |
|
1798 | 1798 | |
|
1799 | 1799 | Filters work: |
|
1800 | 1800 | |
|
1801 | 1801 | $ hg log --template '{author|domain}\n' |
|
1802 | 1802 | |
|
1803 | 1803 | hostname |
|
1804 | 1804 | |
|
1805 | 1805 | |
|
1806 | 1806 | |
|
1807 | 1807 | |
|
1808 | 1808 | place |
|
1809 | 1809 | place |
|
1810 | 1810 | hostname |
|
1811 | 1811 | |
|
1812 | 1812 | $ hg log --template '{author|person}\n' |
|
1813 | 1813 | test |
|
1814 | 1814 | User Name |
|
1815 | 1815 | person |
|
1816 | 1816 | person |
|
1817 | 1817 | person |
|
1818 | 1818 | person |
|
1819 | 1819 | other |
|
1820 | 1820 | A. N. Other |
|
1821 | 1821 | User Name |
|
1822 | 1822 | |
|
1823 | 1823 | $ hg log --template '{author|user}\n' |
|
1824 | 1824 | test |
|
1825 | 1825 | user |
|
1826 | 1826 | person |
|
1827 | 1827 | person |
|
1828 | 1828 | person |
|
1829 | 1829 | person |
|
1830 | 1830 | other |
|
1831 | 1831 | other |
|
1832 | 1832 | user |
|
1833 | 1833 | |
|
1834 | 1834 | $ hg log --template '{date|date}\n' |
|
1835 | 1835 | Wed Jan 01 10:01:00 2020 +0000 |
|
1836 | 1836 | Mon Jan 12 13:46:40 1970 +0000 |
|
1837 | 1837 | Sun Jan 18 08:40:01 1970 +0000 |
|
1838 | 1838 | Sun Jan 18 08:40:00 1970 +0000 |
|
1839 | 1839 | Sat Jan 17 04:53:20 1970 +0000 |
|
1840 | 1840 | Fri Jan 16 01:06:40 1970 +0000 |
|
1841 | 1841 | Wed Jan 14 21:20:00 1970 +0000 |
|
1842 | 1842 | Tue Jan 13 17:33:20 1970 +0000 |
|
1843 | 1843 | Mon Jan 12 13:46:40 1970 +0000 |
|
1844 | 1844 | |
|
1845 | 1845 | $ hg log --template '{date|isodate}\n' |
|
1846 | 1846 | 2020-01-01 10:01 +0000 |
|
1847 | 1847 | 1970-01-12 13:46 +0000 |
|
1848 | 1848 | 1970-01-18 08:40 +0000 |
|
1849 | 1849 | 1970-01-18 08:40 +0000 |
|
1850 | 1850 | 1970-01-17 04:53 +0000 |
|
1851 | 1851 | 1970-01-16 01:06 +0000 |
|
1852 | 1852 | 1970-01-14 21:20 +0000 |
|
1853 | 1853 | 1970-01-13 17:33 +0000 |
|
1854 | 1854 | 1970-01-12 13:46 +0000 |
|
1855 | 1855 | |
|
1856 | 1856 | $ hg log --template '{date|isodatesec}\n' |
|
1857 | 1857 | 2020-01-01 10:01:00 +0000 |
|
1858 | 1858 | 1970-01-12 13:46:40 +0000 |
|
1859 | 1859 | 1970-01-18 08:40:01 +0000 |
|
1860 | 1860 | 1970-01-18 08:40:00 +0000 |
|
1861 | 1861 | 1970-01-17 04:53:20 +0000 |
|
1862 | 1862 | 1970-01-16 01:06:40 +0000 |
|
1863 | 1863 | 1970-01-14 21:20:00 +0000 |
|
1864 | 1864 | 1970-01-13 17:33:20 +0000 |
|
1865 | 1865 | 1970-01-12 13:46:40 +0000 |
|
1866 | 1866 | |
|
1867 | 1867 | $ hg log --template '{date|rfc822date}\n' |
|
1868 | 1868 | Wed, 01 Jan 2020 10:01:00 +0000 |
|
1869 | 1869 | Mon, 12 Jan 1970 13:46:40 +0000 |
|
1870 | 1870 | Sun, 18 Jan 1970 08:40:01 +0000 |
|
1871 | 1871 | Sun, 18 Jan 1970 08:40:00 +0000 |
|
1872 | 1872 | Sat, 17 Jan 1970 04:53:20 +0000 |
|
1873 | 1873 | Fri, 16 Jan 1970 01:06:40 +0000 |
|
1874 | 1874 | Wed, 14 Jan 1970 21:20:00 +0000 |
|
1875 | 1875 | Tue, 13 Jan 1970 17:33:20 +0000 |
|
1876 | 1876 | Mon, 12 Jan 1970 13:46:40 +0000 |
|
1877 | 1877 | |
|
1878 | 1878 | $ hg log --template '{desc|firstline}\n' |
|
1879 | 1879 | third |
|
1880 | 1880 | second |
|
1881 | 1881 | merge |
|
1882 | 1882 | new head |
|
1883 | 1883 | new branch |
|
1884 | 1884 | no user, no domain |
|
1885 | 1885 | no person |
|
1886 | 1886 | other 1 |
|
1887 | 1887 | line 1 |
|
1888 | 1888 | |
|
1889 | 1889 | $ hg log --template '{node|short}\n' |
|
1890 | 1890 | 95c24699272e |
|
1891 | 1891 | 29114dbae42b |
|
1892 | 1892 | d41e714fe50d |
|
1893 | 1893 | 13207e5a10d9 |
|
1894 | 1894 | bbe44766e73d |
|
1895 | 1895 | 10e46f2dcbf4 |
|
1896 | 1896 | 97054abb4ab8 |
|
1897 | 1897 | b608e9d1a3f0 |
|
1898 | 1898 | 1e4e1b8f71e0 |
|
1899 | 1899 | |
|
1900 | 1900 | $ hg log --template '<changeset author="{author|xmlescape}"/>\n' |
|
1901 | 1901 | <changeset author="test"/> |
|
1902 | 1902 | <changeset author="User Name <user@hostname>"/> |
|
1903 | 1903 | <changeset author="person"/> |
|
1904 | 1904 | <changeset author="person"/> |
|
1905 | 1905 | <changeset author="person"/> |
|
1906 | 1906 | <changeset author="person"/> |
|
1907 | 1907 | <changeset author="other@place"/> |
|
1908 | 1908 | <changeset author="A. N. Other <other@place>"/> |
|
1909 | 1909 | <changeset author="User Name <user@hostname>"/> |
|
1910 | 1910 | |
|
1911 | 1911 | $ hg log --template '{rev}: {children}\n' |
|
1912 | 1912 | 8: |
|
1913 | 1913 | 7: 8:95c24699272e |
|
1914 | 1914 | 6: |
|
1915 | 1915 | 5: 6:d41e714fe50d |
|
1916 | 1916 | 4: 6:d41e714fe50d |
|
1917 | 1917 | 3: 4:bbe44766e73d 5:13207e5a10d9 |
|
1918 | 1918 | 2: 3:10e46f2dcbf4 |
|
1919 | 1919 | 1: 2:97054abb4ab8 |
|
1920 | 1920 | 0: 1:b608e9d1a3f0 |
|
1921 | 1921 | |
|
1922 | 1922 | Formatnode filter works: |
|
1923 | 1923 | |
|
1924 | 1924 | $ hg -q log -r 0 --template '{node|formatnode}\n' |
|
1925 | 1925 | 1e4e1b8f71e0 |
|
1926 | 1926 | |
|
1927 | 1927 | $ hg log -r 0 --template '{node|formatnode}\n' |
|
1928 | 1928 | 1e4e1b8f71e0 |
|
1929 | 1929 | |
|
1930 | 1930 | $ hg -v log -r 0 --template '{node|formatnode}\n' |
|
1931 | 1931 | 1e4e1b8f71e0 |
|
1932 | 1932 | |
|
1933 | 1933 | $ hg --debug log -r 0 --template '{node|formatnode}\n' |
|
1934 | 1934 | 1e4e1b8f71e05681d422154f5421e385fec3454f |
|
1935 | 1935 | |
|
1936 | 1936 | Age filter: |
|
1937 | 1937 | |
|
1938 | 1938 | $ hg init unstable-hash |
|
1939 | 1939 | $ cd unstable-hash |
|
1940 | 1940 | $ hg log --template '{date|age}\n' > /dev/null || exit 1 |
|
1941 | 1941 | |
|
1942 | 1942 | >>> from datetime import datetime, timedelta |
|
1943 | 1943 | >>> fp = open('a', 'w') |
|
1944 | 1944 | >>> n = datetime.now() + timedelta(366 * 7) |
|
1945 | 1945 | >>> fp.write('%d-%d-%d 00:00' % (n.year, n.month, n.day)) |
|
1946 | 1946 | >>> fp.close() |
|
1947 | 1947 | $ hg add a |
|
1948 | 1948 | $ hg commit -m future -d "`cat a`" |
|
1949 | 1949 | |
|
1950 | 1950 | $ hg log -l1 --template '{date|age}\n' |
|
1951 | 1951 | 7 years from now |
|
1952 | 1952 | |
|
1953 | 1953 | $ cd .. |
|
1954 | 1954 | $ rm -rf unstable-hash |
|
1955 | 1955 | |
|
1956 | 1956 | Add a dummy commit to make up for the instability of the above: |
|
1957 | 1957 | |
|
1958 | 1958 | $ echo a > a |
|
1959 | 1959 | $ hg add a |
|
1960 | 1960 | $ hg ci -m future |
|
1961 | 1961 | |
|
1962 | 1962 | Count filter: |
|
1963 | 1963 | |
|
1964 | 1964 | $ hg log -l1 --template '{node|count} {node|short|count}\n' |
|
1965 | 1965 | 40 12 |
|
1966 | 1966 | |
|
1967 | 1967 | $ hg log -l1 --template '{revset("null^")|count} {revset(".")|count} {revset("0::3")|count}\n' |
|
1968 | 1968 | 0 1 4 |
|
1969 | 1969 | |
|
1970 | 1970 | $ hg log -G --template '{rev}: children: {children|count}, \ |
|
1971 | 1971 | > tags: {tags|count}, file_adds: {file_adds|count}, \ |
|
1972 | 1972 | > ancestors: {revset("ancestors(%s)", rev)|count}' |
|
1973 | 1973 | @ 9: children: 0, tags: 1, file_adds: 1, ancestors: 3 |
|
1974 | 1974 | | |
|
1975 | 1975 | o 8: children: 1, tags: 0, file_adds: 2, ancestors: 2 |
|
1976 | 1976 | | |
|
1977 | 1977 | o 7: children: 1, tags: 0, file_adds: 1, ancestors: 1 |
|
1978 | 1978 | |
|
1979 | 1979 | o 6: children: 0, tags: 0, file_adds: 0, ancestors: 7 |
|
1980 | 1980 | |\ |
|
1981 | 1981 | | o 5: children: 1, tags: 0, file_adds: 1, ancestors: 5 |
|
1982 | 1982 | | | |
|
1983 | 1983 | o | 4: children: 1, tags: 0, file_adds: 0, ancestors: 5 |
|
1984 | 1984 | |/ |
|
1985 | 1985 | o 3: children: 2, tags: 0, file_adds: 0, ancestors: 4 |
|
1986 | 1986 | | |
|
1987 | 1987 | o 2: children: 1, tags: 0, file_adds: 1, ancestors: 3 |
|
1988 | 1988 | | |
|
1989 | 1989 | o 1: children: 1, tags: 0, file_adds: 1, ancestors: 2 |
|
1990 | 1990 | | |
|
1991 | 1991 | o 0: children: 1, tags: 0, file_adds: 1, ancestors: 1 |
|
1992 | 1992 | |
|
1993 | 1993 | |
|
1994 | 1994 | Upper/lower filters: |
|
1995 | 1995 | |
|
1996 | 1996 | $ hg log -r0 --template '{branch|upper}\n' |
|
1997 | 1997 | DEFAULT |
|
1998 | 1998 | $ hg log -r0 --template '{author|lower}\n' |
|
1999 | 1999 | user name <user@hostname> |
|
2000 | 2000 | $ hg log -r0 --template '{date|upper}\n' |
|
2001 | 2001 | abort: template filter 'upper' is not compatible with keyword 'date' |
|
2002 | 2002 | [255] |
|
2003 | 2003 | |
|
2004 | 2004 | Add a commit that does all possible modifications at once |
|
2005 | 2005 | |
|
2006 | 2006 | $ echo modify >> third |
|
2007 | 2007 | $ touch b |
|
2008 | 2008 | $ hg add b |
|
2009 | 2009 | $ hg mv fourth fifth |
|
2010 | 2010 | $ hg rm a |
|
2011 | 2011 | $ hg ci -m "Modify, add, remove, rename" |
|
2012 | 2012 | |
|
2013 | 2013 | Check the status template |
|
2014 | 2014 | |
|
2015 | 2015 | $ cat <<EOF >> $HGRCPATH |
|
2016 | 2016 | > [extensions] |
|
2017 | 2017 | > color= |
|
2018 | 2018 | > EOF |
|
2019 | 2019 | |
|
2020 | 2020 | $ hg log -T status -r 10 |
|
2021 | 2021 | changeset: 10:0f9759ec227a |
|
2022 | 2022 | tag: tip |
|
2023 | 2023 | user: test |
|
2024 | 2024 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
2025 | 2025 | summary: Modify, add, remove, rename |
|
2026 | 2026 | files: |
|
2027 | 2027 | M third |
|
2028 | 2028 | A b |
|
2029 | 2029 | A fifth |
|
2030 | 2030 | R a |
|
2031 | 2031 | R fourth |
|
2032 | 2032 | |
|
2033 | 2033 | $ hg log -T status -C -r 10 |
|
2034 | 2034 | changeset: 10:0f9759ec227a |
|
2035 | 2035 | tag: tip |
|
2036 | 2036 | user: test |
|
2037 | 2037 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
2038 | 2038 | summary: Modify, add, remove, rename |
|
2039 | 2039 | files: |
|
2040 | 2040 | M third |
|
2041 | 2041 | A b |
|
2042 | 2042 | A fifth |
|
2043 | 2043 | fourth |
|
2044 | 2044 | R a |
|
2045 | 2045 | R fourth |
|
2046 | 2046 | |
|
2047 | 2047 | $ hg log -T status -C -r 10 -v |
|
2048 | 2048 | changeset: 10:0f9759ec227a |
|
2049 | 2049 | tag: tip |
|
2050 | 2050 | user: test |
|
2051 | 2051 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
2052 | 2052 | description: |
|
2053 | 2053 | Modify, add, remove, rename |
|
2054 | 2054 | |
|
2055 | 2055 | files: |
|
2056 | 2056 | M third |
|
2057 | 2057 | A b |
|
2058 | 2058 | A fifth |
|
2059 | 2059 | fourth |
|
2060 | 2060 | R a |
|
2061 | 2061 | R fourth |
|
2062 | 2062 | |
|
2063 | 2063 | $ hg log -T status -C -r 10 --debug |
|
2064 | 2064 | changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c |
|
2065 | 2065 | tag: tip |
|
2066 | 2066 | phase: secret |
|
2067 | 2067 | parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066 |
|
2068 | 2068 | parent: -1:0000000000000000000000000000000000000000 |
|
2069 | 2069 | manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567 |
|
2070 | 2070 | user: test |
|
2071 | 2071 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
2072 | 2072 | extra: branch=default |
|
2073 | 2073 | description: |
|
2074 | 2074 | Modify, add, remove, rename |
|
2075 | 2075 | |
|
2076 | 2076 | files: |
|
2077 | 2077 | M third |
|
2078 | 2078 | A b |
|
2079 | 2079 | A fifth |
|
2080 | 2080 | fourth |
|
2081 | 2081 | R a |
|
2082 | 2082 | R fourth |
|
2083 | 2083 | |
|
2084 | 2084 | $ hg log -T status -C -r 10 --quiet |
|
2085 | 2085 | 10:0f9759ec227a |
|
2086 | 2086 | $ hg --color=debug log -T status -r 10 |
|
2087 | 2087 | [log.changeset changeset.secret|changeset: 10:0f9759ec227a] |
|
2088 | 2088 | [log.tag|tag: tip] |
|
2089 | 2089 | [log.user|user: test] |
|
2090 | 2090 | [log.date|date: Thu Jan 01 00:00:00 1970 +0000] |
|
2091 | 2091 | [log.summary|summary: Modify, add, remove, rename] |
|
2092 | 2092 | [ui.note log.files|files:] |
|
2093 | 2093 | [status.modified|M third] |
|
2094 | 2094 | [status.added|A b] |
|
2095 | 2095 | [status.added|A fifth] |
|
2096 | 2096 | [status.removed|R a] |
|
2097 | 2097 | [status.removed|R fourth] |
|
2098 | 2098 | |
|
2099 | 2099 | $ hg --color=debug log -T status -C -r 10 |
|
2100 | 2100 | [log.changeset changeset.secret|changeset: 10:0f9759ec227a] |
|
2101 | 2101 | [log.tag|tag: tip] |
|
2102 | 2102 | [log.user|user: test] |
|
2103 | 2103 | [log.date|date: Thu Jan 01 00:00:00 1970 +0000] |
|
2104 | 2104 | [log.summary|summary: Modify, add, remove, rename] |
|
2105 | 2105 | [ui.note log.files|files:] |
|
2106 | 2106 | [status.modified|M third] |
|
2107 | 2107 | [status.added|A b] |
|
2108 | 2108 | [status.added|A fifth] |
|
2109 | 2109 | [status.copied| fourth] |
|
2110 | 2110 | [status.removed|R a] |
|
2111 | 2111 | [status.removed|R fourth] |
|
2112 | 2112 | |
|
2113 | 2113 | $ hg --color=debug log -T status -C -r 10 -v |
|
2114 | 2114 | [log.changeset changeset.secret|changeset: 10:0f9759ec227a] |
|
2115 | 2115 | [log.tag|tag: tip] |
|
2116 | 2116 | [log.user|user: test] |
|
2117 | 2117 | [log.date|date: Thu Jan 01 00:00:00 1970 +0000] |
|
2118 | 2118 | [ui.note log.description|description:] |
|
2119 | 2119 | [ui.note log.description|Modify, add, remove, rename] |
|
2120 | 2120 | |
|
2121 | 2121 | [ui.note log.files|files:] |
|
2122 | 2122 | [status.modified|M third] |
|
2123 | 2123 | [status.added|A b] |
|
2124 | 2124 | [status.added|A fifth] |
|
2125 | 2125 | [status.copied| fourth] |
|
2126 | 2126 | [status.removed|R a] |
|
2127 | 2127 | [status.removed|R fourth] |
|
2128 | 2128 | |
|
2129 | 2129 | $ hg --color=debug log -T status -C -r 10 --debug |
|
2130 | 2130 | [log.changeset changeset.secret|changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c] |
|
2131 | 2131 | [log.tag|tag: tip] |
|
2132 | 2132 | [log.phase|phase: secret] |
|
2133 | 2133 | [log.parent changeset.secret|parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066] |
|
2134 | 2134 | [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000] |
|
2135 | 2135 | [ui.debug log.manifest|manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567] |
|
2136 | 2136 | [log.user|user: test] |
|
2137 | 2137 | [log.date|date: Thu Jan 01 00:00:00 1970 +0000] |
|
2138 | 2138 | [ui.debug log.extra|extra: branch=default] |
|
2139 | 2139 | [ui.note log.description|description:] |
|
2140 | 2140 | [ui.note log.description|Modify, add, remove, rename] |
|
2141 | 2141 | |
|
2142 | 2142 | [ui.note log.files|files:] |
|
2143 | 2143 | [status.modified|M third] |
|
2144 | 2144 | [status.added|A b] |
|
2145 | 2145 | [status.added|A fifth] |
|
2146 | 2146 | [status.copied| fourth] |
|
2147 | 2147 | [status.removed|R a] |
|
2148 | 2148 | [status.removed|R fourth] |
|
2149 | 2149 | |
|
2150 | 2150 | $ hg --color=debug log -T status -C -r 10 --quiet |
|
2151 | 2151 | [log.node|10:0f9759ec227a] |
|
2152 | 2152 | |
|
2153 | 2153 | Check the bisect template |
|
2154 | 2154 | |
|
2155 | 2155 | $ hg bisect -g 1 |
|
2156 | 2156 | $ hg bisect -b 3 --noupdate |
|
2157 | 2157 | Testing changeset 2:97054abb4ab8 (2 changesets remaining, ~1 tests) |
|
2158 | 2158 | $ hg log -T bisect -r 0:4 |
|
2159 | 2159 | changeset: 0:1e4e1b8f71e0 |
|
2160 | 2160 | bisect: good (implicit) |
|
2161 | 2161 | user: User Name <user@hostname> |
|
2162 | 2162 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
2163 | 2163 | summary: line 1 |
|
2164 | 2164 | |
|
2165 | 2165 | changeset: 1:b608e9d1a3f0 |
|
2166 | 2166 | bisect: good |
|
2167 | 2167 | user: A. N. Other <other@place> |
|
2168 | 2168 | date: Tue Jan 13 17:33:20 1970 +0000 |
|
2169 | 2169 | summary: other 1 |
|
2170 | 2170 | |
|
2171 | 2171 | changeset: 2:97054abb4ab8 |
|
2172 | 2172 | bisect: untested |
|
2173 | 2173 | user: other@place |
|
2174 | 2174 | date: Wed Jan 14 21:20:00 1970 +0000 |
|
2175 | 2175 | summary: no person |
|
2176 | 2176 | |
|
2177 | 2177 | changeset: 3:10e46f2dcbf4 |
|
2178 | 2178 | bisect: bad |
|
2179 | 2179 | user: person |
|
2180 | 2180 | date: Fri Jan 16 01:06:40 1970 +0000 |
|
2181 | 2181 | summary: no user, no domain |
|
2182 | 2182 | |
|
2183 | 2183 | changeset: 4:bbe44766e73d |
|
2184 | 2184 | bisect: bad (implicit) |
|
2185 | 2185 | branch: foo |
|
2186 | 2186 | user: person |
|
2187 | 2187 | date: Sat Jan 17 04:53:20 1970 +0000 |
|
2188 | 2188 | summary: new branch |
|
2189 | 2189 | |
|
2190 | 2190 | $ hg log --debug -T bisect -r 0:4 |
|
2191 | 2191 | changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f |
|
2192 | 2192 | bisect: good (implicit) |
|
2193 | 2193 | phase: public |
|
2194 | 2194 | parent: -1:0000000000000000000000000000000000000000 |
|
2195 | 2195 | parent: -1:0000000000000000000000000000000000000000 |
|
2196 | 2196 | manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 |
|
2197 | 2197 | user: User Name <user@hostname> |
|
2198 | 2198 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
2199 | 2199 | files+: a |
|
2200 | 2200 | extra: branch=default |
|
2201 | 2201 | description: |
|
2202 | 2202 | line 1 |
|
2203 | 2203 | line 2 |
|
2204 | 2204 | |
|
2205 | 2205 | |
|
2206 | 2206 | changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965 |
|
2207 | 2207 | bisect: good |
|
2208 | 2208 | phase: public |
|
2209 | 2209 | parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f |
|
2210 | 2210 | parent: -1:0000000000000000000000000000000000000000 |
|
2211 | 2211 | manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55 |
|
2212 | 2212 | user: A. N. Other <other@place> |
|
2213 | 2213 | date: Tue Jan 13 17:33:20 1970 +0000 |
|
2214 | 2214 | files+: b |
|
2215 | 2215 | extra: branch=default |
|
2216 | 2216 | description: |
|
2217 | 2217 | other 1 |
|
2218 | 2218 | other 2 |
|
2219 | 2219 | |
|
2220 | 2220 | other 3 |
|
2221 | 2221 | |
|
2222 | 2222 | |
|
2223 | 2223 | changeset: 2:97054abb4ab824450e9164180baf491ae0078465 |
|
2224 | 2224 | bisect: untested |
|
2225 | 2225 | phase: public |
|
2226 | 2226 | parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965 |
|
2227 | 2227 | parent: -1:0000000000000000000000000000000000000000 |
|
2228 | 2228 | manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1 |
|
2229 | 2229 | user: other@place |
|
2230 | 2230 | date: Wed Jan 14 21:20:00 1970 +0000 |
|
2231 | 2231 | files+: c |
|
2232 | 2232 | extra: branch=default |
|
2233 | 2233 | description: |
|
2234 | 2234 | no person |
|
2235 | 2235 | |
|
2236 | 2236 | |
|
2237 | 2237 | changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 |
|
2238 | 2238 | bisect: bad |
|
2239 | 2239 | phase: public |
|
2240 | 2240 | parent: 2:97054abb4ab824450e9164180baf491ae0078465 |
|
2241 | 2241 | parent: -1:0000000000000000000000000000000000000000 |
|
2242 | 2242 | manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc |
|
2243 | 2243 | user: person |
|
2244 | 2244 | date: Fri Jan 16 01:06:40 1970 +0000 |
|
2245 | 2245 | files: c |
|
2246 | 2246 | extra: branch=default |
|
2247 | 2247 | description: |
|
2248 | 2248 | no user, no domain |
|
2249 | 2249 | |
|
2250 | 2250 | |
|
2251 | 2251 | changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74 |
|
2252 | 2252 | bisect: bad (implicit) |
|
2253 | 2253 | branch: foo |
|
2254 | 2254 | phase: draft |
|
2255 | 2255 | parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 |
|
2256 | 2256 | parent: -1:0000000000000000000000000000000000000000 |
|
2257 | 2257 | manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc |
|
2258 | 2258 | user: person |
|
2259 | 2259 | date: Sat Jan 17 04:53:20 1970 +0000 |
|
2260 | 2260 | extra: branch=foo |
|
2261 | 2261 | description: |
|
2262 | 2262 | new branch |
|
2263 | 2263 | |
|
2264 | 2264 | |
|
2265 | 2265 | $ hg log -v -T bisect -r 0:4 |
|
2266 | 2266 | changeset: 0:1e4e1b8f71e0 |
|
2267 | 2267 | bisect: good (implicit) |
|
2268 | 2268 | user: User Name <user@hostname> |
|
2269 | 2269 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
2270 | 2270 | files: a |
|
2271 | 2271 | description: |
|
2272 | 2272 | line 1 |
|
2273 | 2273 | line 2 |
|
2274 | 2274 | |
|
2275 | 2275 | |
|
2276 | 2276 | changeset: 1:b608e9d1a3f0 |
|
2277 | 2277 | bisect: good |
|
2278 | 2278 | user: A. N. Other <other@place> |
|
2279 | 2279 | date: Tue Jan 13 17:33:20 1970 +0000 |
|
2280 | 2280 | files: b |
|
2281 | 2281 | description: |
|
2282 | 2282 | other 1 |
|
2283 | 2283 | other 2 |
|
2284 | 2284 | |
|
2285 | 2285 | other 3 |
|
2286 | 2286 | |
|
2287 | 2287 | |
|
2288 | 2288 | changeset: 2:97054abb4ab8 |
|
2289 | 2289 | bisect: untested |
|
2290 | 2290 | user: other@place |
|
2291 | 2291 | date: Wed Jan 14 21:20:00 1970 +0000 |
|
2292 | 2292 | files: c |
|
2293 | 2293 | description: |
|
2294 | 2294 | no person |
|
2295 | 2295 | |
|
2296 | 2296 | |
|
2297 | 2297 | changeset: 3:10e46f2dcbf4 |
|
2298 | 2298 | bisect: bad |
|
2299 | 2299 | user: person |
|
2300 | 2300 | date: Fri Jan 16 01:06:40 1970 +0000 |
|
2301 | 2301 | files: c |
|
2302 | 2302 | description: |
|
2303 | 2303 | no user, no domain |
|
2304 | 2304 | |
|
2305 | 2305 | |
|
2306 | 2306 | changeset: 4:bbe44766e73d |
|
2307 | 2307 | bisect: bad (implicit) |
|
2308 | 2308 | branch: foo |
|
2309 | 2309 | user: person |
|
2310 | 2310 | date: Sat Jan 17 04:53:20 1970 +0000 |
|
2311 | 2311 | description: |
|
2312 | 2312 | new branch |
|
2313 | 2313 | |
|
2314 | 2314 | |
|
2315 | 2315 | $ hg --color=debug log -T bisect -r 0:4 |
|
2316 | 2316 | [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0] |
|
2317 | 2317 | [log.bisect bisect.good|bisect: good (implicit)] |
|
2318 | 2318 | [log.user|user: User Name <user@hostname>] |
|
2319 | 2319 | [log.date|date: Mon Jan 12 13:46:40 1970 +0000] |
|
2320 | 2320 | [log.summary|summary: line 1] |
|
2321 | 2321 | |
|
2322 | 2322 | [log.changeset changeset.public|changeset: 1:b608e9d1a3f0] |
|
2323 | 2323 | [log.bisect bisect.good|bisect: good] |
|
2324 | 2324 | [log.user|user: A. N. Other <other@place>] |
|
2325 | 2325 | [log.date|date: Tue Jan 13 17:33:20 1970 +0000] |
|
2326 | 2326 | [log.summary|summary: other 1] |
|
2327 | 2327 | |
|
2328 | 2328 | [log.changeset changeset.public|changeset: 2:97054abb4ab8] |
|
2329 | 2329 | [log.bisect bisect.untested|bisect: untested] |
|
2330 | 2330 | [log.user|user: other@place] |
|
2331 | 2331 | [log.date|date: Wed Jan 14 21:20:00 1970 +0000] |
|
2332 | 2332 | [log.summary|summary: no person] |
|
2333 | 2333 | |
|
2334 | 2334 | [log.changeset changeset.public|changeset: 3:10e46f2dcbf4] |
|
2335 | 2335 | [log.bisect bisect.bad|bisect: bad] |
|
2336 | 2336 | [log.user|user: person] |
|
2337 | 2337 | [log.date|date: Fri Jan 16 01:06:40 1970 +0000] |
|
2338 | 2338 | [log.summary|summary: no user, no domain] |
|
2339 | 2339 | |
|
2340 | 2340 | [log.changeset changeset.draft|changeset: 4:bbe44766e73d] |
|
2341 | 2341 | [log.bisect bisect.bad|bisect: bad (implicit)] |
|
2342 | 2342 | [log.branch|branch: foo] |
|
2343 | 2343 | [log.user|user: person] |
|
2344 | 2344 | [log.date|date: Sat Jan 17 04:53:20 1970 +0000] |
|
2345 | 2345 | [log.summary|summary: new branch] |
|
2346 | 2346 | |
|
2347 | 2347 | $ hg --color=debug log --debug -T bisect -r 0:4 |
|
2348 | 2348 | [log.changeset changeset.public|changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f] |
|
2349 | 2349 | [log.bisect bisect.good|bisect: good (implicit)] |
|
2350 | 2350 | [log.phase|phase: public] |
|
2351 | 2351 | [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000] |
|
2352 | 2352 | [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000] |
|
2353 | 2353 | [ui.debug log.manifest|manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0] |
|
2354 | 2354 | [log.user|user: User Name <user@hostname>] |
|
2355 | 2355 | [log.date|date: Mon Jan 12 13:46:40 1970 +0000] |
|
2356 | 2356 | [ui.debug log.files|files+: a] |
|
2357 | 2357 | [ui.debug log.extra|extra: branch=default] |
|
2358 | 2358 | [ui.note log.description|description:] |
|
2359 | 2359 | [ui.note log.description|line 1 |
|
2360 | 2360 | line 2] |
|
2361 | 2361 | |
|
2362 | 2362 | |
|
2363 | 2363 | [log.changeset changeset.public|changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965] |
|
2364 | 2364 | [log.bisect bisect.good|bisect: good] |
|
2365 | 2365 | [log.phase|phase: public] |
|
2366 | 2366 | [log.parent changeset.public|parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f] |
|
2367 | 2367 | [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000] |
|
2368 | 2368 | [ui.debug log.manifest|manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55] |
|
2369 | 2369 | [log.user|user: A. N. Other <other@place>] |
|
2370 | 2370 | [log.date|date: Tue Jan 13 17:33:20 1970 +0000] |
|
2371 | 2371 | [ui.debug log.files|files+: b] |
|
2372 | 2372 | [ui.debug log.extra|extra: branch=default] |
|
2373 | 2373 | [ui.note log.description|description:] |
|
2374 | 2374 | [ui.note log.description|other 1 |
|
2375 | 2375 | other 2 |
|
2376 | 2376 | |
|
2377 | 2377 | other 3] |
|
2378 | 2378 | |
|
2379 | 2379 | |
|
2380 | 2380 | [log.changeset changeset.public|changeset: 2:97054abb4ab824450e9164180baf491ae0078465] |
|
2381 | 2381 | [log.bisect bisect.untested|bisect: untested] |
|
2382 | 2382 | [log.phase|phase: public] |
|
2383 | 2383 | [log.parent changeset.public|parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965] |
|
2384 | 2384 | [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000] |
|
2385 | 2385 | [ui.debug log.manifest|manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1] |
|
2386 | 2386 | [log.user|user: other@place] |
|
2387 | 2387 | [log.date|date: Wed Jan 14 21:20:00 1970 +0000] |
|
2388 | 2388 | [ui.debug log.files|files+: c] |
|
2389 | 2389 | [ui.debug log.extra|extra: branch=default] |
|
2390 | 2390 | [ui.note log.description|description:] |
|
2391 | 2391 | [ui.note log.description|no person] |
|
2392 | 2392 | |
|
2393 | 2393 | |
|
2394 | 2394 | [log.changeset changeset.public|changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47] |
|
2395 | 2395 | [log.bisect bisect.bad|bisect: bad] |
|
2396 | 2396 | [log.phase|phase: public] |
|
2397 | 2397 | [log.parent changeset.public|parent: 2:97054abb4ab824450e9164180baf491ae0078465] |
|
2398 | 2398 | [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000] |
|
2399 | 2399 | [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc] |
|
2400 | 2400 | [log.user|user: person] |
|
2401 | 2401 | [log.date|date: Fri Jan 16 01:06:40 1970 +0000] |
|
2402 | 2402 | [ui.debug log.files|files: c] |
|
2403 | 2403 | [ui.debug log.extra|extra: branch=default] |
|
2404 | 2404 | [ui.note log.description|description:] |
|
2405 | 2405 | [ui.note log.description|no user, no domain] |
|
2406 | 2406 | |
|
2407 | 2407 | |
|
2408 | 2408 | [log.changeset changeset.draft|changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74] |
|
2409 | 2409 | [log.bisect bisect.bad|bisect: bad (implicit)] |
|
2410 | 2410 | [log.branch|branch: foo] |
|
2411 | 2411 | [log.phase|phase: draft] |
|
2412 | 2412 | [log.parent changeset.public|parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47] |
|
2413 | 2413 | [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000] |
|
2414 | 2414 | [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc] |
|
2415 | 2415 | [log.user|user: person] |
|
2416 | 2416 | [log.date|date: Sat Jan 17 04:53:20 1970 +0000] |
|
2417 | 2417 | [ui.debug log.extra|extra: branch=foo] |
|
2418 | 2418 | [ui.note log.description|description:] |
|
2419 | 2419 | [ui.note log.description|new branch] |
|
2420 | 2420 | |
|
2421 | 2421 | |
|
2422 | 2422 | $ hg --color=debug log -v -T bisect -r 0:4 |
|
2423 | 2423 | [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0] |
|
2424 | 2424 | [log.bisect bisect.good|bisect: good (implicit)] |
|
2425 | 2425 | [log.user|user: User Name <user@hostname>] |
|
2426 | 2426 | [log.date|date: Mon Jan 12 13:46:40 1970 +0000] |
|
2427 | 2427 | [ui.note log.files|files: a] |
|
2428 | 2428 | [ui.note log.description|description:] |
|
2429 | 2429 | [ui.note log.description|line 1 |
|
2430 | 2430 | line 2] |
|
2431 | 2431 | |
|
2432 | 2432 | |
|
2433 | 2433 | [log.changeset changeset.public|changeset: 1:b608e9d1a3f0] |
|
2434 | 2434 | [log.bisect bisect.good|bisect: good] |
|
2435 | 2435 | [log.user|user: A. N. Other <other@place>] |
|
2436 | 2436 | [log.date|date: Tue Jan 13 17:33:20 1970 +0000] |
|
2437 | 2437 | [ui.note log.files|files: b] |
|
2438 | 2438 | [ui.note log.description|description:] |
|
2439 | 2439 | [ui.note log.description|other 1 |
|
2440 | 2440 | other 2 |
|
2441 | 2441 | |
|
2442 | 2442 | other 3] |
|
2443 | 2443 | |
|
2444 | 2444 | |
|
2445 | 2445 | [log.changeset changeset.public|changeset: 2:97054abb4ab8] |
|
2446 | 2446 | [log.bisect bisect.untested|bisect: untested] |
|
2447 | 2447 | [log.user|user: other@place] |
|
2448 | 2448 | [log.date|date: Wed Jan 14 21:20:00 1970 +0000] |
|
2449 | 2449 | [ui.note log.files|files: c] |
|
2450 | 2450 | [ui.note log.description|description:] |
|
2451 | 2451 | [ui.note log.description|no person] |
|
2452 | 2452 | |
|
2453 | 2453 | |
|
2454 | 2454 | [log.changeset changeset.public|changeset: 3:10e46f2dcbf4] |
|
2455 | 2455 | [log.bisect bisect.bad|bisect: bad] |
|
2456 | 2456 | [log.user|user: person] |
|
2457 | 2457 | [log.date|date: Fri Jan 16 01:06:40 1970 +0000] |
|
2458 | 2458 | [ui.note log.files|files: c] |
|
2459 | 2459 | [ui.note log.description|description:] |
|
2460 | 2460 | [ui.note log.description|no user, no domain] |
|
2461 | 2461 | |
|
2462 | 2462 | |
|
2463 | 2463 | [log.changeset changeset.draft|changeset: 4:bbe44766e73d] |
|
2464 | 2464 | [log.bisect bisect.bad|bisect: bad (implicit)] |
|
2465 | 2465 | [log.branch|branch: foo] |
|
2466 | 2466 | [log.user|user: person] |
|
2467 | 2467 | [log.date|date: Sat Jan 17 04:53:20 1970 +0000] |
|
2468 | 2468 | [ui.note log.description|description:] |
|
2469 | 2469 | [ui.note log.description|new branch] |
|
2470 | 2470 | |
|
2471 | 2471 | |
|
2472 | 2472 | $ hg bisect --reset |
|
2473 | 2473 | |
|
2474 | 2474 | Error on syntax: |
|
2475 | 2475 | |
|
2476 | 2476 | $ echo 'x = "f' >> t |
|
2477 | 2477 | $ hg log |
|
2478 | 2478 | abort: t:3: unmatched quotes |
|
2479 | 2479 | [255] |
|
2480 | 2480 | |
|
2481 | 2481 | $ hg log -T '{date' |
|
2482 | 2482 | hg: parse error at 1: unterminated template expansion |
|
2483 | 2483 | [255] |
|
2484 | 2484 | |
|
2485 | 2485 | Behind the scenes, this will throw TypeError |
|
2486 | 2486 | |
|
2487 | 2487 | $ hg log -l 3 --template '{date|obfuscate}\n' |
|
2488 | 2488 | abort: template filter 'obfuscate' is not compatible with keyword 'date' |
|
2489 | 2489 | [255] |
|
2490 | 2490 | |
|
2491 | 2491 | Behind the scenes, this will throw a ValueError |
|
2492 | 2492 | |
|
2493 | 2493 | $ hg log -l 3 --template 'line: {desc|shortdate}\n' |
|
2494 | 2494 | abort: template filter 'shortdate' is not compatible with keyword 'desc' |
|
2495 | 2495 | [255] |
|
2496 | 2496 | |
|
2497 | 2497 | Behind the scenes, this will throw AttributeError |
|
2498 | 2498 | |
|
2499 | 2499 | $ hg log -l 3 --template 'line: {date|escape}\n' |
|
2500 | 2500 | abort: template filter 'escape' is not compatible with keyword 'date' |
|
2501 | 2501 | [255] |
|
2502 | 2502 | |
|
2503 | 2503 | $ hg log -l 3 --template 'line: {extras|localdate}\n' |
|
2504 | 2504 | hg: parse error: localdate expects a date information |
|
2505 | 2505 | [255] |
|
2506 | 2506 | |
|
2507 | 2507 | Behind the scenes, this will throw ValueError |
|
2508 | 2508 | |
|
2509 | 2509 | $ hg tip --template '{author|email|date}\n' |
|
2510 | 2510 | hg: parse error: date expects a date information |
|
2511 | 2511 | [255] |
|
2512 | 2512 | |
|
2513 | 2513 | Error in nested template: |
|
2514 | 2514 | |
|
2515 | 2515 | $ hg log -T '{"date' |
|
2516 | 2516 | hg: parse error at 2: unterminated string |
|
2517 | 2517 | [255] |
|
2518 | 2518 | |
|
2519 | 2519 | $ hg log -T '{"foo{date|=}"}' |
|
2520 | 2520 | hg: parse error at 11: syntax error |
|
2521 | 2521 | [255] |
|
2522 | 2522 | |
|
2523 | 2523 | Thrown an error if a template function doesn't exist |
|
2524 | 2524 | |
|
2525 | 2525 | $ hg tip --template '{foo()}\n' |
|
2526 | 2526 | hg: parse error: unknown function 'foo' |
|
2527 | 2527 | [255] |
|
2528 | 2528 | |
|
2529 | 2529 | Pass generator object created by template function to filter |
|
2530 | 2530 | |
|
2531 | 2531 | $ hg log -l 1 --template '{if(author, author)|user}\n' |
|
2532 | 2532 | test |
|
2533 | 2533 | |
|
2534 | 2534 | Test diff function: |
|
2535 | 2535 | |
|
2536 | 2536 | $ hg diff -c 8 |
|
2537 | 2537 | diff -r 29114dbae42b -r 95c24699272e fourth |
|
2538 | 2538 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
2539 | 2539 | +++ b/fourth Wed Jan 01 10:01:00 2020 +0000 |
|
2540 | 2540 | @@ -0,0 +1,1 @@ |
|
2541 | 2541 | +second |
|
2542 | 2542 | diff -r 29114dbae42b -r 95c24699272e second |
|
2543 | 2543 | --- a/second Mon Jan 12 13:46:40 1970 +0000 |
|
2544 | 2544 | +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
2545 | 2545 | @@ -1,1 +0,0 @@ |
|
2546 | 2546 | -second |
|
2547 | 2547 | diff -r 29114dbae42b -r 95c24699272e third |
|
2548 | 2548 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
2549 | 2549 | +++ b/third Wed Jan 01 10:01:00 2020 +0000 |
|
2550 | 2550 | @@ -0,0 +1,1 @@ |
|
2551 | 2551 | +third |
|
2552 | 2552 | |
|
2553 | 2553 | $ hg log -r 8 -T "{diff()}" |
|
2554 | 2554 | diff -r 29114dbae42b -r 95c24699272e fourth |
|
2555 | 2555 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
2556 | 2556 | +++ b/fourth Wed Jan 01 10:01:00 2020 +0000 |
|
2557 | 2557 | @@ -0,0 +1,1 @@ |
|
2558 | 2558 | +second |
|
2559 | 2559 | diff -r 29114dbae42b -r 95c24699272e second |
|
2560 | 2560 | --- a/second Mon Jan 12 13:46:40 1970 +0000 |
|
2561 | 2561 | +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
2562 | 2562 | @@ -1,1 +0,0 @@ |
|
2563 | 2563 | -second |
|
2564 | 2564 | diff -r 29114dbae42b -r 95c24699272e third |
|
2565 | 2565 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
2566 | 2566 | +++ b/third Wed Jan 01 10:01:00 2020 +0000 |
|
2567 | 2567 | @@ -0,0 +1,1 @@ |
|
2568 | 2568 | +third |
|
2569 | 2569 | |
|
2570 | 2570 | $ hg log -r 8 -T "{diff('glob:f*')}" |
|
2571 | 2571 | diff -r 29114dbae42b -r 95c24699272e fourth |
|
2572 | 2572 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
2573 | 2573 | +++ b/fourth Wed Jan 01 10:01:00 2020 +0000 |
|
2574 | 2574 | @@ -0,0 +1,1 @@ |
|
2575 | 2575 | +second |
|
2576 | 2576 | |
|
2577 | 2577 | $ hg log -r 8 -T "{diff('', 'glob:f*')}" |
|
2578 | 2578 | diff -r 29114dbae42b -r 95c24699272e second |
|
2579 | 2579 | --- a/second Mon Jan 12 13:46:40 1970 +0000 |
|
2580 | 2580 | +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
2581 | 2581 | @@ -1,1 +0,0 @@ |
|
2582 | 2582 | -second |
|
2583 | 2583 | diff -r 29114dbae42b -r 95c24699272e third |
|
2584 | 2584 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
2585 | 2585 | +++ b/third Wed Jan 01 10:01:00 2020 +0000 |
|
2586 | 2586 | @@ -0,0 +1,1 @@ |
|
2587 | 2587 | +third |
|
2588 | 2588 | |
|
2589 | 2589 | $ hg log -r 8 -T "{diff('FOURTH'|lower)}" |
|
2590 | 2590 | diff -r 29114dbae42b -r 95c24699272e fourth |
|
2591 | 2591 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
2592 | 2592 | +++ b/fourth Wed Jan 01 10:01:00 2020 +0000 |
|
2593 | 2593 | @@ -0,0 +1,1 @@ |
|
2594 | 2594 | +second |
|
2595 | 2595 | |
|
2596 | 2596 | $ cd .. |
|
2597 | 2597 | |
|
2598 | 2598 | |
|
2599 | 2599 | latesttag: |
|
2600 | 2600 | |
|
2601 | 2601 | $ hg init latesttag |
|
2602 | 2602 | $ cd latesttag |
|
2603 | 2603 | |
|
2604 | 2604 | $ echo a > file |
|
2605 | 2605 | $ hg ci -Am a -d '0 0' |
|
2606 | 2606 | adding file |
|
2607 | 2607 | |
|
2608 | 2608 | $ echo b >> file |
|
2609 | 2609 | $ hg ci -m b -d '1 0' |
|
2610 | 2610 | |
|
2611 | 2611 | $ echo c >> head1 |
|
2612 | 2612 | $ hg ci -Am h1c -d '2 0' |
|
2613 | 2613 | adding head1 |
|
2614 | 2614 | |
|
2615 | 2615 | $ hg update -q 1 |
|
2616 | 2616 | $ echo d >> head2 |
|
2617 | 2617 | $ hg ci -Am h2d -d '3 0' |
|
2618 | 2618 | adding head2 |
|
2619 | 2619 | created new head |
|
2620 | 2620 | |
|
2621 | 2621 | $ echo e >> head2 |
|
2622 | 2622 | $ hg ci -m h2e -d '4 0' |
|
2623 | 2623 | |
|
2624 | 2624 | $ hg merge -q |
|
2625 | 2625 | $ hg ci -m merge -d '5 -3600' |
|
2626 | 2626 | |
|
2627 | 2627 | No tag set: |
|
2628 | 2628 | |
|
2629 | 2629 | $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n' |
|
2630 | 2630 | 5: null+5 |
|
2631 | 2631 | 4: null+4 |
|
2632 | 2632 | 3: null+3 |
|
2633 | 2633 | 2: null+3 |
|
2634 | 2634 | 1: null+2 |
|
2635 | 2635 | 0: null+1 |
|
2636 | 2636 | |
|
2637 | 2637 | One common tag: longest path wins: |
|
2638 | 2638 | |
|
2639 | 2639 | $ hg tag -r 1 -m t1 -d '6 0' t1 |
|
2640 | 2640 | $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n' |
|
2641 | 2641 | 6: t1+4 |
|
2642 | 2642 | 5: t1+3 |
|
2643 | 2643 | 4: t1+2 |
|
2644 | 2644 | 3: t1+1 |
|
2645 | 2645 | 2: t1+1 |
|
2646 | 2646 | 1: t1+0 |
|
2647 | 2647 | 0: null+1 |
|
2648 | 2648 | |
|
2649 | 2649 | One ancestor tag: more recent wins: |
|
2650 | 2650 | |
|
2651 | 2651 | $ hg tag -r 2 -m t2 -d '7 0' t2 |
|
2652 | 2652 | $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n' |
|
2653 | 2653 | 7: t2+3 |
|
2654 | 2654 | 6: t2+2 |
|
2655 | 2655 | 5: t2+1 |
|
2656 | 2656 | 4: t1+2 |
|
2657 | 2657 | 3: t1+1 |
|
2658 | 2658 | 2: t2+0 |
|
2659 | 2659 | 1: t1+0 |
|
2660 | 2660 | 0: null+1 |
|
2661 | 2661 | |
|
2662 | 2662 | Two branch tags: more recent wins: |
|
2663 | 2663 | |
|
2664 | 2664 | $ hg tag -r 3 -m t3 -d '8 0' t3 |
|
2665 | 2665 | $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n' |
|
2666 | 2666 | 8: t3+5 |
|
2667 | 2667 | 7: t3+4 |
|
2668 | 2668 | 6: t3+3 |
|
2669 | 2669 | 5: t3+2 |
|
2670 | 2670 | 4: t3+1 |
|
2671 | 2671 | 3: t3+0 |
|
2672 | 2672 | 2: t2+0 |
|
2673 | 2673 | 1: t1+0 |
|
2674 | 2674 | 0: null+1 |
|
2675 | 2675 | |
|
2676 | 2676 | Merged tag overrides: |
|
2677 | 2677 | |
|
2678 | 2678 | $ hg tag -r 5 -m t5 -d '9 0' t5 |
|
2679 | 2679 | $ hg tag -r 3 -m at3 -d '10 0' at3 |
|
2680 | 2680 | $ hg log --template '{rev}: {latesttag}+{latesttagdistance}\n' |
|
2681 | 2681 | 10: t5+5 |
|
2682 | 2682 | 9: t5+4 |
|
2683 | 2683 | 8: t5+3 |
|
2684 | 2684 | 7: t5+2 |
|
2685 | 2685 | 6: t5+1 |
|
2686 | 2686 | 5: t5+0 |
|
2687 | 2687 | 4: at3:t3+1 |
|
2688 | 2688 | 3: at3:t3+0 |
|
2689 | 2689 | 2: t2+0 |
|
2690 | 2690 | 1: t1+0 |
|
2691 | 2691 | 0: null+1 |
|
2692 | 2692 | |
|
2693 | $ hg log --template "{rev}: {latesttag('re:^t[13]$') % '{tag}, C: {changes}, D: {distance}'}\n" | |
|
2694 | 10: t3, C: 8, D: 7 | |
|
2695 | 9: t3, C: 7, D: 6 | |
|
2696 | 8: t3, C: 6, D: 5 | |
|
2697 | 7: t3, C: 5, D: 4 | |
|
2698 | 6: t3, C: 4, D: 3 | |
|
2699 | 5: t3, C: 3, D: 2 | |
|
2700 | 4: t3, C: 1, D: 1 | |
|
2701 | 3: t3, C: 0, D: 0 | |
|
2702 | 2: t1, C: 1, D: 1 | |
|
2703 | 1: t1, C: 0, D: 0 | |
|
2704 | 0: null, C: 1, D: 1 | |
|
2705 | ||
|
2693 | 2706 | $ cd .. |
|
2694 | 2707 | |
|
2695 | 2708 | |
|
2696 | 2709 | Style path expansion: issue1948 - ui.style option doesn't work on OSX |
|
2697 | 2710 | if it is a relative path |
|
2698 | 2711 | |
|
2699 | 2712 | $ mkdir -p home/styles |
|
2700 | 2713 | |
|
2701 | 2714 | $ cat > home/styles/teststyle <<EOF |
|
2702 | 2715 | > changeset = 'test {rev}:{node|short}\n' |
|
2703 | 2716 | > EOF |
|
2704 | 2717 | |
|
2705 | 2718 | $ HOME=`pwd`/home; export HOME |
|
2706 | 2719 | |
|
2707 | 2720 | $ cat > latesttag/.hg/hgrc <<EOF |
|
2708 | 2721 | > [ui] |
|
2709 | 2722 | > style = ~/styles/teststyle |
|
2710 | 2723 | > EOF |
|
2711 | 2724 | |
|
2712 | 2725 | $ hg -R latesttag tip |
|
2713 | 2726 | test 10:9b4a630e5f5f |
|
2714 | 2727 | |
|
2715 | 2728 | Test recursive showlist template (issue1989): |
|
2716 | 2729 | |
|
2717 | 2730 | $ cat > style1989 <<EOF |
|
2718 | 2731 | > changeset = '{file_mods}{manifest}{extras}' |
|
2719 | 2732 | > file_mod = 'M|{author|person}\n' |
|
2720 | 2733 | > manifest = '{rev},{author}\n' |
|
2721 | 2734 | > extra = '{key}: {author}\n' |
|
2722 | 2735 | > EOF |
|
2723 | 2736 | |
|
2724 | 2737 | $ hg -R latesttag log -r tip --style=style1989 |
|
2725 | 2738 | M|test |
|
2726 | 2739 | 10,test |
|
2727 | 2740 | branch: test |
|
2728 | 2741 | |
|
2729 | 2742 | Test new-style inline templating: |
|
2730 | 2743 | |
|
2731 | 2744 | $ hg log -R latesttag -r tip --template 'modified files: {file_mods % " {file}\n"}\n' |
|
2732 | 2745 | modified files: .hgtags |
|
2733 | 2746 | |
|
2734 | 2747 | Test the sub function of templating for expansion: |
|
2735 | 2748 | |
|
2736 | 2749 | $ hg log -R latesttag -r 10 --template '{sub("[0-9]", "x", "{rev}")}\n' |
|
2737 | 2750 | xx |
|
2738 | 2751 | |
|
2739 | 2752 | $ hg log -R latesttag -r 10 -T '{sub("[", "x", rev)}\n' |
|
2740 | 2753 | hg: parse error: sub got an invalid pattern: [ |
|
2741 | 2754 | [255] |
|
2742 | 2755 | $ hg log -R latesttag -r 10 -T '{sub("[0-9]", r"\1", rev)}\n' |
|
2743 | 2756 | hg: parse error: sub got an invalid replacement: \1 |
|
2744 | 2757 | [255] |
|
2745 | 2758 | |
|
2746 | 2759 | Test the strip function with chars specified: |
|
2747 | 2760 | |
|
2748 | 2761 | $ hg log -R latesttag --template '{desc}\n' |
|
2749 | 2762 | at3 |
|
2750 | 2763 | t5 |
|
2751 | 2764 | t3 |
|
2752 | 2765 | t2 |
|
2753 | 2766 | t1 |
|
2754 | 2767 | merge |
|
2755 | 2768 | h2e |
|
2756 | 2769 | h2d |
|
2757 | 2770 | h1c |
|
2758 | 2771 | b |
|
2759 | 2772 | a |
|
2760 | 2773 | |
|
2761 | 2774 | $ hg log -R latesttag --template '{strip(desc, "te")}\n' |
|
2762 | 2775 | at3 |
|
2763 | 2776 | 5 |
|
2764 | 2777 | 3 |
|
2765 | 2778 | 2 |
|
2766 | 2779 | 1 |
|
2767 | 2780 | merg |
|
2768 | 2781 | h2 |
|
2769 | 2782 | h2d |
|
2770 | 2783 | h1c |
|
2771 | 2784 | b |
|
2772 | 2785 | a |
|
2773 | 2786 | |
|
2774 | 2787 | Test date format: |
|
2775 | 2788 | |
|
2776 | 2789 | $ hg log -R latesttag --template 'date: {date(date, "%y %m %d %S %z")}\n' |
|
2777 | 2790 | date: 70 01 01 10 +0000 |
|
2778 | 2791 | date: 70 01 01 09 +0000 |
|
2779 | 2792 | date: 70 01 01 08 +0000 |
|
2780 | 2793 | date: 70 01 01 07 +0000 |
|
2781 | 2794 | date: 70 01 01 06 +0000 |
|
2782 | 2795 | date: 70 01 01 05 +0100 |
|
2783 | 2796 | date: 70 01 01 04 +0000 |
|
2784 | 2797 | date: 70 01 01 03 +0000 |
|
2785 | 2798 | date: 70 01 01 02 +0000 |
|
2786 | 2799 | date: 70 01 01 01 +0000 |
|
2787 | 2800 | date: 70 01 01 00 +0000 |
|
2788 | 2801 | |
|
2789 | 2802 | Test invalid date: |
|
2790 | 2803 | |
|
2791 | 2804 | $ hg log -R latesttag -T '{date(rev)}\n' |
|
2792 | 2805 | hg: parse error: date expects a date information |
|
2793 | 2806 | [255] |
|
2794 | 2807 | |
|
2795 | 2808 | Test integer literal: |
|
2796 | 2809 | |
|
2797 | 2810 | $ hg log -Ra -r0 -T '{(0)}\n' |
|
2798 | 2811 | 0 |
|
2799 | 2812 | $ hg log -Ra -r0 -T '{(123)}\n' |
|
2800 | 2813 | 123 |
|
2801 | 2814 | $ hg log -Ra -r0 -T '{(-4)}\n' |
|
2802 | 2815 | -4 |
|
2803 | 2816 | $ hg log -Ra -r0 -T '{(-)}\n' |
|
2804 | 2817 | hg: parse error at 2: integer literal without digits |
|
2805 | 2818 | [255] |
|
2806 | 2819 | $ hg log -Ra -r0 -T '{(-a)}\n' |
|
2807 | 2820 | hg: parse error at 2: integer literal without digits |
|
2808 | 2821 | [255] |
|
2809 | 2822 | |
|
2810 | 2823 | top-level integer literal is interpreted as symbol (i.e. variable name): |
|
2811 | 2824 | |
|
2812 | 2825 | $ hg log -Ra -r0 -T '{1}\n' |
|
2813 | 2826 | |
|
2814 | 2827 | $ hg log -Ra -r0 -T '{if("t", "{1}")}\n' |
|
2815 | 2828 | |
|
2816 | 2829 | $ hg log -Ra -r0 -T '{1|stringify}\n' |
|
2817 | 2830 | |
|
2818 | 2831 | |
|
2819 | 2832 | unless explicit symbol is expected: |
|
2820 | 2833 | |
|
2821 | 2834 | $ hg log -Ra -r0 -T '{desc|1}\n' |
|
2822 | 2835 | hg: parse error: expected a symbol, got 'integer' |
|
2823 | 2836 | [255] |
|
2824 | 2837 | $ hg log -Ra -r0 -T '{1()}\n' |
|
2825 | 2838 | hg: parse error: expected a symbol, got 'integer' |
|
2826 | 2839 | [255] |
|
2827 | 2840 | |
|
2828 | 2841 | Test string literal: |
|
2829 | 2842 | |
|
2830 | 2843 | $ hg log -Ra -r0 -T '{"string with no template fragment"}\n' |
|
2831 | 2844 | string with no template fragment |
|
2832 | 2845 | $ hg log -Ra -r0 -T '{"template: {rev}"}\n' |
|
2833 | 2846 | template: 0 |
|
2834 | 2847 | $ hg log -Ra -r0 -T '{r"rawstring: {rev}"}\n' |
|
2835 | 2848 | rawstring: {rev} |
|
2836 | 2849 | |
|
2837 | 2850 | because map operation requires template, raw string can't be used |
|
2838 | 2851 | |
|
2839 | 2852 | $ hg log -Ra -r0 -T '{files % r"rawstring"}\n' |
|
2840 | 2853 | hg: parse error: expected template specifier |
|
2841 | 2854 | [255] |
|
2842 | 2855 | |
|
2843 | 2856 | Test string escaping: |
|
2844 | 2857 | |
|
2845 | 2858 | $ hg log -R latesttag -r 0 --template '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n' |
|
2846 | 2859 | > |
|
2847 | 2860 | <>\n<[> |
|
2848 | 2861 | <>\n<]> |
|
2849 | 2862 | <>\n< |
|
2850 | 2863 | |
|
2851 | 2864 | $ hg log -R latesttag -r 0 \ |
|
2852 | 2865 | > --config ui.logtemplate='>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n' |
|
2853 | 2866 | > |
|
2854 | 2867 | <>\n<[> |
|
2855 | 2868 | <>\n<]> |
|
2856 | 2869 | <>\n< |
|
2857 | 2870 | |
|
2858 | 2871 | $ hg log -R latesttag -r 0 -T esc \ |
|
2859 | 2872 | > --config templates.esc='>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n' |
|
2860 | 2873 | > |
|
2861 | 2874 | <>\n<[> |
|
2862 | 2875 | <>\n<]> |
|
2863 | 2876 | <>\n< |
|
2864 | 2877 | |
|
2865 | 2878 | $ cat <<'EOF' > esctmpl |
|
2866 | 2879 | > changeset = '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n' |
|
2867 | 2880 | > EOF |
|
2868 | 2881 | $ hg log -R latesttag -r 0 --style ./esctmpl |
|
2869 | 2882 | > |
|
2870 | 2883 | <>\n<[> |
|
2871 | 2884 | <>\n<]> |
|
2872 | 2885 | <>\n< |
|
2873 | 2886 | |
|
2874 | 2887 | Test string escaping of quotes: |
|
2875 | 2888 | |
|
2876 | 2889 | $ hg log -Ra -r0 -T '{"\""}\n' |
|
2877 | 2890 | " |
|
2878 | 2891 | $ hg log -Ra -r0 -T '{"\\\""}\n' |
|
2879 | 2892 | \" |
|
2880 | 2893 | $ hg log -Ra -r0 -T '{r"\""}\n' |
|
2881 | 2894 | \" |
|
2882 | 2895 | $ hg log -Ra -r0 -T '{r"\\\""}\n' |
|
2883 | 2896 | \\\" |
|
2884 | 2897 | |
|
2885 | 2898 | |
|
2886 | 2899 | $ hg log -Ra -r0 -T '{"\""}\n' |
|
2887 | 2900 | " |
|
2888 | 2901 | $ hg log -Ra -r0 -T '{"\\\""}\n' |
|
2889 | 2902 | \" |
|
2890 | 2903 | $ hg log -Ra -r0 -T '{r"\""}\n' |
|
2891 | 2904 | \" |
|
2892 | 2905 | $ hg log -Ra -r0 -T '{r"\\\""}\n' |
|
2893 | 2906 | \\\" |
|
2894 | 2907 | |
|
2895 | 2908 | Test exception in quoted template. single backslash before quotation mark is |
|
2896 | 2909 | stripped before parsing: |
|
2897 | 2910 | |
|
2898 | 2911 | $ cat <<'EOF' > escquotetmpl |
|
2899 | 2912 | > changeset = "\" \\" \\\" \\\\" {files % \"{file}\"}\n" |
|
2900 | 2913 | > EOF |
|
2901 | 2914 | $ cd latesttag |
|
2902 | 2915 | $ hg log -r 2 --style ../escquotetmpl |
|
2903 | 2916 | " \" \" \\" head1 |
|
2904 | 2917 | |
|
2905 | 2918 | $ hg log -r 2 -T esc --config templates.esc='"{\"valid\"}\n"' |
|
2906 | 2919 | valid |
|
2907 | 2920 | $ hg log -r 2 -T esc --config templates.esc="'"'{\'"'"'valid\'"'"'}\n'"'" |
|
2908 | 2921 | valid |
|
2909 | 2922 | |
|
2910 | 2923 | Test compatibility with 2.9.2-3.4 of escaped quoted strings in nested |
|
2911 | 2924 | _evalifliteral() templates (issue4733): |
|
2912 | 2925 | |
|
2913 | 2926 | $ hg log -r 2 -T '{if(rev, "\"{rev}")}\n' |
|
2914 | 2927 | "2 |
|
2915 | 2928 | $ hg log -r 2 -T '{if(rev, "{if(rev, \"\\\"{rev}\")}")}\n' |
|
2916 | 2929 | "2 |
|
2917 | 2930 | $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, \\\"\\\\\\\"{rev}\\\")}\")}")}\n' |
|
2918 | 2931 | "2 |
|
2919 | 2932 | |
|
2920 | 2933 | $ hg log -r 2 -T '{if(rev, "\\\"")}\n' |
|
2921 | 2934 | \" |
|
2922 | 2935 | $ hg log -r 2 -T '{if(rev, "{if(rev, \"\\\\\\\"\")}")}\n' |
|
2923 | 2936 | \" |
|
2924 | 2937 | $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, \\\"\\\\\\\\\\\\\\\"\\\")}\")}")}\n' |
|
2925 | 2938 | \" |
|
2926 | 2939 | |
|
2927 | 2940 | $ hg log -r 2 -T '{if(rev, r"\\\"")}\n' |
|
2928 | 2941 | \\\" |
|
2929 | 2942 | $ hg log -r 2 -T '{if(rev, "{if(rev, r\"\\\\\\\"\")}")}\n' |
|
2930 | 2943 | \\\" |
|
2931 | 2944 | $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, r\\\"\\\\\\\\\\\\\\\"\\\")}\")}")}\n' |
|
2932 | 2945 | \\\" |
|
2933 | 2946 | |
|
2934 | 2947 | escaped single quotes and errors: |
|
2935 | 2948 | |
|
2936 | 2949 | $ hg log -r 2 -T "{if(rev, '{if(rev, \'foo\')}')}"'\n' |
|
2937 | 2950 | foo |
|
2938 | 2951 | $ hg log -r 2 -T "{if(rev, '{if(rev, r\'foo\')}')}"'\n' |
|
2939 | 2952 | foo |
|
2940 | 2953 | $ hg log -r 2 -T '{if(rev, "{if(rev, \")}")}\n' |
|
2941 | 2954 | hg: parse error at 21: unterminated string |
|
2942 | 2955 | [255] |
|
2943 | 2956 | $ hg log -r 2 -T '{if(rev, \"\\"")}\n' |
|
2944 | 2957 | hg: parse error: trailing \ in string |
|
2945 | 2958 | [255] |
|
2946 | 2959 | $ hg log -r 2 -T '{if(rev, r\"\\"")}\n' |
|
2947 | 2960 | hg: parse error: trailing \ in string |
|
2948 | 2961 | [255] |
|
2949 | 2962 | |
|
2950 | 2963 | $ cd .. |
|
2951 | 2964 | |
|
2952 | 2965 | Test leading backslashes: |
|
2953 | 2966 | |
|
2954 | 2967 | $ cd latesttag |
|
2955 | 2968 | $ hg log -r 2 -T '\{rev} {files % "\{file}"}\n' |
|
2956 | 2969 | {rev} {file} |
|
2957 | 2970 | $ hg log -r 2 -T '\\{rev} {files % "\\{file}"}\n' |
|
2958 | 2971 | \2 \head1 |
|
2959 | 2972 | $ hg log -r 2 -T '\\\{rev} {files % "\\\{file}"}\n' |
|
2960 | 2973 | \{rev} \{file} |
|
2961 | 2974 | $ cd .. |
|
2962 | 2975 | |
|
2963 | 2976 | Test leading backslashes in "if" expression (issue4714): |
|
2964 | 2977 | |
|
2965 | 2978 | $ cd latesttag |
|
2966 | 2979 | $ hg log -r 2 -T '{if("1", "\{rev}")} {if("1", r"\{rev}")}\n' |
|
2967 | 2980 | {rev} \{rev} |
|
2968 | 2981 | $ hg log -r 2 -T '{if("1", "\\{rev}")} {if("1", r"\\{rev}")}\n' |
|
2969 | 2982 | \2 \\{rev} |
|
2970 | 2983 | $ hg log -r 2 -T '{if("1", "\\\{rev}")} {if("1", r"\\\{rev}")}\n' |
|
2971 | 2984 | \{rev} \\\{rev} |
|
2972 | 2985 | $ cd .. |
|
2973 | 2986 | |
|
2974 | 2987 | "string-escape"-ed "\x5c\x786e" becomes r"\x6e" (once) or r"n" (twice) |
|
2975 | 2988 | |
|
2976 | 2989 | $ hg log -R a -r 0 --template '{if("1", "\x5c\x786e", "NG")}\n' |
|
2977 | 2990 | \x6e |
|
2978 | 2991 | $ hg log -R a -r 0 --template '{if("1", r"\x5c\x786e", "NG")}\n' |
|
2979 | 2992 | \x5c\x786e |
|
2980 | 2993 | $ hg log -R a -r 0 --template '{if("", "NG", "\x5c\x786e")}\n' |
|
2981 | 2994 | \x6e |
|
2982 | 2995 | $ hg log -R a -r 0 --template '{if("", "NG", r"\x5c\x786e")}\n' |
|
2983 | 2996 | \x5c\x786e |
|
2984 | 2997 | |
|
2985 | 2998 | $ hg log -R a -r 2 --template '{ifeq("no perso\x6e", desc, "\x5c\x786e", "NG")}\n' |
|
2986 | 2999 | \x6e |
|
2987 | 3000 | $ hg log -R a -r 2 --template '{ifeq(r"no perso\x6e", desc, "NG", r"\x5c\x786e")}\n' |
|
2988 | 3001 | \x5c\x786e |
|
2989 | 3002 | $ hg log -R a -r 2 --template '{ifeq(desc, "no perso\x6e", "\x5c\x786e", "NG")}\n' |
|
2990 | 3003 | \x6e |
|
2991 | 3004 | $ hg log -R a -r 2 --template '{ifeq(desc, r"no perso\x6e", "NG", r"\x5c\x786e")}\n' |
|
2992 | 3005 | \x5c\x786e |
|
2993 | 3006 | |
|
2994 | 3007 | $ hg log -R a -r 8 --template '{join(files, "\n")}\n' |
|
2995 | 3008 | fourth |
|
2996 | 3009 | second |
|
2997 | 3010 | third |
|
2998 | 3011 | $ hg log -R a -r 8 --template '{join(files, r"\n")}\n' |
|
2999 | 3012 | fourth\nsecond\nthird |
|
3000 | 3013 | |
|
3001 | 3014 | $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", "htm\x6c")}' |
|
3002 | 3015 | <p> |
|
3003 | 3016 | 1st |
|
3004 | 3017 | </p> |
|
3005 | 3018 | <p> |
|
3006 | 3019 | 2nd |
|
3007 | 3020 | </p> |
|
3008 | 3021 | $ hg log -R a -r 2 --template '{rstdoc(r"1st\n\n2nd", "html")}' |
|
3009 | 3022 | <p> |
|
3010 | 3023 | 1st\n\n2nd |
|
3011 | 3024 | </p> |
|
3012 | 3025 | $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", r"htm\x6c")}' |
|
3013 | 3026 | 1st |
|
3014 | 3027 | |
|
3015 | 3028 | 2nd |
|
3016 | 3029 | |
|
3017 | 3030 | $ hg log -R a -r 2 --template '{strip(desc, "\x6e")}\n' |
|
3018 | 3031 | o perso |
|
3019 | 3032 | $ hg log -R a -r 2 --template '{strip(desc, r"\x6e")}\n' |
|
3020 | 3033 | no person |
|
3021 | 3034 | $ hg log -R a -r 2 --template '{strip("no perso\x6e", "\x6e")}\n' |
|
3022 | 3035 | o perso |
|
3023 | 3036 | $ hg log -R a -r 2 --template '{strip(r"no perso\x6e", r"\x6e")}\n' |
|
3024 | 3037 | no perso |
|
3025 | 3038 | |
|
3026 | 3039 | $ hg log -R a -r 2 --template '{sub("\\x6e", "\x2d", desc)}\n' |
|
3027 | 3040 | -o perso- |
|
3028 | 3041 | $ hg log -R a -r 2 --template '{sub(r"\\x6e", "-", desc)}\n' |
|
3029 | 3042 | no person |
|
3030 | 3043 | $ hg log -R a -r 2 --template '{sub("n", r"\x2d", desc)}\n' |
|
3031 | 3044 | \x2do perso\x2d |
|
3032 | 3045 | $ hg log -R a -r 2 --template '{sub("n", "\x2d", "no perso\x6e")}\n' |
|
3033 | 3046 | -o perso- |
|
3034 | 3047 | $ hg log -R a -r 2 --template '{sub("n", r"\x2d", r"no perso\x6e")}\n' |
|
3035 | 3048 | \x2do perso\x6e |
|
3036 | 3049 | |
|
3037 | 3050 | $ hg log -R a -r 8 --template '{files % "{file}\n"}' |
|
3038 | 3051 | fourth |
|
3039 | 3052 | second |
|
3040 | 3053 | third |
|
3041 | 3054 | |
|
3042 | 3055 | Test string escaping in nested expression: |
|
3043 | 3056 | |
|
3044 | 3057 | $ hg log -R a -r 8 --template '{ifeq(r"\x6e", if("1", "\x5c\x786e"), join(files, "\x5c\x786e"))}\n' |
|
3045 | 3058 | fourth\x6esecond\x6ethird |
|
3046 | 3059 | $ hg log -R a -r 8 --template '{ifeq(if("1", r"\x6e"), "\x5c\x786e", join(files, "\x5c\x786e"))}\n' |
|
3047 | 3060 | fourth\x6esecond\x6ethird |
|
3048 | 3061 | |
|
3049 | 3062 | $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", "\x5c\x786e"))}\n' |
|
3050 | 3063 | fourth\x6esecond\x6ethird |
|
3051 | 3064 | $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", r"\x5c\x786e"))}\n' |
|
3052 | 3065 | fourth\x5c\x786esecond\x5c\x786ethird |
|
3053 | 3066 | |
|
3054 | 3067 | $ hg log -R a -r 3:4 --template '{rev}:{sub(if("1", "\x6e"), ifeq(branch, "foo", r"\x5c\x786e", "\x5c\x786e"), desc)}\n' |
|
3055 | 3068 | 3:\x6eo user, \x6eo domai\x6e |
|
3056 | 3069 | 4:\x5c\x786eew bra\x5c\x786ech |
|
3057 | 3070 | |
|
3058 | 3071 | Test quotes in nested expression are evaluated just like a $(command) |
|
3059 | 3072 | substitution in POSIX shells: |
|
3060 | 3073 | |
|
3061 | 3074 | $ hg log -R a -r 8 -T '{"{"{rev}:{node|short}"}"}\n' |
|
3062 | 3075 | 8:95c24699272e |
|
3063 | 3076 | $ hg log -R a -r 8 -T '{"{"\{{rev}} \"{node|short}\""}"}\n' |
|
3064 | 3077 | {8} "95c24699272e" |
|
3065 | 3078 | |
|
3066 | 3079 | Test recursive evaluation: |
|
3067 | 3080 | |
|
3068 | 3081 | $ hg init r |
|
3069 | 3082 | $ cd r |
|
3070 | 3083 | $ echo a > a |
|
3071 | 3084 | $ hg ci -Am '{rev}' |
|
3072 | 3085 | adding a |
|
3073 | 3086 | $ hg log -r 0 --template '{if(rev, desc)}\n' |
|
3074 | 3087 | {rev} |
|
3075 | 3088 | $ hg log -r 0 --template '{if(rev, "{author} {rev}")}\n' |
|
3076 | 3089 | test 0 |
|
3077 | 3090 | |
|
3078 | 3091 | $ hg branch -q 'text.{rev}' |
|
3079 | 3092 | $ echo aa >> aa |
|
3080 | 3093 | $ hg ci -u '{node|short}' -m 'desc to be wrapped desc to be wrapped' |
|
3081 | 3094 | |
|
3082 | 3095 | $ hg log -l1 --template '{fill(desc, "20", author, branch)}' |
|
3083 | 3096 | {node|short}desc to |
|
3084 | 3097 | text.{rev}be wrapped |
|
3085 | 3098 | text.{rev}desc to be |
|
3086 | 3099 | text.{rev}wrapped (no-eol) |
|
3087 | 3100 | $ hg log -l1 --template '{fill(desc, "20", "{node|short}:", "text.{rev}:")}' |
|
3088 | 3101 | bcc7ff960b8e:desc to |
|
3089 | 3102 | text.1:be wrapped |
|
3090 | 3103 | text.1:desc to be |
|
3091 | 3104 | text.1:wrapped (no-eol) |
|
3092 | 3105 | |
|
3093 | 3106 | $ hg log -l 1 --template '{sub(r"[0-9]", "-", author)}' |
|
3094 | 3107 | {node|short} (no-eol) |
|
3095 | 3108 | $ hg log -l 1 --template '{sub(r"[0-9]", "-", "{node|short}")}' |
|
3096 | 3109 | bcc-ff---b-e (no-eol) |
|
3097 | 3110 | |
|
3098 | 3111 | $ cat >> .hg/hgrc <<EOF |
|
3099 | 3112 | > [extensions] |
|
3100 | 3113 | > color= |
|
3101 | 3114 | > [color] |
|
3102 | 3115 | > mode=ansi |
|
3103 | 3116 | > text.{rev} = red |
|
3104 | 3117 | > text.1 = green |
|
3105 | 3118 | > EOF |
|
3106 | 3119 | $ hg log --color=always -l 1 --template '{label(branch, "text\n")}' |
|
3107 | 3120 | \x1b[0;31mtext\x1b[0m (esc) |
|
3108 | 3121 | $ hg log --color=always -l 1 --template '{label("text.{rev}", "text\n")}' |
|
3109 | 3122 | \x1b[0;32mtext\x1b[0m (esc) |
|
3110 | 3123 | |
|
3111 | 3124 | Test branches inside if statement: |
|
3112 | 3125 | |
|
3113 | 3126 | $ hg log -r 0 --template '{if(branches, "yes", "no")}\n' |
|
3114 | 3127 | no |
|
3115 | 3128 | |
|
3116 | 3129 | Test get function: |
|
3117 | 3130 | |
|
3118 | 3131 | $ hg log -r 0 --template '{get(extras, "branch")}\n' |
|
3119 | 3132 | default |
|
3120 | 3133 | $ hg log -r 0 --template '{get(files, "should_fail")}\n' |
|
3121 | 3134 | hg: parse error: get() expects a dict as first argument |
|
3122 | 3135 | [255] |
|
3123 | 3136 | |
|
3124 | 3137 | Test localdate(date, tz) function: |
|
3125 | 3138 | |
|
3126 | 3139 | $ TZ=JST-09 hg log -r0 -T '{date|localdate|isodate}\n' |
|
3127 | 3140 | 1970-01-01 09:00 +0900 |
|
3128 | 3141 | $ TZ=JST-09 hg log -r0 -T '{localdate(date, "UTC")|isodate}\n' |
|
3129 | 3142 | 1970-01-01 00:00 +0000 |
|
3130 | 3143 | $ TZ=JST-09 hg log -r0 -T '{localdate(date, "+0200")|isodate}\n' |
|
3131 | 3144 | 1970-01-01 02:00 +0200 |
|
3132 | 3145 | $ TZ=JST-09 hg log -r0 -T '{localdate(date, "0")|isodate}\n' |
|
3133 | 3146 | 1970-01-01 00:00 +0000 |
|
3134 | 3147 | $ TZ=JST-09 hg log -r0 -T '{localdate(date, 0)|isodate}\n' |
|
3135 | 3148 | 1970-01-01 00:00 +0000 |
|
3136 | 3149 | $ hg log -r0 -T '{localdate(date, "invalid")|isodate}\n' |
|
3137 | 3150 | hg: parse error: localdate expects a timezone |
|
3138 | 3151 | [255] |
|
3139 | 3152 | $ hg log -r0 -T '{localdate(date, date)|isodate}\n' |
|
3140 | 3153 | hg: parse error: localdate expects a timezone |
|
3141 | 3154 | [255] |
|
3142 | 3155 | |
|
3143 | 3156 | Test shortest(node) function: |
|
3144 | 3157 | |
|
3145 | 3158 | $ echo b > b |
|
3146 | 3159 | $ hg ci -qAm b |
|
3147 | 3160 | $ hg log --template '{shortest(node)}\n' |
|
3148 | 3161 | e777 |
|
3149 | 3162 | bcc7 |
|
3150 | 3163 | f776 |
|
3151 | 3164 | $ hg log --template '{shortest(node, 10)}\n' |
|
3152 | 3165 | e777603221 |
|
3153 | 3166 | bcc7ff960b |
|
3154 | 3167 | f7769ec2ab |
|
3155 | 3168 | $ hg log --template '{node|shortest}\n' -l1 |
|
3156 | 3169 | e777 |
|
3157 | 3170 | |
|
3158 | 3171 | Test pad function |
|
3159 | 3172 | |
|
3160 | 3173 | $ hg log --template '{pad(rev, 20)} {author|user}\n' |
|
3161 | 3174 | 2 test |
|
3162 | 3175 | 1 {node|short} |
|
3163 | 3176 | 0 test |
|
3164 | 3177 | |
|
3165 | 3178 | $ hg log --template '{pad(rev, 20, " ", True)} {author|user}\n' |
|
3166 | 3179 | 2 test |
|
3167 | 3180 | 1 {node|short} |
|
3168 | 3181 | 0 test |
|
3169 | 3182 | |
|
3170 | 3183 | $ hg log --template '{pad(rev, 20, "-", False)} {author|user}\n' |
|
3171 | 3184 | 2------------------- test |
|
3172 | 3185 | 1------------------- {node|short} |
|
3173 | 3186 | 0------------------- test |
|
3174 | 3187 | |
|
3175 | 3188 | Test template string in pad function |
|
3176 | 3189 | |
|
3177 | 3190 | $ hg log -r 0 -T '{pad("\{{rev}}", 10)} {author|user}\n' |
|
3178 | 3191 | {0} test |
|
3179 | 3192 | |
|
3180 | 3193 | $ hg log -r 0 -T '{pad(r"\{rev}", 10)} {author|user}\n' |
|
3181 | 3194 | \{rev} test |
|
3182 | 3195 | |
|
3183 | 3196 | Test ifcontains function |
|
3184 | 3197 | |
|
3185 | 3198 | $ hg log --template '{rev} {ifcontains(rev, "2 two 0", "is in the string", "is not")}\n' |
|
3186 | 3199 | 2 is in the string |
|
3187 | 3200 | 1 is not |
|
3188 | 3201 | 0 is in the string |
|
3189 | 3202 | |
|
3190 | 3203 | $ hg log --template '{rev} {ifcontains("a", file_adds, "added a", "did not add a")}\n' |
|
3191 | 3204 | 2 did not add a |
|
3192 | 3205 | 1 did not add a |
|
3193 | 3206 | 0 added a |
|
3194 | 3207 | |
|
3195 | 3208 | Test revset function |
|
3196 | 3209 | |
|
3197 | 3210 | $ hg log --template '{rev} {ifcontains(rev, revset("."), "current rev", "not current rev")}\n' |
|
3198 | 3211 | 2 current rev |
|
3199 | 3212 | 1 not current rev |
|
3200 | 3213 | 0 not current rev |
|
3201 | 3214 | |
|
3202 | 3215 | $ hg log --template '{rev} {ifcontains(rev, revset(". + .^"), "match rev", "not match rev")}\n' |
|
3203 | 3216 | 2 match rev |
|
3204 | 3217 | 1 match rev |
|
3205 | 3218 | 0 not match rev |
|
3206 | 3219 | |
|
3207 | 3220 | $ hg log --template '{rev} Parents: {revset("parents(%s)", rev)}\n' |
|
3208 | 3221 | 2 Parents: 1 |
|
3209 | 3222 | 1 Parents: 0 |
|
3210 | 3223 | 0 Parents: |
|
3211 | 3224 | |
|
3212 | 3225 | $ cat >> .hg/hgrc <<EOF |
|
3213 | 3226 | > [revsetalias] |
|
3214 | 3227 | > myparents(\$1) = parents(\$1) |
|
3215 | 3228 | > EOF |
|
3216 | 3229 | $ hg log --template '{rev} Parents: {revset("myparents(%s)", rev)}\n' |
|
3217 | 3230 | 2 Parents: 1 |
|
3218 | 3231 | 1 Parents: 0 |
|
3219 | 3232 | 0 Parents: |
|
3220 | 3233 | |
|
3221 | 3234 | $ hg log --template 'Rev: {rev}\n{revset("::%s", rev) % "Ancestor: {revision}\n"}\n' |
|
3222 | 3235 | Rev: 2 |
|
3223 | 3236 | Ancestor: 0 |
|
3224 | 3237 | Ancestor: 1 |
|
3225 | 3238 | Ancestor: 2 |
|
3226 | 3239 | |
|
3227 | 3240 | Rev: 1 |
|
3228 | 3241 | Ancestor: 0 |
|
3229 | 3242 | Ancestor: 1 |
|
3230 | 3243 | |
|
3231 | 3244 | Rev: 0 |
|
3232 | 3245 | Ancestor: 0 |
|
3233 | 3246 | |
|
3234 | 3247 | $ hg log --template '{revset("TIP"|lower)}\n' -l1 |
|
3235 | 3248 | 2 |
|
3236 | 3249 | |
|
3237 | 3250 | a list template is evaluated for each item of revset |
|
3238 | 3251 | |
|
3239 | 3252 | $ hg log -T '{rev} p: {revset("p1(%s)", rev) % "{rev}:{node|short}"}\n' |
|
3240 | 3253 | 2 p: 1:bcc7ff960b8e |
|
3241 | 3254 | 1 p: 0:f7769ec2ab97 |
|
3242 | 3255 | 0 p: |
|
3243 | 3256 | |
|
3244 | 3257 | therefore, 'revcache' should be recreated for each rev |
|
3245 | 3258 | |
|
3246 | 3259 | $ hg log -T '{rev} {file_adds}\np {revset("p1(%s)", rev) % "{file_adds}"}\n' |
|
3247 | 3260 | 2 aa b |
|
3248 | 3261 | p |
|
3249 | 3262 | 1 |
|
3250 | 3263 | p a |
|
3251 | 3264 | 0 a |
|
3252 | 3265 | p |
|
3253 | 3266 | |
|
3254 | 3267 | Test active bookmark templating |
|
3255 | 3268 | |
|
3256 | 3269 | $ hg book foo |
|
3257 | 3270 | $ hg book bar |
|
3258 | 3271 | $ hg log --template "{rev} {bookmarks % '{bookmark}{ifeq(bookmark, active, \"*\")} '}\n" |
|
3259 | 3272 | 2 bar* foo |
|
3260 | 3273 | 1 |
|
3261 | 3274 | 0 |
|
3262 | 3275 | $ hg log --template "{rev} {activebookmark}\n" |
|
3263 | 3276 | 2 bar |
|
3264 | 3277 | 1 |
|
3265 | 3278 | 0 |
|
3266 | 3279 | $ hg bookmarks --inactive bar |
|
3267 | 3280 | $ hg log --template "{rev} {activebookmark}\n" |
|
3268 | 3281 | 2 |
|
3269 | 3282 | 1 |
|
3270 | 3283 | 0 |
|
3271 | 3284 | $ hg book -r1 baz |
|
3272 | 3285 | $ hg log --template "{rev} {join(bookmarks, ' ')}\n" |
|
3273 | 3286 | 2 bar foo |
|
3274 | 3287 | 1 baz |
|
3275 | 3288 | 0 |
|
3276 | 3289 | $ hg log --template "{rev} {ifcontains('foo', bookmarks, 't', 'f')}\n" |
|
3277 | 3290 | 2 t |
|
3278 | 3291 | 1 f |
|
3279 | 3292 | 0 f |
|
3280 | 3293 | |
|
3281 | 3294 | Test stringify on sub expressions |
|
3282 | 3295 | |
|
3283 | 3296 | $ cd .. |
|
3284 | 3297 | $ hg log -R a -r 8 --template '{join(files, if("1", if("1", ", ")))}\n' |
|
3285 | 3298 | fourth, second, third |
|
3286 | 3299 | $ hg log -R a -r 8 --template '{strip(if("1", if("1", "-abc-")), if("1", if("1", "-")))}\n' |
|
3287 | 3300 | abc |
|
3288 | 3301 | |
|
3289 | 3302 | Test splitlines |
|
3290 | 3303 | |
|
3291 | 3304 | $ hg log -Gv -R a --template "{splitlines(desc) % 'foo {line}\n'}" |
|
3292 | 3305 | @ foo Modify, add, remove, rename |
|
3293 | 3306 | | |
|
3294 | 3307 | o foo future |
|
3295 | 3308 | | |
|
3296 | 3309 | o foo third |
|
3297 | 3310 | | |
|
3298 | 3311 | o foo second |
|
3299 | 3312 | |
|
3300 | 3313 | o foo merge |
|
3301 | 3314 | |\ |
|
3302 | 3315 | | o foo new head |
|
3303 | 3316 | | | |
|
3304 | 3317 | o | foo new branch |
|
3305 | 3318 | |/ |
|
3306 | 3319 | o foo no user, no domain |
|
3307 | 3320 | | |
|
3308 | 3321 | o foo no person |
|
3309 | 3322 | | |
|
3310 | 3323 | o foo other 1 |
|
3311 | 3324 | | foo other 2 |
|
3312 | 3325 | | foo |
|
3313 | 3326 | | foo other 3 |
|
3314 | 3327 | o foo line 1 |
|
3315 | 3328 | foo line 2 |
|
3316 | 3329 | |
|
3317 | 3330 | Test startswith |
|
3318 | 3331 | $ hg log -Gv -R a --template "{startswith(desc)}" |
|
3319 | 3332 | hg: parse error: startswith expects two arguments |
|
3320 | 3333 | [255] |
|
3321 | 3334 | |
|
3322 | 3335 | $ hg log -Gv -R a --template "{startswith('line', desc)}" |
|
3323 | 3336 | @ |
|
3324 | 3337 | | |
|
3325 | 3338 | o |
|
3326 | 3339 | | |
|
3327 | 3340 | o |
|
3328 | 3341 | | |
|
3329 | 3342 | o |
|
3330 | 3343 | |
|
3331 | 3344 | o |
|
3332 | 3345 | |\ |
|
3333 | 3346 | | o |
|
3334 | 3347 | | | |
|
3335 | 3348 | o | |
|
3336 | 3349 | |/ |
|
3337 | 3350 | o |
|
3338 | 3351 | | |
|
3339 | 3352 | o |
|
3340 | 3353 | | |
|
3341 | 3354 | o |
|
3342 | 3355 | | |
|
3343 | 3356 | o line 1 |
|
3344 | 3357 | line 2 |
|
3345 | 3358 | |
|
3346 | 3359 | Test bad template with better error message |
|
3347 | 3360 | |
|
3348 | 3361 | $ hg log -Gv -R a --template '{desc|user()}' |
|
3349 | 3362 | hg: parse error: expected a symbol, got 'func' |
|
3350 | 3363 | [255] |
|
3351 | 3364 | |
|
3352 | 3365 | Test word function (including index out of bounds graceful failure) |
|
3353 | 3366 | |
|
3354 | 3367 | $ hg log -Gv -R a --template "{word('1', desc)}" |
|
3355 | 3368 | @ add, |
|
3356 | 3369 | | |
|
3357 | 3370 | o |
|
3358 | 3371 | | |
|
3359 | 3372 | o |
|
3360 | 3373 | | |
|
3361 | 3374 | o |
|
3362 | 3375 | |
|
3363 | 3376 | o |
|
3364 | 3377 | |\ |
|
3365 | 3378 | | o head |
|
3366 | 3379 | | | |
|
3367 | 3380 | o | branch |
|
3368 | 3381 | |/ |
|
3369 | 3382 | o user, |
|
3370 | 3383 | | |
|
3371 | 3384 | o person |
|
3372 | 3385 | | |
|
3373 | 3386 | o 1 |
|
3374 | 3387 | | |
|
3375 | 3388 | o 1 |
|
3376 | 3389 | |
|
3377 | 3390 | |
|
3378 | 3391 | Test word third parameter used as splitter |
|
3379 | 3392 | |
|
3380 | 3393 | $ hg log -Gv -R a --template "{word('0', desc, 'o')}" |
|
3381 | 3394 | @ M |
|
3382 | 3395 | | |
|
3383 | 3396 | o future |
|
3384 | 3397 | | |
|
3385 | 3398 | o third |
|
3386 | 3399 | | |
|
3387 | 3400 | o sec |
|
3388 | 3401 | |
|
3389 | 3402 | o merge |
|
3390 | 3403 | |\ |
|
3391 | 3404 | | o new head |
|
3392 | 3405 | | | |
|
3393 | 3406 | o | new branch |
|
3394 | 3407 | |/ |
|
3395 | 3408 | o n |
|
3396 | 3409 | | |
|
3397 | 3410 | o n |
|
3398 | 3411 | | |
|
3399 | 3412 | o |
|
3400 | 3413 | | |
|
3401 | 3414 | o line 1 |
|
3402 | 3415 | line 2 |
|
3403 | 3416 | |
|
3404 | 3417 | Test word error messages for not enough and too many arguments |
|
3405 | 3418 | |
|
3406 | 3419 | $ hg log -Gv -R a --template "{word('0')}" |
|
3407 | 3420 | hg: parse error: word expects two or three arguments, got 1 |
|
3408 | 3421 | [255] |
|
3409 | 3422 | |
|
3410 | 3423 | $ hg log -Gv -R a --template "{word('0', desc, 'o', 'h', 'b', 'o', 'y')}" |
|
3411 | 3424 | hg: parse error: word expects two or three arguments, got 7 |
|
3412 | 3425 | [255] |
|
3413 | 3426 | |
|
3414 | 3427 | Test word for integer literal |
|
3415 | 3428 | |
|
3416 | 3429 | $ hg log -R a --template "{word(2, desc)}\n" -r0 |
|
3417 | 3430 | line |
|
3418 | 3431 | |
|
3419 | 3432 | Test word for invalid numbers |
|
3420 | 3433 | |
|
3421 | 3434 | $ hg log -Gv -R a --template "{word('a', desc)}" |
|
3422 | 3435 | hg: parse error: word expects an integer index |
|
3423 | 3436 | [255] |
|
3424 | 3437 | |
|
3425 | 3438 | Test indent and not adding to empty lines |
|
3426 | 3439 | |
|
3427 | 3440 | $ hg log -T "-----\n{indent(desc, '>> ', ' > ')}\n" -r 0:1 -R a |
|
3428 | 3441 | ----- |
|
3429 | 3442 | > line 1 |
|
3430 | 3443 | >> line 2 |
|
3431 | 3444 | ----- |
|
3432 | 3445 | > other 1 |
|
3433 | 3446 | >> other 2 |
|
3434 | 3447 | |
|
3435 | 3448 | >> other 3 |
|
3436 | 3449 | |
|
3437 | 3450 | Test with non-strings like dates |
|
3438 | 3451 | |
|
3439 | 3452 | $ hg log -T "{indent(date, ' ')}\n" -r 2:3 -R a |
|
3440 | 3453 | 1200000.00 |
|
3441 | 3454 | 1300000.00 |
|
3442 | 3455 | |
|
3443 | 3456 | Test broken string escapes: |
|
3444 | 3457 | |
|
3445 | 3458 | $ hg log -T "bogus\\" -R a |
|
3446 | 3459 | hg: parse error: trailing \ in string |
|
3447 | 3460 | [255] |
|
3448 | 3461 | $ hg log -T "\\xy" -R a |
|
3449 | 3462 | hg: parse error: invalid \x escape |
|
3450 | 3463 | [255] |
@@ -1,639 +1,646 b'' | |||
|
1 | 1 | $ hg init test |
|
2 | 2 | $ cd test |
|
3 | 3 | |
|
4 | 4 | $ echo a > a |
|
5 | 5 | $ hg add a |
|
6 | 6 | $ hg commit -m "test" |
|
7 | 7 | $ hg history |
|
8 | 8 | changeset: 0:acb14030fe0a |
|
9 | 9 | tag: tip |
|
10 | 10 | user: test |
|
11 | 11 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
12 | 12 | summary: test |
|
13 | 13 | |
|
14 | 14 | |
|
15 | 15 | $ hg tag ' ' |
|
16 | 16 | abort: tag names cannot consist entirely of whitespace |
|
17 | 17 | [255] |
|
18 | 18 | |
|
19 | 19 | (this tests also that editor is not invoked, if '--edit' is not |
|
20 | 20 | specified) |
|
21 | 21 | |
|
22 | 22 | $ HGEDITOR=cat hg tag "bleah" |
|
23 | 23 | $ hg history |
|
24 | 24 | changeset: 1:d4f0d2909abc |
|
25 | 25 | tag: tip |
|
26 | 26 | user: test |
|
27 | 27 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
28 | 28 | summary: Added tag bleah for changeset acb14030fe0a |
|
29 | 29 | |
|
30 | 30 | changeset: 0:acb14030fe0a |
|
31 | 31 | tag: bleah |
|
32 | 32 | user: test |
|
33 | 33 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
34 | 34 | summary: test |
|
35 | 35 | |
|
36 | 36 | |
|
37 | 37 | $ echo foo >> .hgtags |
|
38 | 38 | $ hg tag "bleah2" |
|
39 | 39 | abort: working copy of .hgtags is changed |
|
40 | 40 | (please commit .hgtags manually) |
|
41 | 41 | [255] |
|
42 | 42 | |
|
43 | 43 | $ hg revert .hgtags |
|
44 | 44 | $ hg tag -r 0 x y z y y z |
|
45 | 45 | abort: tag names must be unique |
|
46 | 46 | [255] |
|
47 | 47 | $ hg tag tap nada dot tip |
|
48 | 48 | abort: the name 'tip' is reserved |
|
49 | 49 | [255] |
|
50 | 50 | $ hg tag . |
|
51 | 51 | abort: the name '.' is reserved |
|
52 | 52 | [255] |
|
53 | 53 | $ hg tag null |
|
54 | 54 | abort: the name 'null' is reserved |
|
55 | 55 | [255] |
|
56 | 56 | $ hg tag "bleah" |
|
57 | 57 | abort: tag 'bleah' already exists (use -f to force) |
|
58 | 58 | [255] |
|
59 | 59 | $ hg tag "blecch" "bleah" |
|
60 | 60 | abort: tag 'bleah' already exists (use -f to force) |
|
61 | 61 | [255] |
|
62 | 62 | |
|
63 | 63 | $ hg tag --remove "blecch" |
|
64 | 64 | abort: tag 'blecch' does not exist |
|
65 | 65 | [255] |
|
66 | 66 | $ hg tag --remove "bleah" "blecch" "blough" |
|
67 | 67 | abort: tag 'blecch' does not exist |
|
68 | 68 | [255] |
|
69 | 69 | |
|
70 | 70 | $ hg tag -r 0 "bleah0" |
|
71 | 71 | $ hg tag -l -r 1 "bleah1" |
|
72 | 72 | $ hg tag gack gawk gorp |
|
73 | 73 | $ hg tag -f gack |
|
74 | 74 | $ hg tag --remove gack gorp |
|
75 | 75 | |
|
76 | 76 | $ hg tag "bleah " |
|
77 | 77 | abort: tag 'bleah' already exists (use -f to force) |
|
78 | 78 | [255] |
|
79 | 79 | $ hg tag " bleah" |
|
80 | 80 | abort: tag 'bleah' already exists (use -f to force) |
|
81 | 81 | [255] |
|
82 | 82 | $ hg tag " bleah" |
|
83 | 83 | abort: tag 'bleah' already exists (use -f to force) |
|
84 | 84 | [255] |
|
85 | 85 | $ hg tag -r 0 " bleahbleah " |
|
86 | 86 | $ hg tag -r 0 " bleah bleah " |
|
87 | 87 | |
|
88 | 88 | $ cat .hgtags |
|
89 | 89 | acb14030fe0a21b60322c440ad2d20cf7685a376 bleah |
|
90 | 90 | acb14030fe0a21b60322c440ad2d20cf7685a376 bleah0 |
|
91 | 91 | 336fccc858a4eb69609a291105009e484a6b6b8d gack |
|
92 | 92 | 336fccc858a4eb69609a291105009e484a6b6b8d gawk |
|
93 | 93 | 336fccc858a4eb69609a291105009e484a6b6b8d gorp |
|
94 | 94 | 336fccc858a4eb69609a291105009e484a6b6b8d gack |
|
95 | 95 | 799667b6f2d9b957f73fa644a918c2df22bab58f gack |
|
96 | 96 | 799667b6f2d9b957f73fa644a918c2df22bab58f gack |
|
97 | 97 | 0000000000000000000000000000000000000000 gack |
|
98 | 98 | 336fccc858a4eb69609a291105009e484a6b6b8d gorp |
|
99 | 99 | 0000000000000000000000000000000000000000 gorp |
|
100 | 100 | acb14030fe0a21b60322c440ad2d20cf7685a376 bleahbleah |
|
101 | 101 | acb14030fe0a21b60322c440ad2d20cf7685a376 bleah bleah |
|
102 | 102 | |
|
103 | 103 | $ cat .hg/localtags |
|
104 | 104 | d4f0d2909abc9290e2773c08837d70c1794e3f5a bleah1 |
|
105 | 105 | |
|
106 | 106 | tagging on a non-head revision |
|
107 | 107 | |
|
108 | 108 | $ hg update 0 |
|
109 | 109 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
110 | 110 | $ hg tag -l localblah |
|
111 | 111 | $ hg tag "foobar" |
|
112 | 112 | abort: not at a branch head (use -f to force) |
|
113 | 113 | [255] |
|
114 | 114 | $ hg tag -f "foobar" |
|
115 | 115 | $ cat .hgtags |
|
116 | 116 | acb14030fe0a21b60322c440ad2d20cf7685a376 foobar |
|
117 | 117 | $ cat .hg/localtags |
|
118 | 118 | d4f0d2909abc9290e2773c08837d70c1794e3f5a bleah1 |
|
119 | 119 | acb14030fe0a21b60322c440ad2d20cf7685a376 localblah |
|
120 | 120 | |
|
121 | 121 | $ hg tag -l 'xx |
|
122 | 122 | > newline' |
|
123 | 123 | abort: '\n' cannot be used in a name |
|
124 | 124 | [255] |
|
125 | 125 | $ hg tag -l 'xx:xx' |
|
126 | 126 | abort: ':' cannot be used in a name |
|
127 | 127 | [255] |
|
128 | 128 | |
|
129 | 129 | cloning local tags |
|
130 | 130 | |
|
131 | 131 | $ cd .. |
|
132 | 132 | $ hg -R test log -r0:5 |
|
133 | 133 | changeset: 0:acb14030fe0a |
|
134 | 134 | tag: bleah |
|
135 | 135 | tag: bleah bleah |
|
136 | 136 | tag: bleah0 |
|
137 | 137 | tag: bleahbleah |
|
138 | 138 | tag: foobar |
|
139 | 139 | tag: localblah |
|
140 | 140 | user: test |
|
141 | 141 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
142 | 142 | summary: test |
|
143 | 143 | |
|
144 | 144 | changeset: 1:d4f0d2909abc |
|
145 | 145 | tag: bleah1 |
|
146 | 146 | user: test |
|
147 | 147 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
148 | 148 | summary: Added tag bleah for changeset acb14030fe0a |
|
149 | 149 | |
|
150 | 150 | changeset: 2:336fccc858a4 |
|
151 | 151 | tag: gawk |
|
152 | 152 | user: test |
|
153 | 153 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
154 | 154 | summary: Added tag bleah0 for changeset acb14030fe0a |
|
155 | 155 | |
|
156 | 156 | changeset: 3:799667b6f2d9 |
|
157 | 157 | user: test |
|
158 | 158 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
159 | 159 | summary: Added tag gack, gawk, gorp for changeset 336fccc858a4 |
|
160 | 160 | |
|
161 | 161 | changeset: 4:154eeb7c0138 |
|
162 | 162 | user: test |
|
163 | 163 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
164 | 164 | summary: Added tag gack for changeset 799667b6f2d9 |
|
165 | 165 | |
|
166 | 166 | changeset: 5:b4bb47aaff09 |
|
167 | 167 | user: test |
|
168 | 168 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
169 | 169 | summary: Removed tag gack, gorp |
|
170 | 170 | |
|
171 | 171 | $ hg clone -q -rbleah1 test test1 |
|
172 | 172 | $ hg -R test1 parents --style=compact |
|
173 | 173 | 1[tip] d4f0d2909abc 1970-01-01 00:00 +0000 test |
|
174 | 174 | Added tag bleah for changeset acb14030fe0a |
|
175 | 175 | |
|
176 | 176 | $ hg clone -q -r5 test#bleah1 test2 |
|
177 | 177 | $ hg -R test2 parents --style=compact |
|
178 | 178 | 5[tip] b4bb47aaff09 1970-01-01 00:00 +0000 test |
|
179 | 179 | Removed tag gack, gorp |
|
180 | 180 | |
|
181 | 181 | $ hg clone -q -U test#bleah1 test3 |
|
182 | 182 | $ hg -R test3 parents --style=compact |
|
183 | 183 | |
|
184 | 184 | $ cd test |
|
185 | 185 | |
|
186 | 186 | Issue601: hg tag doesn't do the right thing if .hgtags or localtags |
|
187 | 187 | doesn't end with EOL |
|
188 | 188 | |
|
189 | 189 | $ python << EOF |
|
190 | 190 | > f = file('.hg/localtags'); last = f.readlines()[-1][:-1]; f.close() |
|
191 | 191 | > f = file('.hg/localtags', 'w'); f.write(last); f.close() |
|
192 | 192 | > EOF |
|
193 | 193 | $ cat .hg/localtags; echo |
|
194 | 194 | acb14030fe0a21b60322c440ad2d20cf7685a376 localblah |
|
195 | 195 | $ hg tag -l localnewline |
|
196 | 196 | $ cat .hg/localtags; echo |
|
197 | 197 | acb14030fe0a21b60322c440ad2d20cf7685a376 localblah |
|
198 | 198 | c2899151f4e76890c602a2597a650a72666681bf localnewline |
|
199 | 199 | |
|
200 | 200 | |
|
201 | 201 | $ python << EOF |
|
202 | 202 | > f = file('.hgtags'); last = f.readlines()[-1][:-1]; f.close() |
|
203 | 203 | > f = file('.hgtags', 'w'); f.write(last); f.close() |
|
204 | 204 | > EOF |
|
205 | 205 | $ hg ci -m'broken manual edit of .hgtags' |
|
206 | 206 | $ cat .hgtags; echo |
|
207 | 207 | acb14030fe0a21b60322c440ad2d20cf7685a376 foobar |
|
208 | 208 | $ hg tag newline |
|
209 | 209 | $ cat .hgtags; echo |
|
210 | 210 | acb14030fe0a21b60322c440ad2d20cf7685a376 foobar |
|
211 | 211 | a0eea09de1eeec777b46f2085260a373b2fbc293 newline |
|
212 | 212 | |
|
213 | 213 | |
|
214 | 214 | tag and branch using same name |
|
215 | 215 | |
|
216 | 216 | $ hg branch tag-and-branch-same-name |
|
217 | 217 | marked working directory as branch tag-and-branch-same-name |
|
218 | 218 | (branches are permanent and global, did you want a bookmark?) |
|
219 | 219 | $ hg ci -m"discouraged" |
|
220 | 220 | $ hg tag tag-and-branch-same-name |
|
221 | 221 | warning: tag tag-and-branch-same-name conflicts with existing branch name |
|
222 | 222 | |
|
223 | 223 | test custom commit messages |
|
224 | 224 | |
|
225 | 225 | $ cat > editor.sh << '__EOF__' |
|
226 | 226 | > echo "==== before editing" |
|
227 | 227 | > cat "$1" |
|
228 | 228 | > echo "====" |
|
229 | 229 | > echo "custom tag message" > "$1" |
|
230 | 230 | > echo "second line" >> "$1" |
|
231 | 231 | > __EOF__ |
|
232 | 232 | |
|
233 | 233 | at first, test saving last-message.txt |
|
234 | 234 | |
|
235 | 235 | (test that editor is not invoked before transaction starting) |
|
236 | 236 | |
|
237 | 237 | $ cat > .hg/hgrc << '__EOF__' |
|
238 | 238 | > [hooks] |
|
239 | 239 | > # this failure occurs before editor invocation |
|
240 | 240 | > pretag.test-saving-lastmessage = false |
|
241 | 241 | > __EOF__ |
|
242 | 242 | $ rm -f .hg/last-message.txt |
|
243 | 243 | $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg tag custom-tag -e |
|
244 | 244 | abort: pretag.test-saving-lastmessage hook exited with status 1 |
|
245 | 245 | [255] |
|
246 | 246 | $ test -f .hg/last-message.txt |
|
247 | 247 | [1] |
|
248 | 248 | |
|
249 | 249 | (test that editor is invoked and commit message is saved into |
|
250 | 250 | "last-message.txt") |
|
251 | 251 | |
|
252 | 252 | $ cat >> .hg/hgrc << '__EOF__' |
|
253 | 253 | > [hooks] |
|
254 | 254 | > pretag.test-saving-lastmessage = |
|
255 | 255 | > # this failure occurs after editor invocation |
|
256 | 256 | > pretxncommit.unexpectedabort = false |
|
257 | 257 | > __EOF__ |
|
258 | 258 | |
|
259 | 259 | (this tests also that editor is invoked, if '--edit' is specified, |
|
260 | 260 | regardless of '--message') |
|
261 | 261 | |
|
262 | 262 | $ rm -f .hg/last-message.txt |
|
263 | 263 | $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg tag custom-tag -e -m "foo bar" |
|
264 | 264 | ==== before editing |
|
265 | 265 | foo bar |
|
266 | 266 | |
|
267 | 267 | |
|
268 | 268 | HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
269 | 269 | HG: Leave message empty to abort commit. |
|
270 | 270 | HG: -- |
|
271 | 271 | HG: user: test |
|
272 | 272 | HG: branch 'tag-and-branch-same-name' |
|
273 | 273 | HG: changed .hgtags |
|
274 | 274 | ==== |
|
275 | 275 | transaction abort! |
|
276 | 276 | rollback completed |
|
277 | 277 | note: commit message saved in .hg/last-message.txt |
|
278 | 278 | abort: pretxncommit.unexpectedabort hook exited with status 1 |
|
279 | 279 | [255] |
|
280 | 280 | $ cat .hg/last-message.txt |
|
281 | 281 | custom tag message |
|
282 | 282 | second line |
|
283 | 283 | |
|
284 | 284 | $ cat >> .hg/hgrc << '__EOF__' |
|
285 | 285 | > [hooks] |
|
286 | 286 | > pretxncommit.unexpectedabort = |
|
287 | 287 | > __EOF__ |
|
288 | 288 | $ hg status .hgtags |
|
289 | 289 | M .hgtags |
|
290 | 290 | $ hg revert --no-backup -q .hgtags |
|
291 | 291 | |
|
292 | 292 | then, test custom commit message itself |
|
293 | 293 | |
|
294 | 294 | $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg tag custom-tag -e |
|
295 | 295 | ==== before editing |
|
296 | 296 | Added tag custom-tag for changeset 75a534207be6 |
|
297 | 297 | |
|
298 | 298 | |
|
299 | 299 | HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
300 | 300 | HG: Leave message empty to abort commit. |
|
301 | 301 | HG: -- |
|
302 | 302 | HG: user: test |
|
303 | 303 | HG: branch 'tag-and-branch-same-name' |
|
304 | 304 | HG: changed .hgtags |
|
305 | 305 | ==== |
|
306 | 306 | $ hg log -l1 --template "{desc}\n" |
|
307 | 307 | custom tag message |
|
308 | 308 | second line |
|
309 | 309 | |
|
310 | 310 | |
|
311 | 311 | local tag with .hgtags modified |
|
312 | 312 | |
|
313 | 313 | $ hg tag hgtags-modified |
|
314 | 314 | $ hg rollback |
|
315 | 315 | repository tip rolled back to revision 13 (undo commit) |
|
316 | 316 | working directory now based on revision 13 |
|
317 | 317 | $ hg st |
|
318 | 318 | M .hgtags |
|
319 | 319 | ? .hgtags.orig |
|
320 | 320 | ? editor.sh |
|
321 | 321 | $ hg tag --local baz |
|
322 | 322 | $ hg revert --no-backup .hgtags |
|
323 | 323 | |
|
324 | 324 | |
|
325 | 325 | tagging when at named-branch-head that's not a topo-head |
|
326 | 326 | |
|
327 | 327 | $ hg up default |
|
328 | 328 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
329 | 329 | $ hg merge -t internal:local |
|
330 | 330 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
331 | 331 | (branch merge, don't forget to commit) |
|
332 | 332 | $ hg ci -m 'merge named branch' |
|
333 | 333 | $ hg up 13 |
|
334 | 334 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
335 | 335 | $ hg tag new-topo-head |
|
336 | 336 | |
|
337 | 337 | tagging on null rev |
|
338 | 338 | |
|
339 | 339 | $ hg up null |
|
340 | 340 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
341 | 341 | $ hg tag nullrev |
|
342 | 342 | abort: not at a branch head (use -f to force) |
|
343 | 343 | [255] |
|
344 | 344 | |
|
345 | 345 | $ hg init empty |
|
346 | 346 | $ hg tag -R empty nullrev |
|
347 | 347 | abort: cannot tag null revision |
|
348 | 348 | [255] |
|
349 | 349 | |
|
350 | 350 | $ hg tag -R empty -r 00000000000 -f nulltag |
|
351 | 351 | abort: cannot tag null revision |
|
352 | 352 | [255] |
|
353 | 353 | |
|
354 | 354 | $ cd .. |
|
355 | 355 | |
|
356 | 356 | tagging on an uncommitted merge (issue2542) |
|
357 | 357 | |
|
358 | 358 | $ hg init repo-tag-uncommitted-merge |
|
359 | 359 | $ cd repo-tag-uncommitted-merge |
|
360 | 360 | $ echo c1 > f1 |
|
361 | 361 | $ hg ci -Am0 |
|
362 | 362 | adding f1 |
|
363 | 363 | $ echo c2 > f2 |
|
364 | 364 | $ hg ci -Am1 |
|
365 | 365 | adding f2 |
|
366 | 366 | $ hg co -q 0 |
|
367 | 367 | $ hg branch b1 |
|
368 | 368 | marked working directory as branch b1 |
|
369 | 369 | (branches are permanent and global, did you want a bookmark?) |
|
370 | 370 | $ hg ci -m2 |
|
371 | 371 | $ hg up default |
|
372 | 372 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
373 | 373 | $ hg merge b1 |
|
374 | 374 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
375 | 375 | (branch merge, don't forget to commit) |
|
376 | 376 | |
|
377 | 377 | $ hg tag t1 |
|
378 | 378 | abort: uncommitted merge |
|
379 | 379 | [255] |
|
380 | 380 | $ hg status |
|
381 | 381 | $ hg tag --rev 1 t2 |
|
382 | 382 | abort: uncommitted merge |
|
383 | 383 | [255] |
|
384 | 384 | $ hg tag --rev 1 --local t3 |
|
385 | 385 | $ hg tags -v |
|
386 | 386 | tip 2:2a156e8887cc |
|
387 | 387 | t3 1:c3adabd1a5f4 local |
|
388 | 388 | |
|
389 | 389 | $ cd .. |
|
390 | 390 | |
|
391 | 391 | commit hook on tag used to be run without write lock - issue3344 |
|
392 | 392 | |
|
393 | 393 | $ hg init repo-tag |
|
394 | 394 | $ touch repo-tag/test |
|
395 | 395 | $ hg -R repo-tag commit -A -m "test" |
|
396 | 396 | adding test |
|
397 | 397 | $ hg init repo-tag-target |
|
398 | 398 | $ cat > "$TESTTMP/issue3344.sh" <<EOF |
|
399 | 399 | > hg push "$TESTTMP/repo-tag-target" |
|
400 | 400 | > EOF |
|
401 | 401 | $ hg -R repo-tag --config hooks.commit="sh ../issue3344.sh" tag tag |
|
402 | 402 | pushing to $TESTTMP/repo-tag-target (glob) |
|
403 | 403 | searching for changes |
|
404 | 404 | adding changesets |
|
405 | 405 | adding manifests |
|
406 | 406 | adding file changes |
|
407 | 407 | added 2 changesets with 2 changes to 2 files |
|
408 | 408 | |
|
409 | 409 | automatically merge resolvable tag conflicts (i.e. tags that differ in rank) |
|
410 | 410 | create two clones with some different tags as well as some common tags |
|
411 | 411 | check that we can merge tags that differ in rank |
|
412 | 412 | |
|
413 | 413 | $ hg init repo-automatic-tag-merge |
|
414 | 414 | $ cd repo-automatic-tag-merge |
|
415 | 415 | $ echo c0 > f0 |
|
416 | 416 | $ hg ci -A -m0 |
|
417 | 417 | adding f0 |
|
418 | 418 | $ hg tag tbase |
|
419 | 419 | $ hg up -qr '.^' |
|
420 | 420 | $ hg log -r 'wdir()' -T "{latesttagdistance}\n" |
|
421 | 421 | 1 |
|
422 | 422 | $ hg up -q |
|
423 | 423 | $ hg log -r 'wdir()' -T "{latesttagdistance}\n" |
|
424 | 424 | 2 |
|
425 | 425 | $ cd .. |
|
426 | 426 | $ hg clone repo-automatic-tag-merge repo-automatic-tag-merge-clone |
|
427 | 427 | updating to branch default |
|
428 | 428 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
429 | 429 | $ cd repo-automatic-tag-merge-clone |
|
430 | 430 | $ echo c1 > f1 |
|
431 | 431 | $ hg ci -A -m1 |
|
432 | 432 | adding f1 |
|
433 | 433 | $ hg tag t1 t2 t3 |
|
434 | 434 | $ hg tag --remove t2 |
|
435 | 435 | $ hg tag t5 |
|
436 | 436 | $ echo c2 > f2 |
|
437 | 437 | $ hg ci -A -m2 |
|
438 | 438 | adding f2 |
|
439 | 439 | $ hg tag -f t3 |
|
440 | 440 | |
|
441 | 441 | $ cd ../repo-automatic-tag-merge |
|
442 | 442 | $ echo c3 > f3 |
|
443 | 443 | $ hg ci -A -m3 |
|
444 | 444 | adding f3 |
|
445 | 445 | $ hg tag -f t4 t5 t6 |
|
446 | 446 | |
|
447 | 447 | $ hg up -q '.^' |
|
448 | 448 | $ hg log -r 'wdir()' -T "{changessincelatesttag} changes since {latesttag}\n" |
|
449 | 449 | 1 changes since t4:t5:t6 |
|
450 | 450 | $ hg log -r '.' -T "{changessincelatesttag} changes since {latesttag}\n" |
|
451 | 451 | 0 changes since t4:t5:t6 |
|
452 | 452 | $ echo c5 > f3 |
|
453 | 453 | $ hg log -r 'wdir()' -T "{changessincelatesttag} changes since {latesttag}\n" |
|
454 | 454 | 1 changes since t4:t5:t6 |
|
455 | 455 | $ hg up -qC |
|
456 | 456 | |
|
457 | 457 | $ hg tag --remove t5 |
|
458 | 458 | $ echo c4 > f4 |
|
459 | 459 | $ hg log -r '.' -T "{changessincelatesttag} changes since {latesttag}\n" |
|
460 | 460 | 2 changes since t4:t6 |
|
461 | 461 | $ hg log -r '.' -T "{latesttag % '{latesttag}\n'}" |
|
462 | 462 | t4 |
|
463 | 463 | t6 |
|
464 | $ hg log -r '.' -T "{latesttag('t4') % 'T: {tag}, C: {changes}, D: {distance}\n'}" | |
|
465 | T: t4, C: 2, D: 2 | |
|
466 | $ hg log -r '.' -T "{latesttag('re:\d') % 'T: {tag}, C: {changes}, D: {distance}\n'}" | |
|
467 | T: t4, C: 2, D: 2 | |
|
468 | T: t6, C: 2, D: 2 | |
|
469 | $ hg log -r . -T '{join(latesttag(), "*")}\n' | |
|
470 | t4*t6 | |
|
464 | 471 | $ hg ci -A -m4 |
|
465 | 472 | adding f4 |
|
466 | 473 | $ hg log -r 'wdir()' -T "{changessincelatesttag} changes since {latesttag}\n" |
|
467 | 474 | 4 changes since t4:t6 |
|
468 | 475 | $ hg tag t2 |
|
469 | 476 | $ hg tag -f t6 |
|
470 | 477 | |
|
471 | 478 | $ cd ../repo-automatic-tag-merge-clone |
|
472 | 479 | $ hg pull |
|
473 | 480 | pulling from $TESTTMP/repo-automatic-tag-merge (glob) |
|
474 | 481 | searching for changes |
|
475 | 482 | adding changesets |
|
476 | 483 | adding manifests |
|
477 | 484 | adding file changes |
|
478 | 485 | added 6 changesets with 6 changes to 3 files (+1 heads) |
|
479 | 486 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
480 | 487 | $ hg merge --tool internal:tagmerge |
|
481 | 488 | merging .hgtags |
|
482 | 489 | 2 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
483 | 490 | (branch merge, don't forget to commit) |
|
484 | 491 | $ hg status |
|
485 | 492 | M .hgtags |
|
486 | 493 | M f3 |
|
487 | 494 | M f4 |
|
488 | 495 | $ hg resolve -l |
|
489 | 496 | R .hgtags |
|
490 | 497 | $ cat .hgtags |
|
491 | 498 | 9aa4e1292a27a248f8d07339bed9931d54907be7 t4 |
|
492 | 499 | 9aa4e1292a27a248f8d07339bed9931d54907be7 t6 |
|
493 | 500 | 9aa4e1292a27a248f8d07339bed9931d54907be7 t6 |
|
494 | 501 | 09af2ce14077a94effef208b49a718f4836d4338 t6 |
|
495 | 502 | 6cee5c8f3e5b4ae1a3996d2f6489c3e08eb5aea7 tbase |
|
496 | 503 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t1 |
|
497 | 504 | 929bca7b18d067cbf3844c3896319a940059d748 t2 |
|
498 | 505 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2 |
|
499 | 506 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3 |
|
500 | 507 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2 |
|
501 | 508 | 0000000000000000000000000000000000000000 t2 |
|
502 | 509 | 875517b4806a848f942811a315a5bce30804ae85 t5 |
|
503 | 510 | 9aa4e1292a27a248f8d07339bed9931d54907be7 t5 |
|
504 | 511 | 9aa4e1292a27a248f8d07339bed9931d54907be7 t5 |
|
505 | 512 | 0000000000000000000000000000000000000000 t5 |
|
506 | 513 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3 |
|
507 | 514 | 79505d5360b07e3e79d1052e347e73c02b8afa5b t3 |
|
508 | 515 | |
|
509 | 516 | check that the merge tried to minimize the diff with the first merge parent |
|
510 | 517 | |
|
511 | 518 | $ hg diff --git -r 'p1()' .hgtags |
|
512 | 519 | diff --git a/.hgtags b/.hgtags |
|
513 | 520 | --- a/.hgtags |
|
514 | 521 | +++ b/.hgtags |
|
515 | 522 | @@ -1,9 +1,17 @@ |
|
516 | 523 | +9aa4e1292a27a248f8d07339bed9931d54907be7 t4 |
|
517 | 524 | +9aa4e1292a27a248f8d07339bed9931d54907be7 t6 |
|
518 | 525 | +9aa4e1292a27a248f8d07339bed9931d54907be7 t6 |
|
519 | 526 | +09af2ce14077a94effef208b49a718f4836d4338 t6 |
|
520 | 527 | 6cee5c8f3e5b4ae1a3996d2f6489c3e08eb5aea7 tbase |
|
521 | 528 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t1 |
|
522 | 529 | +929bca7b18d067cbf3844c3896319a940059d748 t2 |
|
523 | 530 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2 |
|
524 | 531 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3 |
|
525 | 532 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2 |
|
526 | 533 | 0000000000000000000000000000000000000000 t2 |
|
527 | 534 | 875517b4806a848f942811a315a5bce30804ae85 t5 |
|
528 | 535 | +9aa4e1292a27a248f8d07339bed9931d54907be7 t5 |
|
529 | 536 | +9aa4e1292a27a248f8d07339bed9931d54907be7 t5 |
|
530 | 537 | +0000000000000000000000000000000000000000 t5 |
|
531 | 538 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3 |
|
532 | 539 | 79505d5360b07e3e79d1052e347e73c02b8afa5b t3 |
|
533 | 540 | |
|
534 | 541 | detect merge tag conflicts |
|
535 | 542 | |
|
536 | 543 | $ hg update -C -r tip |
|
537 | 544 | 3 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
538 | 545 | $ hg tag t7 |
|
539 | 546 | $ hg update -C -r 'first(sort(head()))' |
|
540 | 547 | 3 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
541 | 548 | $ printf "%s %s\n" `hg log -r . --template "{node} t7"` >> .hgtags |
|
542 | 549 | $ hg commit -m "manually add conflicting t7 tag" |
|
543 | 550 | $ hg merge --tool internal:tagmerge |
|
544 | 551 | merging .hgtags |
|
545 | 552 | automatic .hgtags merge failed |
|
546 | 553 | the following 1 tags are in conflict: t7 |
|
547 | 554 | automatic tag merging of .hgtags failed! (use 'hg resolve --tool :merge' or another merge tool of your choice) |
|
548 | 555 | 2 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
549 | 556 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
550 | 557 | [1] |
|
551 | 558 | $ hg resolve -l |
|
552 | 559 | U .hgtags |
|
553 | 560 | $ cat .hgtags |
|
554 | 561 | 6cee5c8f3e5b4ae1a3996d2f6489c3e08eb5aea7 tbase |
|
555 | 562 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t1 |
|
556 | 563 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2 |
|
557 | 564 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3 |
|
558 | 565 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2 |
|
559 | 566 | 0000000000000000000000000000000000000000 t2 |
|
560 | 567 | 875517b4806a848f942811a315a5bce30804ae85 t5 |
|
561 | 568 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3 |
|
562 | 569 | 79505d5360b07e3e79d1052e347e73c02b8afa5b t3 |
|
563 | 570 | ea918d56be86a4afc5a95312e8b6750e1428d9d2 t7 |
|
564 | 571 | |
|
565 | 572 | $ cd .. |
|
566 | 573 | |
|
567 | 574 | handle the loss of tags |
|
568 | 575 | |
|
569 | 576 | $ hg clone repo-automatic-tag-merge-clone repo-merge-lost-tags |
|
570 | 577 | updating to branch default |
|
571 | 578 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
572 | 579 | $ cd repo-merge-lost-tags |
|
573 | 580 | $ echo c5 > f5 |
|
574 | 581 | $ hg ci -A -m5 |
|
575 | 582 | adding f5 |
|
576 | 583 | $ hg tag -f t7 |
|
577 | 584 | $ hg update -r 'p1(t7)' |
|
578 | 585 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
579 | 586 | $ printf '' > .hgtags |
|
580 | 587 | $ hg commit -m 'delete all tags' |
|
581 | 588 | created new head |
|
582 | 589 | $ hg log -r 'max(t7::)' |
|
583 | 590 | changeset: 17:ffe462b50880 |
|
584 | 591 | user: test |
|
585 | 592 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
586 | 593 | summary: Added tag t7 for changeset fd3a9e394ce3 |
|
587 | 594 | |
|
588 | 595 | $ hg update -r 'max(t7::)' |
|
589 | 596 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
590 | 597 | $ hg merge -r tip --tool internal:tagmerge |
|
591 | 598 | merging .hgtags |
|
592 | 599 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
593 | 600 | (branch merge, don't forget to commit) |
|
594 | 601 | $ hg resolve -l |
|
595 | 602 | R .hgtags |
|
596 | 603 | $ cat .hgtags |
|
597 | 604 | 6cee5c8f3e5b4ae1a3996d2f6489c3e08eb5aea7 tbase |
|
598 | 605 | 0000000000000000000000000000000000000000 tbase |
|
599 | 606 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t1 |
|
600 | 607 | 0000000000000000000000000000000000000000 t1 |
|
601 | 608 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2 |
|
602 | 609 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3 |
|
603 | 610 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2 |
|
604 | 611 | 0000000000000000000000000000000000000000 t2 |
|
605 | 612 | 875517b4806a848f942811a315a5bce30804ae85 t5 |
|
606 | 613 | 0000000000000000000000000000000000000000 t5 |
|
607 | 614 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3 |
|
608 | 615 | 79505d5360b07e3e79d1052e347e73c02b8afa5b t3 |
|
609 | 616 | 0000000000000000000000000000000000000000 t3 |
|
610 | 617 | ea918d56be86a4afc5a95312e8b6750e1428d9d2 t7 |
|
611 | 618 | 0000000000000000000000000000000000000000 t7 |
|
612 | 619 | ea918d56be86a4afc5a95312e8b6750e1428d9d2 t7 |
|
613 | 620 | fd3a9e394ce3afb354a496323bf68ac1755a30de t7 |
|
614 | 621 | |
|
615 | 622 | also check that we minimize the diff with the 1st merge parent |
|
616 | 623 | |
|
617 | 624 | $ hg diff --git -r 'p1()' .hgtags |
|
618 | 625 | diff --git a/.hgtags b/.hgtags |
|
619 | 626 | --- a/.hgtags |
|
620 | 627 | +++ b/.hgtags |
|
621 | 628 | @@ -1,12 +1,17 @@ |
|
622 | 629 | 6cee5c8f3e5b4ae1a3996d2f6489c3e08eb5aea7 tbase |
|
623 | 630 | +0000000000000000000000000000000000000000 tbase |
|
624 | 631 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t1 |
|
625 | 632 | +0000000000000000000000000000000000000000 t1 |
|
626 | 633 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2 |
|
627 | 634 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3 |
|
628 | 635 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2 |
|
629 | 636 | 0000000000000000000000000000000000000000 t2 |
|
630 | 637 | 875517b4806a848f942811a315a5bce30804ae85 t5 |
|
631 | 638 | +0000000000000000000000000000000000000000 t5 |
|
632 | 639 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3 |
|
633 | 640 | 79505d5360b07e3e79d1052e347e73c02b8afa5b t3 |
|
634 | 641 | +0000000000000000000000000000000000000000 t3 |
|
635 | 642 | ea918d56be86a4afc5a95312e8b6750e1428d9d2 t7 |
|
636 | 643 | +0000000000000000000000000000000000000000 t7 |
|
637 | 644 | ea918d56be86a4afc5a95312e8b6750e1428d9d2 t7 |
|
638 | 645 | fd3a9e394ce3afb354a496323bf68ac1755a30de t7 |
|
639 | 646 |
General Comments 0
You need to be logged in to leave comments.
Login now