如何配置`hg push`只推送到当前分支?

How to configure `hg push` to push to current branch only?

我想将 Mercurial 配置为仅推送当前分支上的提交,而不是所有草稿提交 - 很像 Git 在 push.default 设置为 simple 时所做的.我扫描了 hgrc 手册页,但找不到强制执行此操作的选项。怎么称呼?

虽然已弃用,但您可以为 hgrc 中的命令设置默认值:

[defaults]
push = -r .

推荐的替代方法是别名:

[alias]
pushcurrent = push -r .