Mercurial All Dirs扩展

mercurial_all_dirs的Python项目详细描述


在许多存储库中执行相同的mercurial命令。

1   Example

假设您在~/src/libs/acme中有Mercurial存储库, ~/src/libs/net/aaa,和~/src/libs/net/bbb。然后:

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

甚至:

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

相对文件名根据给定的repo根( 在实际执行每个repo之前命令chdirs):

hg alldirs commit -m "Version update" setup.py src/version.py

注意

在实际操作中,我通常会将命令设置为快捷方式,然后键入:

hg alld status
# etc

注意alldirs不需要任何类型的父级 存储库

如果您已经在某个repo中,命令将在 所以alld无关紧要:

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

2   Failure handling

如果给定的命令未知(hg alldirs badcommand),或者 得到无效选项(hg alldirs log -s),报告错误 立即停止处理。

注意

技术上:命令名和参数在 参观街道。

如果给定的命令在执行期间(hg alldirs pull nosuchalias)失败,alldirs在每个repo中执行该命令 (没有停止)。完成工作后,它总结了 命令失败的存储库。

注意

这是故意的,我不想我的hg alld pull 如果某些回购协议缺少默认路径,则中断。

两种情况下,整个命令返回退出状态信令 一个错误。

3   Installation

3.1   Linux/Unix (from PyPI)

如果您有工作pipeasy_install

pip install --user mercurial_all_dirs

或者:

sudo pip install mercurial_all_dirs

(或者使用easy_install而不是pip)。然后激活:

[extensions]
mercurial_all_dirs =

要升级,请使用--upgrade选项重复相同的命令 示例:

pip install --user --upgrade mercurial_all_dirs

3.2   Linux/Unix (from source)

如果您没有pip,或者希望更密切地关注开发:

  • 克隆此存储库和mercurial_extension_utils并 它们位于同一目录中,例如:

    cd ~/sources
    hg clone https://bitbucket.org/Mekk/mercurial-extension_utils/
    hg clone https://bitbucket.org/Mekk/mercurial-all_dirs/
    
  • 更新到最新标签,

  • 激活方式:

    [extensions]
    mercurial_all_dirs = ~/sources/mercurial-all_dirs/mercurial_all_dirs.py
    

升级,拉和更新。

有关此类的详细说明,请参见mercurial_extension_utils。 安装。

3.3   Windows

如果您安装了任何python,则可以使用pip

pip install mercurial_all_dirs

但是,作为mercurial(无论是从TortoiseHg,还是自己的包中获取) 使用它自己的捆绑python,必须通过指定路径来激活:

[extensions]
mercurial_all_dirs = C:/Python27/Lib/site-packages/mercurial_all_dirs.py
;; Or wherever pip installed it

升级到新版本:

pip --upgrade mercurial_all_dirs

如果没有任何python,请克隆存储库:

cd c:\hgplugins
hg clone https://bitbucket.org/Mekk/mercurial-extension_utils/
hg clone https://bitbucket.org/Mekk/mercurial-all_dirs/

更新到标记的版本并按路径激活:

[extensions]
mercurial_all_dirs = C:/hgplugins/mercurial-all_dirs/mercurial_all_dirs.py
;; Or wherever you cloned

有关详细信息,请参见mercurial_extension_utils文档 Windows安装。

6   Development, bug reports, enhancement suggestions

在Bitbucket上跟踪开发,请参见 http://bitbucket.org/Mekk/mercurial-all_dirs/

使用Bitbucket问题跟踪程序进行错误报告和增强 建议。

7   Additional notes

有关此分机的信息也可以使用 在Mercurial Wiki上:http://mercurial.selenic.com/wiki/AllDirsExtension

同时检查other Mercurial extensions I wrote

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java使用split函数分割字符串,但没有得到期望的结果   未找到包含derby数据库嵌入架构的sql Java桌面应用程序错误   java elasticsearch vs solr用于定制全文搜索系统   java Android:创建没有startOffset的动画延迟?   java如何查看其他应用程序接收的数据?   java如何在Linux中使用D和classpath选项运行jar文件   java和域设计最佳实践   具有相同内存位置的java数组,将显示为输出   连接到java中的elasticsearch?   Java Playframework重定向到带有Json负载的外部url   java无法在Android平台上使用InputStream为蓝牙socket创建ObjectInputStream   使用POI将Excel日期转换为Java日期,年份未正确显示   oracle从数据库层还是Java层调用webservice?