Mercurial:合并在意外创建的子文件夹中 [英] Mercurial: Merge in accidentally created subfolder

查看:96
本文介绍了Mercurial:合并在意外创建的子文件夹中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

TLDR:我似乎在主项目的子文件夹中创建了一个单独的存储库.我怎样才能将它们结合起来?

TLDR: I seem to have created a separate repository in a subfolder of my main project. How can I combine them?

我有一个项目文件夹,我们称其为 BOB .我将(hg clone) BOB 克隆到一个名为 BOB2 的新文件夹中.为了添加新功能,我在 BOB2 上创建了一个名为 BOB-newfeatures 的子文件夹.我已经在这个 BOB-newfeatures 文件夹上工作了一段时间了,并且签到了很多东西.

I have a project folder, let's call it BOB. I cloned (hg clone) BOB to a new folder called BOB2. To add new features, I created a subfolder on BOB2 called BOB-newfeatures. I have been working on this BOB-newfeatures folder for a while, with many checkins.

今天,我意识到以某种方式为 BOB-newfeatures 创建了一个单独的存储库(直到今天,我对 BOB2 main都没有进行任何更改,所以我没有注意到未跟踪更改).如果我在 BOB2 上执行hg status,它将不知道子文件夹中的更改,反之亦然.

Today I realized that somehow I created a separate repository for BOB-newfeatures (I hadn't changed anything on BOB2 main until today so I hadn't noticed that changes weren't being tracked). If I do hg status on BOB2, it doesn't know about changes in the subfolder and vice versa.

有没有办法将它们缝合在一起?我知道我可以将 BOB-newfeatures 中的所有文件都hg add转换为 BOB ,但是后来我认为我丢失了所有签入历史记录.

Is there a way to stitch these together? I know I could hg add all of the files in BOB-newfeatures to BOB but then I think I lose all of my checkin history.

推荐答案

好的,我从(pp)开始用你的名字重建(希望)你的案子.

OK, I reconstructed (I hope) your case, with your names, starting from

BOB2>hg log -T "{node|short}\tFiles: {join(files, ', ')}\n"
25a16a8fea5e    Files: Sub/3.txt
bf3c6cacb4a4    Files: 1.txt, 2.txt
ff71a2b1bbe3    Files: 1.txt

和嵌套存储库

BOB2\BOB-newfeatures>hg log -T "{node|short}\tFiles: {join(files, ', ')}\n"
acac7d413ed2    Files: f1.txt
15a1f9cacf25    Files: f2.txt
f3055921fa01    Files: f1.txt

BOB2

BOB2>hg manifest
1.txt
2.txt
Sub/3.txt


解决问题的方法-使用--filemap 中转换扩展名相反,与Wiki相比,方向:这是将repo的子目录转换为单独的存储库的示例,我将存储库的根目录移至子文件夹


Method of solving problem - using Convert extension with --filemap in inversed, compared to Wiki, direction: it's example transform subdir of repo into separate repository, I'll move repository-root into subfolder

  • 地图文件,已准备好进行转换
rename . BOB-newfeatures

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆