# HG changeset patch # User Benoit Boissinot # Date 1157231675 -7200 # Node ID adf7f3421c5591c890a2f8f4be192d075447caa2 # Parent 4d0e0f149581540df2c6b50ecf864e69f2f434f5 sshrepo: when creating a repo, raise an error if it already exists diff -r 4d0e0f149581 -r adf7f3421c55 mercurial/sshrepo.py --- a/mercurial/sshrepo.py Sat Sep 02 23:06:47 2006 +0200 +++ b/mercurial/sshrepo.py Sat Sep 02 23:14:35 2006 +0200 @@ -34,9 +34,10 @@ 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)