Mercurial > hgsubversion
comparison hgsubversion/svnrepo.py @ 1555:cff81f35b31e
cleanup: reference Abort from mercurial.error instead of mercurial.util
It's been there since hg 1.7 or so, which lets us avoid any need for
compat shims.
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Sat, 24 Mar 2018 16:39:30 -0400 |
parents | 27c4daf50520 |
children | ae572c9be4e6 |
comparison
equal
deleted
inserted
replaced
1554:258fb67fb956 | 1555:cff81f35b31e |
---|---|
131 if path is None: | 131 if path is None: |
132 path = self.ui.config('paths', 'default-push') | 132 path = self.ui.config('paths', 'default-push') |
133 if path is None: | 133 if path is None: |
134 path = self.ui.config('paths', 'default') | 134 path = self.ui.config('paths', 'default') |
135 if not path: | 135 if not path: |
136 raise hgutil.Abort('no Subversion URL specified. Expect ' | 136 raise error.Abort('no Subversion URL specified. Expect ' |
137 '[path] default= or [path] default-push= ' | 137 '[path] default= or [path] default-push= ' |
138 'SVN URL entries in hgrc.') | 138 'SVN URL entries in hgrc.') |
139 self.path = path | 139 self.path = path |
140 if peerapi == 1: | 140 if peerapi == 1: |
141 self._capabilities = set(['lookup', 'subversion']) | 141 self._capabilities = set(['lookup', 'subversion']) |
177 try: | 177 try: |
178 auth = self.svnauth | 178 auth = self.svnauth |
179 return svnwrap.SubversionRepo(auth[0], auth[1], auth[2], password_stores=self.password_stores) | 179 return svnwrap.SubversionRepo(auth[0], auth[1], auth[2], password_stores=self.password_stores) |
180 except svnwrap.SubversionConnectionException, e: | 180 except svnwrap.SubversionConnectionException, e: |
181 self.ui.traceback() | 181 self.ui.traceback() |
182 raise hgutil.Abort(e) | 182 raise error.Abort(e) |
183 | 183 |
184 @property | 184 @property |
185 def ui(self): | 185 def ui(self): |
186 return self._ui | 186 return self._ui |
187 | 187 |
197 def heads(self, *args, **opts): | 197 def heads(self, *args, **opts): |
198 """ | 198 """ |
199 Whenever this function is hit, we abort. The traceback is useful for | 199 Whenever this function is hit, we abort. The traceback is useful for |
200 figuring out where to intercept the functionality. | 200 figuring out where to intercept the functionality. |
201 """ | 201 """ |
202 raise hgutil.Abort('command unavailable for Subversion repositories') | 202 raise error.Abort('command unavailable for Subversion repositories') |
203 | 203 |
204 def pushkey(self, namespace, key, old, new): | 204 def pushkey(self, namespace, key, old, new): |
205 return False | 205 return False |
206 | 206 |
207 def listkeys(self, namespace): | 207 def listkeys(self, namespace): |
249 except error.RepoError: | 249 except error.RepoError: |
250 ui.traceback() | 250 ui.traceback() |
251 ui.note('(falling back to Subversion support)\n') | 251 ui.note('(falling back to Subversion support)\n') |
252 | 252 |
253 if create: | 253 if create: |
254 raise hgutil.Abort('cannot create new remote Subversion repository') | 254 raise error.Abort('cannot create new remote Subversion repository') |
255 | 255 |
256 svnwrap.prompt_callback(SubversionPrompt(ui)) | 256 svnwrap.prompt_callback(SubversionPrompt(ui)) |
257 return svnremoterepo(ui, url) | 257 return svnremoterepo(ui, url) |
258 | 258 |
259 class SubversionPrompt(object): | 259 class SubversionPrompt(object): |