mercurial:减少 hgrc 文件中的重复

标签 mercurial

我在 Google 代码托管上的一些项目中使用了 Hg。对于我在 .hgrc 的 [auth] 部分中设置的每个项目,用户名/密码无需每次都要求输入密码即可推送。但它有很多重复,例如:

[auth]
proj1.prefix = ... 111
proj1.username = google code username
proj1.password = google code password

proj2.prefix = ... 222
proj2.username = google code username
proj2.password = google code password

这可以以某种方式减少重复吗?也许在 hgrc 中设置变量并从所有用户名/密码行引用它?

在此先感谢您的帮助

最佳答案

来自 auth hgrc 中的部分:

format: <name>.<argument> = <value> where <name> is used to group arguments into authentication entries.

<name>.prefix: The authentication entry with the longest matching prefix is used


因此,code.google.com 的单个条目就足够了。同样感兴趣的是 %include file所以你可以将常见的东西存储在单独的文件中,并将它们包含在任何 hgrc 中。

关于mercurial:减少 hgrc 文件中的重复,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2879642/

相关文章:

mercurial - Mercurial 子存​​储库必须是主存储库的子目录吗?

mercurial - 如何使用 PyCharm 克隆本地存储库

mercurial - "Case folding"尝试克隆 mercurial repo 时出错

c# - 从 C# 克隆 Mercurial 存储库?

git - windows单一开发者易于备份的版本控制

git - 处理 DVC 中的空地文件

Mercurial:在没有公共(public)阶段的情况下从远程存储库中提取更改(非发布服务器, "abort: can' t rebase 不可变变更集”)

mercurial - 在 Mercurial 中,hg 嫁接和 hg rebase 有什么区别

mercurial - Push 创建新的远程头! (是不是忘记 merge 了?用push -f强制)

build - 在构建结束时将数据提交到 Mercurial