Merge lp:~milo/linaro-patchmetrics/bug1012037 into lp:linaro-patchmetrics
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Milo Casagrande | ||||
Approved revision: | 365 | ||||
Merged at revision: | 362 | ||||
Proposed branch: | lp:~milo/linaro-patchmetrics/bug1012037 | ||||
Merge into: | lp:linaro-patchmetrics | ||||
Diff against target: |
131 lines (+31/-24) 1 file modified
apps/patchwork/utils.py (+31/-24) |
||||
To merge this branch: | bzr merge lp:~milo/linaro-patchmetrics/bug1012037 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Deepti B. Kalakeri (community) | Approve | ||
Review via email: mp+111203@code.launchpad.net |
Description of the change
This is a duplicate merge request: the previous one had to be removed since we couldn't push anything in Launchpad, and the code was in an external git repo. Now we have a Launchpad Bazaar branch here.
Pasting the old review comment:
With this merge the timeout errors should be resolved.
I re-arranged also the messages we have in case of error, in order to be a little bit more verbose so to have a better idea of where and what is happening.
I removed the file handle for stderr on the call to "git clone", since only in that case we are experiencing the timeouts. This will lead to output to be printed on the cmdline, because even redirecting it with "2>/dev/null" is not working (at least locally).
I also removed the reference to "HEAD" in git pull operations since it is only a reference, and if we have to switch branch for some reasons, this will not work.
This looks good. Just a small comment on the alignment, can we use a similar alignment this fits well within 80 columns and looks readable as well ?
=== modified file 'apps/patchwork /utils. py' utils.py 2012-06-18 14:37:25 +0000 utils.py 2012-06-20 13:23:12 +0000 join(settings. PATCHWORK_ GIT_REPOS_ DIR, project.linkname)
--- apps/patchwork/
+++ apps/patchwork/
@@ -186,13 +186,11 @@
root = os.path.
if os.path. exists( root): subprocess. PIPE, stderr= subprocess. PIPE) Popen([ 'git', 'pull', 'origin'], cwd=root, subprocess. PIPE, stderr= subprocess. PIPE) source_ tree, root], subprocess. PIPE) Popen([ 'git', 'clone', project. source_ tree, root], subprocess. PIPE)
- proc = subprocess.Popen(
- ['git', 'pull', 'origin'], cwd=root,
- stdout=
+ proc = subprocess.
+ stdout=
else:
- proc = subprocess.Popen(
- ['git', 'clone', project.
- stdout=
+ proc = subprocess.
+ stdout=
Also, I ran pep8 on the file and there are couple of fixes which needs to be done, would you please incorporate them as well. Otherwise looks good.