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.
--- 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