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


When I'm trying to <strong>change the branch where I am</strong>, 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 <strong>doesn't exist yet in the default branch</strong>, so if I'm changing the branch, the folder has to be deleted in theory<br /> When I check the properties, I see the folder is in read-only mode, so in cygwin I chmod the folder and try again...

$ 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.


The single workaround I found for the moment is to delete the folder <em>by hand</em> 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 :)


  • Context Rendering in Django
  • cakephp 2 css, javascript and links not working on local machine/localhost
  • MIPS Pseudo istructions, replacements
  • merge and order two columns in the same model
  • Robocopy - Compare modified dates of files?
  • Django how to modify database records by template
  • app_Offline.htm doesn't work for subfolders of my application in IIS
  • Direct insert data in mysql data in android
  • How to separate filename from path? basename() versus preg_split() with array_pop()
  • Is there an easy way to associate an event with a ListViewItem?
  • Why is django manage.py syncdb failing to create new columns on my development server?
  • Thread synchronization with syncwarp
  • Django return user model id with L
  • What does “t” refer to in this SQL?
  • For loop with if condition on multiple R functions
  • CERN ROOT exporting data to plain text
  • Updating both a ConcurrentHashMap and an AtomicInteger safely
  • Spring Cloud Microservice Architecture Confusion
  • How does document.ready work with angular element directives?
  • Not able to aggregate on nested fields in elasticsearch
  • gspread or such: help me get cell coordinates (not value)
  • Django simple Captcha “No module named fields” error
  • How do I exclude a dependency in provided scope when running in Maven test scope?
  • Xcode 4 NSLog Macro link in Xcode 3
  • Why does access(2) check for real and not effective UID?
  • Q promise. Difference between .when and .then
  • Paperclip, set path outside of rails root folder
  • Incrementing object id automatically JS constructor (static method and variable)
  • InvalidAuthenticityToken between subdomains when logging in with Rails app
  • Proper folder structure for lots of source files
  • SQL merge duplicate rows and join values that are different
  • Load html files in TinyMce
  • Free memory of cv::Mat loaded using FileStorage API
  • C# - Getting references of reference
  • File not found error Google Drive API
  • Qt: Run a script BEFORE make
  • LevelDB C iterator
  • unknown Exception android
  • Can't mass-assign protected attributes when import data from csv file
  • Append folder name and increment by 1 using batch script