Differences between revisions 12 and 13
Revision 12 as of 2017-08-09 07:51:04
Size: 1744
Comment: question: who is maintainer of onsub?
Revision 13 as of 2017-08-09 07:52:12
Size: 1721
Comment: fix link
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
Line 9: Line 8:
Repository: https://bitbucket.org/lantiq/onsub /* This repo and event the user does not exist anymore. Who is the current maintainer? maybe https://bitbucket.org/sborho/onsub https://bitbucket.org/jaraco/onsub https://bitbucket.org/nikolausschueler/onsub httphttps://bitbucket.org/wizz/onsub/ ... */ Repository: https://bitbucket.org/lantiq/onsub /* This repo and event the user does not exist anymore. Who is the current maintainer? maybe one of https://bitbucket.org/sborho/onsub https://bitbucket.org/jaraco/onsub https://bitbucket.org/nikolausschueler/onsub https://bitbucket.org/wizz/onsub/ ... */
Line 12: Line 11:
Line 16: Line 14:
Line 19: Line 18:
Line 26: Line 24:
 * `HG_SUBURL`: URL for the current subrepository as specified in the containing repository's ``.hgsub`` file.  * `HG_SUBURL`: URL for the current subrepository as specified in the containing repository's .hgsub file.
Line 28: Line 26:
 * `HG_SUBSTATE`: State of the current subrepository as specified in the containing repository's ``.hgsubstate`` file.  * `HG_SUBSTATE`: State of the current subrepository as specified in the containing repository's .hgsubstate file.
Line 30: Line 28:
 * `HG_SUBTYPE`: Type of the current subrepository (``hg``, ``git``, ``svn``).  * `HG_SUBTYPE`: Type of the current subrepository (hg, git, svn).
Line 33: Line 31:
Line 36: Line 35:
Line 46: Line 44:

onsub

This extension is not distributed with Mercurial.

Author: MartinGeisler

Current Maintainer: Lantiq

Repository: https://bitbucket.org/lantiq/onsub

Overview

The onsub extension will traverse all subrepositories and execute a command in each.

This can be used to update all subrepositories with one command:

$ hg onsub "hg pull -u"

The extension provides a number of environment variables for you to use in your commands:

  • HG_REPO: Absolute path to the top-level repository in which the onsub command was executed.

  • HG_SUBPATH: Relative path to the current subrepository from the top-level repository.

  • HG_SUBURL: URL for the current subrepository as specified in the containing repository's .hgsub file.

  • HG_SUBSTATE: State of the current subrepository as specified in the containing repository's .hgsubstate file.

  • HG_SUBTYPE: Type of the current subrepository (hg, git, svn).

You can also easily run commands on all subrepositories of a given type. For instance, to pull all git subrepositories:

$ hg onsub -t git "git pull origin master"

Consult hg help onsub after enabling the extension for the full and up-to-date documentation.

Configuration

Configure your .hgrc to enable the extension by adding following lines:

[extensions]
onsub = path/to/onsub/onsub.py


CategoryExtension CategoryExtensionsByOthers

OnsubExtension (last edited 2017-08-09 07:52:12 by SimonHeimberg)