gpt4 book ai didi

Mercurial:带参数的别名

转载 作者:行者123 更新时间:2023-12-01 07:54:53 24 4
gpt4 key购买 nike

我想创建一个别名,以便在运行时:

hg pushbranch <<SOME_BRANCH>>

它别名为:
hg push -b <<SOME_BRANCH>>

哪里 SOME_BRANCH是我希望推送的分支的名称。我可以在我的 .hgrc 中创建别名,但不知道如何为别名提供参数。

最佳答案

来自 hgrc help

Positional arguments in the form of $1, $2, etc in the alias definition are expanded by Mercurial before execution.



因此,允许推送任何分支的别名定义将是
pushbranch = push -b $1
hg pushbranch mybranch扩展为 hg push -b mybranch

关于Mercurial:带参数的别名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31009414/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com