Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • thg thg
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 835
    • Issues 835
    • List
    • Boards
    • Service Desk
    • Milestones
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • mercurial
  • TortoiseHg
  • thgthg
  • Issues
  • #961

Closed
Open
Created Jul 13, 2011 by Bitbucket Importer@bitbucket_importerOwner

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

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking