[PATCH] subrepo: pull subrepos recursively, and support pull from clones (issue2024)

Martin Geisler mg at lazybytes.net
Mon Jul 12 13:26:05 CDT 2010


Pradeepkumar Gayam <in3xes at gmail.com> writes:

> # HG changeset patch
> # User Pradeepkumar Gayam <in3xes at gmail.com>
> # Date 1278801299 -19800
> # Node ID ed3ea5d08f64b0b4ea94353ca42cfa6f07e8f38f
> # Parent  f4eddec324b755a45ea71570c7c8dc63bcbdfc1a
> subrepo: pull subrepos recursively, and support pull from clones (issue2024)
>
> diff -r f4eddec324b7 -r ed3ea5d08f64 mercurial/commands.py
> --- a/mercurial/commands.py	Fri Jul 09 14:21:45 2010 +0200
> +++ b/mercurial/commands.py	Sun Jul 11 04:04:59 2010 +0530
> @@ -2798,6 +2798,19 @@
>              raise util.Abort(err)
>  
>      modheads = repo.pull(other, heads=revs, force=opts.get('force'))
> +
> +    if opts.get('subrepo'):
> +        c = repo[repo.changelog.node(len(repo)-1)]

I guess this means that you suggest we pull all the subrepositories
present in tip? Would it not be more logical to pull those present in
the current working directory?

That way, I can do

  hg pull --subrepos

when I want to update all subrepositories in my working copy to their
newest version.

> +        if '.hgsubstate' in c.manifest():
> +            subrepos = c.substate
> +            for s in sorted(subrepos):
> +                try:
> +                    c.sub(s).pull(opts.get('force'), source)
> +                except:
> +                    pass
> +        else:
> +            ui.status(_('No subrepos present'))

We don't capitalize such messages.

-- 
Martin Geisler

Mercurial links: http://mercurial.ch/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20100712/8b5909d8/attachment.pgp>


More information about the Mercurial-devel mailing list