Error “Unlinking directory not permitted” when I'm doing hg update with cygwin

When I’m trying to change the branch where I am, I’m getting this error everytime:

# Just check in which branch I am
$ hg branch
django1.6

$ hg update --clean default
abandon: Unlinking directory not permitted: 'D:\Projects\abc\abc'

(abc is the project name, replace for simplicity here). Since it’s a Django project, named abc, I have a subfolder abc that I have created in the django1.6 branch. This folder doesn’t exist yet in the default branch, so if I’m changing the branch, the folder has to be deleted in theory
When I check the properties, I see the folder is in read-only mode, so in cygwin I chmod the folder and try again…

  • Why are deleted branches not removed on the remote after pushing?
  • Mantain old releases without creating long-lived branches
  • How do I properly branch post-commit and revert the trunk in svn?
  • How to work with current working copy when moving to old branch in GIT?
  • What is a “stale” git branch?
  • How to move bugfixes across branches in DVCS?
  • $ chmod -R 0777 hstareal/
    $ hg update --clean default
    abandon: Unlinking directory not permitted: 'D:\Projects\abc\abc'
    $ hg update --clean another-already-existing-branch
    abandon: Unlinking directory not permitted: 'D:\Projects\abc\abc'
    

    For information, I can create a branch and get back to django1.6 without problems:

    $ hg branch test
    marked working directory as branch test
    (branches are permanent and global, did you want a bookmark?)
    
    $ hg update --clean django1.6
    0 files updated, 0 files merged, 0 files removed, 0 files unresolved
    

    Does anyone see where the problem is? I’m sure it’s something related to cygwin, but I can’t see why.

  • How to update my working Git branch from another branch (develop) ?
  • Git difftool ridiculously slow in Cygwin/MinGW
  • With Git, how can I commit some changes in the working copy to a different branch?
  • What are the downsides to using the official Windows Git binaries from cygwin?
  • svn : how to create a branch from certain revision of trunk
  • Are merges in Git different than in Mercurial?
  • One Solution collect form web for “Error “Unlinking directory not permitted” when I'm doing hg update with cygwin”

    The single workaround I found for the moment is to delete the folder by hand and then update the branch.

    $ rm -rf abc/
    $ hg update --clean default
    27 files updated, 0 files merged, 4 files removed, 0 files unresolved
    

    Really dirty but at least it works… I’m still listening to better suggestions 🙂

    Git Baby is a git and github fan, let's start git clone.