我将 svn 存储库转换为 Mercurial。当我克隆这个新存储库时,默认分支有不同的名称,为什么?
我已成功将我的 svn 存储库转换为 Mercurial,但是当我克隆此存储库时,默认分支会被赋予项目名称而不是“默认”。
示例:
在远程服务器上:
hg branch
default
在本地计算机上:
hg clone http://server/hg/coolProject
hg branch
coolProject
我希望本地计算机上的 hg 分支输出“默认”。我并不真正关心这一点,但是当我将更改推回原始存储库时,会创建一个新头,我认为这是因为分支名称不同。
I have successfully converted my svn repository into mercurial, however when I clone this repo the default branch is given the project name instead of "default".
examples:
on remote server:
hg branch
default
on local machine:
hg clone http://server/hg/coolProject
hg branch
coolProject
I would expect the hg branch on my local machine to output "default". I wouldn't really care about this, but when I push my changes back into the originating repo a new head is created and I assume this is because of the different branch name.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我今天也遇到了同样的问题。
《Mercurial:权威指南:迁移到 Mercurial》一书中详细记录了该解决方案 但 ConvertExtension wiki 中的记录很少。
I had the same problem today.
The solution is nicely documented in the book Mercurial: The Definitive Guide: Migrating to Mercurial but poorly documented in the ConvertExtension wiki.
当您说“默认分支被赋予项目名称default”时,是否没有分支名称为“default”的变更集,或者这就是克隆后您最终进入的分支?如果是后者,您可以随时
hg update default
。如果是前者,您可以使用
--branchmap
选项重新转换
,将您要获取的分支重命名为default
。When you say "the default branch is given the project name default" are there no changesets with the branchname "default" or is that just what branch you ended up on after cloning? If it's the later you can always just
hg update default
.If it's the former you could re-
convert
using the--branchmap
option to rename the branch you're getting todefault
.hgbranch
命令显示您当前所在的分支。请改用hg Branches
命令。远程服务器和本地计算机可能不在同一版本上。使用存储库资源管理器、
hgserve
或hg recognize
和hg log
来查看是否是这种情况。至于项目名称最终作为分支名称,因为在 SVN 中分支实际上只是文件夹,并且分支是按惯例完成的,可能 SVN 转换将项目文件夹误认为是分支文件夹。您的 SVN 项目是否具有 trunk/branches/tags 标准文件夹布局?在这种情况下,请使用
convert.svn
选项指定您的布局(请参阅hg help Convert
)。您还可以尝试向上或向下移动一个目录或其他内容。The
hg branch
command shows you the branch that you are currently on. Use thehg branches
command instead. Probably the remote server and local machine are not on the same revision.Use a repository explorer,
hg serve
, orhg identify
andhg log
to see if this is the case.As for the project name ending up as a branch name, as in SVN branches are really just folders and branching is done by convention, probably the SVN conversion mistook the project folder for a branch folder. Does your SVN project have the standard folder layout of trunk/branches/tags? In that case, specify your layout using the
convert.svn
options (seehg help convert
). You could also try to go one directory up or down or something.