将文件夹从存储库迁移到另一个存储库,其中包含所有更改树数据

发布于 2024-09-27 00:29:37 字数 115 浏览 0 评论 0原文

我在 Mercurial 存储库中有一个文件夹,我想将其复制到另一个 Mercurial 存储库,但要保留我对此文件夹所做的所有更改,并且不会丢失我对此文件夹所做的所有版本控制。

这可能与水银有关吗?

I have a folder in a mercurial repository, that I want to copy to another mercurial repository, but with all the changes that I made to this folder, and without losing the all version control that I did on this folder.

Is that possible to do with mercurial?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

请叫√我孤独 2024-10-04 00:29:37

我认为如果与该目录中的文件相关的变更集仅引用该目录中的文件,您可以使用 hg 导出/导入来实现这一点。首先识别这些文件的所有变更集,然后导出它们,然后导入它们...这是执行第一部分的 shell 脚本:

for i in $(hg log -M --template="{node}\n" directory)
do 
  hg export -r $i -o "$(date '+%Y%m%d%H%M%S')_%H"
done

然后将这些文件移动到新的存储库并依次对每个文件执行 hg import。

如果您的变更集不包含其他文件,那么这将起作用...即使这样,您可能会发现很多拒绝,并且它不包含原始提交消息或合并变更集(显然)。

I think if the changesets relating to files in that directory refer ONLY to files in that directory you could use hg export/import to achieve that. First identify all the changesets for those files, then export them, then import them... here's shell script to do the first part:

for i in $(hg log -M --template="{node}\n" directory)
do 
  hg export -r $i -o "$(date '+%Y%m%d%H%M%S')_%H"
done

then move those files to your new repo and do hg import on each one in turn.

IF your changesets don't include other files then this will work... even then you might find a lot of rejects and it doesn't include the original commit messages or the merges changesets (obviously).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文