Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/devbot/git.py
diff options
context:
space:
mode:
Diffstat (limited to 'devbot/git.py')
-rw-r--r--devbot/git.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/devbot/git.py b/devbot/git.py
index 4a86bd6..4e7d86c 100644
--- a/devbot/git.py
+++ b/devbot/git.py
@@ -6,6 +6,7 @@ from devbot import utils
_root_path = None
+
def _chdir(func):
def wrapped(*args, **kwargs):
orig_cwd = os.getcwd()
@@ -18,6 +19,7 @@ def _chdir(func):
return wrapped
+
class Module:
def __init__(self, path=None, name=None, remote=None,
branch="master", tag=None, retry=10):
@@ -43,7 +45,7 @@ class Module:
if self.tag:
command.run(["git", "checkout", self.tag])
- else:
+ else:
command.run(["git", "checkout", self._branch])
def update(self):
@@ -68,7 +70,7 @@ class Module:
if revision is None:
revision = self._branch
- command.run(["git", "checkout", revision])
+ command.run(["git", "checkout", revision])
@_chdir
def describe(self):
@@ -93,7 +95,7 @@ class Module:
def get_annotation(self, tag):
# FIXME this is fragile, there must be a better way
- show = subprocess.check_output(["git", "show", tag])
+ show = subprocess.check_output(["git", "show", tag])
annotation = []
for line in show.split("\n"):
@@ -120,10 +122,12 @@ class Module:
return True
+
def set_root_path(path):
global _root_path
_root_path = path
+
def get_root_module():
remote = "git://git.sugarlabs.org/sugar-build/sugar-build.git"