How do you disable mercurial from leaving .orig files after a merge?

老子叫甜甜 提交于 2019-12-18 12:05:42

问题


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.


回答1:


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.




回答2:


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

rm **/*.orig

Alternatively you can use Hg Purge extension




回答3:


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

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



回答4:


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




回答5:


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)"



来源:https://stackoverflow.com/questions/7429332/how-do-you-disable-mercurial-from-leaving-orig-files-after-a-merge

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!