sshrepo: when creating a repo, raise an error if it already exists

This commit is contained in:
Benoit Boissinot 2006-09-02 23:14:35 +02:00
parent 4456f11f57
commit 955f1cbc96

View File

@ -34,9 +34,10 @@ class sshrepository(remoterepository):
if create:
try:
self.validate_repo(ui, sshcmd, args, remotecmd)
return # the repo is good, nothing more to do
except hg.RepoError:
pass
else:
raise hg.RepoError(_("repository %s already exists") % path)
cmd = '%s %s "%s init %s"'
cmd = cmd % (sshcmd, args, remotecmd, self.path)