From 70c5519b8f83c5b95e6a76814eb4070d4057bdf8 Mon Sep 17 00:00:00 2001 From: Sverre Rabbelier Date: Sun, 24 Jul 2011 13:43:34 +0200 Subject: [PATCH] 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. --- git_remote_helpers/git/importer.py | 2 +- git_remote_helpers/git/repo.py | 6 +++--- git_remote_helpers/helper.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/git_remote_helpers/git/importer.py b/git_remote_helpers/git/importer.py index 02a719ac02..b7d6107933 100644 --- a/git_remote_helpers/git/importer.py +++ b/git_remote_helpers/git/importer.py @@ -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')) diff --git a/git_remote_helpers/git/repo.py b/git_remote_helpers/git/repo.py index acbf8d7785..4536233868 100644 --- a/git_remote_helpers/git/repo.py +++ b/git_remote_helpers/git/repo.py @@ -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") diff --git a/git_remote_helpers/helper.py b/git_remote_helpers/helper.py index a2e968e8d8..164c8b578f 100644 --- a/git_remote_helpers/helper.py +++ b/git_remote_helpers/helper.py @@ -70,7 +70,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) @@ -129,7 +129,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: -- 2.11.4.GIT