mercurial-all-dirs


Namemercurial-all-dirs JSON
Version 1.1.4 PyPI version JSON
download
home_pagehttps://foss.heptapod.net/mercurial/mercurial-all_dirs
SummaryMercurial All Dirs Extension
upload_time2024-09-25 06:50:54
maintainerNone
docs_urlNone
authorMarcin Kasperski
requires_pythonNone
licenseBSD
keywords mercurial subdirs multi alias
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. -*- mode: rst; compile-command: "rst2html README.rst README.html" -*-

====================================
Mercurial All Dirs extension
====================================

Execute the same Mercurial command in many repositories.

.. contents::
   :local:
   :depth: 2

.. sectnum::

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::

   In practice I usually shortcut the command and type::

        hg alld status
        # etc

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


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.

.. note::

   Technically: command name and params are parsed once, before
   visiting subdirs.

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.

.. note::

   That is done on purpose, I do not want my ``hg alld pull``
   to break if some repo lacks default path.

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


Installation
=================================================

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

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.

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. 



Related extensions
==================================================

There 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 ``~/src`` you
must ``hg init src``, create file like ``.hgsub`` there, 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 can ``hg alld status`` them all.

Command syntax also matters. I strongly prefer typing::

     hg alld pull --update

to 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, consider
`Subrepos Extension`_.

History
==================================================

See `HISTORY.rst`_

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.

Tests
=============

Tests can be run by::

    cram -v tests/*.t

(against current mercurial) or::

    tox

(against various versions).

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`_.

.. _Octobus: https://octobus.net/
.. _Clever Cloud: https://www.clever-cloud.com/

.. _other Mercurial extensions I wrote: http://code.mekk.waw.pl/mercurial.html

.. _Mercurial: http://mercurial.selenic.com
.. _HISTORY.rst: https://foss.heptapod.net/mercurial/mercurial-all-dirs/src/tip/HISTORY.rst
.. _mercurial_extension_utils: https://foss.heptapod.net/mercurial/mercurial-extension_utils/
.. _dynamic_username: https://foss.heptapod.net/mercurial/mercurial-dynamic_username/

.. _TortoiseHg: http://tortoisehg.bitbucket.org/

.. _OnSub Extension: https://www.mercurial-scm.org/wiki/OnsubExtension
.. _Subrepos Extension: https://www.mercurial-scm.org/wiki/Subrepository
.. _Forest Extension: https://www.mercurial-scm.org/wiki/ForestExtension

.. |drone-badge| 
    image:: https://drone.io/bitbucket.org/Mekk/mercurial-all_dirs/status.png
     :target: https://drone.io/bitbucket.org/Mekk/mercurial-all_dirs/latest
     :align: middle

            

Raw data

            {
    "_id": null,
    "home_page": "https://foss.heptapod.net/mercurial/mercurial-all_dirs",
    "name": "mercurial-all-dirs",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "mercurial subdirs multi alias",
    "author": "Marcin Kasperski",
    "author_email": "Marcin.Kasperski@mekk.waw.pl",
    "download_url": "https://files.pythonhosted.org/packages/c5/76/36a2101dba4940d648c26c3ebc575095b4d8ab97159893553bf32b0d5d28/mercurial_all_dirs-1.1.4.tar.gz",
    "platform": null,
    "description": ".. -*- mode: rst; compile-command: \"rst2html README.rst README.html\" -*-\n\n====================================\nMercurial All Dirs extension\n====================================\n\nExecute the same Mercurial command in many repositories.\n\n.. contents::\n   :local:\n   :depth: 2\n\n.. sectnum::\n\nExample\n=====================\n\nImagine you have Mercurial repositories in ``~/src/libs/acme``, \n``~/src/libs/net/aaa``, and ``~/src/libs/net/bbb``. Then::\n\n    cd ~/src/libs\n    hg alldirs status\n    # \u2026 shows status in all three repos\n    hg alldirs heads -t\n    # \u2026 and heads\n    hg alldirs log -l 2\n    # \u2026 and recent commit\n\nand even::\n\n    hg alldirs commit -m \"Documentation updates\"\n    # Commit in all three repos\n    hg alldirs push bb\n    # \u2026 and pushes them all\n\nRelative file names are resolved against given repo root (the\ncommand chdirs to every repo before actually executing it)::\n\n    hg alldirs commit -m \"Version update\" setup.py src/version.py \n\n.. note::\n\n   In practice I usually shortcut the command and type::\n\n        hg alld status\n        # etc\n\nNote that ``alldirs`` does not require any kind of *parent\nrepository*.\n\nIn case you are already inside some repo, command is executed on\nit, so ``alld`` does not matter::\n\n    cd ~/src/libs/net/aaa\n    hg status\n    hg alld status\n    # \u2026 Both do the same\n\n\nFailure handling\n=================================================\n\nIn case given command is not known (``hg alldirs badcommand``), or\ngot invalid options (``hg alldirs log -s``), error is reported\nimmediately and processing stops.\n\n.. note::\n\n   Technically: command name and params are parsed once, before\n   visiting subdirs.\n\nIn case given commands fails during execution (``hg alldirs pull\nnosuchalias``), ``alldirs`` executes the command in every repo\n(doesn't stop). After finishing the job, it summarizes list of\nrepositories in which the command failed.\n\n.. note::\n\n   That is done on purpose, I do not want my ``hg alld pull``\n   to break if some repo lacks default path.\n\nIn both cases whole command returns exit status signalling\nan error. \n\n\nInstallation\n=================================================\n\nLinux/Unix (from PyPI)\n~~~~~~~~~~~~~~~~~~~~~~\n\nIf you have working ``pip`` or ``easy_install``::\n\n    pip install --user mercurial_all_dirs\n\nor maybe::\n\n    sudo pip install mercurial_all_dirs\n\n(or use ``easy_install`` instead of ``pip``). Then activate by::\n\n    [extensions]\n    mercurial_all_dirs =\n\nTo upgrade, repeat the same command with ``--upgrade`` option, for\nexample::\n\n    pip install --user --upgrade mercurial_all_dirs\n\nLinux/Unix (from source)\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nIf you don't have ``pip``, or wish to follow development more closely:\n\n- clone both this repository and `mercurial_extension_utils`_ and put\n  them in the same directory, for example::\n\n    cd ~/sources\n    hg clone https://foss.heptapod.net/mercurial/mercurial-extension_utils/\n    hg clone https://foss.heptapod.net/mercurial/mercurial-all_dirs/\n\n- update to newest tags,\n\n- activate by::\n\n    [extensions]\n    mercurial_all_dirs = ~/sources/mercurial-all_dirs/mercurial_all_dirs.py\n\nTo upgrade, pull and update.\n\nSee `mercurial_extension_utils`_ for longer description of this kind\nof installation.\n\nWindows\n~~~~~~~~~~~~~~~~~~~~~~~\n\nIf you have any Python installed, you may install with ``pip``::\n\n    pip install mercurial_all_dirs\n\nStill, as Mercurial (whether taken from TortoiseHg_, or own package)\nuses it's own bundled Python, you must activate by specifying the path::\n\n    [extensions]\n    mercurial_all_dirs = C:/Python27/Lib/site-packages/mercurial_all_dirs.py\n    ;; Or wherever pip installed it\n\nTo upgrade to new version::\n\n    pip --upgrade mercurial_all_dirs\n\nIf you don't have any Python, clone repositories::\n\n    cd c:\\hgplugins\n    hg clone https://foss.heptapod.net/mercurial/mercurial-extension_utils/\n    hg clone https://foss.heptapod.net/mercurial/mercurial-all_dirs/\n\nupdate to tagged versions and activate by path::\n\n    [extensions]\n    mercurial_all_dirs = C:/hgplugins/mercurial-all_dirs/mercurial_all_dirs.py\n    ;; Or wherever you cloned\n\nSee `mercurial_extension_utils`_ documentation for more details on\nWindows installation. \n\n\n\nRelated extensions\n==================================================\n\nThere are a few extensions which support operations on repository\ngroups - `Subrepos Extension`_, `OnSub Extension`_, `Forest\nExtension`_. They all require using parent repository, which defines\nthe project structure. So, to pull all repos below ``~/src`` you\nmust ``hg init src``, create file like ``.hgsub`` there, etc.\n\nAll Dirs does not require such a parent repo. It just works on\nwhatever is found on the disk. You decided to keep some repositories\nbelow ``~/src``? Fine, you can ``hg alld status`` them all.\n\nCommand syntax also matters. I strongly prefer typing::\n\n     hg alld pull --update\n\nto typing::\n\n     hg onsub \"hg pull --update\"\n\nAt the same time, All Dirs does not support any kind of declaration\nthat some repositories are related, group cloning, version\nrelationship etc. If you are interested in such features, consider\n`Subrepos Extension`_.\n\nHistory\n==================================================\n\nSee `HISTORY.rst`_\n\nRepository, bug reports, enhancement suggestions\n===================================================\n\nDevelopment is tracked on HeptaPod, see \nhttps://foss.heptapod.net/mercurial/mercurial-all_dirs/\n\nUse issue tracker there for bug reports and enhancement\nsuggestions.\n\nThanks to Octobus_ and `Clever Cloud`_ for hosting this service.\n\nTests\n=============\n\nTests can be run by::\n\n    cram -v tests/*.t\n\n(against current mercurial) or::\n\n    tox\n\n(against various versions).\n\nAdditional notes\n================\n\nInformation about this extension is also available\non Mercurial Wiki: http://mercurial.selenic.com/wiki/AllDirsExtension\n\nCheck also `other Mercurial extensions I wrote`_.\n\n.. _Octobus: https://octobus.net/\n.. _Clever Cloud: https://www.clever-cloud.com/\n\n.. _other Mercurial extensions I wrote: http://code.mekk.waw.pl/mercurial.html\n\n.. _Mercurial: http://mercurial.selenic.com\n.. _HISTORY.rst: https://foss.heptapod.net/mercurial/mercurial-all-dirs/src/tip/HISTORY.rst\n.. _mercurial_extension_utils: https://foss.heptapod.net/mercurial/mercurial-extension_utils/\n.. _dynamic_username: https://foss.heptapod.net/mercurial/mercurial-dynamic_username/\n\n.. _TortoiseHg: http://tortoisehg.bitbucket.org/\n\n.. _OnSub Extension: https://www.mercurial-scm.org/wiki/OnsubExtension\n.. _Subrepos Extension: https://www.mercurial-scm.org/wiki/Subrepository\n.. _Forest Extension: https://www.mercurial-scm.org/wiki/ForestExtension\n\n.. |drone-badge| \n    image:: https://drone.io/bitbucket.org/Mekk/mercurial-all_dirs/status.png\n     :target: https://drone.io/bitbucket.org/Mekk/mercurial-all_dirs/latest\n     :align: middle\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "Mercurial All Dirs Extension",
    "version": "1.1.4",
    "project_urls": {
        "Homepage": "https://foss.heptapod.net/mercurial/mercurial-all_dirs"
    },
    "split_keywords": [
        "mercurial",
        "subdirs",
        "multi",
        "alias"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c57636a2101dba4940d648c26c3ebc575095b4d8ab97159893553bf32b0d5d28",
                "md5": "d2436ada565236154269e16609512442",
                "sha256": "c6b7d1f6867f5d10e46fbef2d4d5ad66bca8e55f1617993daa2750485c8d07b3"
            },
            "downloads": -1,
            "filename": "mercurial_all_dirs-1.1.4.tar.gz",
            "has_sig": false,
            "md5_digest": "d2436ada565236154269e16609512442",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 13047,
            "upload_time": "2024-09-25T06:50:54",
            "upload_time_iso_8601": "2024-09-25T06:50:54.514587Z",
            "url": "https://files.pythonhosted.org/packages/c5/76/36a2101dba4940d648c26c3ebc575095b4d8ab97159893553bf32b0d5d28/mercurial_all_dirs-1.1.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-25 06:50:54",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "mercurial-all-dirs"
}
        
Elapsed time: 0.37809s