Mercurial > hg
changeset 11590:0b15aee0a306
protocol: convert some ssh abort calls
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 14 Jul 2010 17:07:13 -0500 |
parents | e8d22fe2ddab |
children | 0d9cb3f3b0a1 |
files | mercurial/sshrepo.py |
diffstat | 1 files changed, 9 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/sshrepo.py Wed Jul 14 17:07:10 2010 -0500 +++ b/mercurial/sshrepo.py Wed Jul 14 17:07:13 2010 -0500 @@ -27,7 +27,7 @@ m = re.match(r'^ssh://(([^@]+)@)?([^:/]+)(:(\d+))?(/(.*))?$', path) if not m: - self.abort(error.RepoError(_("couldn't parse location %s") % path)) + self._abort(error.RepoError(_("couldn't parse location %s") % path)) self.user = m.group(2) self.host = m.group(3) @@ -46,7 +46,7 @@ ui.note(_('running %s\n') % cmd) res = util.system(cmd) if res != 0: - self.abort(error.RepoError(_("could not create remote repo"))) + self._abort(error.RepoError(_("could not create remote repo"))) self.validate_repo(ui, sshcmd, args, remotecmd) @@ -79,7 +79,7 @@ lines.append(l) max_noise -= 1 else: - self.abort(error.RepoError(_("no suitable response from remote hg"))) + self._abort(error.RepoError(_("no suitable response from remote hg"))) self.capabilities = set() for l in reversed(lines): @@ -97,10 +97,6 @@ break self.ui.status(_("remote: "), l) - def abort(self, exception): - self.cleanup() - raise exception - def _abort(self, exception): self.cleanup() raise exception @@ -138,7 +134,7 @@ try: l = int(l) except: - self.abort(error.ResponseError(_("unexpected response:"), l)) + self._abort(error.ResponseError(_("unexpected response:"), l)) return self.pipei.read(l) def _send(self, data, flush=False): @@ -174,7 +170,7 @@ d = self._call("unbundle", heads=' '.join(map(hex, heads))) if d: # remote may send "unsynced changes" - self.abort(error.RepoError(_("push refused: %s") % d)) + self._abort(error.RepoError(_("push refused: %s") % d)) while 1: d = cg.read(4096) @@ -187,13 +183,13 @@ r = self._recv() if r: # remote may send "unsynced changes" - self.abort(error.RepoError(_("push failed: %s") % r)) + self._abort(error.RepoError(_("push failed: %s") % r)) r = self._recv() try: return int(r) except: - self.abort(error.ResponseError(_("unexpected response:"), r)) + self._abort(error.ResponseError(_("unexpected response:"), r)) def addchangegroup(self, cg, source, url): '''Send a changegroup to the remote server. Return an integer @@ -201,7 +197,7 @@ remote.''' d = self._call("addchangegroup") if d: - self.abort(error.RepoError(_("push refused: %s") % d)) + self._abort(error.RepoError(_("push refused: %s") % d)) while 1: d = cg.read(4096) if not d: @@ -218,6 +214,6 @@ try: return int(r) except: - self.abort(error.ResponseError(_("unexpected response:"), r)) + self._abort(error.ResponseError(_("unexpected response:"), r)) instance = sshrepository