Mercurial allpaths 扩展
项目描述
一次推送或拉取到许多(或所有)路径。
1 基本用法
执行
hg pushall
以推送所有为仓库定义的远程。或者
hg pullall
按顺序从所有远程拉取。
还有
hg incomingall hg outgoingall
可以给出标准的推送/拉取选项,例如
hg pushall -f -B issue-13724 hg pullall -r stable --insecure
这些命令遍历由 hg paths 返回的所有路径。这通常意味着遍历 .hg/hgrc 文件中定义的路径,但也会处理 路径模式 路径。您可以通过配置影响这种行为,请参阅以下内容。
2 定义路径组
除了在所有地方推送/拉取,您还可以定义并使用 组
hg pushall -g publish
将所有路径从 publish 组(其中 publish 是您选择的符号名称)进行推送。或者
hg pullall -g shared
从 shared 组中的所有路径进行拉取。
定义此类组有两种方式
在 [all_paths] 部分定义合适的条目(可在 .hg/hgrc 或您的全局 ~/.hgrc 中)。例如
[all_paths] group.publish = bitbucket github backup
(路径别名 bitbucket、github 和 backup 必须以某种方式定义)。
(旧方法)在 .hg/hgrc 中放置同名部分,并定义所有路径。例如
[publish] bitbucket = ssh://hg@bitbucket.org/ludovicchabant/piecrust github = git+ssh://git@github.com:ludovicchabant/PieCrust.git backup = ssh://ludo@backup.local/piecrust
语法与标准 [paths] 部分相同,只需使用您组的名称命名部分。
我推荐使用前一种方法,因为它可以避免冲突风险,使得全局定义组而不是为每个仓库定义组变得容易(如果您使用 Path Pattern,这特别有用),并且更加紧凑。
对于 incomingall 和 outgoingall 也处理组,但必须使用长 --group 选项(-g 已经被标准 Mercurial 占用,表示在 --git diff 格式下报告)。
hg outgoingall --group publish
3 配置
可以通过您全局的 ~/.hgrc 或仓库级别的 .hg/hgrc 配置文件中的 [all_paths] 部分配置此扩展。
[all_paths] prioritize = platon department ignore = bitbucket production group.publish = github bitbucket group.backup = homebackup awsbackup
prioritize 影响顺序,定义了首先处理的路径。这主要用于 pullall,在本地快速计算机上拉取数据比从远程服务器上拉取数据可以节省时间和流量。所以
prioritize = platon department
意味着:如果存在名为 platon 的路径,首先处理它,然后处理名为 department 的路径,然后再处理其他路径。
ignore 列出应忽略的路径,这些远程路径将被跳过。所以
ignore = bitbucket production
意味着 hg pullall 或 hg pushall 不应使用 bitbucket 路径(在我这个例子中,因为这是一个 HTTP 远程,我已配置了更喜欢的 bitssh),以及 production 路径(因为我更愿意在特定需求下进行拉取和推送)。
这两个设置仅影响 默认 命令(没有 -g GROUP 选项运行的命令)。在组定义中指定项的顺序处理项。
group.«NAME» 定义用于 -g «NAME 的组,如前所述。
4 安装
4.1 从PyPi
如果您有工作的 pip 或 easy_install
pip install --user mercurial_all_paths
或者可能
sudo pip install mercurial_all_paths
然后通过
[extensions] mercurial_all_paths =
要升级,使用 --upgrade 选项重复相同的命令,例如
pip install --user --upgrade mercurial_all_paths
4.2 从源码
如果您没有 pip,或者想更紧密地跟踪开发
克隆这两个仓库 mercurial_extension_utils 并将它们放在同一目录中,例如
cd ~/sources hg clone https://foss.heptapod.net/mercurial/mercurial-extension_utils/ hg clone https://foss.heptapod.net/mercurial/mercurial-all_paths/
更新到最新标签
然后通过
[extensions] mercurial_all_paths = ~/sources/mercurial-all_paths/mercurial_all_paths.py
要升级,拉取并更新。
请注意目录名称的重要性。有关此类安装的更详细描述,请参阅mercurial_extension_utils。
5 历史
请参阅HISTORY.rst
6 仓库、错误报告、改进建议
开发在HeptaPod上进行,请参阅
使用该处的issue tracker提交错误报告和建议。
感谢Octobus和Clever Cloud提供此服务。
原始仓库,由Ludovic Chabant维护
7 其他说明
有关此扩展的信息也可在Mercurial Wiki上找到: http://mercurial.selenic.com/wiki/AllPathsExtension
项目详情
mercurial_all_paths-1.2.2.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 529f1e81511570d9a0a2d3b38ffc3631f9006a79d7ec4b072058313cab6e5ced |
|
MD5 | b7f50510bae9e81060d6bb1015eb739b |
|
BLAKE2b-256 | 77851ca6de331cbdba292d50c36c04aaee407ee09807e1dcfa3c35afe20a4443 |