2009-06-04 00:15:43 +04:00
|
|
|
from mercurial import repo, util
|
2009-10-08 22:50:09 +04:00
|
|
|
try:
|
|
|
|
from mercurial.error import RepoError
|
|
|
|
except ImportError:
|
|
|
|
from mercurial.repo import RepoError
|
|
|
|
|
2009-04-29 11:54:13 +04:00
|
|
|
from git_handler import GitHandler
|
|
|
|
|
|
|
|
class gitrepo(repo.repository):
|
2009-08-01 20:55:54 +04:00
|
|
|
capabilities = ['lookup']
|
2009-06-04 00:15:43 +04:00
|
|
|
def __init__(self, ui, path, create):
|
2009-07-07 20:46:14 +04:00
|
|
|
if create: # pragma: no cover
|
2009-06-04 00:15:43 +04:00
|
|
|
raise util.Abort('Cannot create a git repository.')
|
2009-10-08 22:50:09 +04:00
|
|
|
self.ui = ui
|
2009-06-04 00:15:43 +04:00
|
|
|
self.path = path
|
2009-08-01 20:55:54 +04:00
|
|
|
def lookup(self, key):
|
|
|
|
if isinstance(key, str):
|
|
|
|
return key
|
2009-10-08 22:50:09 +04:00
|
|
|
def local(self):
|
|
|
|
if not self.path:
|
|
|
|
raise RepoError
|
2010-06-13 06:49:14 +04:00
|
|
|
def heads(self):
|
|
|
|
return []
|
2009-10-08 22:50:09 +04:00
|
|
|
|
2009-04-29 11:54:13 +04:00
|
|
|
|
|
|
|
instance = gitrepo
|