如何(有可能)创建一个运行多个命令的hg命令别名? [英] How (is it possible) to create an hg command alias that runs multiple commands?

查看:64
本文介绍了如何(有可能)创建一个运行多个命令的hg命令别名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的hgrc文件中定义一个Mercurial命令别名,以调用多个命令.例如,我想执行以下操作:

I would like to define a Mercurial command alias in my hgrc file that invokes multiple commands. For example I would like to do something like the following:

[alias]
giveup = revert --all --no-backup; purge
syncprod = fetch production; push production

这将允许我调用hg syncprod并让其先调用fetch,然后再进行push.尚无法确定此功能是否存在. (我猜这意味着不.)

This would allow me to call hg syncprod and have it invoke a fetch and then a push. Haven't been able to determine if this capability exists. (I'm guessing that means no.)

推荐答案

使用shell别名样式,如下所示:

Use the shell alias style like this:

giveup = !$HG revert --all --no-backup ; $HG purge

尽管如此,我个人会为它们创建一个bash别名,这样我就可以完全跳过hg部分.

Though, personally I'd just create a bash alias for those so I could skip the hg part altogether.

这篇关于如何(有可能)创建一个运行多个命令的hg命令别名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆