Can't hg update, "Unlinking directory not permitted"!

382 Views Asked by At

I have a Hg repository I created by cloning an SVN repository using hgsubversion. When I do a 'hg update --clean' I get an error: abort: Unlinking directory not permitted: 'E:\Scratch\svn_to_hg\WorkProject_hg\My Project\PublishProfiles'.

If I specify a revision, 1487, the update works fine. If I specify the revision 1488, I get the error. So rev 1488 must be the issue. This is what 1488 looks like:

> hg log -v -r 1488
changeset:   1488:d2292eeddb4e
user:        smartin@c08dbded-914e-0410-8527-b5f3b8929523
date:        Wed May 07 15:29:46 2014 +0000
files:       My Project/PublishProfiles/Shea FS.pubxml

which is me adding a file to the folder it is complaining that it can not delete.

I have 200 revisions after 1488, so I am not sure what to do here...

I am on windows 7, using hg 3.1.1, that came with Tortise HG. I did a update to the latest hgsubversion, I have also tried running the command as an administrator, and the good old 'reboot'.

Any one else have an ideas?

Update: I have an update. I am able to do the update, if I update to 1487, then I notice that the 'PublishProfiles' folder is actually an empty file! I delete that file, and then I can update to 1488 or right to tip. I guess the question now, is how can I get this so others don't have to do this everytime get clone this repository?

2

There are 2 best solutions below

1
sheamus On

Not sure if this is the best answer or not... install git. No I am not being sarcastic. The following work flawlessly for me:

git svn clone REMOTE_SVN --no-metadata --author-file=user_map.txt TEMP_GIT_REPO
hg convert -s git -d hg TEMP_GIT_REPO MY_GIT_REPO

This was actually almost twice as fast as using hgsubversion as well. You will need enable the convert extension, but I think hg ships with it, so nothing to download.

~S

0
elad silver On

I don't know if this will solve your specific problem but maybe it will help others. I'm working on windows (with sourcetree) and Linux with hg. whenever i try to do push/pull/whatever i get that message. what I did in source tree is right click the probplem causing file > stop tracking then right click again and discard file. I'm aware that this is just a temporary work around but it's better then nothing