如何解决 Mercurial 折叠箱碰撞问题?

发布于 2024-12-07 07:47:58 字数 404 浏览 0 评论 0原文

我使用 Mercurial 作为源代码控制,并在 KILN 上管理主存储库。 在某个时间点,我将 iOS 项目名称从 WeatherTimeMachine 更改为 WeatherTimemachine。 这导致了几个文件和文件夹的大小写更改:

  • WeatherTimeMachine.xcode
  • WeatherTimeMachine_Prefix.pch
  • WeatherTimeMachine-Info.plist

同时,我在 KILN 中的修订版中添加了一个标签...所以我现在有:

  • KILN 中的一个头
  • a 尝试合并

时,我收到以下错误消息:“Mercurial 大小写折叠冲突”

如何解决此问题?

I use Mercurial as source control with the main repository managed on KILN.
At one point in time I changed my iOS project name from WeatherTimeMachine to weathertimemachine.
This resulted in a case change of several files and folders:

  • WeatherTimeMachine.xcode
  • WeatherTimeMachine_Prefix.pch
  • WeatherTimeMachine-Info.plist

In the meantime I've added a tag to a revision in KILN... So I now have:

  • a head in KILN
  • a head on my local repo with case changes

When trying to merge I get the following error message: "Mercurial case-folding collision"

How can I fix this?

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

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

发布评论

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

评论(6

难得心□动 2024-12-14 07:47:58

如果您使用的是 Mac OS X,则无需按照 Mercurial 文档的建议将存储库导出到 Linux 或其他区分大小写的文件系统。只需使用“磁盘工具”创建一个区分大小写的日志磁盘映像,比您的存储库稍大,将您的存储库复制到那里,然后删除冲突的文件并提交。

If you're on Mac OS X, you don't need to export your repository to Linux or another foreign case-sensitive file system as suggested by the Mercurial documentation. Just use Disk Utility to create a case-sensitive, journaled disk image slightly bigger than your repository, copy your repo there, then remove the conflicting files and commit.

行雁书 2024-12-14 07:47:58

这是一个无需编程的答案,但它一劳永逸地解决了我反复无常的案例折叠问题!无论如何,现在......

我放弃了避免和“修复”案例碰撞问题的尝试。这看起来很丑陋,你永远无法真正“解决”问题,只能采取解决方法。

(我能想到的)真正解决问题的唯一方法是使用区分大小写的文件系统。无需重新格式化整个磁盘,单个分区即可很好地完成这项工作。

我使用了操作系统附带的磁盘实用程序应用程序,非常简单,只需记住在创建新分区时选择Mac OS Extended(区分大小写,日志式)即可。另请注意,磁盘工具只能通过移动分区的末尾(而不是开头)来调整分区大小。

您可以创建一个指向旧源代码所在位置的符号链接,因此无需更改 IDE 设置和其他内容(但我还没有尝试过这一点,只是对新分区感到满意)。

This is a no-programming no-hg answer, but it solved my mercurial case-folding problems once and for all! For now anyway..

I gave up trying to avoid and "fix" the case-collision problems. That just looks ugly and you can never really "solve" the problem, only can do a workaround.

The only way (that I can think of) to really solve the problem is to have a case-sensitive filesystem. No need to reformat your entire disk, a single partition will do the job nicely.

I used the Disk Utility app that comes with the os, pretty straightforward, just remember to select Mac OS Extended (Case-sensitive, Journaled) when creating new partition. Also, note that the Disk Utility can resize partitions only by moving the end (not the beginning) of partition.

You can probably create a symlink to where your old source code lived, so no need to change the IDE settings and stuff (but I haven't tried this, just happy with the new partition).

江南烟雨〆相思醉 2024-12-14 07:47:58

我在这里找到了一些信息:FishingCaseCollisions,但不知何故这对我不起作用。以下是我设法解决此问题的方法:

复制现有的存储库文件夹(为了安全)。例如:

  • cp -r WeatherTimeMachine WeatherTimeMachineCopy

欺骗 Mercurial 使其认为有问题的版本是当前提示:

  • hg debugsetparents
  • hg debugrebuildstate

删除导致问题的文件(需要使用 -f 来强制删除)。下面是一个示例:

  • hg rm -A -f WeatherTimeMachine-Info.plist

删除所有有问题的文件后,提交更改

  • hg ci -m "fixed colony-folding issues" -u michael

然后将 Mercurial 恢复到正确的版本

  • hg debugsetparents Tip
  • hg debugrebuildstate

在此之后,可以进行合并,问题就消失了。

现在我可以愉快地继续使用 MacHg 来管理我的 Mercurial 存储库并将我的更改集推送到 KILN。

I have found some information here: FixingCaseCollisions, but somehow this did not work for me. Here is how I managed to solve this issue:

Make a copy of your existing repository folder (for safety). For example:

  • cp -r WeatherTimeMachine WeatherTimeMachineCopy

Fool mercurial into thinking the problematic revision is the current tip:

  • hg debugsetparents <bad revision>
  • hg debugrebuildstate

Remove the files which are causing the problem (-f is required to force the removal). Here is an example:

  • hg rm -A -f WeatherTimeMachine-Info.plist

Once all problematic files have been removed, commit the changes

  • hg ci -m "fixed collision-folding issue" -u michael

Then restore mercurial to the proper revision

  • hg debugsetparents tip
  • hg debugrebuildstate

After this the merge is possible and the problem is gone.

And now I can happily resume working with MacHg to manage my Mercurial repository and push my change sets to KILN.

阳光的暖冬 2024-12-14 07:47:58

我们通过发出 HG 重命名命令解决了这个问题,而没有诉诸区分大小写的文件系统。假设您遇到了麻烦,因为“Foo.txt”需要被称为“foo.txt”:

> hg rename Foo.txt Foo.txt.renamed
> hg rename Foo.txt.renamed foo.txt

当文件被删除,然后在主存储库中以相同的名称重新创建时,我们遇到了这个问题,但大小写不同。尽管已从主存储库中提取变更集,但无法合并在这些更改之前创建的分支存储库。

We resolved this without resorting to a case-sensitive filesystem by issuing HG rename commands. Say you are having trouble because "Foo.txt" needs to be called "foo.txt":

> hg rename Foo.txt Foo.txt.renamed
> hg rename Foo.txt.renamed foo.txt

We encountered this problem when a file was deleted and then later re-created in the main repository with the same name, but different case. A branch repository that was created before these changes could not then be merged in, despite the changesets from the main repository having been pulled.

铁憨憨 2024-12-14 07:47:58

对于 Mac OS X,对我来说有效的是简单地复制文件夹(重复工作 - cmd-D)并从新路径继续处理它。

For Mac OS X, what worked for me is to simply copy the folder (duplicate works - cmd-D) and continue working on it, from the new path.

疾风者 2024-12-14 07:47:58

OSX 相同,我想克隆一个存储库,但我遇到了大小写折叠错误,阻止了我进行顶部克隆。

如果存储库有多个提交,只需使用以下命令克隆早期版本:

hg clone -r 7

然后将任何冲突的内容添加到 .hgignore 文件并更新。

OSX same I wanted to clone a repo and I had case-folding error preventing me top clone.

If the repository has multiple commit simply clone an earlier revision with this command:

hg clone -r 7

Then add anything conflicting to the .hgignore file and update.

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