如何禁止 Mercurial 在合并后留下 .orig 文件?

发布于 2024-12-04 14:16:03 字数 144 浏览 0 评论 0原文

不久前更新 TortoiseHg+Mercurial 后,我开始在合并后获取 .orig 文件。我已经研究了删除/清除它们的解决方案,但我正在寻找一种方法来禁用文件被遗忘。在没有出现这些文件的情况下进行良好合并后,我想知道这是否是可以关闭的新功能。

After updating TortoiseHg+Mercurial a while back I am starting to get .orig files after merges. I have looked at the solutions for removing/purging them but I am looking for a way to disable the files from being left behind. After doing merges fine without these files appearing I was wondering if this was something new that could be turned back off.

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

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

发布评论

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

评论(5

涙—继续流 2024-12-11 14:16:03

更新:

根据 Mercurial 配置文档 默认部分已被弃用。 Mercurial wiki 对它们的使用也特别批评。建议的替代方法是创建一个命令别名(而不是隐藏内置命令)来提供您正在寻找的功能。这是我在配置中切换到的内容。

[alias]
undo = revert --no-backup

原文:

我在遇到完全相同的问题时偶然发现了这一点。我一直在处理它并删除 .orig 文件,因为我似乎从来不需要它们。我发现的最好的建议是 StackOverflow,并建议使用 hgrc 文件的默认部分。要具体解决此问题,请添加以下部分:

[defaults]
revert = --no-backup

这是我读到的相关内容。

Update:

According to the Mercurial config documentation the defaults section is deprecated. The Mercurial wiki is also particularly critical of their use. The recommended replacement is to create a command alias (while not shadowing built in commands) that provides the functionality you are looking for. Here's what I've switched to in my config.

[alias]
undo = revert --no-backup

Original:

I stumbled across this while experiencing the exact same problem. I had been just dealing with it and deleting the .orig files, since I never seem to need them. The best recommendation I've found was on StackOverflow and suggests using the defaults section of your hgrc file. To address this specifically, add the following section:

[defaults]
revert = --no-backup

Here's where I read about this.

蓝色星空 2024-12-11 14:16:03

就我个人而言,我会将 *.orig 文件添加到 hg 忽略列表中,并且时不时地执行 a

rm **/*.orig

或者您可以使用 汞清除扩展

Personally I will add *.orig files to the hg ignore list, and from time to time do a

rm **/*.orig

Alternatively you can use Hg Purge extension

野侃 2024-12-11 14:16:03

以下内容似乎足以说服 hg 不要写入这些文件:

# ~/.hgrc
[ui]
origbackuppath = /tmp/hg-trash

The following seems to be enough to convince hg not to write these files:

# ~/.hgrc
[ui]
origbackuppath = /tmp/hg-trash
零時差 2024-12-11 14:16:03

我通过禁用应用程序中的备份使其在 SourceTree 中工作。

输入图片此处描述

I got it working in SourceTree by disabling backups in application.

enter image description here

-黛色若梦 2024-12-11 14:16:03

留下 .orig 文件的是 KDiff3,而不是 TortoiseHg。
禁用此设置的方法如下:

设置 - 配置 KDiff3 - 选项卡目录
最后一个复选框:“备份文件 (.orig)”

It is KDiff3 that is leaving the .orig files, not TortoiseHg.
This is how to disable this setting:

Settings - Configure KDiff3 - Tab Directory
Last CheckBox: "Backup files (.orig)"

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