view hgext/children.py @ 17598:b7302d65006c stable

largefiles: restore normal 'clone -u' and 'clone -U' functionality Previously, tip would be checked out regardless of the -u or -U parameter. I'm not sure what the 'required for successful walkchangerevs' comment meant, but it appears to reference code which has since moved to downloadlfiles() in 7d6a660ca151. Perhaps it was to force caching when the -U parameter is given? The price of this change is that -U --all-largefiles won't cache anything. That will be fixed next. Note that X + Y in the 'X largefiles updated, n removed' and 'Y additional largefiles cached' lines do not add up to the same values in these tests, but all of the largefiles have been downloaded. The reason being that several largefiles have the same content (eb7338044 is pointed to by sub/large2, large3 and sub/large4). In the 'clone -u 1' operation, this largefile is cached to populate the working directory, even without --all-largefiles. That means the file isn't downloaded again and cached in the rev where large3 and sub/large4 both point to this file. Downloading that one file in that one rev seems to be counted twice with 'clone -u 0'. (Maybe it is also being downloaded twice?)
author Matt Harbison <matt_harbison@yahoo.com>
date Sat, 08 Sep 2012 13:31:06 -0400
parents 38caf405d010
children 434e5bd615fc
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 or any later version.

'''command to display child changesets (DEPRECATED)

This extension is deprecated. You should use :hg:`log -r
"children(REV)"` instead.
'''

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

testedwith = 'internal'

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)
    displayer.close()

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