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.
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
revert
have to do with merging? 2) Aliases won't work because the command is not for me but for NetBeans' Mercurial plug-in. –
Liz 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
(cd `hg root` && find . -type f -name "*.orig" | xargs rm)
–
Flori The following seems to be enough to convince hg not to write these files:
# ~/.hgrc
[ui]
origbackuppath = /tmp/hg-trash
/dev/null
doesn't work for me. A good directory choice is /home/yourUserName/.local/share/Trash/files
. This way, you keep the safety against accidental revert without polluting your repo with .orig
files. –
Jeaninejeanlouis /dev/null
. I have updated the answer to use a different directory. –
Sagesagebrush 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)"
© 2022 - 2024 — McMap. All rights reserved.