Mercurial OnRemote扩展

mercurial_on_remote的Python项目详细描述


在远程存储库上执行一些Mercurial命令(仅限于ssh/本地存储库)。在

1   Example

我的两个主要用例:

  • 推送后更新远程目录:

    hg push staging
    hg onremote staging update -r tip
    
  • 检查状态并可能在远程目录中提交:

    ^{pr2}$ 在

在这些示例中,stagingrhdevel是映射的远程路径 指向像ssh://some.machine.net/repos/myrepo这样的URL(本地路径有效 也是)。在

显式路径也可以工作,但不太方便:

hg onremote ssh://euler.mydev.net/repos/myrepo   status

2   Arguments

通用命令语法:

hg onremote «remote» «command» «arguments»

其中«remote»是远程存储库别名或路径,以及剩余的参数 构成正常的反复无常的命令。在

选项--ssh可以像使用push或pull一样使用:

hg onremote --ssh /custom/ssh staging status

3   How does it work

扩展只解析指定的路径,并且:

  • 如果它映射到本地目录,则执行hg --cwd that/directory «command» «arguments»
  • 如果它映射到ssh路径,则执行ssh that/machine hg --cwd that/directory «command» «arguments»
  • 在其他地方(http或其他远程)它拒绝工作。在

没有什么特别神奇的,扩展是有意的 节省一些击键并避免流中断(我主要编写它 停止编写各种push and updateshell脚本)。在

小心!在

您需要真正的ssh访问才能使其正常工作。远程存储库, 从bitbucketmercurial-server安装通常 拒绝运行命令的尝试(如人们所料)。在

4   Configuration

当前没有专用配置。在

标准的mercurial设置用于决定如何调用 ssh,以及调用哪个远程命令来生成Mercurial(请参见 sshremotecmd设置在[ui]部分)。 这样,onremote使用相同的ssh命令 它由hg pushhg pull使用,并且相同 多变的名字。在

5   Problems and limitations

交互命令可能由于缺少 完全工作的控制台。 我建议避免使用触发交互式提示的命令 或者编辑器生成。如果您尝试hg onremote commitadd-m "Some message"。在

注意

目前OnRemote不能初始化完整的终端支持 (从技术上讲,没有添加ssh -t或类似内容)。可能吧 未来的改变。在

6   Installation

要求Mercurial≥3.4(尝试在旧版本上运行将 导致撞车),强烈建议Mercurial≥4.5 (版本3.4-4.4涉及一些黑客攻击,可能会失败更多 复杂的论据)。在

6.1   Linux/Unix (from PyPI)

如果您有工作pipeasy_install

pip install --user mercurial_on_remote

或者可能:

sudo pip install mercurial_on_remote

(或使用easy_install代替pip)。然后激活方式:

[extensions]
mercurial_on_remote =

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

pip install --user --upgrade mercurial_on_remote

6.2   Linux/Unix (from source)

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

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

    cd ~/sources
    hg clone https://foss.heptapod.net/mercurial/mercurial-extension_utils/
    hg clone https://foss.heptapod.net/mercurial/mercurial-on_remote/
    
  • 更新到最新标签

  • 激活方式:

    [extensions]
    mercurial_on_remote = ~/sources/mercurial-on_remote/mercurial_on_remote.py
    

升级,拉和更新。在

请参阅mercurial_extension_utils以获取此类详细描述 安装。在

6.3   Windows

如果安装了Python,可以使用pip进行安装:

pip install mercurial_on_remote

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

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

要升级到新版本:

pip --upgrade mercurial_on_remote

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

cd c:\hgplugins
hg clone https://foss.heptapod.net/mercurial/mercurial-extension_utils/
hg clone https://foss.heptapod.net/mercurial/mercurial-on_remote/

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

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

mercurial_extension_utils有关的更多详细信息,请参阅文档 Windows安装。在

8   Repository, bug reports, enhancement suggestions

在HeptaPod上跟踪开发,参见 https://foss.heptapod.net/mercurial/mercurial-on_remote/

在那里使用问题跟踪器进行缺陷报告和增强 建议。在

{a30}感谢你的服务。在

9   Additional notes

有关此扩展的信息也可用 在Mercurial Wiki上:http://mercurial.selenic.com/wiki/OnRemoteExtension

同时检查other Mercurial extensions I wrote。在

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

推荐PyPI第三方库


热门话题
java如何在数据库中插入行时自动发送电子邮件?   从进程输出读取的Java问题   java质疑StyledDocument和JTextPane之间的关系,以及接口的正确使用   java错误getPlayer(args[0]);   java如何使Spring引导在重新打包的WAR中包含清单文件?   Java中的除法与模   java使用2d数组和JfreeChart制作散点图   java扩展SonarQube FindBugs插件和自定义FindBugs插件   javaspring:hibernate+ehcache   具有不正确的equals和HashCode实现的java HashMap   java Jaspersoft报告网。旧金山。jasperreports。发动机例外:net。旧金山。jasperreports。发动机填满JRepressionEvalException:计算表达式时出错   java如果输入与其变量不匹配,如何添加错误   在java中使用简单数组[]实现队列   无法启动上下文路径/hsx上的java FAIL应用程序