在 Subversion 中,我可以是我的登录名以外的用户吗?

问题描述:

我想知道如何让 Subversion 更改显示我的更改的名称.

I'd like to know how to get Subversion to change the name that my changes appear under.

我刚刚开始使用 Subversion.我目前正在使用它来控制 XP 笔记本电脑上的代码,我总是以我妻子的名义登录.我希望 subversion 数据库在我的名字下显示更改.

I'm just starting to use Subversion. I'm currently using it to version control code on an XP laptop where I'm always logged in under my wife's name. I'd like the subversion DB to show the changes under my name.

稍后我将复制数据库,以便整个房子都可以访问它.我的妻子使用办公室电脑,她总是以我的名义登录.我可能会设置它以便它自动检查修改后的文档......最好是在她的名字下.

Later on I'll replicate the DB so it is accessible to the whole house. My wife uses the office computer where she is always logged in under my name. I'll probably set it up so that it automatically checks in modified documents... preferably under her name.

最终我可能会在另一个用户名下的 Linux 机器上使用它.

Eventually I'll probably be using it from a linux machine under another username.

有什么办法可以修改用户环境来改变Subversion调用你的用户名吗?我希望设置 SVN_USERNAME='Mark' 之类的东西会覆盖,但它通常会获取名称.

Is there some way to modify the user environment to change the user name that Subversion calls you? I'd expect something like setting SVN_USERNAME='Mark' which would override however it usually gets the name.

更新:看起来迈克尔提到的 --username 标志确实可以改变 "svn stat" 报告的名称,即使对于本地文件:存储库.此外,它是粘性的,因此您无需为下一个命令指定它.我什至重新启动,它仍然使用我之前启动时的 "--username" 值.

Update: It looks like the --username flag that Michael referred to does work to change the name reported by "svn stat", even for local file: repositories. In addition, it is sticky so you don't need to specify it for the next command. I even rebooted and it still used the "--username" value from my previous boot.

大多数 Subversion 命令采用 --username 选项来指定要用于存储库的用户名.Subversion 会记住在每个工作副本中使用的最后一个存储库用户名和密码,这意味着,除其他外,如果您使用 svn checkout --username myuser,则无需再次指定用户名.

Most Subversion commands take the --username option to specify the username you want to use to the repository. Subversion remembers the last repository username and password used in each working copy, which means, among other things, that if you use svn checkout --username myuser you never need to specify the username again.

饰演 Kamil Kisiel说,当 Subversion 直接从文件系统访问存储库时(即,存储库 URL 的格式为 file:///path/to/repofile://file-server/path/to/repo),它使用您的文件系统权限来访问存储库.当你 通过 SSH 隧道连接时 (svn+ssh://server/path/to/repo),SVN 使用您在 服务器 上的 FS 权限,由您的 SSH 登录决定.在这些情况下,svn checkout --username 可能不适用于您的存储库.

As Kamil Kisiel says, when Subversion is accessing the repository directly off the file system (that is, the repository URL is of form file:///path/to/repo or file://file-server/path/to/repo), it uses your file system permissions to access the repository. And when you connect via SSH tunneling (svn+ssh://server/path/to/repo), SVN uses your FS permissions on the server, as determined by your SSH login. In those cases, svn checkout --username may not work for your repository.