# Timeout for git operations.
GIT_TIMEOUT = 120 * 60
+# XXX This is a temporary solution, a workardound for bug 1017933.
+# Once that bug is fixed or in the process, this should be removed.
FIXME would be more appropriate than XXX
+ # XXX this is a temporary solution, we need to fix bug
+ # https://bugs.launchpad.net/linaro-patchmetrics/+bug/1017933
+ if project.name in REPO_BRANCHES:
+ ensure_on_valid_branch(project, REPO_BRANCHES.get(project.name))
+
Here as well, FIXME would be more appropriate than XXX
The following piece of code repeats in 2 places, it can be made as a function call ?
wait = 0
wait_increment = 5
while wait < timeout:
proc.poll()
if proc.returncode is not None:
break
wait += wait_increment time.sleep(wait_increment)
if proc.returncode is None: kill_git_processes(proc, project)
+++ apps/patchwork/ bin/update- committed- patches. py 2012-06-28 08:43:05 +0000
@@ -21,8 +21,12 @@
from patchwork.models import Project, State source_ checkout_ for_project, FailedToFetchGi tRepo, for_commit, get_commits_ to_parse, get_patches_ matching_ commit) source_ checkout_ for_project, to_parse, for_commit, matching_ commit,
from patchwork.utils import (
- ensure_
- get_diff_
+ ensure_
+ get_commits_
+ get_diff_
+ get_patches_
+ GitException,
+ )
The comma at the end can be removed.
=== modified file 'apps/patchwork /utils. py' utils.py 2012-06-25 15:29:36 +0000 utils.py 2012-06-28 08:43:05 +0000
--- apps/patchwork/
+++ apps/patchwork/
@@ -33,6 +33,25 @@
# Timeout for git operations.
GIT_TIMEOUT = 120 * 60
+# XXX This is a temporary solution, a workardound for bug 1017933.
+# Once that bug is fixed or in the process, this should be removed.
FIXME would be more appropriate than XXX
+ # XXX this is a temporary solution, we need to fix bug /bugs.launchpad .net/linaro- patchmetrics/ +bug/1017933 on_valid_ branch( project, REPO_BRANCHES. get(project. name))
+ # https:/
+ if project.name in REPO_BRANCHES:
+ ensure_
+
Here as well, FIXME would be more appropriate than XXX
The following piece of code repeats in 2 places, it can be made as a function call ?
wait = 0
wait_increment = 5
while wait < timeout:
time.sleep( wait_increment)
proc.poll()
if proc.returncode is not None:
break
wait += wait_increment
if proc.returncode is None:
kill_git_ processes( proc, project)
stdout, stderr = proc.communicate()