如何将 .svn 文件夹提交到 Mercurial 存储库?
我想将每个代码文件夹的 .svn
文件夹提交到 Hg 存储库。问题是许多 .svn
子文件夹是空的,因此无法提交到 Mercurial 存储库。
我发现的一个解决方案是向每个文件夹添加一个空文件,但这很麻烦。难道就没有更简单的方法吗?
I want to commit the .svn
folder, of each code folder, to the Hg repository. The problem is that many .svn
subfolders are empty and, because of that, can't be committed to the mercurial repository.
One solution I found is to add an empty file to each of those folders, but this is cumbersome. Isn't there an easier way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要为每个添加一个空文件。您可以通过以下方式快速做到这一点:
You need to add an empty file for each. You could do that quickly with:
当您想在 svn 存储库之上使用 hg 时,可以尝试 hgsubversion 扩展 。 Hgsubversion 使 Mercurial 能够像 svn 客户端一样与 svn 服务器通信。
OTOH 如果你坚持到处都有 .svn 文件夹,你可以使用 hgsvn 来管理你的并行 hg和 svn 仓库结帐。但是 hgsvn 的缺点是它不会自动对返回到 svn 的内容进行变基,因此当您必须将 svn 历史记录与本地历史记录合并(就水银合并而言)时,您无法导出每个本地提交,只有合并提交(即使有合并,也有导出每个提交的方法,但是第一次本地提交会撤消最近的 svn 历史记录,而合并提交会重做它,这会导致有缺陷的 svn 历史记录)。
有关不同 svn<->hg 工作流程的更多信息,请参见 WorkingWithSubversion wiki 页面。
When you want to use hg on top of a svn repo, you can try the hgsubversion extension. Hgsubversion gives mercurial the ability to talk to svn servers like a svn client.
OTOH if you insist to have .svn folders everywhere, you can use hgsvn to manage your parallel hg and svn repo checkout. But hgsvn has the drawback that it does no automatic rebase for stuff which gets back into svn, so when you have had to merge (in terms of a mercurial merge) the svn history with your local history, you can't export every local commit, only the merge commit (there is the way to export every commit even when there is a merge, but the first local commit will undo the recent svn history, and the merge commit will redo it, which causes a defect svn history).
More about different svn<->hg workflows are on the WorkingWithSubversion wiki page.