views:

35

answers:

1

I made a repository as a test a while ago but I now want to create a different repository with the same name - is there a way to delete an existing repository using mercurial-server, and create another one with the same name? Or perhaps a way to overwrite the contents of a repository?

+1  A: 

Mercurial repos are just file system paths, so you should be able to remove the the repo and rebuild a new one it isn't place. IN looking it appears the mercurial-server wraps standard repos with a special restricted shell, to control access. I've never used mercurial-server, but I don't see why you couldn't create a backup of the directory at the filesystem level, then rm it and start over..

Doon
Yes you can. I already did that a couple of times under Mercurial server. Just rm -rf <repo> on the server machine, and hg will forget all about the previous repo.
Christophe Muller
This is probably a silly question, but how do I do that when the hg user has no password and I can't see the path to be able to rm it using sudo? I could give root a password temporarily I guess but that seems messy.
Ben Hymers
sudo <insert your shell here> or could also try sudo su hg for example:sudo sh will give you a root shell, and you should be all set to remove the directory (assuming your sudo will allow it) sudo su hg should switch you to the hg user, and also allow you to remove the directory (There are cases where this won't work such as invalid shell, etc..) but one of the 2 above should work.
Doon
You're a star. Thanks!
Ben Hymers