view hgext/children.py @ 9855:f47c0881b16e

inotify: Do not access inotify when dirstate is dirty (issue1811) Original patch was provided by Simon Heimberg It delegates dirstate computation to dirstate.status when dirstate is dirty: better be slow from time to time instead of using wrong data. This solves issue1719. As the last component, issue1810, is still not solved, test-inotify-dirty-dirstate will fail for now. It emphasizes a regression due to 7c01599dd340: changeset: 9515:7c01599dd340 user: Nicolas Dumazet <nicdumz.commits@gmail.com> date: Sun Aug 16 11:11:37 2009 +0900 summary: inotify: use cmdutil.service instead of local daemonizing code Ancestors of 7c01599dd30 are passing the test, when applied this patch. Regression has to be investigated, but this patch is important since it affects often mq operations.
author Nicolas Dumazet <nicdumz.commits@gmail.com>
date Wed, 11 Nov 2009 14:38:59 +0900
parents d6d811d90976
children 56284451a22c 25e572394f5c
line wrap: on
line source

# Mercurial extension to provide the 'hg children' command
#
# Copyright 2007 by Intevation GmbH <intevation@intevation.de>
#
# Author(s):
# Thomas Arendsen Hein <thomas@intevation.de>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2, incorporated herein by reference.

'''command to display child changesets'''

from mercurial import cmdutil
from mercurial.commands import templateopts
from mercurial.i18n import _


def children(ui, repo, file_=None, **opts):
    """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.
    """
    rev = opts.get('rev')
    if file_:
        ctx = repo.filectx(file_, changeid=rev)
    else:
        ctx = repo[rev]

    displayer = cmdutil.show_changeset(ui, repo, opts)
    for cctx in ctx.children():
        displayer.show(cctx)


cmdtable = {
    "children":
        (children,
         [('r', 'rev', '', _('show children of the specified revision')),
         ] + templateopts,
         _('hg children [-r REV] [FILE]')),
}