"hg update" silently fails causing "mystery adds"
Created originally on Bitbucket by ryanflegel (Ryan Flegel)
TortoiseHg Dialogs (version 2.1.1), Mercurial (version 1.9+10-e9264b45237d)
When a file is locked by another process and an Update is done to another revision where that file has been deleted, the file isn't physically removed from the hard drive, but the update still appears successful. This causes a problem when you merge in the other branch into your workspace--since the file is still physically there, it thinks you meant to keep it there as part of the merge process, so the file re-appears in the merge changeset, even though it was deleted in the other branch.
I assume the same problem exists if the file is modified.
In older version of TortoiseHg this update would have failed, so you couldn't accidentally re-add the file (although it did make a mess of your workarea).
Step-by-step to reproduce: #Delete file in one branch (A) #In a separate branch (B) with a common ancestor, lock a file with another process and update to Branch A. #Merge Branch B into Branch A. #As a result of the merge the file will remain, even though it was deleted in Branch B.
For those using Windows, here's a quick VBScript to lock a file: {{{ Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile("filetolock.txt", 8, True) WScript.Echo ("Press Enter to continue") objFile.Close }}}
Anyway, a warning or error would be preferred to this sneaky behaviour. We've had to delete the same files 3-4 times this week and it's only Wednesday :-)