changeset 3084:75dcfe28da4a

sshrepo: don't try to validate when creating the repo - This removes the "repo not found" error when cloning or init-ing a remote repo. - Since the remote hg will abort if the repo already exists we don't need to validate it.
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Wed, 13 Sep 2006 19:57:40 +0200
parents 82c9d1aac308
children 240ec0e61290
files mercurial/sshrepo.py tests/test-init.out
diffstat 2 files changed, 6 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/sshrepo.py	Wed Sep 13 08:57:08 2006 -0700
+++ b/mercurial/sshrepo.py	Wed Sep 13 19:57:40 2006 +0200
@@ -32,13 +32,6 @@
         remotecmd = self.ui.config("ui", "remotecmd", "hg")
 
         if create:
-            try:
-                self.validate_repo(ui, sshcmd, args, remotecmd)
-            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)
 
--- a/tests/test-init.out	Wed Sep 13 08:57:08 2006 -0700
+++ b/tests/test-init.out	Wed Sep 13 19:57:40 2006 +0200
@@ -3,7 +3,6 @@
 #test failure
 abort: repository local already exists!
 # init+push to remote2
-remote: abort: repository remote2 not found!
 changeset:   0:c4e059d443be
 tag:         tip
 user:        test
@@ -17,26 +16,25 @@
 remote: adding file changes
 remote: added 1 changesets with 1 changes to 1 files
 # clone to remote1
-remote: abort: repository remote1 not found!
 searching for changes
 remote: adding changesets
 remote: adding manifests
 remote: adding file changes
 remote: added 1 changesets with 1 changes to 1 files
 # init to existing repo
-abort: repository ssh://user@dummy/remote1 already exists!
+abort: repository remote1 already exists!
+abort: could not create remote repo!
 # clone to existing repo
-abort: repository ssh://user@dummy/remote1 already exists!
+abort: repository remote1 already exists!
+abort: could not create remote repo!
 # output of dummyssh
-Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio 3: 4: 5:
 Got arguments 1:user@dummy 2:hg init remote2 3: 4: 5:
 Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio 3: 4: 5:
 Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio 3: 4: 5:
-Got arguments 1:user@dummy 2:hg -R remote1 serve --stdio 3: 4: 5:
 Got arguments 1:user@dummy 2:hg init remote1 3: 4: 5:
 Got arguments 1:user@dummy 2:hg -R remote1 serve --stdio 3: 4: 5:
-Got arguments 1:user@dummy 2:hg -R remote1 serve --stdio 3: 4: 5:
-Got arguments 1:user@dummy 2:hg -R remote1 serve --stdio 3: 4: 5:
+Got arguments 1:user@dummy 2:hg init remote1 3: 4: 5:
+Got arguments 1:user@dummy 2:hg init remote1 3: 4: 5:
 # comparing repositories
 0:c4e059d443be
 0:c4e059d443be