Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a children command to complement the parents command?

Tags:

dvcs

mercurial

Mercurial provides the command parents to examine a given revision's parent(s). This can easily be used to Traverse the DAG backward. I need to traverse the DAG forward. Is there a hg children command?

like image 263
deft_code Avatar asked Oct 19 '10 19:10

deft_code


2 Answers

If you're using Mercurial 1.6 or later, there is a built-in functional language for specifying sets of revisions; see hg help revsets for full details.

In your case, you would use

hg log -r "children(XXX)"

to show immediate children of revision XXX, or

hg log -r "descendants(XXX)"

to show all changesets with XXX as an ancestor.

like image 82
Niall C. Avatar answered Nov 15 '22 11:11

Niall C.


Use the bundled children extension. hg help children (1.5):

hg children [-r REV] [FILE]

show the children of the given or working directory revision

    Print the children of the working directory's revisions. If a revision is
    given via -r/--rev, the children of that revision will be printed. If a
    file argument is given, revision in which the file was last changed (after
    the working directory revision or the argument to --rev if given) is
    printed.

options:

 -r --rev       show children of the specified revision
    --style     display using template map file
    --template  display with template
like image 34
Geoffrey Zheng Avatar answered Nov 15 '22 11:11

Geoffrey Zheng