Mercurial > hg-git
comparison hggit/gitrepo.py @ 1128:6141895a53c9
compat: switch from hgutil.Abort to error.Abort
author | Kevin Bullock <kbullock@ringworld.org> |
---|---|
date | Wed, 02 May 2018 20:43:17 -0500 |
parents | e41773ad3584 |
children | 5edabf9db748 |
comparison
equal
deleted
inserted
replaced
1127:108d9303ef71 | 1128:6141895a53c9 |
---|---|
1 from util import isgitsshuri | 1 from util import isgitsshuri |
2 from mercurial import util | 2 from mercurial import ( |
3 from mercurial.error import RepoError | 3 error, |
4 util | |
5 ) | |
4 | 6 |
5 peerapi = False | 7 peerapi = False |
6 try: | 8 try: |
7 from mercurial.repository import peer as peerrepository | 9 from mercurial.repository import peer as peerrepository |
8 peerapi = True | 10 peerapi = True |
11 | 13 |
12 | 14 |
13 class gitrepo(peerrepository): | 15 class gitrepo(peerrepository): |
14 def __init__(self, ui, path, create, intents=None): | 16 def __init__(self, ui, path, create, intents=None): |
15 if create: # pragma: no cover | 17 if create: # pragma: no cover |
16 raise util.Abort('Cannot create a git repository.') | 18 raise error.Abort('Cannot create a git repository.') |
17 self._ui = ui | 19 self._ui = ui |
18 self.path = path | 20 self.path = path |
19 self.localrepo = None | 21 self.localrepo = None |
20 | 22 |
21 _peercapabilities = ['lookup'] | 23 _peercapabilities = ['lookup'] |
37 if isinstance(key, str): | 39 if isinstance(key, str): |
38 return key | 40 return key |
39 | 41 |
40 def local(self): | 42 def local(self): |
41 if not self.path: | 43 if not self.path: |
42 raise RepoError | 44 raise error.RepoError |
43 | 45 |
44 def heads(self): | 46 def heads(self): |
45 return [] | 47 return [] |
46 | 48 |
47 def listkeys(self, namespace): | 49 def listkeys(self, namespace): |