# HG changeset patch # User Benoit Boissinot # Date 2006-09-02 21:14:35 # Node ID adf7f3421c5591c890a2f8f4be192d075447caa2 # Parent 4d0e0f149581540df2c6b50ecf864e69f2f434f5 sshrepo: when creating a repo, raise an error if it already exists diff --git a/mercurial/sshrepo.py b/mercurial/sshrepo.py --- a/mercurial/sshrepo.py +++ b/mercurial/sshrepo.py @@ -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)