Force pull from subrepos

Mina R Waheeb syncer at gmail.com
Wed Jul 15 15:02:28 CDT 2009


Here is an my workflow:

cd toplevel
hg init
hg convert http://svn.myserver/somerepo subrepo
echo subrepo = subrepo > .hgsub
hg add .hgsub
cd subrepo
hg update # now we have the lastest tip from the converted repo (mirror,
read only)
cd ..
hg commit # now the .hgsubstate contains a specific version of the subrepo
hg update null

## The above commands i used to set up the main repo which everyone push to
it

## do normal clone in a dev machine
hg clone http://hg.myserver/toplevel # Now i have a copy

## I have cron job incrementally update the hg mirror daily
cd /path/to/toplevel/
hg convert http://svn.myserver/somerepo subrepo ## pull the svn updates from
the SVN server

## Now i go back to the cloned repo
hg pull # I got no changes because .hgsubstate is pointed to a specific
version
## then i have to do
cd subrepo # and add the default push url
hg pull
cd ..
hg commit # this will change the .hgsubstate to the current version in the
local copy

I know the above is designed functionally for the subrepo, but I just need
pull from all the subrepo (the tip) not pull the current version in the
.hgsubstate, because not every independently commit i do in subrepo i have
to do changeset for it in the toplevel repo!

What i said about the entry (idea) in .hgsubstate, when it fullzeros always
pull the tip.
(0000000000000000000000000000000000000000   my/subrepo)

Thanks,
Mina R Waheeb

On Wed, Jul 15, 2009 at 7:32 PM, Matt Mackall <mpm at selenic.com> wrote:

> On Tue, 2009-07-14 at 22:04 +0000, Mina R Waheeb wrote:
> > Hi, I have setup main repo contains subrepo created by convert
> > extension from SVN repo, Its read only and always synced by cron job
> > on the server side. I need to pull the synced changes in the cloned
> > repo (client repo) but .hgsubstate contains a specific version which
> > prevent me from pull the synced updates and makes me add a default URL
> > for each sub repo and pull each one alone. my question is there is any
> > way to force pull from subrepos?
>
> I might have some hope of understanding this with an example.
>
> As detailed in the documentation, subrepos are only pulled when
> necessary. That means pull on happens in a subrepo when we attempt to
> *update* a subrepo to a revision we don't have locally. Nothing at all
> happens with suprepos when you *pull* at the top level.
>
> > my scenario is very similar to SVN externals and i think its very
> > common.
>
> Not surprisingly, Mercurial is different from SVN here: SVN has no
> notion of pushing a pulling.
>
> > Also i have an idea when .hgsubstate contains
> > (0000000000000000000000000000000000000000   my/subrepo) then hg always
> > pull the tip
>
> Again, I have no idea what this means.
>
> When we pull in a subrepo, we always do a full pull.
>
> --
> http://selenic.com : development and support for Mercurial and Linux
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://selenic.com/pipermail/mercurial/attachments/20090715/56984b59/attachment.htm 


More information about the Mercurial mailing list