Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Mercurial中按存储库设置不同的用户名?_Mercurial_Repository_Configuration Files - Fatal编程技术网

如何在Mercurial中按存储库设置不同的用户名?

如何在Mercurial中按存储库设置不同的用户名?,mercurial,repository,configuration-files,Mercurial,Repository,Configuration Files,我正在使用Mercurial作为风险投资公司为不同的客户进行项目。我知道如何设置默认用户,但是否有为每个项目设置不同用户的方法 只需编辑每个存储库中的文件.hg/hgrc。它的语法与您的~/.hgrc相同,但只会影响特定的回购 在repo1/.hg/hgrc中: [ui] username = Foo Bar <foobar@example.com> [ui] username = Something Else <something.else@example.com>

我正在使用Mercurial作为风险投资公司为不同的客户进行项目。我知道如何设置默认用户,但是否有为每个项目设置不同用户的方法

只需编辑每个存储库中的文件
.hg/hgrc
。它的语法与您的
~/.hgrc
相同,但只会影响特定的回购

repo1/.hg/hgrc
中:

[ui]
username = Foo Bar <foobar@example.com>
[ui]
username = Something Else <something.else@example.com>

除了为每个存储库设置用户名外,您还可以使用扩展名并为全局
~/.hgrc
中的特定位置设置用户名,如下所示:

[extensions]
dynamic_username =

[dynamic_username]
work.location = ~/work
work.username = John Smith <john.smith@serious.com>
hobby.location = ~/hobby ~/blogging
hobby.username = Johny <fastjohny@fantasy.net>
[扩展]
动态用户名=
[动态用户名]
work.location=~/work
work.username=约翰·史密斯
hobby.location=~/hobby~/博客
hobby.username=Johny