Package: mercurial_all_dirs
Execute the same Mercurial command in many repositories.1Example2Failure handling3Installation3.1Linux/Unix (from PyPI)3.2Linux/Unix (from source)3.3Windows4Related extensions5History6Repository, bug reports, enhancement suggestions7Tests8Additional notes1ExampleImagine you have Mercurial repositories in~/src/libs/acme,~/src/libs/net/aaa, and~/src/libs/net/bbb. Then:cd ~/src/libs
hg alldirs status
# … shows status in all three repos
hg alldirs heads -t
# … and heads
hg alldirs log -l 2
# … and recent commitand even:hg alldirs commit -m "Documentation updates"
# Commit in all three repos
hg alldirs push bb
# … and pushes them allRelative file names are resolved against given repo root (the
command chdirs to every repo before actually executing it):hg alldirs commit -m "Version update" setup.py src/version.pyNoteIn practice I usually shortcut the command and type:hg alld status
# etcNote thatalldirsdoes not require any kind ofparent
repository.In case you are already inside some repo, command is executed on
it, soallddoes not matter:cd ~/src/libs/net/aaa
hg status
hg alld status
# … Both do the same2Failure handlingIn case given command is not known (hg alldirs badcommand), or
got invalid options (hg alldirs log-s), error is reported
immediately and processing stops.NoteTechnically: command name and params are parsed once, before
visiting subdirs.In case given commands fails during execution (hg alldirs pull nosuchalias),alldirsexecutes the command in every repo
(doesn’t stop). After finishing the job, it summarizes list of
repositories in which the command failed.NoteThat is done on purpose, I do not want myhg alld pullto break if some repo lacks default path.In both cases whole command returns exit status signalling
an error.3Installation3.1Linux/Unix (from PyPI)If you have workingpiporeasy_install:pip install --user mercurial_all_dirsor maybe:sudo pip install mercurial_all_dirs(or useeasy_installinstead ofpip). Then activate by:[extensions]
mercurial_all_dirs =To upgrade, repeat the same command with--upgradeoption, for
example:pip install --user --upgrade mercurial_all_dirs3.2Linux/Unix (from source)If you don’t havepip, or wish to follow development more closely:clone both this repository andmercurial_extension_utilsand put
them in the same directory, for example:cd ~/sources
hg clone https://foss.heptapod.net/mercurial/mercurial-extension_utils/
hg clone https://foss.heptapod.net/mercurial/mercurial-all_dirs/update to newest tags,activate by:[extensions]
mercurial_all_dirs = ~/sources/mercurial-all_dirs/mercurial_all_dirs.pyTo upgrade, pull and update.Seemercurial_extension_utilsfor longer description of this kind
of installation.3.3WindowsIf you have any Python installed, you may install withpip:pip install mercurial_all_dirsStill, as Mercurial (whether taken fromTortoiseHg, or own package)
uses it’s own bundled Python, you must activate by specifying the path:[extensions]
mercurial_all_dirs = C:/Python27/Lib/site-packages/mercurial_all_dirs.py
;; Or wherever pip installed itTo upgrade to new version:pip --upgrade mercurial_all_dirsIf you don’t have any Python, clone repositories:cd c:\hgplugins
hg clone https://foss.heptapod.net/mercurial/mercurial-extension_utils/
hg clone https://foss.heptapod.net/mercurial/mercurial-all_dirs/update to tagged versions and activate by path:[extensions]
mercurial_all_dirs = C:/hgplugins/mercurial-all_dirs/mercurial_all_dirs.py
;; Or wherever you clonedSeemercurial_extension_utilsdocumentation for more details on
Windows installation.4Related extensionsThere are a few extensions which support operations on repository
groups -Subrepos Extension,OnSub Extension,Forest
Extension. They all require using parent repository, which defines
the project structure. So, to pull all repos below~/srcyou
musthg init src, create file like.hgsubthere, etc.All Dirs does not require such a parent repo. It just works on
whatever is found on the disk. You decided to keep some repositories
below~/src? Fine, you canhg alld statusthem all.Command syntax also matters. I strongly prefer typing:hg alld pull --updateto typing:hg onsub "hg pull --update"At the same time, All Dirs does not support any kind of declaration
that some repositories are related, group cloning, version
relationship etc. If you are interested in such features, considerSubrepos Extension.5HistorySeeHISTORY.rst6Repository, bug reports, enhancement suggestionsDevelopment is tracked on HeptaPod, seehttps://foss.heptapod.net/mercurial/mercurial-all_dirs/Use issue tracker there for bug reports and enhancement
suggestions.Thanks toOctobusandClever Cloudfor hosting this service.7TestsTests can be run by:cram -v tests/*.t(against current mercurial) or:tox(against various versions).8Additional notesInformation about this extension is also available
on Mercurial Wiki:http://mercurial.selenic.com/wiki/AllDirsExtensionCheck alsoother Mercurial extensions I wrote.