Show More
@@ -1,69 +1,69 b'' | |||
|
1 | 1 | # Mercurial extension to provide the 'hg children' command |
|
2 | 2 | # |
|
3 | 3 | # Copyright 2007 by Intevation GmbH <intevation@intevation.de> |
|
4 | 4 | # |
|
5 | 5 | # Author(s): |
|
6 | 6 | # Thomas Arendsen Hein <thomas@intevation.de> |
|
7 | 7 | # |
|
8 | 8 | # This software may be used and distributed according to the terms of the |
|
9 | 9 | # GNU General Public License version 2 or any later version. |
|
10 | 10 | |
|
11 | 11 | '''command to display child changesets (DEPRECATED) |
|
12 | 12 | |
|
13 | 13 | This extension is deprecated. You should use :hg:`log -r |
|
14 | 14 | "children(REV)"` instead. |
|
15 | 15 | ''' |
|
16 | 16 | |
|
17 | 17 | from __future__ import absolute_import |
|
18 | 18 | |
|
19 | 19 | from mercurial.i18n import _ |
|
20 | 20 | from mercurial import ( |
|
21 | 21 | cmdutil, |
|
22 | 22 | commands, |
|
23 | 23 | ) |
|
24 | 24 | |
|
25 | 25 | templateopts = commands.templateopts |
|
26 | 26 | |
|
27 | 27 | cmdtable = {} |
|
28 | 28 | command = cmdutil.command(cmdtable) |
|
29 | 29 | # Note for extension authors: ONLY specify testedwith = 'internal' for |
|
30 | 30 | # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should |
|
31 | 31 | # be specifying the version(s) of Mercurial they are tested with, or |
|
32 | 32 | # leave the attribute unspecified. |
|
33 | 33 | testedwith = 'internal' |
|
34 | 34 | |
|
35 | 35 | @command('children', |
|
36 | 36 | [('r', 'rev', '', |
|
37 | 37 | _('show children of the specified revision'), _('REV')), |
|
38 | 38 | ] + templateopts, |
|
39 | 39 | _('hg children [-r REV] [FILE]'), |
|
40 | 40 | inferrepo=True) |
|
41 | 41 | def children(ui, repo, file_=None, **opts): |
|
42 | 42 | """show the children of the given or working directory revision |
|
43 | 43 | |
|
44 | 44 | Print the children of the working directory's revisions. If a |
|
45 | 45 | revision is given via -r/--rev, the children of that revision will |
|
46 | 46 | be printed. If a file argument is given, revision in which the |
|
47 | 47 | file was last changed (after the working directory revision or the |
|
48 | 48 | argument to --rev if given) is printed. |
|
49 | 49 | |
|
50 | 50 | Please use :hg:`log` instead:: |
|
51 | 51 | |
|
52 |
hg children => hg log -r |
|
|
53 |
hg children -r REV => hg log -r |
|
|
52 | hg children => hg log -r "children()" | |
|
53 | hg children -r REV => hg log -r "children(REV)" | |
|
54 | 54 | |
|
55 | 55 | See :hg:`help log` and :hg:`help revsets.children`. |
|
56 | 56 | |
|
57 | 57 | """ |
|
58 | 58 | rev = opts.get('rev') |
|
59 | 59 | if file_: |
|
60 | 60 | fctx = repo.filectx(file_, changeid=rev) |
|
61 | 61 | childctxs = [fcctx.changectx() for fcctx in fctx.children()] |
|
62 | 62 | else: |
|
63 | 63 | ctx = repo[rev] |
|
64 | 64 | childctxs = ctx.children() |
|
65 | 65 | |
|
66 | 66 | displayer = cmdutil.show_changeset(ui, repo, opts) |
|
67 | 67 | for cctx in childctxs: |
|
68 | 68 | displayer.show(cctx) |
|
69 | 69 | displayer.close() |
General Comments 0
You need to be logged in to leave comments.
Login now