Recursive pull on subrepos

Andreas Reichel andreas at manticore-projects.com
Fri Sep 2 21:21:56 CDT 2011


Dear All,

syncing between bitbucket and various laptops and computers I have one
top-repository REPO_A which just links in several SUBREPO_1 to
SUBREPO_20.
The reason is some of the SUBREPOs are public, others are private:

are at opteron ~/data/src $ cat .hgsub
Broker = ssh://hg@bitbucket.org/manticoretrader/broker
ChartExport = ssh://hg@bitbucket.org/manticoretrader/chartexport
Foundation = ssh://hg@bitbucket.org/manticoretrader/foundation
HttpHelpers = ssh://hg@bitbucket.org/manticoretrader/httphelpers
InvestmentReport =
ssh://hg@bitbucket.org/manticoretrader/investmentreport
PositionBuilder = ssh://hg@bitbucket.org/manticoretrader/positionbuilder
QuotesDB = ssh://hg@bitbucket.org/manticoretrader/quotesdb
SwingUI = ssh://hg@bitbucket.org/manticoretrader/swingui
Trader = ssh://hg@bitbucket.org/manticoretrader/trader
TradingSystem = ssh://hg@bitbucket.org/manticoretrader/tradingsystem
Utilities = ssh://hg@bitbucket.org/manticoretrader/utilities
WebsiteParser = ssh://hg@bitbucket.org/manticoretrader/websiteparser
UncrustifyGUI = ssh://hg@bitbucket.org/manticoretrader/uncrustifygui
CashFlowEngine = ssh://hg@bitbucket.org/manticoretrader/cashflowengine
CashFlowApplication =
ssh://hg@bitbucket.org/manticoretrader/cashflowapplication
website = ssh://hg@bitbucket.org/manticoretrader/website
website_manticore =
ssh://hg@bitbucket.org/manticoretrader/website_manticore
ETLTools = ssh://hg@bitbucket.org/manticoretrader/etltools

REPO_A changes only, when adding another SUBREPO. Also I work on many
SUBREPOs in parallel. So I would like to synchronize all the SUBREPOs
quite often. While "hg push" works very well, "hg pull" does not work
recursively. To ease the pain I wrote a script like:

#!/bin/bash
while read LINE
do
	DEST=`echo $LINE | cut -d '=' -f 1 | sed 's/^ *//;s/ *$//'`
	REPO=`echo $LINE | cut -d '=' -f 2 | sed 's/^ *//;s/ *$//'`
	
	hg pull -u --cwd $DEST $REPO
done < .hgsub


and I wonder if this could be integrated into the mercurial directly. I
understand there are reasons, when you do not like to pull the SUBREPOs
(well, honestly I do not -- but I can accept of course) but please
understand there are also situations where you like to pull all SUBREPOs
and it is a lot of overhead to pull 20 SUBREPOs manually.

At least any kind of extension would be great!

Thank you and best regards!
Andreas




More information about the Mercurial-devel mailing list