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

陌路散爱 提交于 2020-01-17 05:21:10

问题


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

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


回答1:


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



来源:https://stackoverflow.com/questions/22363360/error-unlinking-directory-not-permitted-when-im-doing-hg-update-with-cygwin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!