git-remote-testgit: make local a function

Other helpers (such as git-remote-hg) require that 'self.local' is a
function, rather than a variable.
This commit is contained in:
Sverre Rabbelier
2011-07-24 13:43:34 +02:00
committed by Pat Thoyts
parent 7bd3e8c326
commit a2f32259dd
3 changed files with 6 additions and 6 deletions

View File

@@ -23,7 +23,7 @@ class GitImporter(object):
"""
dirname = self.repo.get_base_path(base)
if self.repo.local:
if self.repo.local():
gitdir = self.repo.gitpath
else:
gitdir = os.path.abspath(os.path.join(dirname, '.git'))

View File

@@ -38,14 +38,14 @@ class GitRepo(object):
self.path = path
self.head = None
self.revmap = {}
self.local = not is_remote(self.path)
self.local = lambda: not is_remote(self.path)
if(self.path.endswith('.git')):
self.gitpath = self.path
else:
self.gitpath = os.path.join(self.path, '.git')
if self.local and not os.path.exists(self.gitpath):
if self.local() and not os.path.exists(self.gitpath):
os.makedirs(self.gitpath)
def get_revs(self):
@@ -68,7 +68,7 @@ class GitRepo(object):
"""Determines the head of a local repo.
"""
if not self.local:
if not self.local():
return
path = os.path.join(self.gitpath, "HEAD")

View File

@@ -71,7 +71,7 @@ class RemoteHelper(object):
"""Updates (or clones) a local repo.
"""
if repo.local:
if repo.local():
return repo
path = repo.non_local.clone(repo.gitdir)
@@ -130,7 +130,7 @@ class RemoteHelper(object):
changed[name] = value
if not repo.local:
if not repo.local():
repo.non_local.push(repo.gitdir)
for ref in changed: