diff mercurial/sshrepo.py @ 7637:1d54e2f6c0b7

error: move repo errors rename NoCapability to CapabilityError
author Matt Mackall <mpm@selenic.com>
date Mon, 12 Jan 2009 10:42:31 -0600
parents 4dd7b28003d2
children d2f753830f80
line wrap: on
line diff
--- a/mercurial/sshrepo.py	Sun Jan 11 23:04:24 2009 -0600
+++ b/mercurial/sshrepo.py	Mon Jan 12 10:42:31 2009 -0600
@@ -7,7 +7,7 @@
 
 from node import bin, hex
 from i18n import _
-import repo, os, re, util
+import repo, os, re, util, error
 
 class remotelock(object):
     def __init__(self, repo):
@@ -26,7 +26,7 @@
 
         m = re.match(r'^ssh://(([^@]+)@)?([^:/]+)(:(\d+))?(/(.*))?$', path)
         if not m:
-            self.raise_(repo.RepoError(_("couldn't parse location %s") % path))
+            self.raise_(error.RepoError(_("couldn't parse location %s") % path))
 
         self.user = m.group(2)
         self.host = m.group(3)
@@ -45,7 +45,7 @@
             ui.note(_('running %s\n') % cmd)
             res = util.system(cmd)
             if res != 0:
-                self.raise_(repo.RepoError(_("could not create remote repo")))
+                self.raise_(error.RepoError(_("could not create remote repo")))
 
         self.validate_repo(ui, sshcmd, args, remotecmd)
 
@@ -78,7 +78,7 @@
             lines.append(l)
             max_noise -= 1
         else:
-            self.raise_(repo.RepoError(_("no suitable response from remote hg")))
+            self.raise_(error.RepoError(_("no suitable response from remote hg")))
 
         self.capabilities = util.set()
         lines.reverse()
@@ -157,7 +157,7 @@
         if int(success):
             return bin(data)
         else:
-            self.raise_(repo.RepoError(data))
+            self.raise_(error.RepoError(data))
 
     def heads(self):
         d = self.call("heads")
@@ -198,7 +198,7 @@
         d = self.call("unbundle", heads=' '.join(map(hex, heads)))
         if d:
             # remote may send "unsynced changes"
-            self.raise_(repo.RepoError(_("push refused: %s") % d))
+            self.raise_(error.RepoError(_("push refused: %s") % d))
 
         while 1:
             d = cg.read(4096)
@@ -211,7 +211,7 @@
         r = self._recv()
         if r:
             # remote may send "unsynced changes"
-            self.raise_(repo.RepoError(_("push failed: %s") % r))
+            self.raise_(error.RepoError(_("push failed: %s") % r))
 
         r = self._recv()
         try:
@@ -222,7 +222,7 @@
     def addchangegroup(self, cg, source, url):
         d = self.call("addchangegroup")
         if d:
-            self.raise_(repo.RepoError(_("push refused: %s") % d))
+            self.raise_(error.RepoError(_("push refused: %s") % d))
         while 1:
             d = cg.read(4096)
             if not d: