Show More
@@ -1,422 +1,426 b'' | |||
|
1 | 1 | # ASCII graph log extension for Mercurial |
|
2 | 2 | # |
|
3 | 3 | # Copyright 2007 Joel Rosdahl <joel@rosdahl.net> |
|
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 | '''command to view revision graphs from a shell |
|
9 | 9 | |
|
10 | 10 | This extension adds a --graph option to the incoming, outgoing and log |
|
11 | 11 | commands. When this options is given, an ASCII representation of the |
|
12 | 12 | revision graph is also shown. |
|
13 | 13 | ''' |
|
14 | 14 | |
|
15 | 15 | from mercurial.cmdutil import show_changeset |
|
16 | 16 | from mercurial.commands import templateopts |
|
17 | 17 | from mercurial.i18n import _ |
|
18 | 18 | from mercurial.node import nullrev |
|
19 | 19 | from mercurial import cmdutil, commands, extensions, scmutil |
|
20 | 20 | from mercurial import hg, util, graphmod |
|
21 | 21 | |
|
22 | 22 | cmdtable = {} |
|
23 | 23 | command = cmdutil.command(cmdtable) |
|
24 | 24 | |
|
25 | 25 | ASCIIDATA = 'ASC' |
|
26 | 26 | |
|
27 | 27 | def asciiedges(type, char, lines, seen, rev, parents): |
|
28 | 28 | """adds edge info to changelog DAG walk suitable for ascii()""" |
|
29 | 29 | if rev not in seen: |
|
30 | 30 | seen.append(rev) |
|
31 | 31 | nodeidx = seen.index(rev) |
|
32 | 32 | |
|
33 | 33 | knownparents = [] |
|
34 | 34 | newparents = [] |
|
35 | 35 | for parent in parents: |
|
36 | 36 | if parent in seen: |
|
37 | 37 | knownparents.append(parent) |
|
38 | 38 | else: |
|
39 | 39 | newparents.append(parent) |
|
40 | 40 | |
|
41 | 41 | ncols = len(seen) |
|
42 | 42 | nextseen = seen[:] |
|
43 | 43 | nextseen[nodeidx:nodeidx + 1] = newparents |
|
44 | 44 | edges = [(nodeidx, nextseen.index(p)) for p in knownparents] |
|
45 | 45 | |
|
46 | 46 | while len(newparents) > 2: |
|
47 | 47 | # ascii() only knows how to add or remove a single column between two |
|
48 | 48 | # calls. Nodes with more than two parents break this constraint so we |
|
49 | 49 | # introduce intermediate expansion lines to grow the active node list |
|
50 | 50 | # slowly. |
|
51 | 51 | edges.append((nodeidx, nodeidx)) |
|
52 | 52 | edges.append((nodeidx, nodeidx + 1)) |
|
53 | 53 | nmorecols = 1 |
|
54 | 54 | yield (type, char, lines, (nodeidx, edges, ncols, nmorecols)) |
|
55 | 55 | char = '\\' |
|
56 | 56 | lines = [] |
|
57 | 57 | nodeidx += 1 |
|
58 | 58 | ncols += 1 |
|
59 | 59 | edges = [] |
|
60 | 60 | del newparents[0] |
|
61 | 61 | |
|
62 | 62 | if len(newparents) > 0: |
|
63 | 63 | edges.append((nodeidx, nodeidx)) |
|
64 | 64 | if len(newparents) > 1: |
|
65 | 65 | edges.append((nodeidx, nodeidx + 1)) |
|
66 | 66 | nmorecols = len(nextseen) - ncols |
|
67 | 67 | seen[:] = nextseen |
|
68 | 68 | yield (type, char, lines, (nodeidx, edges, ncols, nmorecols)) |
|
69 | 69 | |
|
70 | 70 | def fix_long_right_edges(edges): |
|
71 | 71 | for (i, (start, end)) in enumerate(edges): |
|
72 | 72 | if end > start: |
|
73 | 73 | edges[i] = (start, end + 1) |
|
74 | 74 | |
|
75 | 75 | def get_nodeline_edges_tail( |
|
76 | 76 | node_index, p_node_index, n_columns, n_columns_diff, p_diff, fix_tail): |
|
77 | 77 | if fix_tail and n_columns_diff == p_diff and n_columns_diff != 0: |
|
78 | 78 | # Still going in the same non-vertical direction. |
|
79 | 79 | if n_columns_diff == -1: |
|
80 | 80 | start = max(node_index + 1, p_node_index) |
|
81 | 81 | tail = ["|", " "] * (start - node_index - 1) |
|
82 | 82 | tail.extend(["/", " "] * (n_columns - start)) |
|
83 | 83 | return tail |
|
84 | 84 | else: |
|
85 | 85 | return ["\\", " "] * (n_columns - node_index - 1) |
|
86 | 86 | else: |
|
87 | 87 | return ["|", " "] * (n_columns - node_index - 1) |
|
88 | 88 | |
|
89 | 89 | def draw_edges(edges, nodeline, interline): |
|
90 | 90 | for (start, end) in edges: |
|
91 | 91 | if start == end + 1: |
|
92 | 92 | interline[2 * end + 1] = "/" |
|
93 | 93 | elif start == end - 1: |
|
94 | 94 | interline[2 * start + 1] = "\\" |
|
95 | 95 | elif start == end: |
|
96 | 96 | interline[2 * start] = "|" |
|
97 | 97 | else: |
|
98 | 98 | if 2 * end >= len(nodeline): |
|
99 | 99 | continue |
|
100 | 100 | nodeline[2 * end] = "+" |
|
101 | 101 | if start > end: |
|
102 | 102 | (start, end) = (end, start) |
|
103 | 103 | for i in range(2 * start + 1, 2 * end): |
|
104 | 104 | if nodeline[i] != "+": |
|
105 | 105 | nodeline[i] = "-" |
|
106 | 106 | |
|
107 | 107 | def get_padding_line(ni, n_columns, edges): |
|
108 | 108 | line = [] |
|
109 | 109 | line.extend(["|", " "] * ni) |
|
110 | 110 | if (ni, ni - 1) in edges or (ni, ni) in edges: |
|
111 | 111 | # (ni, ni - 1) (ni, ni) |
|
112 | 112 | # | | | | | | | | |
|
113 | 113 | # +---o | | o---+ |
|
114 | 114 | # | | c | | c | | |
|
115 | 115 | # | |/ / | |/ / |
|
116 | 116 | # | | | | | | |
|
117 | 117 | c = "|" |
|
118 | 118 | else: |
|
119 | 119 | c = " " |
|
120 | 120 | line.extend([c, " "]) |
|
121 | 121 | line.extend(["|", " "] * (n_columns - ni - 1)) |
|
122 | 122 | return line |
|
123 | 123 | |
|
124 | 124 | def asciistate(): |
|
125 | 125 | """returns the initial value for the "state" argument to ascii()""" |
|
126 | 126 | return [0, 0] |
|
127 | 127 | |
|
128 | 128 | def ascii(ui, state, type, char, text, coldata): |
|
129 | 129 | """prints an ASCII graph of the DAG |
|
130 | 130 | |
|
131 | 131 | takes the following arguments (one call per node in the graph): |
|
132 | 132 | |
|
133 | 133 | - ui to write to |
|
134 | 134 | - Somewhere to keep the needed state in (init to asciistate()) |
|
135 | 135 | - Column of the current node in the set of ongoing edges. |
|
136 | 136 | - Type indicator of node data == ASCIIDATA. |
|
137 | 137 | - Payload: (char, lines): |
|
138 | 138 | - Character to use as node's symbol. |
|
139 | 139 | - List of lines to display as the node's text. |
|
140 | 140 | - Edges; a list of (col, next_col) indicating the edges between |
|
141 | 141 | the current node and its parents. |
|
142 | 142 | - Number of columns (ongoing edges) in the current revision. |
|
143 | 143 | - The difference between the number of columns (ongoing edges) |
|
144 | 144 | in the next revision and the number of columns (ongoing edges) |
|
145 | 145 | in the current revision. That is: -1 means one column removed; |
|
146 | 146 | 0 means no columns added or removed; 1 means one column added. |
|
147 | 147 | """ |
|
148 | 148 | |
|
149 | 149 | idx, edges, ncols, coldiff = coldata |
|
150 | 150 | assert -2 < coldiff < 2 |
|
151 | 151 | if coldiff == -1: |
|
152 | 152 | # Transform |
|
153 | 153 | # |
|
154 | 154 | # | | | | | | |
|
155 | 155 | # o | | into o---+ |
|
156 | 156 | # |X / |/ / |
|
157 | 157 | # | | | | |
|
158 | 158 | fix_long_right_edges(edges) |
|
159 | 159 | |
|
160 | 160 | # add_padding_line says whether to rewrite |
|
161 | 161 | # |
|
162 | 162 | # | | | | | | | | |
|
163 | 163 | # | o---+ into | o---+ |
|
164 | 164 | # | / / | | | # <--- padding line |
|
165 | 165 | # o | | | / / |
|
166 | 166 | # o | | |
|
167 | 167 | add_padding_line = (len(text) > 2 and coldiff == -1 and |
|
168 | 168 | [x for (x, y) in edges if x + 1 < y]) |
|
169 | 169 | |
|
170 | 170 | # fix_nodeline_tail says whether to rewrite |
|
171 | 171 | # |
|
172 | 172 | # | | o | | | | o | | |
|
173 | 173 | # | | |/ / | | |/ / |
|
174 | 174 | # | o | | into | o / / # <--- fixed nodeline tail |
|
175 | 175 | # | |/ / | |/ / |
|
176 | 176 | # o | | o | | |
|
177 | 177 | fix_nodeline_tail = len(text) <= 2 and not add_padding_line |
|
178 | 178 | |
|
179 | 179 | # nodeline is the line containing the node character (typically o) |
|
180 | 180 | nodeline = ["|", " "] * idx |
|
181 | 181 | nodeline.extend([char, " "]) |
|
182 | 182 | |
|
183 | 183 | nodeline.extend( |
|
184 | 184 | get_nodeline_edges_tail(idx, state[1], ncols, coldiff, |
|
185 | 185 | state[0], fix_nodeline_tail)) |
|
186 | 186 | |
|
187 | 187 | # shift_interline is the line containing the non-vertical |
|
188 | 188 | # edges between this entry and the next |
|
189 | 189 | shift_interline = ["|", " "] * idx |
|
190 | 190 | if coldiff == -1: |
|
191 | 191 | n_spaces = 1 |
|
192 | 192 | edge_ch = "/" |
|
193 | 193 | elif coldiff == 0: |
|
194 | 194 | n_spaces = 2 |
|
195 | 195 | edge_ch = "|" |
|
196 | 196 | else: |
|
197 | 197 | n_spaces = 3 |
|
198 | 198 | edge_ch = "\\" |
|
199 | 199 | shift_interline.extend(n_spaces * [" "]) |
|
200 | 200 | shift_interline.extend([edge_ch, " "] * (ncols - idx - 1)) |
|
201 | 201 | |
|
202 | 202 | # draw edges from the current node to its parents |
|
203 | 203 | draw_edges(edges, nodeline, shift_interline) |
|
204 | 204 | |
|
205 | 205 | # lines is the list of all graph lines to print |
|
206 | 206 | lines = [nodeline] |
|
207 | 207 | if add_padding_line: |
|
208 | 208 | lines.append(get_padding_line(idx, ncols, edges)) |
|
209 | 209 | lines.append(shift_interline) |
|
210 | 210 | |
|
211 | 211 | # make sure that there are as many graph lines as there are |
|
212 | 212 | # log strings |
|
213 | 213 | while len(text) < len(lines): |
|
214 | 214 | text.append("") |
|
215 | 215 | if len(lines) < len(text): |
|
216 | 216 | extra_interline = ["|", " "] * (ncols + coldiff) |
|
217 | 217 | while len(lines) < len(text): |
|
218 | 218 | lines.append(extra_interline) |
|
219 | 219 | |
|
220 | 220 | # print lines |
|
221 | 221 | indentation_level = max(ncols, ncols + coldiff) |
|
222 | 222 | for (line, logstr) in zip(lines, text): |
|
223 | 223 | ln = "%-*s %s" % (2 * indentation_level, "".join(line), logstr) |
|
224 | 224 | ui.write(ln.rstrip() + '\n') |
|
225 | 225 | |
|
226 | 226 | # ... and start over |
|
227 | 227 | state[0] = coldiff |
|
228 | 228 | state[1] = idx |
|
229 | 229 | |
|
230 | 230 | def get_revs(repo, rev_opt): |
|
231 | 231 | if rev_opt: |
|
232 | 232 | revs = scmutil.revrange(repo, rev_opt) |
|
233 | 233 | if len(revs) == 0: |
|
234 | 234 | return (nullrev, nullrev) |
|
235 | 235 | return (max(revs), min(revs)) |
|
236 | 236 | else: |
|
237 | 237 | return (len(repo) - 1, 0) |
|
238 | 238 | |
|
239 | 239 | def check_unsupported_flags(pats, opts): |
|
240 | 240 | for op in ["follow_first", "copies", "newest_first"]: |
|
241 | 241 | if op in opts and opts[op]: |
|
242 | 242 | raise util.Abort(_("-G/--graph option is incompatible with --%s") |
|
243 | 243 | % op.replace("_", "-")) |
|
244 | 244 | if pats and opts.get('follow'): |
|
245 | 245 | raise util.Abort(_("-G/--graph option is incompatible with --follow " |
|
246 | 246 | "with file argument")) |
|
247 | 247 | |
|
248 | 248 | def revset(repo, pats, opts): |
|
249 | 249 | """Return revset str built of revisions, log options and file patterns. |
|
250 | 250 | """ |
|
251 | 251 | opt2revset = { |
|
252 | 252 | 'follow': ('follow()', None), |
|
253 | 253 | 'no_merges': ('not merge()', None), |
|
254 | 254 | 'only_merges': ('merge()', None), |
|
255 | 255 | 'removed': ('removes("*")', None), |
|
256 | 256 | 'date': ('date(%(val)r)', None), |
|
257 | 257 | 'branch': ('branch(%(val)r)', ' or '), |
|
258 | 258 | '_patslog': ('filelog(%(val)r)', ' or '), |
|
259 | 259 | 'keyword': ('keyword(%(val)r)', ' or '), |
|
260 | 260 | 'prune': ('not (%(val)r or ancestors(%(val)r))', ' and '), |
|
261 | 261 | 'user': ('user(%(val)r)', ' or '), |
|
262 | 262 | 'rev': ('%(val)s', ' or '), |
|
263 | 263 | } |
|
264 | 264 | |
|
265 | 265 | opts = dict(opts) |
|
266 | 266 | # branch and only_branch are really aliases and must be handled at |
|
267 | 267 | # the same time |
|
268 | 268 | if 'branch' in opts and 'only_branch' in opts: |
|
269 | 269 | opts['branch'] = opts['branch'] + opts.pop('only_branch') |
|
270 | 270 | |
|
271 | match = scmutil.match(repo[None], pats, opts) | |
|
271 | # pats/include/exclude are passed to match.match() directly in | |
|
272 | # _matchfile() revset but walkchangerevs() builds its matcher with | |
|
273 | # scmutil.match(). The difference is input pats are globbed on | |
|
274 | # platforms without shell expansion (windows). | |
|
275 | match, pats = scmutil.matchandpats(repo[None], pats, opts) | |
|
272 | 276 | slowpath = match.anypats() or (match.files() and opts.get('removed')) |
|
273 | 277 | if not slowpath: |
|
274 | 278 | for f in match.files(): |
|
275 | 279 | filelog = repo.file(f) |
|
276 | 280 | if not len(filelog): |
|
277 | 281 | # A zero count may be a directory or deleted file, so |
|
278 | 282 | # try to find matching entries on the slow path. |
|
279 | 283 | slowpath = True |
|
280 | 284 | if slowpath: |
|
281 | 285 | # See cmdutil.walkchangerevs() slow path. |
|
282 | 286 | # |
|
283 | 287 | # pats/include/exclude cannot be represented as separate |
|
284 | 288 | # revset expressions as their filtering logic applies at file |
|
285 | 289 | # level. For instance "-I a -X a" matches a revision touching |
|
286 | 290 | # "a" and "b" while "file(a) and not file(b)" does not. |
|
287 | 291 | matchargs = [] |
|
288 | 292 | for p in pats: |
|
289 | 293 | matchargs.append('p:' + p) |
|
290 | 294 | for p in opts.get('include', []): |
|
291 | 295 | matchargs.append('i:' + p) |
|
292 | 296 | for p in opts.get('exclude', []): |
|
293 | 297 | matchargs.append('x:' + p) |
|
294 | 298 | matchargs = ','.join(('%r' % p) for p in matchargs) |
|
295 | 299 | opts['rev'] = opts.get('rev', []) + ['_matchfiles(%s)' % matchargs] |
|
296 | 300 | else: |
|
297 | 301 | opts['_patslog'] = list(pats) |
|
298 | 302 | |
|
299 | 303 | revset = [] |
|
300 | 304 | for op, val in opts.iteritems(): |
|
301 | 305 | if not val: |
|
302 | 306 | continue |
|
303 | 307 | if op not in opt2revset: |
|
304 | 308 | continue |
|
305 | 309 | revop, andor = opt2revset[op] |
|
306 | 310 | if '%(val)' not in revop: |
|
307 | 311 | revset.append(revop) |
|
308 | 312 | else: |
|
309 | 313 | if not isinstance(val, list): |
|
310 | 314 | expr = revop % {'val': val} |
|
311 | 315 | else: |
|
312 | 316 | expr = '(' + andor.join((revop % {'val': v}) for v in val) + ')' |
|
313 | 317 | revset.append(expr) |
|
314 | 318 | |
|
315 | 319 | if revset: |
|
316 | 320 | revset = '(' + ' and '.join(revset) + ')' |
|
317 | 321 | else: |
|
318 | 322 | revset = 'all()' |
|
319 | 323 | return revset |
|
320 | 324 | |
|
321 | 325 | def generate(ui, dag, displayer, showparents, edgefn): |
|
322 | 326 | seen, state = [], asciistate() |
|
323 | 327 | for rev, type, ctx, parents in dag: |
|
324 | 328 | char = ctx.node() in showparents and '@' or 'o' |
|
325 | 329 | displayer.show(ctx) |
|
326 | 330 | lines = displayer.hunk.pop(rev).split('\n')[:-1] |
|
327 | 331 | displayer.flush(rev) |
|
328 | 332 | edges = edgefn(type, char, lines, seen, rev, parents) |
|
329 | 333 | for type, char, lines, coldata in edges: |
|
330 | 334 | ascii(ui, state, type, char, lines, coldata) |
|
331 | 335 | displayer.close() |
|
332 | 336 | |
|
333 | 337 | @command('glog', |
|
334 | 338 | [('l', 'limit', '', |
|
335 | 339 | _('limit number of changes displayed'), _('NUM')), |
|
336 | 340 | ('p', 'patch', False, _('show patch')), |
|
337 | 341 | ('r', 'rev', [], _('show the specified revision or range'), _('REV')), |
|
338 | 342 | ] + templateopts, |
|
339 | 343 | _('hg glog [OPTION]... [FILE]')) |
|
340 | 344 | def graphlog(ui, repo, *pats, **opts): |
|
341 | 345 | """show revision history alongside an ASCII revision graph |
|
342 | 346 | |
|
343 | 347 | Print a revision history alongside a revision graph drawn with |
|
344 | 348 | ASCII characters. |
|
345 | 349 | |
|
346 | 350 | Nodes printed as an @ character are parents of the working |
|
347 | 351 | directory. |
|
348 | 352 | """ |
|
349 | 353 | |
|
350 | 354 | check_unsupported_flags(pats, opts) |
|
351 | 355 | |
|
352 | 356 | revs = sorted(scmutil.revrange(repo, [revset(repo, pats, opts)]), reverse=1) |
|
353 | 357 | limit = cmdutil.loglimit(opts) |
|
354 | 358 | if limit is not None: |
|
355 | 359 | revs = revs[:limit] |
|
356 | 360 | revdag = graphmod.dagwalker(repo, revs) |
|
357 | 361 | |
|
358 | 362 | displayer = show_changeset(ui, repo, opts, buffered=True) |
|
359 | 363 | showparents = [ctx.node() for ctx in repo[None].parents()] |
|
360 | 364 | generate(ui, revdag, displayer, showparents, asciiedges) |
|
361 | 365 | |
|
362 | 366 | def graphrevs(repo, nodes, opts): |
|
363 | 367 | limit = cmdutil.loglimit(opts) |
|
364 | 368 | nodes.reverse() |
|
365 | 369 | if limit is not None: |
|
366 | 370 | nodes = nodes[:limit] |
|
367 | 371 | return graphmod.nodes(repo, nodes) |
|
368 | 372 | |
|
369 | 373 | def goutgoing(ui, repo, dest=None, **opts): |
|
370 | 374 | """show the outgoing changesets alongside an ASCII revision graph |
|
371 | 375 | |
|
372 | 376 | Print the outgoing changesets alongside a revision graph drawn with |
|
373 | 377 | ASCII characters. |
|
374 | 378 | |
|
375 | 379 | Nodes printed as an @ character are parents of the working |
|
376 | 380 | directory. |
|
377 | 381 | """ |
|
378 | 382 | |
|
379 | 383 | check_unsupported_flags([], opts) |
|
380 | 384 | o = hg._outgoing(ui, repo, dest, opts) |
|
381 | 385 | if o is None: |
|
382 | 386 | return |
|
383 | 387 | |
|
384 | 388 | revdag = graphrevs(repo, o, opts) |
|
385 | 389 | displayer = show_changeset(ui, repo, opts, buffered=True) |
|
386 | 390 | showparents = [ctx.node() for ctx in repo[None].parents()] |
|
387 | 391 | generate(ui, revdag, displayer, showparents, asciiedges) |
|
388 | 392 | |
|
389 | 393 | def gincoming(ui, repo, source="default", **opts): |
|
390 | 394 | """show the incoming changesets alongside an ASCII revision graph |
|
391 | 395 | |
|
392 | 396 | Print the incoming changesets alongside a revision graph drawn with |
|
393 | 397 | ASCII characters. |
|
394 | 398 | |
|
395 | 399 | Nodes printed as an @ character are parents of the working |
|
396 | 400 | directory. |
|
397 | 401 | """ |
|
398 | 402 | def subreporecurse(): |
|
399 | 403 | return 1 |
|
400 | 404 | |
|
401 | 405 | check_unsupported_flags([], opts) |
|
402 | 406 | def display(other, chlist, displayer): |
|
403 | 407 | revdag = graphrevs(other, chlist, opts) |
|
404 | 408 | showparents = [ctx.node() for ctx in repo[None].parents()] |
|
405 | 409 | generate(ui, revdag, displayer, showparents, asciiedges) |
|
406 | 410 | |
|
407 | 411 | hg._incoming(display, subreporecurse, ui, repo, source, opts, buffered=True) |
|
408 | 412 | |
|
409 | 413 | def uisetup(ui): |
|
410 | 414 | '''Initialize the extension.''' |
|
411 | 415 | _wrapcmd('log', commands.table, graphlog) |
|
412 | 416 | _wrapcmd('incoming', commands.table, gincoming) |
|
413 | 417 | _wrapcmd('outgoing', commands.table, goutgoing) |
|
414 | 418 | |
|
415 | 419 | def _wrapcmd(cmd, table, wrapfn): |
|
416 | 420 | '''wrap the command''' |
|
417 | 421 | def graph(orig, *args, **kwargs): |
|
418 | 422 | if kwargs['graph']: |
|
419 | 423 | return wrapfn(*args, **kwargs) |
|
420 | 424 | return orig(*args, **kwargs) |
|
421 | 425 | entry = extensions.wrapcommand(table, cmd, graph) |
|
422 | 426 | entry[1].append(('G', 'graph', None, _("show the revision DAG"))) |
@@ -1,845 +1,848 b'' | |||
|
1 | 1 | # scmutil.py - Mercurial core utility functions |
|
2 | 2 | # |
|
3 | 3 | # Copyright 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 i18n import _ |
|
9 | 9 | import util, error, osutil, revset, similar, encoding |
|
10 | 10 | import match as matchmod |
|
11 | 11 | import os, errno, re, stat, sys, glob |
|
12 | 12 | |
|
13 | 13 | def nochangesfound(ui, secretlist=None): |
|
14 | 14 | '''report no changes for push/pull''' |
|
15 | 15 | if secretlist: |
|
16 | 16 | ui.status(_("no changes found (ignored %d secret changesets)\n") |
|
17 | 17 | % len(secretlist)) |
|
18 | 18 | else: |
|
19 | 19 | ui.status(_("no changes found\n")) |
|
20 | 20 | |
|
21 | 21 | def checkfilename(f): |
|
22 | 22 | '''Check that the filename f is an acceptable filename for a tracked file''' |
|
23 | 23 | if '\r' in f or '\n' in f: |
|
24 | 24 | raise util.Abort(_("'\\n' and '\\r' disallowed in filenames: %r") % f) |
|
25 | 25 | |
|
26 | 26 | def checkportable(ui, f): |
|
27 | 27 | '''Check if filename f is portable and warn or abort depending on config''' |
|
28 | 28 | checkfilename(f) |
|
29 | 29 | abort, warn = checkportabilityalert(ui) |
|
30 | 30 | if abort or warn: |
|
31 | 31 | msg = util.checkwinfilename(f) |
|
32 | 32 | if msg: |
|
33 | 33 | msg = "%s: %r" % (msg, f) |
|
34 | 34 | if abort: |
|
35 | 35 | raise util.Abort(msg) |
|
36 | 36 | ui.warn(_("warning: %s\n") % msg) |
|
37 | 37 | |
|
38 | 38 | def checkportabilityalert(ui): |
|
39 | 39 | '''check if the user's config requests nothing, a warning, or abort for |
|
40 | 40 | non-portable filenames''' |
|
41 | 41 | val = ui.config('ui', 'portablefilenames', 'warn') |
|
42 | 42 | lval = val.lower() |
|
43 | 43 | bval = util.parsebool(val) |
|
44 | 44 | abort = os.name == 'nt' or lval == 'abort' |
|
45 | 45 | warn = bval or lval == 'warn' |
|
46 | 46 | if bval is None and not (warn or abort or lval == 'ignore'): |
|
47 | 47 | raise error.ConfigError( |
|
48 | 48 | _("ui.portablefilenames value is invalid ('%s')") % val) |
|
49 | 49 | return abort, warn |
|
50 | 50 | |
|
51 | 51 | class casecollisionauditor(object): |
|
52 | 52 | def __init__(self, ui, abort, existingiter): |
|
53 | 53 | self._ui = ui |
|
54 | 54 | self._abort = abort |
|
55 | 55 | self._map = {} |
|
56 | 56 | for f in existingiter: |
|
57 | 57 | self._map[encoding.lower(f)] = f |
|
58 | 58 | |
|
59 | 59 | def __call__(self, f): |
|
60 | 60 | fl = encoding.lower(f) |
|
61 | 61 | map = self._map |
|
62 | 62 | if fl in map and map[fl] != f: |
|
63 | 63 | msg = _('possible case-folding collision for %s') % f |
|
64 | 64 | if self._abort: |
|
65 | 65 | raise util.Abort(msg) |
|
66 | 66 | self._ui.warn(_("warning: %s\n") % msg) |
|
67 | 67 | map[fl] = f |
|
68 | 68 | |
|
69 | 69 | class pathauditor(object): |
|
70 | 70 | '''ensure that a filesystem path contains no banned components. |
|
71 | 71 | the following properties of a path are checked: |
|
72 | 72 | |
|
73 | 73 | - ends with a directory separator |
|
74 | 74 | - under top-level .hg |
|
75 | 75 | - starts at the root of a windows drive |
|
76 | 76 | - contains ".." |
|
77 | 77 | - traverses a symlink (e.g. a/symlink_here/b) |
|
78 | 78 | - inside a nested repository (a callback can be used to approve |
|
79 | 79 | some nested repositories, e.g., subrepositories) |
|
80 | 80 | ''' |
|
81 | 81 | |
|
82 | 82 | def __init__(self, root, callback=None): |
|
83 | 83 | self.audited = set() |
|
84 | 84 | self.auditeddir = set() |
|
85 | 85 | self.root = root |
|
86 | 86 | self.callback = callback |
|
87 | 87 | if os.path.lexists(root) and not util.checkcase(root): |
|
88 | 88 | self.normcase = util.normcase |
|
89 | 89 | else: |
|
90 | 90 | self.normcase = lambda x: x |
|
91 | 91 | |
|
92 | 92 | def __call__(self, path): |
|
93 | 93 | '''Check the relative path. |
|
94 | 94 | path may contain a pattern (e.g. foodir/**.txt)''' |
|
95 | 95 | |
|
96 | 96 | path = util.localpath(path) |
|
97 | 97 | normpath = self.normcase(path) |
|
98 | 98 | if normpath in self.audited: |
|
99 | 99 | return |
|
100 | 100 | # AIX ignores "/" at end of path, others raise EISDIR. |
|
101 | 101 | if util.endswithsep(path): |
|
102 | 102 | raise util.Abort(_("path ends in directory separator: %s") % path) |
|
103 | 103 | parts = util.splitpath(path) |
|
104 | 104 | if (os.path.splitdrive(path)[0] |
|
105 | 105 | or parts[0].lower() in ('.hg', '.hg.', '') |
|
106 | 106 | or os.pardir in parts): |
|
107 | 107 | raise util.Abort(_("path contains illegal component: %s") % path) |
|
108 | 108 | if '.hg' in path.lower(): |
|
109 | 109 | lparts = [p.lower() for p in parts] |
|
110 | 110 | for p in '.hg', '.hg.': |
|
111 | 111 | if p in lparts[1:]: |
|
112 | 112 | pos = lparts.index(p) |
|
113 | 113 | base = os.path.join(*parts[:pos]) |
|
114 | 114 | raise util.Abort(_("path '%s' is inside nested repo %r") |
|
115 | 115 | % (path, base)) |
|
116 | 116 | |
|
117 | 117 | normparts = util.splitpath(normpath) |
|
118 | 118 | assert len(parts) == len(normparts) |
|
119 | 119 | |
|
120 | 120 | parts.pop() |
|
121 | 121 | normparts.pop() |
|
122 | 122 | prefixes = [] |
|
123 | 123 | while parts: |
|
124 | 124 | prefix = os.sep.join(parts) |
|
125 | 125 | normprefix = os.sep.join(normparts) |
|
126 | 126 | if normprefix in self.auditeddir: |
|
127 | 127 | break |
|
128 | 128 | curpath = os.path.join(self.root, prefix) |
|
129 | 129 | try: |
|
130 | 130 | st = os.lstat(curpath) |
|
131 | 131 | except OSError, err: |
|
132 | 132 | # EINVAL can be raised as invalid path syntax under win32. |
|
133 | 133 | # They must be ignored for patterns can be checked too. |
|
134 | 134 | if err.errno not in (errno.ENOENT, errno.ENOTDIR, errno.EINVAL): |
|
135 | 135 | raise |
|
136 | 136 | else: |
|
137 | 137 | if stat.S_ISLNK(st.st_mode): |
|
138 | 138 | raise util.Abort( |
|
139 | 139 | _('path %r traverses symbolic link %r') |
|
140 | 140 | % (path, prefix)) |
|
141 | 141 | elif (stat.S_ISDIR(st.st_mode) and |
|
142 | 142 | os.path.isdir(os.path.join(curpath, '.hg'))): |
|
143 | 143 | if not self.callback or not self.callback(curpath): |
|
144 | 144 | raise util.Abort(_("path '%s' is inside nested repo %r") % |
|
145 | 145 | (path, prefix)) |
|
146 | 146 | prefixes.append(normprefix) |
|
147 | 147 | parts.pop() |
|
148 | 148 | normparts.pop() |
|
149 | 149 | |
|
150 | 150 | self.audited.add(normpath) |
|
151 | 151 | # only add prefixes to the cache after checking everything: we don't |
|
152 | 152 | # want to add "foo/bar/baz" before checking if there's a "foo/.hg" |
|
153 | 153 | self.auditeddir.update(prefixes) |
|
154 | 154 | |
|
155 | 155 | class abstractopener(object): |
|
156 | 156 | """Abstract base class; cannot be instantiated""" |
|
157 | 157 | |
|
158 | 158 | def __init__(self, *args, **kwargs): |
|
159 | 159 | '''Prevent instantiation; don't call this from subclasses.''' |
|
160 | 160 | raise NotImplementedError('attempted instantiating ' + str(type(self))) |
|
161 | 161 | |
|
162 | 162 | def read(self, path): |
|
163 | 163 | fp = self(path, 'rb') |
|
164 | 164 | try: |
|
165 | 165 | return fp.read() |
|
166 | 166 | finally: |
|
167 | 167 | fp.close() |
|
168 | 168 | |
|
169 | 169 | def write(self, path, data): |
|
170 | 170 | fp = self(path, 'wb') |
|
171 | 171 | try: |
|
172 | 172 | return fp.write(data) |
|
173 | 173 | finally: |
|
174 | 174 | fp.close() |
|
175 | 175 | |
|
176 | 176 | def append(self, path, data): |
|
177 | 177 | fp = self(path, 'ab') |
|
178 | 178 | try: |
|
179 | 179 | return fp.write(data) |
|
180 | 180 | finally: |
|
181 | 181 | fp.close() |
|
182 | 182 | |
|
183 | 183 | class opener(abstractopener): |
|
184 | 184 | '''Open files relative to a base directory |
|
185 | 185 | |
|
186 | 186 | This class is used to hide the details of COW semantics and |
|
187 | 187 | remote file access from higher level code. |
|
188 | 188 | ''' |
|
189 | 189 | def __init__(self, base, audit=True): |
|
190 | 190 | self.base = base |
|
191 | 191 | self._audit = audit |
|
192 | 192 | if audit: |
|
193 | 193 | self.auditor = pathauditor(base) |
|
194 | 194 | else: |
|
195 | 195 | self.auditor = util.always |
|
196 | 196 | self.createmode = None |
|
197 | 197 | self._trustnlink = None |
|
198 | 198 | |
|
199 | 199 | @util.propertycache |
|
200 | 200 | def _cansymlink(self): |
|
201 | 201 | return util.checklink(self.base) |
|
202 | 202 | |
|
203 | 203 | def _fixfilemode(self, name): |
|
204 | 204 | if self.createmode is None: |
|
205 | 205 | return |
|
206 | 206 | os.chmod(name, self.createmode & 0666) |
|
207 | 207 | |
|
208 | 208 | def __call__(self, path, mode="r", text=False, atomictemp=False): |
|
209 | 209 | if self._audit: |
|
210 | 210 | r = util.checkosfilename(path) |
|
211 | 211 | if r: |
|
212 | 212 | raise util.Abort("%s: %r" % (r, path)) |
|
213 | 213 | self.auditor(path) |
|
214 | 214 | f = os.path.join(self.base, path) |
|
215 | 215 | |
|
216 | 216 | if not text and "b" not in mode: |
|
217 | 217 | mode += "b" # for that other OS |
|
218 | 218 | |
|
219 | 219 | nlink = -1 |
|
220 | 220 | dirname, basename = os.path.split(f) |
|
221 | 221 | # If basename is empty, then the path is malformed because it points |
|
222 | 222 | # to a directory. Let the posixfile() call below raise IOError. |
|
223 | 223 | if basename and mode not in ('r', 'rb'): |
|
224 | 224 | if atomictemp: |
|
225 | 225 | if not os.path.isdir(dirname): |
|
226 | 226 | util.makedirs(dirname, self.createmode) |
|
227 | 227 | return util.atomictempfile(f, mode, self.createmode) |
|
228 | 228 | try: |
|
229 | 229 | if 'w' in mode: |
|
230 | 230 | util.unlink(f) |
|
231 | 231 | nlink = 0 |
|
232 | 232 | else: |
|
233 | 233 | # nlinks() may behave differently for files on Windows |
|
234 | 234 | # shares if the file is open. |
|
235 | 235 | fd = util.posixfile(f) |
|
236 | 236 | nlink = util.nlinks(f) |
|
237 | 237 | if nlink < 1: |
|
238 | 238 | nlink = 2 # force mktempcopy (issue1922) |
|
239 | 239 | fd.close() |
|
240 | 240 | except (OSError, IOError), e: |
|
241 | 241 | if e.errno != errno.ENOENT: |
|
242 | 242 | raise |
|
243 | 243 | nlink = 0 |
|
244 | 244 | if not os.path.isdir(dirname): |
|
245 | 245 | util.makedirs(dirname, self.createmode) |
|
246 | 246 | if nlink > 0: |
|
247 | 247 | if self._trustnlink is None: |
|
248 | 248 | self._trustnlink = nlink > 1 or util.checknlink(f) |
|
249 | 249 | if nlink > 1 or not self._trustnlink: |
|
250 | 250 | util.rename(util.mktempcopy(f), f) |
|
251 | 251 | fp = util.posixfile(f, mode) |
|
252 | 252 | if nlink == 0: |
|
253 | 253 | self._fixfilemode(f) |
|
254 | 254 | return fp |
|
255 | 255 | |
|
256 | 256 | def symlink(self, src, dst): |
|
257 | 257 | self.auditor(dst) |
|
258 | 258 | linkname = os.path.join(self.base, dst) |
|
259 | 259 | try: |
|
260 | 260 | os.unlink(linkname) |
|
261 | 261 | except OSError: |
|
262 | 262 | pass |
|
263 | 263 | |
|
264 | 264 | dirname = os.path.dirname(linkname) |
|
265 | 265 | if not os.path.exists(dirname): |
|
266 | 266 | util.makedirs(dirname, self.createmode) |
|
267 | 267 | |
|
268 | 268 | if self._cansymlink: |
|
269 | 269 | try: |
|
270 | 270 | os.symlink(src, linkname) |
|
271 | 271 | except OSError, err: |
|
272 | 272 | raise OSError(err.errno, _('could not symlink to %r: %s') % |
|
273 | 273 | (src, err.strerror), linkname) |
|
274 | 274 | else: |
|
275 | 275 | f = self(dst, "w") |
|
276 | 276 | f.write(src) |
|
277 | 277 | f.close() |
|
278 | 278 | self._fixfilemode(dst) |
|
279 | 279 | |
|
280 | 280 | def audit(self, path): |
|
281 | 281 | self.auditor(path) |
|
282 | 282 | |
|
283 | 283 | class filteropener(abstractopener): |
|
284 | 284 | '''Wrapper opener for filtering filenames with a function.''' |
|
285 | 285 | |
|
286 | 286 | def __init__(self, opener, filter): |
|
287 | 287 | self._filter = filter |
|
288 | 288 | self._orig = opener |
|
289 | 289 | |
|
290 | 290 | def __call__(self, path, *args, **kwargs): |
|
291 | 291 | return self._orig(self._filter(path), *args, **kwargs) |
|
292 | 292 | |
|
293 | 293 | def canonpath(root, cwd, myname, auditor=None): |
|
294 | 294 | '''return the canonical path of myname, given cwd and root''' |
|
295 | 295 | if util.endswithsep(root): |
|
296 | 296 | rootsep = root |
|
297 | 297 | else: |
|
298 | 298 | rootsep = root + os.sep |
|
299 | 299 | name = myname |
|
300 | 300 | if not os.path.isabs(name): |
|
301 | 301 | name = os.path.join(root, cwd, name) |
|
302 | 302 | name = os.path.normpath(name) |
|
303 | 303 | if auditor is None: |
|
304 | 304 | auditor = pathauditor(root) |
|
305 | 305 | if name != rootsep and name.startswith(rootsep): |
|
306 | 306 | name = name[len(rootsep):] |
|
307 | 307 | auditor(name) |
|
308 | 308 | return util.pconvert(name) |
|
309 | 309 | elif name == root: |
|
310 | 310 | return '' |
|
311 | 311 | else: |
|
312 | 312 | # Determine whether `name' is in the hierarchy at or beneath `root', |
|
313 | 313 | # by iterating name=dirname(name) until that causes no change (can't |
|
314 | 314 | # check name == '/', because that doesn't work on windows). For each |
|
315 | 315 | # `name', compare dev/inode numbers. If they match, the list `rel' |
|
316 | 316 | # holds the reversed list of components making up the relative file |
|
317 | 317 | # name we want. |
|
318 | 318 | root_st = os.stat(root) |
|
319 | 319 | rel = [] |
|
320 | 320 | while True: |
|
321 | 321 | try: |
|
322 | 322 | name_st = os.stat(name) |
|
323 | 323 | except OSError: |
|
324 | 324 | name_st = None |
|
325 | 325 | if name_st and util.samestat(name_st, root_st): |
|
326 | 326 | if not rel: |
|
327 | 327 | # name was actually the same as root (maybe a symlink) |
|
328 | 328 | return '' |
|
329 | 329 | rel.reverse() |
|
330 | 330 | name = os.path.join(*rel) |
|
331 | 331 | auditor(name) |
|
332 | 332 | return util.pconvert(name) |
|
333 | 333 | dirname, basename = os.path.split(name) |
|
334 | 334 | rel.append(basename) |
|
335 | 335 | if dirname == name: |
|
336 | 336 | break |
|
337 | 337 | name = dirname |
|
338 | 338 | |
|
339 | 339 | raise util.Abort('%s not under root' % myname) |
|
340 | 340 | |
|
341 | 341 | def walkrepos(path, followsym=False, seen_dirs=None, recurse=False): |
|
342 | 342 | '''yield every hg repository under path, recursively.''' |
|
343 | 343 | def errhandler(err): |
|
344 | 344 | if err.filename == path: |
|
345 | 345 | raise err |
|
346 | 346 | samestat = getattr(os.path, 'samestat', None) |
|
347 | 347 | if followsym and samestat is not None: |
|
348 | 348 | def adddir(dirlst, dirname): |
|
349 | 349 | match = False |
|
350 | 350 | dirstat = os.stat(dirname) |
|
351 | 351 | for lstdirstat in dirlst: |
|
352 | 352 | if samestat(dirstat, lstdirstat): |
|
353 | 353 | match = True |
|
354 | 354 | break |
|
355 | 355 | if not match: |
|
356 | 356 | dirlst.append(dirstat) |
|
357 | 357 | return not match |
|
358 | 358 | else: |
|
359 | 359 | followsym = False |
|
360 | 360 | |
|
361 | 361 | if (seen_dirs is None) and followsym: |
|
362 | 362 | seen_dirs = [] |
|
363 | 363 | adddir(seen_dirs, path) |
|
364 | 364 | for root, dirs, files in os.walk(path, topdown=True, onerror=errhandler): |
|
365 | 365 | dirs.sort() |
|
366 | 366 | if '.hg' in dirs: |
|
367 | 367 | yield root # found a repository |
|
368 | 368 | qroot = os.path.join(root, '.hg', 'patches') |
|
369 | 369 | if os.path.isdir(os.path.join(qroot, '.hg')): |
|
370 | 370 | yield qroot # we have a patch queue repo here |
|
371 | 371 | if recurse: |
|
372 | 372 | # avoid recursing inside the .hg directory |
|
373 | 373 | dirs.remove('.hg') |
|
374 | 374 | else: |
|
375 | 375 | dirs[:] = [] # don't descend further |
|
376 | 376 | elif followsym: |
|
377 | 377 | newdirs = [] |
|
378 | 378 | for d in dirs: |
|
379 | 379 | fname = os.path.join(root, d) |
|
380 | 380 | if adddir(seen_dirs, fname): |
|
381 | 381 | if os.path.islink(fname): |
|
382 | 382 | for hgname in walkrepos(fname, True, seen_dirs): |
|
383 | 383 | yield hgname |
|
384 | 384 | else: |
|
385 | 385 | newdirs.append(d) |
|
386 | 386 | dirs[:] = newdirs |
|
387 | 387 | |
|
388 | 388 | def osrcpath(): |
|
389 | 389 | '''return default os-specific hgrc search path''' |
|
390 | 390 | path = systemrcpath() |
|
391 | 391 | path.extend(userrcpath()) |
|
392 | 392 | path = [os.path.normpath(f) for f in path] |
|
393 | 393 | return path |
|
394 | 394 | |
|
395 | 395 | _rcpath = None |
|
396 | 396 | |
|
397 | 397 | def rcpath(): |
|
398 | 398 | '''return hgrc search path. if env var HGRCPATH is set, use it. |
|
399 | 399 | for each item in path, if directory, use files ending in .rc, |
|
400 | 400 | else use item. |
|
401 | 401 | make HGRCPATH empty to only look in .hg/hgrc of current repo. |
|
402 | 402 | if no HGRCPATH, use default os-specific path.''' |
|
403 | 403 | global _rcpath |
|
404 | 404 | if _rcpath is None: |
|
405 | 405 | if 'HGRCPATH' in os.environ: |
|
406 | 406 | _rcpath = [] |
|
407 | 407 | for p in os.environ['HGRCPATH'].split(os.pathsep): |
|
408 | 408 | if not p: |
|
409 | 409 | continue |
|
410 | 410 | p = util.expandpath(p) |
|
411 | 411 | if os.path.isdir(p): |
|
412 | 412 | for f, kind in osutil.listdir(p): |
|
413 | 413 | if f.endswith('.rc'): |
|
414 | 414 | _rcpath.append(os.path.join(p, f)) |
|
415 | 415 | else: |
|
416 | 416 | _rcpath.append(p) |
|
417 | 417 | else: |
|
418 | 418 | _rcpath = osrcpath() |
|
419 | 419 | return _rcpath |
|
420 | 420 | |
|
421 | 421 | if os.name != 'nt': |
|
422 | 422 | |
|
423 | 423 | def rcfiles(path): |
|
424 | 424 | rcs = [os.path.join(path, 'hgrc')] |
|
425 | 425 | rcdir = os.path.join(path, 'hgrc.d') |
|
426 | 426 | try: |
|
427 | 427 | rcs.extend([os.path.join(rcdir, f) |
|
428 | 428 | for f, kind in osutil.listdir(rcdir) |
|
429 | 429 | if f.endswith(".rc")]) |
|
430 | 430 | except OSError: |
|
431 | 431 | pass |
|
432 | 432 | return rcs |
|
433 | 433 | |
|
434 | 434 | def systemrcpath(): |
|
435 | 435 | path = [] |
|
436 | 436 | # old mod_python does not set sys.argv |
|
437 | 437 | if len(getattr(sys, 'argv', [])) > 0: |
|
438 | 438 | p = os.path.dirname(os.path.dirname(sys.argv[0])) |
|
439 | 439 | path.extend(rcfiles(os.path.join(p, 'etc/mercurial'))) |
|
440 | 440 | path.extend(rcfiles('/etc/mercurial')) |
|
441 | 441 | return path |
|
442 | 442 | |
|
443 | 443 | def userrcpath(): |
|
444 | 444 | return [os.path.expanduser('~/.hgrc')] |
|
445 | 445 | |
|
446 | 446 | else: |
|
447 | 447 | |
|
448 | 448 | _HKEY_LOCAL_MACHINE = 0x80000002L |
|
449 | 449 | |
|
450 | 450 | def systemrcpath(): |
|
451 | 451 | '''return default os-specific hgrc search path''' |
|
452 | 452 | rcpath = [] |
|
453 | 453 | filename = util.executablepath() |
|
454 | 454 | # Use mercurial.ini found in directory with hg.exe |
|
455 | 455 | progrc = os.path.join(os.path.dirname(filename), 'mercurial.ini') |
|
456 | 456 | if os.path.isfile(progrc): |
|
457 | 457 | rcpath.append(progrc) |
|
458 | 458 | return rcpath |
|
459 | 459 | # Use hgrc.d found in directory with hg.exe |
|
460 | 460 | progrcd = os.path.join(os.path.dirname(filename), 'hgrc.d') |
|
461 | 461 | if os.path.isdir(progrcd): |
|
462 | 462 | for f, kind in osutil.listdir(progrcd): |
|
463 | 463 | if f.endswith('.rc'): |
|
464 | 464 | rcpath.append(os.path.join(progrcd, f)) |
|
465 | 465 | return rcpath |
|
466 | 466 | # else look for a system rcpath in the registry |
|
467 | 467 | value = util.lookupreg('SOFTWARE\\Mercurial', None, |
|
468 | 468 | _HKEY_LOCAL_MACHINE) |
|
469 | 469 | if not isinstance(value, str) or not value: |
|
470 | 470 | return rcpath |
|
471 | 471 | value = util.localpath(value) |
|
472 | 472 | for p in value.split(os.pathsep): |
|
473 | 473 | if p.lower().endswith('mercurial.ini'): |
|
474 | 474 | rcpath.append(p) |
|
475 | 475 | elif os.path.isdir(p): |
|
476 | 476 | for f, kind in osutil.listdir(p): |
|
477 | 477 | if f.endswith('.rc'): |
|
478 | 478 | rcpath.append(os.path.join(p, f)) |
|
479 | 479 | return rcpath |
|
480 | 480 | |
|
481 | 481 | def userrcpath(): |
|
482 | 482 | '''return os-specific hgrc search path to the user dir''' |
|
483 | 483 | home = os.path.expanduser('~') |
|
484 | 484 | path = [os.path.join(home, 'mercurial.ini'), |
|
485 | 485 | os.path.join(home, '.hgrc')] |
|
486 | 486 | userprofile = os.environ.get('USERPROFILE') |
|
487 | 487 | if userprofile: |
|
488 | 488 | path.append(os.path.join(userprofile, 'mercurial.ini')) |
|
489 | 489 | path.append(os.path.join(userprofile, '.hgrc')) |
|
490 | 490 | return path |
|
491 | 491 | |
|
492 | 492 | def revsingle(repo, revspec, default='.'): |
|
493 | 493 | if not revspec: |
|
494 | 494 | return repo[default] |
|
495 | 495 | |
|
496 | 496 | l = revrange(repo, [revspec]) |
|
497 | 497 | if len(l) < 1: |
|
498 | 498 | raise util.Abort(_('empty revision set')) |
|
499 | 499 | return repo[l[-1]] |
|
500 | 500 | |
|
501 | 501 | def revpair(repo, revs): |
|
502 | 502 | if not revs: |
|
503 | 503 | return repo.dirstate.p1(), None |
|
504 | 504 | |
|
505 | 505 | l = revrange(repo, revs) |
|
506 | 506 | |
|
507 | 507 | if len(l) == 0: |
|
508 | 508 | return repo.dirstate.p1(), None |
|
509 | 509 | |
|
510 | 510 | if len(l) == 1: |
|
511 | 511 | return repo.lookup(l[0]), None |
|
512 | 512 | |
|
513 | 513 | return repo.lookup(l[0]), repo.lookup(l[-1]) |
|
514 | 514 | |
|
515 | 515 | _revrangesep = ':' |
|
516 | 516 | |
|
517 | 517 | def revrange(repo, revs): |
|
518 | 518 | """Yield revision as strings from a list of revision specifications.""" |
|
519 | 519 | |
|
520 | 520 | def revfix(repo, val, defval): |
|
521 | 521 | if not val and val != 0 and defval is not None: |
|
522 | 522 | return defval |
|
523 | 523 | return repo.changelog.rev(repo.lookup(val)) |
|
524 | 524 | |
|
525 | 525 | seen, l = set(), [] |
|
526 | 526 | for spec in revs: |
|
527 | 527 | # attempt to parse old-style ranges first to deal with |
|
528 | 528 | # things like old-tag which contain query metacharacters |
|
529 | 529 | try: |
|
530 | 530 | if isinstance(spec, int): |
|
531 | 531 | seen.add(spec) |
|
532 | 532 | l.append(spec) |
|
533 | 533 | continue |
|
534 | 534 | |
|
535 | 535 | if _revrangesep in spec: |
|
536 | 536 | start, end = spec.split(_revrangesep, 1) |
|
537 | 537 | start = revfix(repo, start, 0) |
|
538 | 538 | end = revfix(repo, end, len(repo) - 1) |
|
539 | 539 | step = start > end and -1 or 1 |
|
540 | 540 | for rev in xrange(start, end + step, step): |
|
541 | 541 | if rev in seen: |
|
542 | 542 | continue |
|
543 | 543 | seen.add(rev) |
|
544 | 544 | l.append(rev) |
|
545 | 545 | continue |
|
546 | 546 | elif spec and spec in repo: # single unquoted rev |
|
547 | 547 | rev = revfix(repo, spec, None) |
|
548 | 548 | if rev in seen: |
|
549 | 549 | continue |
|
550 | 550 | seen.add(rev) |
|
551 | 551 | l.append(rev) |
|
552 | 552 | continue |
|
553 | 553 | except error.RepoLookupError: |
|
554 | 554 | pass |
|
555 | 555 | |
|
556 | 556 | # fall through to new-style queries if old-style fails |
|
557 | 557 | m = revset.match(repo.ui, spec) |
|
558 | 558 | for r in m(repo, range(len(repo))): |
|
559 | 559 | if r not in seen: |
|
560 | 560 | l.append(r) |
|
561 | 561 | seen.update(l) |
|
562 | 562 | |
|
563 | 563 | return l |
|
564 | 564 | |
|
565 | 565 | def expandpats(pats): |
|
566 | 566 | if not util.expandglobs: |
|
567 | 567 | return list(pats) |
|
568 | 568 | ret = [] |
|
569 | 569 | for p in pats: |
|
570 | 570 | kind, name = matchmod._patsplit(p, None) |
|
571 | 571 | if kind is None: |
|
572 | 572 | try: |
|
573 | 573 | globbed = glob.glob(name) |
|
574 | 574 | except re.error: |
|
575 | 575 | globbed = [name] |
|
576 | 576 | if globbed: |
|
577 | 577 | ret.extend(globbed) |
|
578 | 578 | continue |
|
579 | 579 | ret.append(p) |
|
580 | 580 | return ret |
|
581 | 581 | |
|
582 | def match(ctx, pats=[], opts={}, globbed=False, default='relpath'): | |
|
582 | def matchandpats(ctx, pats=[], opts={}, globbed=False, default='relpath'): | |
|
583 | 583 | if pats == ("",): |
|
584 | 584 | pats = [] |
|
585 | 585 | if not globbed and default == 'relpath': |
|
586 | 586 | pats = expandpats(pats or []) |
|
587 | 587 | |
|
588 | 588 | m = ctx.match(pats, opts.get('include'), opts.get('exclude'), |
|
589 | 589 | default) |
|
590 | 590 | def badfn(f, msg): |
|
591 | 591 | ctx._repo.ui.warn("%s: %s\n" % (m.rel(f), msg)) |
|
592 | 592 | m.bad = badfn |
|
593 | return m | |
|
593 | return m, pats | |
|
594 | ||
|
595 | def match(ctx, pats=[], opts={}, globbed=False, default='relpath'): | |
|
596 | return matchandpats(ctx, pats, opts, globbed, default)[0] | |
|
594 | 597 | |
|
595 | 598 | def matchall(repo): |
|
596 | 599 | return matchmod.always(repo.root, repo.getcwd()) |
|
597 | 600 | |
|
598 | 601 | def matchfiles(repo, files): |
|
599 | 602 | return matchmod.exact(repo.root, repo.getcwd(), files) |
|
600 | 603 | |
|
601 | 604 | def addremove(repo, pats=[], opts={}, dry_run=None, similarity=None): |
|
602 | 605 | if dry_run is None: |
|
603 | 606 | dry_run = opts.get('dry_run') |
|
604 | 607 | if similarity is None: |
|
605 | 608 | similarity = float(opts.get('similarity') or 0) |
|
606 | 609 | # we'd use status here, except handling of symlinks and ignore is tricky |
|
607 | 610 | added, unknown, deleted, removed = [], [], [], [] |
|
608 | 611 | audit_path = pathauditor(repo.root) |
|
609 | 612 | m = match(repo[None], pats, opts) |
|
610 | 613 | rejected = [] |
|
611 | 614 | m.bad = lambda x, y: rejected.append(x) |
|
612 | 615 | |
|
613 | 616 | for abs in repo.walk(m): |
|
614 | 617 | target = repo.wjoin(abs) |
|
615 | 618 | good = True |
|
616 | 619 | try: |
|
617 | 620 | audit_path(abs) |
|
618 | 621 | except (OSError, util.Abort): |
|
619 | 622 | good = False |
|
620 | 623 | rel = m.rel(abs) |
|
621 | 624 | exact = m.exact(abs) |
|
622 | 625 | if good and abs not in repo.dirstate: |
|
623 | 626 | unknown.append(abs) |
|
624 | 627 | if repo.ui.verbose or not exact: |
|
625 | 628 | repo.ui.status(_('adding %s\n') % ((pats and rel) or abs)) |
|
626 | 629 | elif repo.dirstate[abs] != 'r' and (not good or not os.path.lexists(target) |
|
627 | 630 | or (os.path.isdir(target) and not os.path.islink(target))): |
|
628 | 631 | deleted.append(abs) |
|
629 | 632 | if repo.ui.verbose or not exact: |
|
630 | 633 | repo.ui.status(_('removing %s\n') % ((pats and rel) or abs)) |
|
631 | 634 | # for finding renames |
|
632 | 635 | elif repo.dirstate[abs] == 'r': |
|
633 | 636 | removed.append(abs) |
|
634 | 637 | elif repo.dirstate[abs] == 'a': |
|
635 | 638 | added.append(abs) |
|
636 | 639 | copies = {} |
|
637 | 640 | if similarity > 0: |
|
638 | 641 | for old, new, score in similar.findrenames(repo, |
|
639 | 642 | added + unknown, removed + deleted, similarity): |
|
640 | 643 | if repo.ui.verbose or not m.exact(old) or not m.exact(new): |
|
641 | 644 | repo.ui.status(_('recording removal of %s as rename to %s ' |
|
642 | 645 | '(%d%% similar)\n') % |
|
643 | 646 | (m.rel(old), m.rel(new), score * 100)) |
|
644 | 647 | copies[new] = old |
|
645 | 648 | |
|
646 | 649 | if not dry_run: |
|
647 | 650 | wctx = repo[None] |
|
648 | 651 | wlock = repo.wlock() |
|
649 | 652 | try: |
|
650 | 653 | wctx.forget(deleted) |
|
651 | 654 | wctx.add(unknown) |
|
652 | 655 | for new, old in copies.iteritems(): |
|
653 | 656 | wctx.copy(old, new) |
|
654 | 657 | finally: |
|
655 | 658 | wlock.release() |
|
656 | 659 | |
|
657 | 660 | for f in rejected: |
|
658 | 661 | if f in m.files(): |
|
659 | 662 | return 1 |
|
660 | 663 | return 0 |
|
661 | 664 | |
|
662 | 665 | def updatedir(ui, repo, patches, similarity=0): |
|
663 | 666 | '''Update dirstate after patch application according to metadata''' |
|
664 | 667 | if not patches: |
|
665 | 668 | return [] |
|
666 | 669 | copies = [] |
|
667 | 670 | removes = set() |
|
668 | 671 | cfiles = patches.keys() |
|
669 | 672 | cwd = repo.getcwd() |
|
670 | 673 | if cwd: |
|
671 | 674 | cfiles = [util.pathto(repo.root, cwd, f) for f in patches.keys()] |
|
672 | 675 | for f in patches: |
|
673 | 676 | gp = patches[f] |
|
674 | 677 | if not gp: |
|
675 | 678 | continue |
|
676 | 679 | if gp.op == 'RENAME': |
|
677 | 680 | copies.append((gp.oldpath, gp.path)) |
|
678 | 681 | removes.add(gp.oldpath) |
|
679 | 682 | elif gp.op == 'COPY': |
|
680 | 683 | copies.append((gp.oldpath, gp.path)) |
|
681 | 684 | elif gp.op == 'DELETE': |
|
682 | 685 | removes.add(gp.path) |
|
683 | 686 | |
|
684 | 687 | wctx = repo[None] |
|
685 | 688 | for src, dst in copies: |
|
686 | 689 | dirstatecopy(ui, repo, wctx, src, dst, cwd=cwd) |
|
687 | 690 | if (not similarity) and removes: |
|
688 | 691 | wctx.remove(sorted(removes), True) |
|
689 | 692 | |
|
690 | 693 | for f in patches: |
|
691 | 694 | gp = patches[f] |
|
692 | 695 | if gp and gp.mode: |
|
693 | 696 | islink, isexec = gp.mode |
|
694 | 697 | dst = repo.wjoin(gp.path) |
|
695 | 698 | # patch won't create empty files |
|
696 | 699 | if gp.op == 'ADD' and not os.path.lexists(dst): |
|
697 | 700 | flags = (isexec and 'x' or '') + (islink and 'l' or '') |
|
698 | 701 | repo.wwrite(gp.path, '', flags) |
|
699 | 702 | util.setflags(dst, islink, isexec) |
|
700 | 703 | addremove(repo, cfiles, similarity=similarity) |
|
701 | 704 | files = patches.keys() |
|
702 | 705 | files.extend([r for r in removes if r not in files]) |
|
703 | 706 | return sorted(files) |
|
704 | 707 | |
|
705 | 708 | def dirstatecopy(ui, repo, wctx, src, dst, dryrun=False, cwd=None): |
|
706 | 709 | """Update the dirstate to reflect the intent of copying src to dst. For |
|
707 | 710 | different reasons it might not end with dst being marked as copied from src. |
|
708 | 711 | """ |
|
709 | 712 | origsrc = repo.dirstate.copied(src) or src |
|
710 | 713 | if dst == origsrc: # copying back a copy? |
|
711 | 714 | if repo.dirstate[dst] not in 'mn' and not dryrun: |
|
712 | 715 | repo.dirstate.normallookup(dst) |
|
713 | 716 | else: |
|
714 | 717 | if repo.dirstate[origsrc] == 'a' and origsrc == src: |
|
715 | 718 | if not ui.quiet: |
|
716 | 719 | ui.warn(_("%s has not been committed yet, so no copy " |
|
717 | 720 | "data will be stored for %s.\n") |
|
718 | 721 | % (repo.pathto(origsrc, cwd), repo.pathto(dst, cwd))) |
|
719 | 722 | if repo.dirstate[dst] in '?r' and not dryrun: |
|
720 | 723 | wctx.add([dst]) |
|
721 | 724 | elif not dryrun: |
|
722 | 725 | wctx.copy(origsrc, dst) |
|
723 | 726 | |
|
724 | 727 | def readrequires(opener, supported): |
|
725 | 728 | '''Reads and parses .hg/requires and checks if all entries found |
|
726 | 729 | are in the list of supported features.''' |
|
727 | 730 | requirements = set(opener.read("requires").splitlines()) |
|
728 | 731 | missings = [] |
|
729 | 732 | for r in requirements: |
|
730 | 733 | if r not in supported: |
|
731 | 734 | if not r or not r[0].isalnum(): |
|
732 | 735 | raise error.RequirementError(_(".hg/requires file is corrupt")) |
|
733 | 736 | missings.append(r) |
|
734 | 737 | missings.sort() |
|
735 | 738 | if missings: |
|
736 | 739 | raise error.RequirementError(_("unknown repository format: " |
|
737 | 740 | "requires features '%s' (upgrade Mercurial)") % "', '".join(missings)) |
|
738 | 741 | return requirements |
|
739 | 742 | |
|
740 | 743 | class filecacheentry(object): |
|
741 | 744 | def __init__(self, path): |
|
742 | 745 | self.path = path |
|
743 | 746 | self.cachestat = filecacheentry.stat(self.path) |
|
744 | 747 | |
|
745 | 748 | if self.cachestat: |
|
746 | 749 | self._cacheable = self.cachestat.cacheable() |
|
747 | 750 | else: |
|
748 | 751 | # None means we don't know yet |
|
749 | 752 | self._cacheable = None |
|
750 | 753 | |
|
751 | 754 | def refresh(self): |
|
752 | 755 | if self.cacheable(): |
|
753 | 756 | self.cachestat = filecacheentry.stat(self.path) |
|
754 | 757 | |
|
755 | 758 | def cacheable(self): |
|
756 | 759 | if self._cacheable is not None: |
|
757 | 760 | return self._cacheable |
|
758 | 761 | |
|
759 | 762 | # we don't know yet, assume it is for now |
|
760 | 763 | return True |
|
761 | 764 | |
|
762 | 765 | def changed(self): |
|
763 | 766 | # no point in going further if we can't cache it |
|
764 | 767 | if not self.cacheable(): |
|
765 | 768 | return True |
|
766 | 769 | |
|
767 | 770 | newstat = filecacheentry.stat(self.path) |
|
768 | 771 | |
|
769 | 772 | # we may not know if it's cacheable yet, check again now |
|
770 | 773 | if newstat and self._cacheable is None: |
|
771 | 774 | self._cacheable = newstat.cacheable() |
|
772 | 775 | |
|
773 | 776 | # check again |
|
774 | 777 | if not self._cacheable: |
|
775 | 778 | return True |
|
776 | 779 | |
|
777 | 780 | if self.cachestat != newstat: |
|
778 | 781 | self.cachestat = newstat |
|
779 | 782 | return True |
|
780 | 783 | else: |
|
781 | 784 | return False |
|
782 | 785 | |
|
783 | 786 | @staticmethod |
|
784 | 787 | def stat(path): |
|
785 | 788 | try: |
|
786 | 789 | return util.cachestat(path) |
|
787 | 790 | except OSError, e: |
|
788 | 791 | if e.errno != errno.ENOENT: |
|
789 | 792 | raise |
|
790 | 793 | |
|
791 | 794 | class filecache(object): |
|
792 | 795 | '''A property like decorator that tracks a file under .hg/ for updates. |
|
793 | 796 | |
|
794 | 797 | Records stat info when called in _filecache. |
|
795 | 798 | |
|
796 | 799 | On subsequent calls, compares old stat info with new info, and recreates |
|
797 | 800 | the object when needed, updating the new stat info in _filecache. |
|
798 | 801 | |
|
799 | 802 | Mercurial either atomic renames or appends for files under .hg, |
|
800 | 803 | so to ensure the cache is reliable we need the filesystem to be able |
|
801 | 804 | to tell us if a file has been replaced. If it can't, we fallback to |
|
802 | 805 | recreating the object on every call (essentially the same behaviour as |
|
803 | 806 | propertycache).''' |
|
804 | 807 | def __init__(self, path, instore=False): |
|
805 | 808 | self.path = path |
|
806 | 809 | self.instore = instore |
|
807 | 810 | |
|
808 | 811 | def __call__(self, func): |
|
809 | 812 | self.func = func |
|
810 | 813 | self.name = func.__name__ |
|
811 | 814 | return self |
|
812 | 815 | |
|
813 | 816 | def __get__(self, obj, type=None): |
|
814 | 817 | # do we need to check if the file changed? |
|
815 | 818 | if self.name in obj.__dict__: |
|
816 | 819 | return obj.__dict__[self.name] |
|
817 | 820 | |
|
818 | 821 | entry = obj._filecache.get(self.name) |
|
819 | 822 | |
|
820 | 823 | if entry: |
|
821 | 824 | if entry.changed(): |
|
822 | 825 | entry.obj = self.func(obj) |
|
823 | 826 | else: |
|
824 | 827 | path = self.instore and obj.sjoin(self.path) or obj.join(self.path) |
|
825 | 828 | |
|
826 | 829 | # We stat -before- creating the object so our cache doesn't lie if |
|
827 | 830 | # a writer modified between the time we read and stat |
|
828 | 831 | entry = filecacheentry(path) |
|
829 | 832 | entry.obj = self.func(obj) |
|
830 | 833 | |
|
831 | 834 | obj._filecache[self.name] = entry |
|
832 | 835 | |
|
833 | 836 | obj.__dict__[self.name] = entry.obj |
|
834 | 837 | return entry.obj |
|
835 | 838 | |
|
836 | 839 | def __set__(self, obj, value): |
|
837 | 840 | if self.name in obj._filecache: |
|
838 | 841 | obj._filecache[self.name].obj = value # update cached copy |
|
839 | 842 | obj.__dict__[self.name] = value # update copy returned by obj.x |
|
840 | 843 | |
|
841 | 844 | def __delete__(self, obj): |
|
842 | 845 | try: |
|
843 | 846 | del obj.__dict__[self.name] |
|
844 | 847 | except KeyError: |
|
845 | 848 | raise AttributeError, self.name |
@@ -1,1551 +1,1564 b'' | |||
|
1 | 1 | @ (34) head |
|
2 | 2 | | |
|
3 | 3 | | o (33) head |
|
4 | 4 | | | |
|
5 | 5 | o | (32) expand |
|
6 | 6 | |\ \ |
|
7 | 7 | | o \ (31) expand |
|
8 | 8 | | |\ \ |
|
9 | 9 | | | o \ (30) expand |
|
10 | 10 | | | |\ \ |
|
11 | 11 | | | | o | (29) regular commit |
|
12 | 12 | | | | | | |
|
13 | 13 | | | o | | (28) merge zero known |
|
14 | 14 | | | |\ \ \ |
|
15 | 15 | o | | | | | (27) collapse |
|
16 | 16 | |/ / / / / |
|
17 | 17 | | | o---+ (26) merge one known; far right |
|
18 | 18 | | | | | | |
|
19 | 19 | +---o | | (25) merge one known; far left |
|
20 | 20 | | | | | | |
|
21 | 21 | | | o | | (24) merge one known; immediate right |
|
22 | 22 | | | |\| | |
|
23 | 23 | | | o | | (23) merge one known; immediate left |
|
24 | 24 | | |/| | | |
|
25 | 25 | +---o---+ (22) merge two known; one far left, one far right |
|
26 | 26 | | | / / |
|
27 | 27 | o | | | (21) expand |
|
28 | 28 | |\ \ \ \ |
|
29 | 29 | | o---+-+ (20) merge two known; two far right |
|
30 | 30 | | / / / |
|
31 | 31 | o | | | (19) expand |
|
32 | 32 | |\ \ \ \ |
|
33 | 33 | +---+---o (18) merge two known; two far left |
|
34 | 34 | | | | | |
|
35 | 35 | | o | | (17) expand |
|
36 | 36 | | |\ \ \ |
|
37 | 37 | | | o---+ (16) merge two known; one immediate right, one near right |
|
38 | 38 | | | |/ / |
|
39 | 39 | o | | | (15) expand |
|
40 | 40 | |\ \ \ \ |
|
41 | 41 | | o-----+ (14) merge two known; one immediate right, one far right |
|
42 | 42 | | |/ / / |
|
43 | 43 | o | | | (13) expand |
|
44 | 44 | |\ \ \ \ |
|
45 | 45 | +---o | | (12) merge two known; one immediate right, one far left |
|
46 | 46 | | | |/ / |
|
47 | 47 | | o | | (11) expand |
|
48 | 48 | | |\ \ \ |
|
49 | 49 | | | o---+ (10) merge two known; one immediate left, one near right |
|
50 | 50 | | |/ / / |
|
51 | 51 | o | | | (9) expand |
|
52 | 52 | |\ \ \ \ |
|
53 | 53 | | o-----+ (8) merge two known; one immediate left, one far right |
|
54 | 54 | |/ / / / |
|
55 | 55 | o | | | (7) expand |
|
56 | 56 | |\ \ \ \ |
|
57 | 57 | +---o | | (6) merge two known; one immediate left, one far left |
|
58 | 58 | | |/ / / |
|
59 | 59 | | o | | (5) expand |
|
60 | 60 | | |\ \ \ |
|
61 | 61 | | | o | | (4) merge two known; one immediate left, one immediate right |
|
62 | 62 | | |/|/ / |
|
63 | 63 | | o / / (3) collapse |
|
64 | 64 | |/ / / |
|
65 | 65 | o / / (2) collapse |
|
66 | 66 | |/ / |
|
67 | 67 | o / (1) collapse |
|
68 | 68 | |/ |
|
69 | 69 | o (0) root |
|
70 | 70 | |
|
71 | 71 | |
|
72 | 72 | $ "$TESTDIR/hghave" no-outer-repo || exit 80 |
|
73 | 73 | |
|
74 | 74 | $ commit() |
|
75 | 75 | > { |
|
76 | 76 | > rev=$1 |
|
77 | 77 | > msg=$2 |
|
78 | 78 | > shift 2 |
|
79 | 79 | > if [ "$#" -gt 0 ]; then |
|
80 | 80 | > hg debugsetparents "$@" |
|
81 | 81 | > fi |
|
82 | 82 | > echo $rev > a |
|
83 | 83 | > hg commit -Aqd "$rev 0" -m "($rev) $msg" |
|
84 | 84 | > } |
|
85 | 85 | |
|
86 | 86 | $ cat > printrevset.py <<EOF |
|
87 | 87 | > from mercurial import extensions, revset, commands |
|
88 | 88 | > from hgext import graphlog |
|
89 | 89 | > |
|
90 | 90 | > def uisetup(ui): |
|
91 | 91 | > def printrevset(orig, ui, repo, *pats, **opts): |
|
92 | 92 | > if opts.get('print_revset'): |
|
93 | 93 | > expr = graphlog.revset(repo, pats, opts) |
|
94 | 94 | > tree = revset.parse(expr)[0] |
|
95 | 95 | > ui.write(tree, "\n") |
|
96 | 96 | > return 0 |
|
97 | 97 | > return orig(ui, repo, *pats, **opts) |
|
98 | 98 | > entry = extensions.wrapcommand(commands.table, 'log', printrevset) |
|
99 | 99 | > entry[1].append(('', 'print-revset', False, |
|
100 | 100 | > 'print generated revset and exit (DEPRECATED)')) |
|
101 | 101 | > EOF |
|
102 | 102 | |
|
103 | 103 | $ echo "[extensions]" >> $HGRCPATH |
|
104 | 104 | $ echo "graphlog=" >> $HGRCPATH |
|
105 | 105 | $ echo "printrevset=`pwd`/printrevset.py" >> $HGRCPATH |
|
106 | 106 | |
|
107 | 107 | $ hg init repo |
|
108 | 108 | $ cd repo |
|
109 | 109 | |
|
110 | 110 | Empty repo: |
|
111 | 111 | |
|
112 | 112 | $ hg glog |
|
113 | 113 | |
|
114 | 114 | |
|
115 | 115 | Building DAG: |
|
116 | 116 | |
|
117 | 117 | $ commit 0 "root" |
|
118 | 118 | $ commit 1 "collapse" 0 |
|
119 | 119 | $ commit 2 "collapse" 1 |
|
120 | 120 | $ commit 3 "collapse" 2 |
|
121 | 121 | $ commit 4 "merge two known; one immediate left, one immediate right" 1 3 |
|
122 | 122 | $ commit 5 "expand" 3 4 |
|
123 | 123 | $ commit 6 "merge two known; one immediate left, one far left" 2 5 |
|
124 | 124 | $ commit 7 "expand" 2 5 |
|
125 | 125 | $ commit 8 "merge two known; one immediate left, one far right" 0 7 |
|
126 | 126 | $ commit 9 "expand" 7 8 |
|
127 | 127 | $ commit 10 "merge two known; one immediate left, one near right" 0 6 |
|
128 | 128 | $ commit 11 "expand" 6 10 |
|
129 | 129 | $ commit 12 "merge two known; one immediate right, one far left" 1 9 |
|
130 | 130 | $ commit 13 "expand" 9 11 |
|
131 | 131 | $ commit 14 "merge two known; one immediate right, one far right" 0 12 |
|
132 | 132 | $ commit 15 "expand" 13 14 |
|
133 | 133 | $ commit 16 "merge two known; one immediate right, one near right" 0 1 |
|
134 | 134 | $ commit 17 "expand" 12 16 |
|
135 | 135 | $ commit 18 "merge two known; two far left" 1 15 |
|
136 | 136 | $ commit 19 "expand" 15 17 |
|
137 | 137 | $ commit 20 "merge two known; two far right" 0 18 |
|
138 | 138 | $ commit 21 "expand" 19 20 |
|
139 | 139 | $ commit 22 "merge two known; one far left, one far right" 18 21 |
|
140 | 140 | $ commit 23 "merge one known; immediate left" 1 22 |
|
141 | 141 | $ commit 24 "merge one known; immediate right" 0 23 |
|
142 | 142 | $ commit 25 "merge one known; far left" 21 24 |
|
143 | 143 | $ commit 26 "merge one known; far right" 18 25 |
|
144 | 144 | $ commit 27 "collapse" 21 |
|
145 | 145 | $ commit 28 "merge zero known" 1 26 |
|
146 | 146 | $ commit 29 "regular commit" 0 |
|
147 | 147 | $ commit 30 "expand" 28 29 |
|
148 | 148 | $ commit 31 "expand" 21 30 |
|
149 | 149 | $ commit 32 "expand" 27 31 |
|
150 | 150 | $ commit 33 "head" 18 |
|
151 | 151 | $ commit 34 "head" 32 |
|
152 | 152 | |
|
153 | 153 | |
|
154 | 154 | $ hg glog -q |
|
155 | 155 | @ 34:fea3ac5810e0 |
|
156 | 156 | | |
|
157 | 157 | | o 33:68608f5145f9 |
|
158 | 158 | | | |
|
159 | 159 | o | 32:d06dffa21a31 |
|
160 | 160 | |\ \ |
|
161 | 161 | | o \ 31:621d83e11f67 |
|
162 | 162 | | |\ \ |
|
163 | 163 | | | o \ 30:6e11cd4b648f |
|
164 | 164 | | | |\ \ |
|
165 | 165 | | | | o | 29:cd9bb2be7593 |
|
166 | 166 | | | | | | |
|
167 | 167 | | | o | | 28:44ecd0b9ae99 |
|
168 | 168 | | | |\ \ \ |
|
169 | 169 | o | | | | | 27:886ed638191b |
|
170 | 170 | |/ / / / / |
|
171 | 171 | | | o---+ 26:7f25b6c2f0b9 |
|
172 | 172 | | | | | | |
|
173 | 173 | +---o | | 25:91da8ed57247 |
|
174 | 174 | | | | | | |
|
175 | 175 | | | o | | 24:a9c19a3d96b7 |
|
176 | 176 | | | |\| | |
|
177 | 177 | | | o | | 23:a01cddf0766d |
|
178 | 178 | | |/| | | |
|
179 | 179 | +---o---+ 22:e0d9cccacb5d |
|
180 | 180 | | | / / |
|
181 | 181 | o | | | 21:d42a756af44d |
|
182 | 182 | |\ \ \ \ |
|
183 | 183 | | o---+-+ 20:d30ed6450e32 |
|
184 | 184 | | / / / |
|
185 | 185 | o | | | 19:31ddc2c1573b |
|
186 | 186 | |\ \ \ \ |
|
187 | 187 | +---+---o 18:1aa84d96232a |
|
188 | 188 | | | | | |
|
189 | 189 | | o | | 17:44765d7c06e0 |
|
190 | 190 | | |\ \ \ |
|
191 | 191 | | | o---+ 16:3677d192927d |
|
192 | 192 | | | |/ / |
|
193 | 193 | o | | | 15:1dda3f72782d |
|
194 | 194 | |\ \ \ \ |
|
195 | 195 | | o-----+ 14:8eac370358ef |
|
196 | 196 | | |/ / / |
|
197 | 197 | o | | | 13:22d8966a97e3 |
|
198 | 198 | |\ \ \ \ |
|
199 | 199 | +---o | | 12:86b91144a6e9 |
|
200 | 200 | | | |/ / |
|
201 | 201 | | o | | 11:832d76e6bdf2 |
|
202 | 202 | | |\ \ \ |
|
203 | 203 | | | o---+ 10:74c64d036d72 |
|
204 | 204 | | |/ / / |
|
205 | 205 | o | | | 9:7010c0af0a35 |
|
206 | 206 | |\ \ \ \ |
|
207 | 207 | | o-----+ 8:7a0b11f71937 |
|
208 | 208 | |/ / / / |
|
209 | 209 | o | | | 7:b632bb1b1224 |
|
210 | 210 | |\ \ \ \ |
|
211 | 211 | +---o | | 6:b105a072e251 |
|
212 | 212 | | |/ / / |
|
213 | 213 | | o | | 5:4409d547b708 |
|
214 | 214 | | |\ \ \ |
|
215 | 215 | | | o | | 4:26a8bac39d9f |
|
216 | 216 | | |/|/ / |
|
217 | 217 | | o / / 3:27eef8ed80b4 |
|
218 | 218 | |/ / / |
|
219 | 219 | o / / 2:3d9a33b8d1e1 |
|
220 | 220 | |/ / |
|
221 | 221 | o / 1:6db2ef61d156 |
|
222 | 222 | |/ |
|
223 | 223 | o 0:e6eb3150255d |
|
224 | 224 | |
|
225 | 225 | |
|
226 | 226 | $ hg glog |
|
227 | 227 | @ changeset: 34:fea3ac5810e0 |
|
228 | 228 | | tag: tip |
|
229 | 229 | | parent: 32:d06dffa21a31 |
|
230 | 230 | | user: test |
|
231 | 231 | | date: Thu Jan 01 00:00:34 1970 +0000 |
|
232 | 232 | | summary: (34) head |
|
233 | 233 | | |
|
234 | 234 | | o changeset: 33:68608f5145f9 |
|
235 | 235 | | | parent: 18:1aa84d96232a |
|
236 | 236 | | | user: test |
|
237 | 237 | | | date: Thu Jan 01 00:00:33 1970 +0000 |
|
238 | 238 | | | summary: (33) head |
|
239 | 239 | | | |
|
240 | 240 | o | changeset: 32:d06dffa21a31 |
|
241 | 241 | |\ \ parent: 27:886ed638191b |
|
242 | 242 | | | | parent: 31:621d83e11f67 |
|
243 | 243 | | | | user: test |
|
244 | 244 | | | | date: Thu Jan 01 00:00:32 1970 +0000 |
|
245 | 245 | | | | summary: (32) expand |
|
246 | 246 | | | | |
|
247 | 247 | | o | changeset: 31:621d83e11f67 |
|
248 | 248 | | |\ \ parent: 21:d42a756af44d |
|
249 | 249 | | | | | parent: 30:6e11cd4b648f |
|
250 | 250 | | | | | user: test |
|
251 | 251 | | | | | date: Thu Jan 01 00:00:31 1970 +0000 |
|
252 | 252 | | | | | summary: (31) expand |
|
253 | 253 | | | | | |
|
254 | 254 | | | o | changeset: 30:6e11cd4b648f |
|
255 | 255 | | | |\ \ parent: 28:44ecd0b9ae99 |
|
256 | 256 | | | | | | parent: 29:cd9bb2be7593 |
|
257 | 257 | | | | | | user: test |
|
258 | 258 | | | | | | date: Thu Jan 01 00:00:30 1970 +0000 |
|
259 | 259 | | | | | | summary: (30) expand |
|
260 | 260 | | | | | | |
|
261 | 261 | | | | o | changeset: 29:cd9bb2be7593 |
|
262 | 262 | | | | | | parent: 0:e6eb3150255d |
|
263 | 263 | | | | | | user: test |
|
264 | 264 | | | | | | date: Thu Jan 01 00:00:29 1970 +0000 |
|
265 | 265 | | | | | | summary: (29) regular commit |
|
266 | 266 | | | | | | |
|
267 | 267 | | | o | | changeset: 28:44ecd0b9ae99 |
|
268 | 268 | | | |\ \ \ parent: 1:6db2ef61d156 |
|
269 | 269 | | | | | | | parent: 26:7f25b6c2f0b9 |
|
270 | 270 | | | | | | | user: test |
|
271 | 271 | | | | | | | date: Thu Jan 01 00:00:28 1970 +0000 |
|
272 | 272 | | | | | | | summary: (28) merge zero known |
|
273 | 273 | | | | | | | |
|
274 | 274 | o | | | | | changeset: 27:886ed638191b |
|
275 | 275 | |/ / / / / parent: 21:d42a756af44d |
|
276 | 276 | | | | | | user: test |
|
277 | 277 | | | | | | date: Thu Jan 01 00:00:27 1970 +0000 |
|
278 | 278 | | | | | | summary: (27) collapse |
|
279 | 279 | | | | | | |
|
280 | 280 | | | o---+ changeset: 26:7f25b6c2f0b9 |
|
281 | 281 | | | | | | parent: 18:1aa84d96232a |
|
282 | 282 | | | | | | parent: 25:91da8ed57247 |
|
283 | 283 | | | | | | user: test |
|
284 | 284 | | | | | | date: Thu Jan 01 00:00:26 1970 +0000 |
|
285 | 285 | | | | | | summary: (26) merge one known; far right |
|
286 | 286 | | | | | | |
|
287 | 287 | +---o | | changeset: 25:91da8ed57247 |
|
288 | 288 | | | | | | parent: 21:d42a756af44d |
|
289 | 289 | | | | | | parent: 24:a9c19a3d96b7 |
|
290 | 290 | | | | | | user: test |
|
291 | 291 | | | | | | date: Thu Jan 01 00:00:25 1970 +0000 |
|
292 | 292 | | | | | | summary: (25) merge one known; far left |
|
293 | 293 | | | | | | |
|
294 | 294 | | | o | | changeset: 24:a9c19a3d96b7 |
|
295 | 295 | | | |\| | parent: 0:e6eb3150255d |
|
296 | 296 | | | | | | parent: 23:a01cddf0766d |
|
297 | 297 | | | | | | user: test |
|
298 | 298 | | | | | | date: Thu Jan 01 00:00:24 1970 +0000 |
|
299 | 299 | | | | | | summary: (24) merge one known; immediate right |
|
300 | 300 | | | | | | |
|
301 | 301 | | | o | | changeset: 23:a01cddf0766d |
|
302 | 302 | | |/| | | parent: 1:6db2ef61d156 |
|
303 | 303 | | | | | | parent: 22:e0d9cccacb5d |
|
304 | 304 | | | | | | user: test |
|
305 | 305 | | | | | | date: Thu Jan 01 00:00:23 1970 +0000 |
|
306 | 306 | | | | | | summary: (23) merge one known; immediate left |
|
307 | 307 | | | | | | |
|
308 | 308 | +---o---+ changeset: 22:e0d9cccacb5d |
|
309 | 309 | | | | | parent: 18:1aa84d96232a |
|
310 | 310 | | | / / parent: 21:d42a756af44d |
|
311 | 311 | | | | | user: test |
|
312 | 312 | | | | | date: Thu Jan 01 00:00:22 1970 +0000 |
|
313 | 313 | | | | | summary: (22) merge two known; one far left, one far right |
|
314 | 314 | | | | | |
|
315 | 315 | o | | | changeset: 21:d42a756af44d |
|
316 | 316 | |\ \ \ \ parent: 19:31ddc2c1573b |
|
317 | 317 | | | | | | parent: 20:d30ed6450e32 |
|
318 | 318 | | | | | | user: test |
|
319 | 319 | | | | | | date: Thu Jan 01 00:00:21 1970 +0000 |
|
320 | 320 | | | | | | summary: (21) expand |
|
321 | 321 | | | | | | |
|
322 | 322 | | o---+-+ changeset: 20:d30ed6450e32 |
|
323 | 323 | | | | | parent: 0:e6eb3150255d |
|
324 | 324 | | / / / parent: 18:1aa84d96232a |
|
325 | 325 | | | | | user: test |
|
326 | 326 | | | | | date: Thu Jan 01 00:00:20 1970 +0000 |
|
327 | 327 | | | | | summary: (20) merge two known; two far right |
|
328 | 328 | | | | | |
|
329 | 329 | o | | | changeset: 19:31ddc2c1573b |
|
330 | 330 | |\ \ \ \ parent: 15:1dda3f72782d |
|
331 | 331 | | | | | | parent: 17:44765d7c06e0 |
|
332 | 332 | | | | | | user: test |
|
333 | 333 | | | | | | date: Thu Jan 01 00:00:19 1970 +0000 |
|
334 | 334 | | | | | | summary: (19) expand |
|
335 | 335 | | | | | | |
|
336 | 336 | +---+---o changeset: 18:1aa84d96232a |
|
337 | 337 | | | | | parent: 1:6db2ef61d156 |
|
338 | 338 | | | | | parent: 15:1dda3f72782d |
|
339 | 339 | | | | | user: test |
|
340 | 340 | | | | | date: Thu Jan 01 00:00:18 1970 +0000 |
|
341 | 341 | | | | | summary: (18) merge two known; two far left |
|
342 | 342 | | | | | |
|
343 | 343 | | o | | changeset: 17:44765d7c06e0 |
|
344 | 344 | | |\ \ \ parent: 12:86b91144a6e9 |
|
345 | 345 | | | | | | parent: 16:3677d192927d |
|
346 | 346 | | | | | | user: test |
|
347 | 347 | | | | | | date: Thu Jan 01 00:00:17 1970 +0000 |
|
348 | 348 | | | | | | summary: (17) expand |
|
349 | 349 | | | | | | |
|
350 | 350 | | | o---+ changeset: 16:3677d192927d |
|
351 | 351 | | | | | | parent: 0:e6eb3150255d |
|
352 | 352 | | | |/ / parent: 1:6db2ef61d156 |
|
353 | 353 | | | | | user: test |
|
354 | 354 | | | | | date: Thu Jan 01 00:00:16 1970 +0000 |
|
355 | 355 | | | | | summary: (16) merge two known; one immediate right, one near right |
|
356 | 356 | | | | | |
|
357 | 357 | o | | | changeset: 15:1dda3f72782d |
|
358 | 358 | |\ \ \ \ parent: 13:22d8966a97e3 |
|
359 | 359 | | | | | | parent: 14:8eac370358ef |
|
360 | 360 | | | | | | user: test |
|
361 | 361 | | | | | | date: Thu Jan 01 00:00:15 1970 +0000 |
|
362 | 362 | | | | | | summary: (15) expand |
|
363 | 363 | | | | | | |
|
364 | 364 | | o-----+ changeset: 14:8eac370358ef |
|
365 | 365 | | | | | | parent: 0:e6eb3150255d |
|
366 | 366 | | |/ / / parent: 12:86b91144a6e9 |
|
367 | 367 | | | | | user: test |
|
368 | 368 | | | | | date: Thu Jan 01 00:00:14 1970 +0000 |
|
369 | 369 | | | | | summary: (14) merge two known; one immediate right, one far right |
|
370 | 370 | | | | | |
|
371 | 371 | o | | | changeset: 13:22d8966a97e3 |
|
372 | 372 | |\ \ \ \ parent: 9:7010c0af0a35 |
|
373 | 373 | | | | | | parent: 11:832d76e6bdf2 |
|
374 | 374 | | | | | | user: test |
|
375 | 375 | | | | | | date: Thu Jan 01 00:00:13 1970 +0000 |
|
376 | 376 | | | | | | summary: (13) expand |
|
377 | 377 | | | | | | |
|
378 | 378 | +---o | | changeset: 12:86b91144a6e9 |
|
379 | 379 | | | |/ / parent: 1:6db2ef61d156 |
|
380 | 380 | | | | | parent: 9:7010c0af0a35 |
|
381 | 381 | | | | | user: test |
|
382 | 382 | | | | | date: Thu Jan 01 00:00:12 1970 +0000 |
|
383 | 383 | | | | | summary: (12) merge two known; one immediate right, one far left |
|
384 | 384 | | | | | |
|
385 | 385 | | o | | changeset: 11:832d76e6bdf2 |
|
386 | 386 | | |\ \ \ parent: 6:b105a072e251 |
|
387 | 387 | | | | | | parent: 10:74c64d036d72 |
|
388 | 388 | | | | | | user: test |
|
389 | 389 | | | | | | date: Thu Jan 01 00:00:11 1970 +0000 |
|
390 | 390 | | | | | | summary: (11) expand |
|
391 | 391 | | | | | | |
|
392 | 392 | | | o---+ changeset: 10:74c64d036d72 |
|
393 | 393 | | | | | | parent: 0:e6eb3150255d |
|
394 | 394 | | |/ / / parent: 6:b105a072e251 |
|
395 | 395 | | | | | user: test |
|
396 | 396 | | | | | date: Thu Jan 01 00:00:10 1970 +0000 |
|
397 | 397 | | | | | summary: (10) merge two known; one immediate left, one near right |
|
398 | 398 | | | | | |
|
399 | 399 | o | | | changeset: 9:7010c0af0a35 |
|
400 | 400 | |\ \ \ \ parent: 7:b632bb1b1224 |
|
401 | 401 | | | | | | parent: 8:7a0b11f71937 |
|
402 | 402 | | | | | | user: test |
|
403 | 403 | | | | | | date: Thu Jan 01 00:00:09 1970 +0000 |
|
404 | 404 | | | | | | summary: (9) expand |
|
405 | 405 | | | | | | |
|
406 | 406 | | o-----+ changeset: 8:7a0b11f71937 |
|
407 | 407 | | | | | | parent: 0:e6eb3150255d |
|
408 | 408 | |/ / / / parent: 7:b632bb1b1224 |
|
409 | 409 | | | | | user: test |
|
410 | 410 | | | | | date: Thu Jan 01 00:00:08 1970 +0000 |
|
411 | 411 | | | | | summary: (8) merge two known; one immediate left, one far right |
|
412 | 412 | | | | | |
|
413 | 413 | o | | | changeset: 7:b632bb1b1224 |
|
414 | 414 | |\ \ \ \ parent: 2:3d9a33b8d1e1 |
|
415 | 415 | | | | | | parent: 5:4409d547b708 |
|
416 | 416 | | | | | | user: test |
|
417 | 417 | | | | | | date: Thu Jan 01 00:00:07 1970 +0000 |
|
418 | 418 | | | | | | summary: (7) expand |
|
419 | 419 | | | | | | |
|
420 | 420 | +---o | | changeset: 6:b105a072e251 |
|
421 | 421 | | |/ / / parent: 2:3d9a33b8d1e1 |
|
422 | 422 | | | | | parent: 5:4409d547b708 |
|
423 | 423 | | | | | user: test |
|
424 | 424 | | | | | date: Thu Jan 01 00:00:06 1970 +0000 |
|
425 | 425 | | | | | summary: (6) merge two known; one immediate left, one far left |
|
426 | 426 | | | | | |
|
427 | 427 | | o | | changeset: 5:4409d547b708 |
|
428 | 428 | | |\ \ \ parent: 3:27eef8ed80b4 |
|
429 | 429 | | | | | | parent: 4:26a8bac39d9f |
|
430 | 430 | | | | | | user: test |
|
431 | 431 | | | | | | date: Thu Jan 01 00:00:05 1970 +0000 |
|
432 | 432 | | | | | | summary: (5) expand |
|
433 | 433 | | | | | | |
|
434 | 434 | | | o | | changeset: 4:26a8bac39d9f |
|
435 | 435 | | |/|/ / parent: 1:6db2ef61d156 |
|
436 | 436 | | | | | parent: 3:27eef8ed80b4 |
|
437 | 437 | | | | | user: test |
|
438 | 438 | | | | | date: Thu Jan 01 00:00:04 1970 +0000 |
|
439 | 439 | | | | | summary: (4) merge two known; one immediate left, one immediate right |
|
440 | 440 | | | | | |
|
441 | 441 | | o | | changeset: 3:27eef8ed80b4 |
|
442 | 442 | |/ / / user: test |
|
443 | 443 | | | | date: Thu Jan 01 00:00:03 1970 +0000 |
|
444 | 444 | | | | summary: (3) collapse |
|
445 | 445 | | | | |
|
446 | 446 | o | | changeset: 2:3d9a33b8d1e1 |
|
447 | 447 | |/ / user: test |
|
448 | 448 | | | date: Thu Jan 01 00:00:02 1970 +0000 |
|
449 | 449 | | | summary: (2) collapse |
|
450 | 450 | | | |
|
451 | 451 | o | changeset: 1:6db2ef61d156 |
|
452 | 452 | |/ user: test |
|
453 | 453 | | date: Thu Jan 01 00:00:01 1970 +0000 |
|
454 | 454 | | summary: (1) collapse |
|
455 | 455 | | |
|
456 | 456 | o changeset: 0:e6eb3150255d |
|
457 | 457 | user: test |
|
458 | 458 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
459 | 459 | summary: (0) root |
|
460 | 460 | |
|
461 | 461 | |
|
462 | 462 | File glog: |
|
463 | 463 | $ hg glog a |
|
464 | 464 | @ changeset: 34:fea3ac5810e0 |
|
465 | 465 | | tag: tip |
|
466 | 466 | | parent: 32:d06dffa21a31 |
|
467 | 467 | | user: test |
|
468 | 468 | | date: Thu Jan 01 00:00:34 1970 +0000 |
|
469 | 469 | | summary: (34) head |
|
470 | 470 | | |
|
471 | 471 | | o changeset: 33:68608f5145f9 |
|
472 | 472 | | | parent: 18:1aa84d96232a |
|
473 | 473 | | | user: test |
|
474 | 474 | | | date: Thu Jan 01 00:00:33 1970 +0000 |
|
475 | 475 | | | summary: (33) head |
|
476 | 476 | | | |
|
477 | 477 | o | changeset: 32:d06dffa21a31 |
|
478 | 478 | |\ \ parent: 27:886ed638191b |
|
479 | 479 | | | | parent: 31:621d83e11f67 |
|
480 | 480 | | | | user: test |
|
481 | 481 | | | | date: Thu Jan 01 00:00:32 1970 +0000 |
|
482 | 482 | | | | summary: (32) expand |
|
483 | 483 | | | | |
|
484 | 484 | | o | changeset: 31:621d83e11f67 |
|
485 | 485 | | |\ \ parent: 21:d42a756af44d |
|
486 | 486 | | | | | parent: 30:6e11cd4b648f |
|
487 | 487 | | | | | user: test |
|
488 | 488 | | | | | date: Thu Jan 01 00:00:31 1970 +0000 |
|
489 | 489 | | | | | summary: (31) expand |
|
490 | 490 | | | | | |
|
491 | 491 | | | o | changeset: 30:6e11cd4b648f |
|
492 | 492 | | | |\ \ parent: 28:44ecd0b9ae99 |
|
493 | 493 | | | | | | parent: 29:cd9bb2be7593 |
|
494 | 494 | | | | | | user: test |
|
495 | 495 | | | | | | date: Thu Jan 01 00:00:30 1970 +0000 |
|
496 | 496 | | | | | | summary: (30) expand |
|
497 | 497 | | | | | | |
|
498 | 498 | | | | o | changeset: 29:cd9bb2be7593 |
|
499 | 499 | | | | | | parent: 0:e6eb3150255d |
|
500 | 500 | | | | | | user: test |
|
501 | 501 | | | | | | date: Thu Jan 01 00:00:29 1970 +0000 |
|
502 | 502 | | | | | | summary: (29) regular commit |
|
503 | 503 | | | | | | |
|
504 | 504 | | | o | | changeset: 28:44ecd0b9ae99 |
|
505 | 505 | | | |\ \ \ parent: 1:6db2ef61d156 |
|
506 | 506 | | | | | | | parent: 26:7f25b6c2f0b9 |
|
507 | 507 | | | | | | | user: test |
|
508 | 508 | | | | | | | date: Thu Jan 01 00:00:28 1970 +0000 |
|
509 | 509 | | | | | | | summary: (28) merge zero known |
|
510 | 510 | | | | | | | |
|
511 | 511 | o | | | | | changeset: 27:886ed638191b |
|
512 | 512 | |/ / / / / parent: 21:d42a756af44d |
|
513 | 513 | | | | | | user: test |
|
514 | 514 | | | | | | date: Thu Jan 01 00:00:27 1970 +0000 |
|
515 | 515 | | | | | | summary: (27) collapse |
|
516 | 516 | | | | | | |
|
517 | 517 | | | o---+ changeset: 26:7f25b6c2f0b9 |
|
518 | 518 | | | | | | parent: 18:1aa84d96232a |
|
519 | 519 | | | | | | parent: 25:91da8ed57247 |
|
520 | 520 | | | | | | user: test |
|
521 | 521 | | | | | | date: Thu Jan 01 00:00:26 1970 +0000 |
|
522 | 522 | | | | | | summary: (26) merge one known; far right |
|
523 | 523 | | | | | | |
|
524 | 524 | +---o | | changeset: 25:91da8ed57247 |
|
525 | 525 | | | | | | parent: 21:d42a756af44d |
|
526 | 526 | | | | | | parent: 24:a9c19a3d96b7 |
|
527 | 527 | | | | | | user: test |
|
528 | 528 | | | | | | date: Thu Jan 01 00:00:25 1970 +0000 |
|
529 | 529 | | | | | | summary: (25) merge one known; far left |
|
530 | 530 | | | | | | |
|
531 | 531 | | | o | | changeset: 24:a9c19a3d96b7 |
|
532 | 532 | | | |\| | parent: 0:e6eb3150255d |
|
533 | 533 | | | | | | parent: 23:a01cddf0766d |
|
534 | 534 | | | | | | user: test |
|
535 | 535 | | | | | | date: Thu Jan 01 00:00:24 1970 +0000 |
|
536 | 536 | | | | | | summary: (24) merge one known; immediate right |
|
537 | 537 | | | | | | |
|
538 | 538 | | | o | | changeset: 23:a01cddf0766d |
|
539 | 539 | | |/| | | parent: 1:6db2ef61d156 |
|
540 | 540 | | | | | | parent: 22:e0d9cccacb5d |
|
541 | 541 | | | | | | user: test |
|
542 | 542 | | | | | | date: Thu Jan 01 00:00:23 1970 +0000 |
|
543 | 543 | | | | | | summary: (23) merge one known; immediate left |
|
544 | 544 | | | | | | |
|
545 | 545 | +---o---+ changeset: 22:e0d9cccacb5d |
|
546 | 546 | | | | | parent: 18:1aa84d96232a |
|
547 | 547 | | | / / parent: 21:d42a756af44d |
|
548 | 548 | | | | | user: test |
|
549 | 549 | | | | | date: Thu Jan 01 00:00:22 1970 +0000 |
|
550 | 550 | | | | | summary: (22) merge two known; one far left, one far right |
|
551 | 551 | | | | | |
|
552 | 552 | o | | | changeset: 21:d42a756af44d |
|
553 | 553 | |\ \ \ \ parent: 19:31ddc2c1573b |
|
554 | 554 | | | | | | parent: 20:d30ed6450e32 |
|
555 | 555 | | | | | | user: test |
|
556 | 556 | | | | | | date: Thu Jan 01 00:00:21 1970 +0000 |
|
557 | 557 | | | | | | summary: (21) expand |
|
558 | 558 | | | | | | |
|
559 | 559 | | o---+-+ changeset: 20:d30ed6450e32 |
|
560 | 560 | | | | | parent: 0:e6eb3150255d |
|
561 | 561 | | / / / parent: 18:1aa84d96232a |
|
562 | 562 | | | | | user: test |
|
563 | 563 | | | | | date: Thu Jan 01 00:00:20 1970 +0000 |
|
564 | 564 | | | | | summary: (20) merge two known; two far right |
|
565 | 565 | | | | | |
|
566 | 566 | o | | | changeset: 19:31ddc2c1573b |
|
567 | 567 | |\ \ \ \ parent: 15:1dda3f72782d |
|
568 | 568 | | | | | | parent: 17:44765d7c06e0 |
|
569 | 569 | | | | | | user: test |
|
570 | 570 | | | | | | date: Thu Jan 01 00:00:19 1970 +0000 |
|
571 | 571 | | | | | | summary: (19) expand |
|
572 | 572 | | | | | | |
|
573 | 573 | +---+---o changeset: 18:1aa84d96232a |
|
574 | 574 | | | | | parent: 1:6db2ef61d156 |
|
575 | 575 | | | | | parent: 15:1dda3f72782d |
|
576 | 576 | | | | | user: test |
|
577 | 577 | | | | | date: Thu Jan 01 00:00:18 1970 +0000 |
|
578 | 578 | | | | | summary: (18) merge two known; two far left |
|
579 | 579 | | | | | |
|
580 | 580 | | o | | changeset: 17:44765d7c06e0 |
|
581 | 581 | | |\ \ \ parent: 12:86b91144a6e9 |
|
582 | 582 | | | | | | parent: 16:3677d192927d |
|
583 | 583 | | | | | | user: test |
|
584 | 584 | | | | | | date: Thu Jan 01 00:00:17 1970 +0000 |
|
585 | 585 | | | | | | summary: (17) expand |
|
586 | 586 | | | | | | |
|
587 | 587 | | | o---+ changeset: 16:3677d192927d |
|
588 | 588 | | | | | | parent: 0:e6eb3150255d |
|
589 | 589 | | | |/ / parent: 1:6db2ef61d156 |
|
590 | 590 | | | | | user: test |
|
591 | 591 | | | | | date: Thu Jan 01 00:00:16 1970 +0000 |
|
592 | 592 | | | | | summary: (16) merge two known; one immediate right, one near right |
|
593 | 593 | | | | | |
|
594 | 594 | o | | | changeset: 15:1dda3f72782d |
|
595 | 595 | |\ \ \ \ parent: 13:22d8966a97e3 |
|
596 | 596 | | | | | | parent: 14:8eac370358ef |
|
597 | 597 | | | | | | user: test |
|
598 | 598 | | | | | | date: Thu Jan 01 00:00:15 1970 +0000 |
|
599 | 599 | | | | | | summary: (15) expand |
|
600 | 600 | | | | | | |
|
601 | 601 | | o-----+ changeset: 14:8eac370358ef |
|
602 | 602 | | | | | | parent: 0:e6eb3150255d |
|
603 | 603 | | |/ / / parent: 12:86b91144a6e9 |
|
604 | 604 | | | | | user: test |
|
605 | 605 | | | | | date: Thu Jan 01 00:00:14 1970 +0000 |
|
606 | 606 | | | | | summary: (14) merge two known; one immediate right, one far right |
|
607 | 607 | | | | | |
|
608 | 608 | o | | | changeset: 13:22d8966a97e3 |
|
609 | 609 | |\ \ \ \ parent: 9:7010c0af0a35 |
|
610 | 610 | | | | | | parent: 11:832d76e6bdf2 |
|
611 | 611 | | | | | | user: test |
|
612 | 612 | | | | | | date: Thu Jan 01 00:00:13 1970 +0000 |
|
613 | 613 | | | | | | summary: (13) expand |
|
614 | 614 | | | | | | |
|
615 | 615 | +---o | | changeset: 12:86b91144a6e9 |
|
616 | 616 | | | |/ / parent: 1:6db2ef61d156 |
|
617 | 617 | | | | | parent: 9:7010c0af0a35 |
|
618 | 618 | | | | | user: test |
|
619 | 619 | | | | | date: Thu Jan 01 00:00:12 1970 +0000 |
|
620 | 620 | | | | | summary: (12) merge two known; one immediate right, one far left |
|
621 | 621 | | | | | |
|
622 | 622 | | o | | changeset: 11:832d76e6bdf2 |
|
623 | 623 | | |\ \ \ parent: 6:b105a072e251 |
|
624 | 624 | | | | | | parent: 10:74c64d036d72 |
|
625 | 625 | | | | | | user: test |
|
626 | 626 | | | | | | date: Thu Jan 01 00:00:11 1970 +0000 |
|
627 | 627 | | | | | | summary: (11) expand |
|
628 | 628 | | | | | | |
|
629 | 629 | | | o---+ changeset: 10:74c64d036d72 |
|
630 | 630 | | | | | | parent: 0:e6eb3150255d |
|
631 | 631 | | |/ / / parent: 6:b105a072e251 |
|
632 | 632 | | | | | user: test |
|
633 | 633 | | | | | date: Thu Jan 01 00:00:10 1970 +0000 |
|
634 | 634 | | | | | summary: (10) merge two known; one immediate left, one near right |
|
635 | 635 | | | | | |
|
636 | 636 | o | | | changeset: 9:7010c0af0a35 |
|
637 | 637 | |\ \ \ \ parent: 7:b632bb1b1224 |
|
638 | 638 | | | | | | parent: 8:7a0b11f71937 |
|
639 | 639 | | | | | | user: test |
|
640 | 640 | | | | | | date: Thu Jan 01 00:00:09 1970 +0000 |
|
641 | 641 | | | | | | summary: (9) expand |
|
642 | 642 | | | | | | |
|
643 | 643 | | o-----+ changeset: 8:7a0b11f71937 |
|
644 | 644 | | | | | | parent: 0:e6eb3150255d |
|
645 | 645 | |/ / / / parent: 7:b632bb1b1224 |
|
646 | 646 | | | | | user: test |
|
647 | 647 | | | | | date: Thu Jan 01 00:00:08 1970 +0000 |
|
648 | 648 | | | | | summary: (8) merge two known; one immediate left, one far right |
|
649 | 649 | | | | | |
|
650 | 650 | o | | | changeset: 7:b632bb1b1224 |
|
651 | 651 | |\ \ \ \ parent: 2:3d9a33b8d1e1 |
|
652 | 652 | | | | | | parent: 5:4409d547b708 |
|
653 | 653 | | | | | | user: test |
|
654 | 654 | | | | | | date: Thu Jan 01 00:00:07 1970 +0000 |
|
655 | 655 | | | | | | summary: (7) expand |
|
656 | 656 | | | | | | |
|
657 | 657 | +---o | | changeset: 6:b105a072e251 |
|
658 | 658 | | |/ / / parent: 2:3d9a33b8d1e1 |
|
659 | 659 | | | | | parent: 5:4409d547b708 |
|
660 | 660 | | | | | user: test |
|
661 | 661 | | | | | date: Thu Jan 01 00:00:06 1970 +0000 |
|
662 | 662 | | | | | summary: (6) merge two known; one immediate left, one far left |
|
663 | 663 | | | | | |
|
664 | 664 | | o | | changeset: 5:4409d547b708 |
|
665 | 665 | | |\ \ \ parent: 3:27eef8ed80b4 |
|
666 | 666 | | | | | | parent: 4:26a8bac39d9f |
|
667 | 667 | | | | | | user: test |
|
668 | 668 | | | | | | date: Thu Jan 01 00:00:05 1970 +0000 |
|
669 | 669 | | | | | | summary: (5) expand |
|
670 | 670 | | | | | | |
|
671 | 671 | | | o | | changeset: 4:26a8bac39d9f |
|
672 | 672 | | |/|/ / parent: 1:6db2ef61d156 |
|
673 | 673 | | | | | parent: 3:27eef8ed80b4 |
|
674 | 674 | | | | | user: test |
|
675 | 675 | | | | | date: Thu Jan 01 00:00:04 1970 +0000 |
|
676 | 676 | | | | | summary: (4) merge two known; one immediate left, one immediate right |
|
677 | 677 | | | | | |
|
678 | 678 | | o | | changeset: 3:27eef8ed80b4 |
|
679 | 679 | |/ / / user: test |
|
680 | 680 | | | | date: Thu Jan 01 00:00:03 1970 +0000 |
|
681 | 681 | | | | summary: (3) collapse |
|
682 | 682 | | | | |
|
683 | 683 | o | | changeset: 2:3d9a33b8d1e1 |
|
684 | 684 | |/ / user: test |
|
685 | 685 | | | date: Thu Jan 01 00:00:02 1970 +0000 |
|
686 | 686 | | | summary: (2) collapse |
|
687 | 687 | | | |
|
688 | 688 | o | changeset: 1:6db2ef61d156 |
|
689 | 689 | |/ user: test |
|
690 | 690 | | date: Thu Jan 01 00:00:01 1970 +0000 |
|
691 | 691 | | summary: (1) collapse |
|
692 | 692 | | |
|
693 | 693 | o changeset: 0:e6eb3150255d |
|
694 | 694 | user: test |
|
695 | 695 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
696 | 696 | summary: (0) root |
|
697 | 697 | |
|
698 | 698 | |
|
699 | 699 | File glog per revset: |
|
700 | 700 | |
|
701 | 701 | $ hg glog -r 'file("a")' |
|
702 | 702 | @ changeset: 34:fea3ac5810e0 |
|
703 | 703 | | tag: tip |
|
704 | 704 | | parent: 32:d06dffa21a31 |
|
705 | 705 | | user: test |
|
706 | 706 | | date: Thu Jan 01 00:00:34 1970 +0000 |
|
707 | 707 | | summary: (34) head |
|
708 | 708 | | |
|
709 | 709 | | o changeset: 33:68608f5145f9 |
|
710 | 710 | | | parent: 18:1aa84d96232a |
|
711 | 711 | | | user: test |
|
712 | 712 | | | date: Thu Jan 01 00:00:33 1970 +0000 |
|
713 | 713 | | | summary: (33) head |
|
714 | 714 | | | |
|
715 | 715 | o | changeset: 32:d06dffa21a31 |
|
716 | 716 | |\ \ parent: 27:886ed638191b |
|
717 | 717 | | | | parent: 31:621d83e11f67 |
|
718 | 718 | | | | user: test |
|
719 | 719 | | | | date: Thu Jan 01 00:00:32 1970 +0000 |
|
720 | 720 | | | | summary: (32) expand |
|
721 | 721 | | | | |
|
722 | 722 | | o | changeset: 31:621d83e11f67 |
|
723 | 723 | | |\ \ parent: 21:d42a756af44d |
|
724 | 724 | | | | | parent: 30:6e11cd4b648f |
|
725 | 725 | | | | | user: test |
|
726 | 726 | | | | | date: Thu Jan 01 00:00:31 1970 +0000 |
|
727 | 727 | | | | | summary: (31) expand |
|
728 | 728 | | | | | |
|
729 | 729 | | | o | changeset: 30:6e11cd4b648f |
|
730 | 730 | | | |\ \ parent: 28:44ecd0b9ae99 |
|
731 | 731 | | | | | | parent: 29:cd9bb2be7593 |
|
732 | 732 | | | | | | user: test |
|
733 | 733 | | | | | | date: Thu Jan 01 00:00:30 1970 +0000 |
|
734 | 734 | | | | | | summary: (30) expand |
|
735 | 735 | | | | | | |
|
736 | 736 | | | | o | changeset: 29:cd9bb2be7593 |
|
737 | 737 | | | | | | parent: 0:e6eb3150255d |
|
738 | 738 | | | | | | user: test |
|
739 | 739 | | | | | | date: Thu Jan 01 00:00:29 1970 +0000 |
|
740 | 740 | | | | | | summary: (29) regular commit |
|
741 | 741 | | | | | | |
|
742 | 742 | | | o | | changeset: 28:44ecd0b9ae99 |
|
743 | 743 | | | |\ \ \ parent: 1:6db2ef61d156 |
|
744 | 744 | | | | | | | parent: 26:7f25b6c2f0b9 |
|
745 | 745 | | | | | | | user: test |
|
746 | 746 | | | | | | | date: Thu Jan 01 00:00:28 1970 +0000 |
|
747 | 747 | | | | | | | summary: (28) merge zero known |
|
748 | 748 | | | | | | | |
|
749 | 749 | o | | | | | changeset: 27:886ed638191b |
|
750 | 750 | |/ / / / / parent: 21:d42a756af44d |
|
751 | 751 | | | | | | user: test |
|
752 | 752 | | | | | | date: Thu Jan 01 00:00:27 1970 +0000 |
|
753 | 753 | | | | | | summary: (27) collapse |
|
754 | 754 | | | | | | |
|
755 | 755 | | | o---+ changeset: 26:7f25b6c2f0b9 |
|
756 | 756 | | | | | | parent: 18:1aa84d96232a |
|
757 | 757 | | | | | | parent: 25:91da8ed57247 |
|
758 | 758 | | | | | | user: test |
|
759 | 759 | | | | | | date: Thu Jan 01 00:00:26 1970 +0000 |
|
760 | 760 | | | | | | summary: (26) merge one known; far right |
|
761 | 761 | | | | | | |
|
762 | 762 | +---o | | changeset: 25:91da8ed57247 |
|
763 | 763 | | | | | | parent: 21:d42a756af44d |
|
764 | 764 | | | | | | parent: 24:a9c19a3d96b7 |
|
765 | 765 | | | | | | user: test |
|
766 | 766 | | | | | | date: Thu Jan 01 00:00:25 1970 +0000 |
|
767 | 767 | | | | | | summary: (25) merge one known; far left |
|
768 | 768 | | | | | | |
|
769 | 769 | | | o | | changeset: 24:a9c19a3d96b7 |
|
770 | 770 | | | |\| | parent: 0:e6eb3150255d |
|
771 | 771 | | | | | | parent: 23:a01cddf0766d |
|
772 | 772 | | | | | | user: test |
|
773 | 773 | | | | | | date: Thu Jan 01 00:00:24 1970 +0000 |
|
774 | 774 | | | | | | summary: (24) merge one known; immediate right |
|
775 | 775 | | | | | | |
|
776 | 776 | | | o | | changeset: 23:a01cddf0766d |
|
777 | 777 | | |/| | | parent: 1:6db2ef61d156 |
|
778 | 778 | | | | | | parent: 22:e0d9cccacb5d |
|
779 | 779 | | | | | | user: test |
|
780 | 780 | | | | | | date: Thu Jan 01 00:00:23 1970 +0000 |
|
781 | 781 | | | | | | summary: (23) merge one known; immediate left |
|
782 | 782 | | | | | | |
|
783 | 783 | +---o---+ changeset: 22:e0d9cccacb5d |
|
784 | 784 | | | | | parent: 18:1aa84d96232a |
|
785 | 785 | | | / / parent: 21:d42a756af44d |
|
786 | 786 | | | | | user: test |
|
787 | 787 | | | | | date: Thu Jan 01 00:00:22 1970 +0000 |
|
788 | 788 | | | | | summary: (22) merge two known; one far left, one far right |
|
789 | 789 | | | | | |
|
790 | 790 | o | | | changeset: 21:d42a756af44d |
|
791 | 791 | |\ \ \ \ parent: 19:31ddc2c1573b |
|
792 | 792 | | | | | | parent: 20:d30ed6450e32 |
|
793 | 793 | | | | | | user: test |
|
794 | 794 | | | | | | date: Thu Jan 01 00:00:21 1970 +0000 |
|
795 | 795 | | | | | | summary: (21) expand |
|
796 | 796 | | | | | | |
|
797 | 797 | | o---+-+ changeset: 20:d30ed6450e32 |
|
798 | 798 | | | | | parent: 0:e6eb3150255d |
|
799 | 799 | | / / / parent: 18:1aa84d96232a |
|
800 | 800 | | | | | user: test |
|
801 | 801 | | | | | date: Thu Jan 01 00:00:20 1970 +0000 |
|
802 | 802 | | | | | summary: (20) merge two known; two far right |
|
803 | 803 | | | | | |
|
804 | 804 | o | | | changeset: 19:31ddc2c1573b |
|
805 | 805 | |\ \ \ \ parent: 15:1dda3f72782d |
|
806 | 806 | | | | | | parent: 17:44765d7c06e0 |
|
807 | 807 | | | | | | user: test |
|
808 | 808 | | | | | | date: Thu Jan 01 00:00:19 1970 +0000 |
|
809 | 809 | | | | | | summary: (19) expand |
|
810 | 810 | | | | | | |
|
811 | 811 | +---+---o changeset: 18:1aa84d96232a |
|
812 | 812 | | | | | parent: 1:6db2ef61d156 |
|
813 | 813 | | | | | parent: 15:1dda3f72782d |
|
814 | 814 | | | | | user: test |
|
815 | 815 | | | | | date: Thu Jan 01 00:00:18 1970 +0000 |
|
816 | 816 | | | | | summary: (18) merge two known; two far left |
|
817 | 817 | | | | | |
|
818 | 818 | | o | | changeset: 17:44765d7c06e0 |
|
819 | 819 | | |\ \ \ parent: 12:86b91144a6e9 |
|
820 | 820 | | | | | | parent: 16:3677d192927d |
|
821 | 821 | | | | | | user: test |
|
822 | 822 | | | | | | date: Thu Jan 01 00:00:17 1970 +0000 |
|
823 | 823 | | | | | | summary: (17) expand |
|
824 | 824 | | | | | | |
|
825 | 825 | | | o---+ changeset: 16:3677d192927d |
|
826 | 826 | | | | | | parent: 0:e6eb3150255d |
|
827 | 827 | | | |/ / parent: 1:6db2ef61d156 |
|
828 | 828 | | | | | user: test |
|
829 | 829 | | | | | date: Thu Jan 01 00:00:16 1970 +0000 |
|
830 | 830 | | | | | summary: (16) merge two known; one immediate right, one near right |
|
831 | 831 | | | | | |
|
832 | 832 | o | | | changeset: 15:1dda3f72782d |
|
833 | 833 | |\ \ \ \ parent: 13:22d8966a97e3 |
|
834 | 834 | | | | | | parent: 14:8eac370358ef |
|
835 | 835 | | | | | | user: test |
|
836 | 836 | | | | | | date: Thu Jan 01 00:00:15 1970 +0000 |
|
837 | 837 | | | | | | summary: (15) expand |
|
838 | 838 | | | | | | |
|
839 | 839 | | o-----+ changeset: 14:8eac370358ef |
|
840 | 840 | | | | | | parent: 0:e6eb3150255d |
|
841 | 841 | | |/ / / parent: 12:86b91144a6e9 |
|
842 | 842 | | | | | user: test |
|
843 | 843 | | | | | date: Thu Jan 01 00:00:14 1970 +0000 |
|
844 | 844 | | | | | summary: (14) merge two known; one immediate right, one far right |
|
845 | 845 | | | | | |
|
846 | 846 | o | | | changeset: 13:22d8966a97e3 |
|
847 | 847 | |\ \ \ \ parent: 9:7010c0af0a35 |
|
848 | 848 | | | | | | parent: 11:832d76e6bdf2 |
|
849 | 849 | | | | | | user: test |
|
850 | 850 | | | | | | date: Thu Jan 01 00:00:13 1970 +0000 |
|
851 | 851 | | | | | | summary: (13) expand |
|
852 | 852 | | | | | | |
|
853 | 853 | +---o | | changeset: 12:86b91144a6e9 |
|
854 | 854 | | | |/ / parent: 1:6db2ef61d156 |
|
855 | 855 | | | | | parent: 9:7010c0af0a35 |
|
856 | 856 | | | | | user: test |
|
857 | 857 | | | | | date: Thu Jan 01 00:00:12 1970 +0000 |
|
858 | 858 | | | | | summary: (12) merge two known; one immediate right, one far left |
|
859 | 859 | | | | | |
|
860 | 860 | | o | | changeset: 11:832d76e6bdf2 |
|
861 | 861 | | |\ \ \ parent: 6:b105a072e251 |
|
862 | 862 | | | | | | parent: 10:74c64d036d72 |
|
863 | 863 | | | | | | user: test |
|
864 | 864 | | | | | | date: Thu Jan 01 00:00:11 1970 +0000 |
|
865 | 865 | | | | | | summary: (11) expand |
|
866 | 866 | | | | | | |
|
867 | 867 | | | o---+ changeset: 10:74c64d036d72 |
|
868 | 868 | | | | | | parent: 0:e6eb3150255d |
|
869 | 869 | | |/ / / parent: 6:b105a072e251 |
|
870 | 870 | | | | | user: test |
|
871 | 871 | | | | | date: Thu Jan 01 00:00:10 1970 +0000 |
|
872 | 872 | | | | | summary: (10) merge two known; one immediate left, one near right |
|
873 | 873 | | | | | |
|
874 | 874 | o | | | changeset: 9:7010c0af0a35 |
|
875 | 875 | |\ \ \ \ parent: 7:b632bb1b1224 |
|
876 | 876 | | | | | | parent: 8:7a0b11f71937 |
|
877 | 877 | | | | | | user: test |
|
878 | 878 | | | | | | date: Thu Jan 01 00:00:09 1970 +0000 |
|
879 | 879 | | | | | | summary: (9) expand |
|
880 | 880 | | | | | | |
|
881 | 881 | | o-----+ changeset: 8:7a0b11f71937 |
|
882 | 882 | | | | | | parent: 0:e6eb3150255d |
|
883 | 883 | |/ / / / parent: 7:b632bb1b1224 |
|
884 | 884 | | | | | user: test |
|
885 | 885 | | | | | date: Thu Jan 01 00:00:08 1970 +0000 |
|
886 | 886 | | | | | summary: (8) merge two known; one immediate left, one far right |
|
887 | 887 | | | | | |
|
888 | 888 | o | | | changeset: 7:b632bb1b1224 |
|
889 | 889 | |\ \ \ \ parent: 2:3d9a33b8d1e1 |
|
890 | 890 | | | | | | parent: 5:4409d547b708 |
|
891 | 891 | | | | | | user: test |
|
892 | 892 | | | | | | date: Thu Jan 01 00:00:07 1970 +0000 |
|
893 | 893 | | | | | | summary: (7) expand |
|
894 | 894 | | | | | | |
|
895 | 895 | +---o | | changeset: 6:b105a072e251 |
|
896 | 896 | | |/ / / parent: 2:3d9a33b8d1e1 |
|
897 | 897 | | | | | parent: 5:4409d547b708 |
|
898 | 898 | | | | | user: test |
|
899 | 899 | | | | | date: Thu Jan 01 00:00:06 1970 +0000 |
|
900 | 900 | | | | | summary: (6) merge two known; one immediate left, one far left |
|
901 | 901 | | | | | |
|
902 | 902 | | o | | changeset: 5:4409d547b708 |
|
903 | 903 | | |\ \ \ parent: 3:27eef8ed80b4 |
|
904 | 904 | | | | | | parent: 4:26a8bac39d9f |
|
905 | 905 | | | | | | user: test |
|
906 | 906 | | | | | | date: Thu Jan 01 00:00:05 1970 +0000 |
|
907 | 907 | | | | | | summary: (5) expand |
|
908 | 908 | | | | | | |
|
909 | 909 | | | o | | changeset: 4:26a8bac39d9f |
|
910 | 910 | | |/|/ / parent: 1:6db2ef61d156 |
|
911 | 911 | | | | | parent: 3:27eef8ed80b4 |
|
912 | 912 | | | | | user: test |
|
913 | 913 | | | | | date: Thu Jan 01 00:00:04 1970 +0000 |
|
914 | 914 | | | | | summary: (4) merge two known; one immediate left, one immediate right |
|
915 | 915 | | | | | |
|
916 | 916 | | o | | changeset: 3:27eef8ed80b4 |
|
917 | 917 | |/ / / user: test |
|
918 | 918 | | | | date: Thu Jan 01 00:00:03 1970 +0000 |
|
919 | 919 | | | | summary: (3) collapse |
|
920 | 920 | | | | |
|
921 | 921 | o | | changeset: 2:3d9a33b8d1e1 |
|
922 | 922 | |/ / user: test |
|
923 | 923 | | | date: Thu Jan 01 00:00:02 1970 +0000 |
|
924 | 924 | | | summary: (2) collapse |
|
925 | 925 | | | |
|
926 | 926 | o | changeset: 1:6db2ef61d156 |
|
927 | 927 | |/ user: test |
|
928 | 928 | | date: Thu Jan 01 00:00:01 1970 +0000 |
|
929 | 929 | | summary: (1) collapse |
|
930 | 930 | | |
|
931 | 931 | o changeset: 0:e6eb3150255d |
|
932 | 932 | user: test |
|
933 | 933 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
934 | 934 | summary: (0) root |
|
935 | 935 | |
|
936 | 936 | |
|
937 | 937 | |
|
938 | 938 | File glog per revset (only merges): |
|
939 | 939 | |
|
940 | 940 | $ hg log -G -r 'file("a")' -m |
|
941 | 941 | o changeset: 32:d06dffa21a31 |
|
942 | 942 | |\ parent: 27:886ed638191b |
|
943 | 943 | | | parent: 31:621d83e11f67 |
|
944 | 944 | | | user: test |
|
945 | 945 | | | date: Thu Jan 01 00:00:32 1970 +0000 |
|
946 | 946 | | | summary: (32) expand |
|
947 | 947 | | | |
|
948 | 948 | o | changeset: 31:621d83e11f67 |
|
949 | 949 | |\| parent: 21:d42a756af44d |
|
950 | 950 | | | parent: 30:6e11cd4b648f |
|
951 | 951 | | | user: test |
|
952 | 952 | | | date: Thu Jan 01 00:00:31 1970 +0000 |
|
953 | 953 | | | summary: (31) expand |
|
954 | 954 | | | |
|
955 | 955 | o | changeset: 30:6e11cd4b648f |
|
956 | 956 | |\ \ parent: 28:44ecd0b9ae99 |
|
957 | 957 | | | | parent: 29:cd9bb2be7593 |
|
958 | 958 | | | | user: test |
|
959 | 959 | | | | date: Thu Jan 01 00:00:30 1970 +0000 |
|
960 | 960 | | | | summary: (30) expand |
|
961 | 961 | | | | |
|
962 | 962 | o | | changeset: 28:44ecd0b9ae99 |
|
963 | 963 | |\ \ \ parent: 1:6db2ef61d156 |
|
964 | 964 | | | | | parent: 26:7f25b6c2f0b9 |
|
965 | 965 | | | | | user: test |
|
966 | 966 | | | | | date: Thu Jan 01 00:00:28 1970 +0000 |
|
967 | 967 | | | | | summary: (28) merge zero known |
|
968 | 968 | | | | | |
|
969 | 969 | o | | | changeset: 26:7f25b6c2f0b9 |
|
970 | 970 | |\ \ \ \ parent: 18:1aa84d96232a |
|
971 | 971 | | | | | | parent: 25:91da8ed57247 |
|
972 | 972 | | | | | | user: test |
|
973 | 973 | | | | | | date: Thu Jan 01 00:00:26 1970 +0000 |
|
974 | 974 | | | | | | summary: (26) merge one known; far right |
|
975 | 975 | | | | | | |
|
976 | 976 | | o-----+ changeset: 25:91da8ed57247 |
|
977 | 977 | | | | | | parent: 21:d42a756af44d |
|
978 | 978 | | | | | | parent: 24:a9c19a3d96b7 |
|
979 | 979 | | | | | | user: test |
|
980 | 980 | | | | | | date: Thu Jan 01 00:00:25 1970 +0000 |
|
981 | 981 | | | | | | summary: (25) merge one known; far left |
|
982 | 982 | | | | | | |
|
983 | 983 | | o | | | changeset: 24:a9c19a3d96b7 |
|
984 | 984 | | |\ \ \ \ parent: 0:e6eb3150255d |
|
985 | 985 | | | | | | | parent: 23:a01cddf0766d |
|
986 | 986 | | | | | | | user: test |
|
987 | 987 | | | | | | | date: Thu Jan 01 00:00:24 1970 +0000 |
|
988 | 988 | | | | | | | summary: (24) merge one known; immediate right |
|
989 | 989 | | | | | | | |
|
990 | 990 | | o---+ | | changeset: 23:a01cddf0766d |
|
991 | 991 | | | | | | | parent: 1:6db2ef61d156 |
|
992 | 992 | | | | | | | parent: 22:e0d9cccacb5d |
|
993 | 993 | | | | | | | user: test |
|
994 | 994 | | | | | | | date: Thu Jan 01 00:00:23 1970 +0000 |
|
995 | 995 | | | | | | | summary: (23) merge one known; immediate left |
|
996 | 996 | | | | | | | |
|
997 | 997 | | o-------+ changeset: 22:e0d9cccacb5d |
|
998 | 998 | | | | | | | parent: 18:1aa84d96232a |
|
999 | 999 | |/ / / / / parent: 21:d42a756af44d |
|
1000 | 1000 | | | | | | user: test |
|
1001 | 1001 | | | | | | date: Thu Jan 01 00:00:22 1970 +0000 |
|
1002 | 1002 | | | | | | summary: (22) merge two known; one far left, one far right |
|
1003 | 1003 | | | | | | |
|
1004 | 1004 | | | | | o changeset: 21:d42a756af44d |
|
1005 | 1005 | | | | | |\ parent: 19:31ddc2c1573b |
|
1006 | 1006 | | | | | | | parent: 20:d30ed6450e32 |
|
1007 | 1007 | | | | | | | user: test |
|
1008 | 1008 | | | | | | | date: Thu Jan 01 00:00:21 1970 +0000 |
|
1009 | 1009 | | | | | | | summary: (21) expand |
|
1010 | 1010 | | | | | | | |
|
1011 | 1011 | +-+-------o changeset: 20:d30ed6450e32 |
|
1012 | 1012 | | | | | | parent: 0:e6eb3150255d |
|
1013 | 1013 | | | | | | parent: 18:1aa84d96232a |
|
1014 | 1014 | | | | | | user: test |
|
1015 | 1015 | | | | | | date: Thu Jan 01 00:00:20 1970 +0000 |
|
1016 | 1016 | | | | | | summary: (20) merge two known; two far right |
|
1017 | 1017 | | | | | | |
|
1018 | 1018 | | | | | o changeset: 19:31ddc2c1573b |
|
1019 | 1019 | | | | | |\ parent: 15:1dda3f72782d |
|
1020 | 1020 | | | | | | | parent: 17:44765d7c06e0 |
|
1021 | 1021 | | | | | | | user: test |
|
1022 | 1022 | | | | | | | date: Thu Jan 01 00:00:19 1970 +0000 |
|
1023 | 1023 | | | | | | | summary: (19) expand |
|
1024 | 1024 | | | | | | | |
|
1025 | 1025 | o---+---+ | changeset: 18:1aa84d96232a |
|
1026 | 1026 | | | | | | parent: 1:6db2ef61d156 |
|
1027 | 1027 | / / / / / parent: 15:1dda3f72782d |
|
1028 | 1028 | | | | | | user: test |
|
1029 | 1029 | | | | | | date: Thu Jan 01 00:00:18 1970 +0000 |
|
1030 | 1030 | | | | | | summary: (18) merge two known; two far left |
|
1031 | 1031 | | | | | | |
|
1032 | 1032 | | | | | o changeset: 17:44765d7c06e0 |
|
1033 | 1033 | | | | | |\ parent: 12:86b91144a6e9 |
|
1034 | 1034 | | | | | | | parent: 16:3677d192927d |
|
1035 | 1035 | | | | | | | user: test |
|
1036 | 1036 | | | | | | | date: Thu Jan 01 00:00:17 1970 +0000 |
|
1037 | 1037 | | | | | | | summary: (17) expand |
|
1038 | 1038 | | | | | | | |
|
1039 | 1039 | +-+-------o changeset: 16:3677d192927d |
|
1040 | 1040 | | | | | | parent: 0:e6eb3150255d |
|
1041 | 1041 | | | | | | parent: 1:6db2ef61d156 |
|
1042 | 1042 | | | | | | user: test |
|
1043 | 1043 | | | | | | date: Thu Jan 01 00:00:16 1970 +0000 |
|
1044 | 1044 | | | | | | summary: (16) merge two known; one immediate right, one near right |
|
1045 | 1045 | | | | | | |
|
1046 | 1046 | | | | o | changeset: 15:1dda3f72782d |
|
1047 | 1047 | | | | |\ \ parent: 13:22d8966a97e3 |
|
1048 | 1048 | | | | | | | parent: 14:8eac370358ef |
|
1049 | 1049 | | | | | | | user: test |
|
1050 | 1050 | | | | | | | date: Thu Jan 01 00:00:15 1970 +0000 |
|
1051 | 1051 | | | | | | | summary: (15) expand |
|
1052 | 1052 | | | | | | | |
|
1053 | 1053 | +-------o | changeset: 14:8eac370358ef |
|
1054 | 1054 | | | | | |/ parent: 0:e6eb3150255d |
|
1055 | 1055 | | | | | | parent: 12:86b91144a6e9 |
|
1056 | 1056 | | | | | | user: test |
|
1057 | 1057 | | | | | | date: Thu Jan 01 00:00:14 1970 +0000 |
|
1058 | 1058 | | | | | | summary: (14) merge two known; one immediate right, one far right |
|
1059 | 1059 | | | | | | |
|
1060 | 1060 | | | | o | changeset: 13:22d8966a97e3 |
|
1061 | 1061 | | | | |\ \ parent: 9:7010c0af0a35 |
|
1062 | 1062 | | | | | | | parent: 11:832d76e6bdf2 |
|
1063 | 1063 | | | | | | | user: test |
|
1064 | 1064 | | | | | | | date: Thu Jan 01 00:00:13 1970 +0000 |
|
1065 | 1065 | | | | | | | summary: (13) expand |
|
1066 | 1066 | | | | | | | |
|
1067 | 1067 | | +---+---o changeset: 12:86b91144a6e9 |
|
1068 | 1068 | | | | | | parent: 1:6db2ef61d156 |
|
1069 | 1069 | | | | | | parent: 9:7010c0af0a35 |
|
1070 | 1070 | | | | | | user: test |
|
1071 | 1071 | | | | | | date: Thu Jan 01 00:00:12 1970 +0000 |
|
1072 | 1072 | | | | | | summary: (12) merge two known; one immediate right, one far left |
|
1073 | 1073 | | | | | | |
|
1074 | 1074 | | | | | o changeset: 11:832d76e6bdf2 |
|
1075 | 1075 | | | | | |\ parent: 6:b105a072e251 |
|
1076 | 1076 | | | | | | | parent: 10:74c64d036d72 |
|
1077 | 1077 | | | | | | | user: test |
|
1078 | 1078 | | | | | | | date: Thu Jan 01 00:00:11 1970 +0000 |
|
1079 | 1079 | | | | | | | summary: (11) expand |
|
1080 | 1080 | | | | | | | |
|
1081 | 1081 | +---------o changeset: 10:74c64d036d72 |
|
1082 | 1082 | | | | | |/ parent: 0:e6eb3150255d |
|
1083 | 1083 | | | | | | parent: 6:b105a072e251 |
|
1084 | 1084 | | | | | | user: test |
|
1085 | 1085 | | | | | | date: Thu Jan 01 00:00:10 1970 +0000 |
|
1086 | 1086 | | | | | | summary: (10) merge two known; one immediate left, one near right |
|
1087 | 1087 | | | | | | |
|
1088 | 1088 | | | | o | changeset: 9:7010c0af0a35 |
|
1089 | 1089 | | | | |\ \ parent: 7:b632bb1b1224 |
|
1090 | 1090 | | | | | | | parent: 8:7a0b11f71937 |
|
1091 | 1091 | | | | | | | user: test |
|
1092 | 1092 | | | | | | | date: Thu Jan 01 00:00:09 1970 +0000 |
|
1093 | 1093 | | | | | | | summary: (9) expand |
|
1094 | 1094 | | | | | | | |
|
1095 | 1095 | +-------o | changeset: 8:7a0b11f71937 |
|
1096 | 1096 | | | | |/ / parent: 0:e6eb3150255d |
|
1097 | 1097 | | | | | | parent: 7:b632bb1b1224 |
|
1098 | 1098 | | | | | | user: test |
|
1099 | 1099 | | | | | | date: Thu Jan 01 00:00:08 1970 +0000 |
|
1100 | 1100 | | | | | | summary: (8) merge two known; one immediate left, one far right |
|
1101 | 1101 | | | | | | |
|
1102 | 1102 | | | | o | changeset: 7:b632bb1b1224 |
|
1103 | 1103 | | | | |\ \ parent: 2:3d9a33b8d1e1 |
|
1104 | 1104 | | | | | | | parent: 5:4409d547b708 |
|
1105 | 1105 | | | | | | | user: test |
|
1106 | 1106 | | | | | | | date: Thu Jan 01 00:00:07 1970 +0000 |
|
1107 | 1107 | | | | | | | summary: (7) expand |
|
1108 | 1108 | | | | | | | |
|
1109 | 1109 | | | | +---o changeset: 6:b105a072e251 |
|
1110 | 1110 | | | | | |/ parent: 2:3d9a33b8d1e1 |
|
1111 | 1111 | | | | | | parent: 5:4409d547b708 |
|
1112 | 1112 | | | | | | user: test |
|
1113 | 1113 | | | | | | date: Thu Jan 01 00:00:06 1970 +0000 |
|
1114 | 1114 | | | | | | summary: (6) merge two known; one immediate left, one far left |
|
1115 | 1115 | | | | | | |
|
1116 | 1116 | | | | o | changeset: 5:4409d547b708 |
|
1117 | 1117 | | | | |\ \ parent: 3:27eef8ed80b4 |
|
1118 | 1118 | | | | | | | parent: 4:26a8bac39d9f |
|
1119 | 1119 | | | | | | | user: test |
|
1120 | 1120 | | | | | | | date: Thu Jan 01 00:00:05 1970 +0000 |
|
1121 | 1121 | | | | | | | summary: (5) expand |
|
1122 | 1122 | | | | | | | |
|
1123 | 1123 | | +---o | | changeset: 4:26a8bac39d9f |
|
1124 | 1124 | | | | |/ / parent: 1:6db2ef61d156 |
|
1125 | 1125 | | | | | | parent: 3:27eef8ed80b4 |
|
1126 | 1126 | | | | | | user: test |
|
1127 | 1127 | | | | | | date: Thu Jan 01 00:00:04 1970 +0000 |
|
1128 | 1128 | | | | | | summary: (4) merge two known; one immediate left, one immediate right |
|
1129 | 1129 | | | | | | |
|
1130 | 1130 | |
|
1131 | 1131 | |
|
1132 | 1132 | Empty revision range - display nothing: |
|
1133 | 1133 | $ hg glog -r 1..0 |
|
1134 | 1134 | |
|
1135 | 1135 | From outer space: |
|
1136 | 1136 | $ cd .. |
|
1137 | 1137 | $ hg glog -l1 repo |
|
1138 | 1138 | @ changeset: 34:fea3ac5810e0 |
|
1139 | 1139 | | tag: tip |
|
1140 | 1140 | | parent: 32:d06dffa21a31 |
|
1141 | 1141 | | user: test |
|
1142 | 1142 | | date: Thu Jan 01 00:00:34 1970 +0000 |
|
1143 | 1143 | | summary: (34) head |
|
1144 | 1144 | | |
|
1145 | 1145 | $ hg glog -l1 repo/a |
|
1146 | 1146 | @ changeset: 34:fea3ac5810e0 |
|
1147 | 1147 | | tag: tip |
|
1148 | 1148 | | parent: 32:d06dffa21a31 |
|
1149 | 1149 | | user: test |
|
1150 | 1150 | | date: Thu Jan 01 00:00:34 1970 +0000 |
|
1151 | 1151 | | summary: (34) head |
|
1152 | 1152 | | |
|
1153 | 1153 | $ hg glog -l1 repo/missing |
|
1154 | 1154 | |
|
1155 | 1155 | File log with revs != cset revs: |
|
1156 | 1156 | $ hg init flog |
|
1157 | 1157 | $ cd flog |
|
1158 | 1158 | $ echo one >one |
|
1159 | 1159 | $ hg add one |
|
1160 | 1160 | $ hg commit -mone |
|
1161 | 1161 | $ echo two >two |
|
1162 | 1162 | $ hg add two |
|
1163 | 1163 | $ hg commit -mtwo |
|
1164 | 1164 | $ echo more >two |
|
1165 | 1165 | $ hg commit -mmore |
|
1166 | 1166 | $ hg glog two |
|
1167 | 1167 | @ changeset: 2:12c28321755b |
|
1168 | 1168 | | tag: tip |
|
1169 | 1169 | | user: test |
|
1170 | 1170 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1171 | 1171 | | summary: more |
|
1172 | 1172 | | |
|
1173 | 1173 | o changeset: 1:5ac72c0599bf |
|
1174 | 1174 | | user: test |
|
1175 | 1175 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1176 | 1176 | | summary: two |
|
1177 | 1177 | | |
|
1178 | 1178 | |
|
1179 | 1179 | Issue1896: File log with explicit style |
|
1180 | 1180 | $ hg glog --style=default one |
|
1181 | 1181 | o changeset: 0:3d578b4a1f53 |
|
1182 | 1182 | user: test |
|
1183 | 1183 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1184 | 1184 | summary: one |
|
1185 | 1185 | |
|
1186 | 1186 | Issue2395: glog --style header and footer |
|
1187 | 1187 | $ hg glog --style=xml one |
|
1188 | 1188 | <?xml version="1.0"?> |
|
1189 | 1189 | <log> |
|
1190 | 1190 | o <logentry revision="0" node="3d578b4a1f537d5fcf7301bfa9c0b97adfaa6fb1"> |
|
1191 | 1191 | <author email="test">test</author> |
|
1192 | 1192 | <date>1970-01-01T00:00:00+00:00</date> |
|
1193 | 1193 | <msg xml:space="preserve">one</msg> |
|
1194 | 1194 | </logentry> |
|
1195 | 1195 | </log> |
|
1196 | 1196 | |
|
1197 | 1197 | $ cd .. |
|
1198 | 1198 | |
|
1199 | 1199 | Incoming and outgoing: |
|
1200 | 1200 | |
|
1201 | 1201 | $ hg clone -U -r31 repo repo2 |
|
1202 | 1202 | adding changesets |
|
1203 | 1203 | adding manifests |
|
1204 | 1204 | adding file changes |
|
1205 | 1205 | added 31 changesets with 31 changes to 1 files |
|
1206 | 1206 | $ cd repo2 |
|
1207 | 1207 | |
|
1208 | 1208 | $ hg incoming --graph ../repo |
|
1209 | 1209 | comparing with ../repo |
|
1210 | 1210 | searching for changes |
|
1211 | 1211 | o changeset: 34:fea3ac5810e0 |
|
1212 | 1212 | | tag: tip |
|
1213 | 1213 | | parent: 32:d06dffa21a31 |
|
1214 | 1214 | | user: test |
|
1215 | 1215 | | date: Thu Jan 01 00:00:34 1970 +0000 |
|
1216 | 1216 | | summary: (34) head |
|
1217 | 1217 | | |
|
1218 | 1218 | | o changeset: 33:68608f5145f9 |
|
1219 | 1219 | | parent: 18:1aa84d96232a |
|
1220 | 1220 | | user: test |
|
1221 | 1221 | | date: Thu Jan 01 00:00:33 1970 +0000 |
|
1222 | 1222 | | summary: (33) head |
|
1223 | 1223 | | |
|
1224 | 1224 | o changeset: 32:d06dffa21a31 |
|
1225 | 1225 | | parent: 27:886ed638191b |
|
1226 | 1226 | | parent: 31:621d83e11f67 |
|
1227 | 1227 | | user: test |
|
1228 | 1228 | | date: Thu Jan 01 00:00:32 1970 +0000 |
|
1229 | 1229 | | summary: (32) expand |
|
1230 | 1230 | | |
|
1231 | 1231 | o changeset: 27:886ed638191b |
|
1232 | 1232 | parent: 21:d42a756af44d |
|
1233 | 1233 | user: test |
|
1234 | 1234 | date: Thu Jan 01 00:00:27 1970 +0000 |
|
1235 | 1235 | summary: (27) collapse |
|
1236 | 1236 | |
|
1237 | 1237 | $ cd .. |
|
1238 | 1238 | |
|
1239 | 1239 | $ hg -R repo outgoing --graph repo2 |
|
1240 | 1240 | comparing with repo2 |
|
1241 | 1241 | searching for changes |
|
1242 | 1242 | @ changeset: 34:fea3ac5810e0 |
|
1243 | 1243 | | tag: tip |
|
1244 | 1244 | | parent: 32:d06dffa21a31 |
|
1245 | 1245 | | user: test |
|
1246 | 1246 | | date: Thu Jan 01 00:00:34 1970 +0000 |
|
1247 | 1247 | | summary: (34) head |
|
1248 | 1248 | | |
|
1249 | 1249 | | o changeset: 33:68608f5145f9 |
|
1250 | 1250 | | parent: 18:1aa84d96232a |
|
1251 | 1251 | | user: test |
|
1252 | 1252 | | date: Thu Jan 01 00:00:33 1970 +0000 |
|
1253 | 1253 | | summary: (33) head |
|
1254 | 1254 | | |
|
1255 | 1255 | o changeset: 32:d06dffa21a31 |
|
1256 | 1256 | | parent: 27:886ed638191b |
|
1257 | 1257 | | parent: 31:621d83e11f67 |
|
1258 | 1258 | | user: test |
|
1259 | 1259 | | date: Thu Jan 01 00:00:32 1970 +0000 |
|
1260 | 1260 | | summary: (32) expand |
|
1261 | 1261 | | |
|
1262 | 1262 | o changeset: 27:886ed638191b |
|
1263 | 1263 | parent: 21:d42a756af44d |
|
1264 | 1264 | user: test |
|
1265 | 1265 | date: Thu Jan 01 00:00:27 1970 +0000 |
|
1266 | 1266 | summary: (27) collapse |
|
1267 | 1267 | |
|
1268 | 1268 | |
|
1269 | 1269 | File + limit with revs != cset revs: |
|
1270 | 1270 | $ cd repo |
|
1271 | 1271 | $ touch b |
|
1272 | 1272 | $ hg ci -Aqm0 |
|
1273 | 1273 | $ hg glog -l2 a |
|
1274 | 1274 | o changeset: 34:fea3ac5810e0 |
|
1275 | 1275 | | parent: 32:d06dffa21a31 |
|
1276 | 1276 | | user: test |
|
1277 | 1277 | | date: Thu Jan 01 00:00:34 1970 +0000 |
|
1278 | 1278 | | summary: (34) head |
|
1279 | 1279 | | |
|
1280 | 1280 | | o changeset: 33:68608f5145f9 |
|
1281 | 1281 | | | parent: 18:1aa84d96232a |
|
1282 | 1282 | | | user: test |
|
1283 | 1283 | | | date: Thu Jan 01 00:00:33 1970 +0000 |
|
1284 | 1284 | | | summary: (33) head |
|
1285 | 1285 | | | |
|
1286 | 1286 | |
|
1287 | 1287 | File + limit + -ra:b, (b - a) < limit: |
|
1288 | 1288 | $ hg glog -l3000 -r32:tip a |
|
1289 | 1289 | o changeset: 34:fea3ac5810e0 |
|
1290 | 1290 | | parent: 32:d06dffa21a31 |
|
1291 | 1291 | | user: test |
|
1292 | 1292 | | date: Thu Jan 01 00:00:34 1970 +0000 |
|
1293 | 1293 | | summary: (34) head |
|
1294 | 1294 | | |
|
1295 | 1295 | | o changeset: 33:68608f5145f9 |
|
1296 | 1296 | | | parent: 18:1aa84d96232a |
|
1297 | 1297 | | | user: test |
|
1298 | 1298 | | | date: Thu Jan 01 00:00:33 1970 +0000 |
|
1299 | 1299 | | | summary: (33) head |
|
1300 | 1300 | | | |
|
1301 | 1301 | o | changeset: 32:d06dffa21a31 |
|
1302 | 1302 | |\ \ parent: 27:886ed638191b |
|
1303 | 1303 | | | | parent: 31:621d83e11f67 |
|
1304 | 1304 | | | | user: test |
|
1305 | 1305 | | | | date: Thu Jan 01 00:00:32 1970 +0000 |
|
1306 | 1306 | | | | summary: (32) expand |
|
1307 | 1307 | | | | |
|
1308 | 1308 | |
|
1309 | 1309 | Point out a common and an uncommon unshown parent |
|
1310 | 1310 | |
|
1311 | 1311 | $ hg glog -r 'rev(8) or rev(9)' |
|
1312 | 1312 | o changeset: 9:7010c0af0a35 |
|
1313 | 1313 | |\ parent: 7:b632bb1b1224 |
|
1314 | 1314 | | | parent: 8:7a0b11f71937 |
|
1315 | 1315 | | | user: test |
|
1316 | 1316 | | | date: Thu Jan 01 00:00:09 1970 +0000 |
|
1317 | 1317 | | | summary: (9) expand |
|
1318 | 1318 | | | |
|
1319 | 1319 | o | changeset: 8:7a0b11f71937 |
|
1320 | 1320 | |\| parent: 0:e6eb3150255d |
|
1321 | 1321 | | | parent: 7:b632bb1b1224 |
|
1322 | 1322 | | | user: test |
|
1323 | 1323 | | | date: Thu Jan 01 00:00:08 1970 +0000 |
|
1324 | 1324 | | | summary: (8) merge two known; one immediate left, one far right |
|
1325 | 1325 | | | |
|
1326 | 1326 | |
|
1327 | 1327 | File + limit + -ra:b, b < tip: |
|
1328 | 1328 | |
|
1329 | 1329 | $ hg glog -l1 -r32:34 a |
|
1330 | 1330 | o changeset: 34:fea3ac5810e0 |
|
1331 | 1331 | | parent: 32:d06dffa21a31 |
|
1332 | 1332 | | user: test |
|
1333 | 1333 | | date: Thu Jan 01 00:00:34 1970 +0000 |
|
1334 | 1334 | | summary: (34) head |
|
1335 | 1335 | | |
|
1336 | 1336 | |
|
1337 | 1337 | file(File) + limit + -ra:b, b < tip: |
|
1338 | 1338 | |
|
1339 | 1339 | $ hg glog -l1 -r32:34 -r 'file("a")' |
|
1340 | 1340 | o changeset: 34:fea3ac5810e0 |
|
1341 | 1341 | | parent: 32:d06dffa21a31 |
|
1342 | 1342 | | user: test |
|
1343 | 1343 | | date: Thu Jan 01 00:00:34 1970 +0000 |
|
1344 | 1344 | | summary: (34) head |
|
1345 | 1345 | | |
|
1346 | 1346 | |
|
1347 | 1347 | limit(file(File) and a::b), b < tip: |
|
1348 | 1348 | |
|
1349 | 1349 | $ hg glog -r 'limit(file("a") and 32::34, 1)' |
|
1350 | 1350 | o changeset: 32:d06dffa21a31 |
|
1351 | 1351 | |\ parent: 27:886ed638191b |
|
1352 | 1352 | | | parent: 31:621d83e11f67 |
|
1353 | 1353 | | | user: test |
|
1354 | 1354 | | | date: Thu Jan 01 00:00:32 1970 +0000 |
|
1355 | 1355 | | | summary: (32) expand |
|
1356 | 1356 | | | |
|
1357 | 1357 | |
|
1358 | 1358 | File + limit + -ra:b, b < tip: |
|
1359 | 1359 | |
|
1360 | 1360 | $ hg glog -r 'limit(file("a") and 34::32, 1)' |
|
1361 | 1361 | |
|
1362 | 1362 | File + limit + -ra:b, b < tip, (b - a) < limit: |
|
1363 | 1363 | |
|
1364 | 1364 | $ hg glog -l10 -r33:34 a |
|
1365 | 1365 | o changeset: 34:fea3ac5810e0 |
|
1366 | 1366 | | parent: 32:d06dffa21a31 |
|
1367 | 1367 | | user: test |
|
1368 | 1368 | | date: Thu Jan 01 00:00:34 1970 +0000 |
|
1369 | 1369 | | summary: (34) head |
|
1370 | 1370 | | |
|
1371 | 1371 | | o changeset: 33:68608f5145f9 |
|
1372 | 1372 | | | parent: 18:1aa84d96232a |
|
1373 | 1373 | | | user: test |
|
1374 | 1374 | | | date: Thu Jan 01 00:00:33 1970 +0000 |
|
1375 | 1375 | | | summary: (33) head |
|
1376 | 1376 | | | |
|
1377 | 1377 | |
|
1378 | 1378 | Do not crash or produce strange graphs if history is buggy |
|
1379 | 1379 | |
|
1380 | 1380 | $ hg branch branch |
|
1381 | 1381 | marked working directory as branch branch |
|
1382 | 1382 | (branches are permanent and global, did you want a bookmark?) |
|
1383 | 1383 | $ commit 36 "buggy merge: identical parents" 35 35 |
|
1384 | 1384 | $ hg glog -l5 |
|
1385 | 1385 | @ changeset: 36:08a19a744424 |
|
1386 | 1386 | | branch: branch |
|
1387 | 1387 | | tag: tip |
|
1388 | 1388 | | parent: 35:9159c3644c5e |
|
1389 | 1389 | | parent: 35:9159c3644c5e |
|
1390 | 1390 | | user: test |
|
1391 | 1391 | | date: Thu Jan 01 00:00:36 1970 +0000 |
|
1392 | 1392 | | summary: (36) buggy merge: identical parents |
|
1393 | 1393 | | |
|
1394 | 1394 | o changeset: 35:9159c3644c5e |
|
1395 | 1395 | | user: test |
|
1396 | 1396 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1397 | 1397 | | summary: 0 |
|
1398 | 1398 | | |
|
1399 | 1399 | o changeset: 34:fea3ac5810e0 |
|
1400 | 1400 | | parent: 32:d06dffa21a31 |
|
1401 | 1401 | | user: test |
|
1402 | 1402 | | date: Thu Jan 01 00:00:34 1970 +0000 |
|
1403 | 1403 | | summary: (34) head |
|
1404 | 1404 | | |
|
1405 | 1405 | | o changeset: 33:68608f5145f9 |
|
1406 | 1406 | | | parent: 18:1aa84d96232a |
|
1407 | 1407 | | | user: test |
|
1408 | 1408 | | | date: Thu Jan 01 00:00:33 1970 +0000 |
|
1409 | 1409 | | | summary: (33) head |
|
1410 | 1410 | | | |
|
1411 | 1411 | o | changeset: 32:d06dffa21a31 |
|
1412 | 1412 | |\ \ parent: 27:886ed638191b |
|
1413 | 1413 | | | | parent: 31:621d83e11f67 |
|
1414 | 1414 | | | | user: test |
|
1415 | 1415 | | | | date: Thu Jan 01 00:00:32 1970 +0000 |
|
1416 | 1416 | | | | summary: (32) expand |
|
1417 | 1417 | | | | |
|
1418 | 1418 | |
|
1419 | 1419 | Test log -G options |
|
1420 | 1420 | |
|
1421 | 1421 | $ testlog() { |
|
1422 | 1422 | > hg log -G --print-revset "$@" |
|
1423 | 1423 | > hg log --template 'nodetag {rev}\n' "$@" | grep nodetag \ |
|
1424 | 1424 | > | sed 's/.*nodetag/nodetag/' > log.nodes |
|
1425 | 1425 | > hg log -G --template 'nodetag {rev}\n' "$@" | grep nodetag \ |
|
1426 | 1426 | > | sed 's/.*nodetag/nodetag/' > glog.nodes |
|
1427 | 1427 | > diff -u log.nodes glog.nodes |
|
1428 | 1428 | > } |
|
1429 | 1429 | |
|
1430 | 1430 | glog always reorders nodes which explains the difference with log |
|
1431 | 1431 | |
|
1432 | 1432 | $ testlog -r 27 -r 25 -r 21 -r 34 -r 32 -r 31 |
|
1433 | 1433 | ('group', ('group', ('or', ('or', ('or', ('or', ('or', ('symbol', '27'), ('symbol', '25')), ('symbol', '21')), ('symbol', '34')), ('symbol', '32')), ('symbol', '31')))) |
|
1434 | 1434 | --- log.nodes * (glob) |
|
1435 | 1435 | +++ glog.nodes * (glob) |
|
1436 | 1436 | @@ -1,6 +1,6 @@ |
|
1437 | 1437 | -nodetag 27 |
|
1438 | 1438 | -nodetag 25 |
|
1439 | 1439 | -nodetag 21 |
|
1440 | 1440 | nodetag 34 |
|
1441 | 1441 | nodetag 32 |
|
1442 | 1442 | nodetag 31 |
|
1443 | 1443 | +nodetag 27 |
|
1444 | 1444 | +nodetag 25 |
|
1445 | 1445 | +nodetag 21 |
|
1446 | 1446 | [1] |
|
1447 | 1447 | $ testlog -u test -u not-a-user |
|
1448 | 1448 | ('group', ('group', ('or', ('func', ('symbol', 'user'), ('string', 'test')), ('func', ('symbol', 'user'), ('string', 'not-a-user'))))) |
|
1449 | 1449 | $ testlog -b not-a-branch |
|
1450 | 1450 | ('group', ('group', ('func', ('symbol', 'branch'), ('string', 'not-a-branch')))) |
|
1451 | 1451 | abort: unknown revision 'not-a-branch'! |
|
1452 | 1452 | abort: unknown revision 'not-a-branch'! |
|
1453 | 1453 | $ testlog -b default -b branch --only-branch branch |
|
1454 | 1454 | ('group', ('group', ('or', ('or', ('func', ('symbol', 'branch'), ('string', 'default')), ('func', ('symbol', 'branch'), ('string', 'branch'))), ('func', ('symbol', 'branch'), ('string', 'branch'))))) |
|
1455 | 1455 | $ testlog -k expand -k merge |
|
1456 | 1456 | ('group', ('group', ('or', ('func', ('symbol', 'keyword'), ('string', 'expand')), ('func', ('symbol', 'keyword'), ('string', 'merge'))))) |
|
1457 | 1457 | $ hg log -G --follow --template 'nodetag {rev}\n' | grep nodetag | wc -l |
|
1458 | 1458 | \s*36 (re) |
|
1459 | 1459 | $ hg log -G --removed --template 'nodetag {rev}\n' | grep nodetag | wc -l |
|
1460 | 1460 | \s*0 (re) |
|
1461 | 1461 | $ hg log -G --only-merges --template 'nodetag {rev}\n' | grep nodetag | wc -l |
|
1462 | 1462 | \s*28 (re) |
|
1463 | 1463 | $ hg log -G --no-merges --template 'nodetag {rev}\n' |
|
1464 | 1464 | o nodetag 35 |
|
1465 | 1465 | | |
|
1466 | 1466 | o nodetag 34 |
|
1467 | 1467 | |\ |
|
1468 | 1468 | | \ |
|
1469 | 1469 | | |\ |
|
1470 | 1470 | | | \ |
|
1471 | 1471 | | | |\ |
|
1472 | 1472 | | | | \ |
|
1473 | 1473 | | | | |\ |
|
1474 | 1474 | | | | | \ |
|
1475 | 1475 | | | | | |\ |
|
1476 | 1476 | +-+-+-+-----o nodetag 33 |
|
1477 | 1477 | | | | | | | |
|
1478 | 1478 | +---------o nodetag 29 |
|
1479 | 1479 | | | | | | |
|
1480 | 1480 | +-+-+---o nodetag 27 |
|
1481 | 1481 | | | | |/ |
|
1482 | 1482 | | | | o nodetag 3 |
|
1483 | 1483 | | | |/ |
|
1484 | 1484 | | | o nodetag 2 |
|
1485 | 1485 | | |/ |
|
1486 | 1486 | | o nodetag 1 |
|
1487 | 1487 | |/ |
|
1488 | 1488 | o nodetag 0 |
|
1489 | 1489 | |
|
1490 | 1490 | $ hg log -G -d 'brace ) in a date' |
|
1491 | 1491 | abort: invalid date: 'brace ) in a date' |
|
1492 | 1492 | [255] |
|
1493 | 1493 | $ hg log -G -P 32 --template '{rev}\n' |
|
1494 | 1494 | @ 36 |
|
1495 | 1495 | | |
|
1496 | 1496 | o 35 |
|
1497 | 1497 | | |
|
1498 | 1498 | o 34 |
|
1499 | 1499 | | |
|
1500 | 1500 | | o 33 |
|
1501 | 1501 | | | |
|
1502 | 1502 | $ hg log -G --follow a |
|
1503 | 1503 | abort: -G/--graph option is incompatible with --follow with file argument |
|
1504 | 1504 | [255] |
|
1505 | 1505 | |
|
1506 | 1506 | |
|
1507 | 1507 | Dedicated repo for --follow and paths filtering |
|
1508 | 1508 | |
|
1509 | 1509 | $ cd .. |
|
1510 | 1510 | $ hg init follow |
|
1511 | 1511 | $ cd follow |
|
1512 | 1512 | $ echo a > a |
|
1513 | $ echo aa > aa | |
|
1513 | 1514 | $ hg ci -Am "add a" |
|
1514 | 1515 | adding a |
|
1516 | adding aa | |
|
1515 | 1517 | $ hg cp a b |
|
1516 | 1518 | $ hg ci -m "copy a b" |
|
1517 | 1519 | $ mkdir dir |
|
1518 | 1520 | $ hg mv b dir |
|
1519 | 1521 | $ hg ci -m "mv b dir/b" |
|
1520 | 1522 | $ hg mv a b |
|
1521 | 1523 | $ echo a > d |
|
1522 | 1524 | $ hg add d |
|
1523 | 1525 | $ hg ci -m "mv a b; add d" |
|
1524 | 1526 | $ hg mv dir/b e |
|
1525 | 1527 | $ hg ci -m "mv dir/b e" |
|
1526 | 1528 | $ hg glog --template '({rev}) {desc|firstline}\n' |
|
1527 | 1529 | @ (4) mv dir/b e |
|
1528 | 1530 | | |
|
1529 | 1531 | o (3) mv a b; add d |
|
1530 | 1532 | | |
|
1531 | 1533 | o (2) mv b dir/b |
|
1532 | 1534 | | |
|
1533 | 1535 | o (1) copy a b |
|
1534 | 1536 | | |
|
1535 | 1537 | o (0) add a |
|
1536 | 1538 | |
|
1537 | 1539 | |
|
1538 | 1540 | $ testlog a |
|
1539 | 1541 | ('group', ('group', ('func', ('symbol', 'filelog'), ('string', 'a')))) |
|
1540 | 1542 | $ testlog a b |
|
1541 | 1543 | ('group', ('group', ('or', ('func', ('symbol', 'filelog'), ('string', 'a')), ('func', ('symbol', 'filelog'), ('string', 'b'))))) |
|
1542 | 1544 | |
|
1543 | 1545 | Test falling back to slow path for non-existing files |
|
1544 | 1546 | |
|
1545 | 1547 | $ testlog a c |
|
1546 | 1548 | ('group', ('group', ('func', ('symbol', '_matchfiles'), ('list', ('string', 'p:a'), ('string', 'p:c'))))) |
|
1547 | 1549 | |
|
1548 | 1550 | Test multiple --include/--exclude/paths |
|
1549 | 1551 | |
|
1550 | 1552 | $ testlog --include a --include e --exclude b --exclude e a e |
|
1551 | 1553 | ('group', ('group', ('func', ('symbol', '_matchfiles'), ('list', ('list', ('list', ('list', ('list', ('string', 'p:a'), ('string', 'p:e')), ('string', 'i:a')), ('string', 'i:e')), ('string', 'x:b')), ('string', 'x:e'))))) |
|
1554 | ||
|
1555 | Test glob expansion of pats | |
|
1556 | ||
|
1557 | $ expandglobs=`python -c "import mercurial.util; \ | |
|
1558 | > print mercurial.util.expandglobs and 'true' or 'false'"` | |
|
1559 | $ if [ $expandglobs = "true" ]; then | |
|
1560 | > testlog 'a*'; | |
|
1561 | > else | |
|
1562 | > testlog a*; | |
|
1563 | > fi; | |
|
1564 | ('group', ('group', ('func', ('symbol', 'filelog'), ('string', 'aa')))) |
General Comments 0
You need to be logged in to leave comments.
Login now