tags:

views:

64

answers:

3

Hi,

I am looking to remove a directory from local and central repository. I managed to do it locally by

     hg remove name_directoriy  
     hg commit

However, after pushing my changes to the central repository the deleted folder is still in the central repository while it is gone locally.

How to remove directory in central repository?

Thank you

p.s. with 'remove' i mean that it does not appear but still it is in the history

+3  A: 

If you mean that you want to remove it from the history on the central repository, the answer is that you can't - that's not how version control works.

If you mean that your remote repository has a working directory that you want the file(s) to disappear from, then you probably need to run hg update on that remote repo.

Amber
Thank you but 'hg update' did not work. any other suggestions?
latvian
Is there any file left in `name_directoriy`? hg will not remove the directory if some ignored files somehow get in there.
Geoffrey Zheng
+2  A: 

The idea of central repository is foreign to mercurial, all repositories are equal, so the idea of a central repository is only useful when thinking about your workflow.

What this means is that the directory is in the history of both your local copy of the repository and the one you call central.

Mercurial, as any other SCM, doesn't delete files or directories from the history, as that would defeat its whole purpose, so you'd better ask yourself why you want to delete it, is it something that really can't be there (like a directory full of sensitive medical records in a public repository) or is it just a directory that isn't needed anymore?, if the answer is the latter, just leave it alone, maybe in the future you'll be glad it's there, if you REALLY need to delete it, take a look around here.

diegogs
Thank you for replay. Answering the question it is just directory not needed. I would like to delete to avoid confusion for others(imagine 10 or 20 like that kind of directories) and eliminate opportunity for others to use 'deleted' directory. I think its a enough argument to delete...at last, i don't want to be limited by technology. again, i am not trying to delete from history but so that it just does not appear there
latvian
+5  A: 

What you want to do on the remote repository is:

hg update

What you've described above removes the files in that directory, and then pushes the change the removes the files up to the remote repository, but it doesn't update the working directory files on the remote repository. To update the working directory on that remote repository you need to run the update command there.

As everyone else is pointing out those files, of course, still exist in history, but if you want them out of the working dir it's the update you're missing.

Ry4an
thank you for replay. The 'hg update' does not do the work. I still can see the deleted directory in the central repository
latvian
When you say "see it in the central repository" where are you seeing it? Are you looking at a web interface (hgweb or bitbucket)? Are you looking at the filesystem and doing a directory listing? Are you actually seeing the files in the directory or just the directory? What does `hg summary` say when you run it on the server? Lastly, are you _positive you ran `hg update` on a shell on the remote server, not locally?
Ry4an
...let me try to answer best i know. It is running on web interface but i am not sure if it is hgweb or bitbucket, how do I tell that? I am on filesystem and doing "dir" to see. "hg status" does not show since i committed already. Oh i see, i did the update locally but i need to do it on server for server to sync with central, correct?...i will try that in moment and will get back to you. Thank you again
latvian
Looks like the Mercurial Web app is caching per session, so when i refreshed the page the changes in central did not show up. After starting new session(new window opened) the changes in central repository showed up. Thank you....whether the changes were due to 'hg update' or not i cannot tell for sure but i assume it was
latvian