Skip to main content

Execute the same Mercurial command in many repositories.

1 Example

Imagine 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 commit

and even:

hg alldirs commit -m "Documentation updates"
# Commit in all three repos
hg alldirs push bb
# … and pushes them all

Relative 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.py

Note that alldirs does not require any kind of parent repository.

In case you are already inside some repo, command is executed on it, so alld does not matter:

cd ~/src/libs/net/aaa
hg status
hg alld status
# … Both do the same

2 Failure handling

In case given command is not known (hg alldirs badcommand), or got invalid options (hg alldirs log -s), error is reported immediately and processing stops.

In case given commands fails during execution (hg alldirs pull nosuchalias), alldirs executes the command in every repo (doesn’t stop). After finishing the job, it summarizes list of repositories in which the command failed.

In both cases whole command returns exit status signalling an error.

3 Installation

3.1 Linux/Unix (from PyPI)

If you have working pip or easy_install:

pip install --user mercurial_all_dirs

or maybe:

sudo pip install mercurial_all_dirs

(or use easy_install instead of pip). Then activate by:

[extensions]
mercurial_all_dirs =

To upgrade, repeat the same command with --upgrade option, for example:

pip install --user --upgrade mercurial_all_dirs

3.2 Linux/Unix (from source)

If you don’t have pip, or wish to follow development more closely:

  • clone both this repository and mercurial_extension_utils and 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.py

To upgrade, pull and update.

See mercurial_extension_utils for longer description of this kind of installation.

3.3 Windows

If you have any Python installed, you may install with pip:

pip install mercurial_all_dirs

Still, as Mercurial (whether taken from TortoiseHg, 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 it

To upgrade to new version:

pip --upgrade mercurial_all_dirs

If 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 cloned

See mercurial_extension_utils documentation for more details on Windows installation.

5 History

See HISTORY.rst

6 Repository, bug reports, enhancement suggestions

Development is tracked on HeptaPod, see https://foss.heptapod.net/mercurial/mercurial-all_dirs/

Use issue tracker there for bug reports and enhancement suggestions.

Thanks to Octobus and Clever Cloud for hosting this service.

7 Tests

Tests can be run by:

cram -v tests/*.t

(against current mercurial) or:

tox

(against various versions).

8 Additional notes

Information about this extension is also available on Mercurial Wiki: http://mercurial.selenic.com/wiki/AllDirsExtension

Check also other Mercurial extensions I wrote.

Metadata

Release files for mercurial-all-dirs 1.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mercurial-all-dirs 1.1.4
File Size Uploaded
mercurial_all_dirs-1.1.4.tar.gz 13.0 kB Details

Release files / mercurial_all_dirs-1.1.4.tar.gz

Download URL mercurial_all_dirs-1.1.4.tar.gz
Size 13.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c6b7d1f6867f5d10e46fbef2d4d5ad66bca8e55f1617993daa2750485c8d07b3
BLAKE2b-256 checksum
How to use checksums
c57636a2101dba4940d648c26c3ebc575095b4d8ab97159893553bf32b0d5d28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

1.1.4 This release

1 release file

1.1.3

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

0.6.4

1 release file

0.6.3

1 release file

0.6.2

1 release file

0.6.1

1 release file

0.6.0

1 release file

0.5.0

1 release file

0.4.2

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page