comparison mercurial/sshrepo.py @ 3033:adf7f3421c55

sshrepo: when creating a repo, raise an error if it already exists
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Sat, 02 Sep 2006 23:14:35 +0200
parents 2b0bc36a48d8
children 75dcfe28da4a
comparison
equal deleted inserted replaced
3032:4d0e0f149581 3033:adf7f3421c55
32 remotecmd = self.ui.config("ui", "remotecmd", "hg") 32 remotecmd = self.ui.config("ui", "remotecmd", "hg")
33 33
34 if create: 34 if create:
35 try: 35 try:
36 self.validate_repo(ui, sshcmd, args, remotecmd) 36 self.validate_repo(ui, sshcmd, args, remotecmd)
37 return # the repo is good, nothing more to do
38 except hg.RepoError: 37 except hg.RepoError:
39 pass 38 pass
39 else:
40 raise hg.RepoError(_("repository %s already exists") % path)
40 41
41 cmd = '%s %s "%s init %s"' 42 cmd = '%s %s "%s init %s"'
42 cmd = cmd % (sshcmd, args, remotecmd, self.path) 43 cmd = cmd % (sshcmd, args, remotecmd, self.path)
43 44
44 ui.note('running %s\n' % cmd) 45 ui.note('running %s\n' % cmd)