##// END OF EJS Templates
children: mark extension as deprecated
Augie Fackler -
r16668:f393d20f default
parent child Browse files
Show More
@@ -1,45 +1,49 b''
1 # Mercurial extension to provide the 'hg children' command
1 # Mercurial extension to provide the 'hg children' command
2 #
2 #
3 # Copyright 2007 by Intevation GmbH <intevation@intevation.de>
3 # Copyright 2007 by Intevation GmbH <intevation@intevation.de>
4 #
4 #
5 # Author(s):
5 # Author(s):
6 # Thomas Arendsen Hein <thomas@intevation.de>
6 # Thomas Arendsen Hein <thomas@intevation.de>
7 #
7 #
8 # This software may be used and distributed according to the terms of the
8 # This software may be used and distributed according to the terms of the
9 # GNU General Public License version 2 or any later version.
9 # GNU General Public License version 2 or any later version.
10
10
11 '''command to display child changesets'''
11 '''command to display child changesets (DEPRECATED)
12
13 This extension is deprecated. You should use `hg log -r "children($revision)"`
14 instead.
15 '''
12
16
13 from mercurial import cmdutil
17 from mercurial import cmdutil
14 from mercurial.commands import templateopts
18 from mercurial.commands import templateopts
15 from mercurial.i18n import _
19 from mercurial.i18n import _
16
20
17
21
18 def children(ui, repo, file_=None, **opts):
22 def children(ui, repo, file_=None, **opts):
19 """show the children of the given or working directory revision
23 """show the children of the given or working directory revision
20
24
21 Print the children of the working directory's revisions. If a
25 Print the children of the working directory's revisions. If a
22 revision is given via -r/--rev, the children of that revision will
26 revision is given via -r/--rev, the children of that revision will
23 be printed. If a file argument is given, revision in which the
27 be printed. If a file argument is given, revision in which the
24 file was last changed (after the working directory revision or the
28 file was last changed (after the working directory revision or the
25 argument to --rev if given) is printed.
29 argument to --rev if given) is printed.
26 """
30 """
27 rev = opts.get('rev')
31 rev = opts.get('rev')
28 if file_:
32 if file_:
29 ctx = repo.filectx(file_, changeid=rev)
33 ctx = repo.filectx(file_, changeid=rev)
30 else:
34 else:
31 ctx = repo[rev]
35 ctx = repo[rev]
32
36
33 displayer = cmdutil.show_changeset(ui, repo, opts)
37 displayer = cmdutil.show_changeset(ui, repo, opts)
34 for cctx in ctx.children():
38 for cctx in ctx.children():
35 displayer.show(cctx)
39 displayer.show(cctx)
36 displayer.close()
40 displayer.close()
37
41
38 cmdtable = {
42 cmdtable = {
39 "children":
43 "children":
40 (children,
44 (children,
41 [('r', 'rev', '',
45 [('r', 'rev', '',
42 _('show children of the specified revision'), _('REV')),
46 _('show children of the specified revision'), _('REV')),
43 ] + templateopts,
47 ] + templateopts,
44 _('hg children [-r REV] [FILE]')),
48 _('hg children [-r REV] [FILE]')),
45 }
49 }
General Comments 0
You need to be logged in to leave comments. Login now