aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/util/subproc.py
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2009-12-15 06:44:20 -0500
committerW. Trevor King <wking@drexel.edu>2009-12-15 06:44:20 -0500
commit89b7a1411e4658e831f5d635534b24355dbb941d (patch)
tree77f84979931ac4bf8bcf14d293154fe29e8491bc /libbe/util/subproc.py
parent380889988b6d7881c4e0b5968053f85676d27211 (diff)
downloadbugseverywhere-89b7a1411e4658e831f5d635534b24355dbb941d.tar.gz
Fixed libbe.command.diff + ugly BugDir.duplicate_bugdir implementation
duplicate_bugdir() works, but for the vcs backends, it could require shelling out for _every_ file read. This could, and probably will, be horribly slow. Still it works ;). I'm not sure what a better implementation would be. The old implementation checked out the entire earlier state into a temporary directory pros: single shell out, simple upgrade implementation cons: wouldn't work well for HTTP backens I think a good solution would run along the lines of the currently commented out code in duplicate_bugdir(), where a VersionedStorage.changed_since(revision) call would give you a list of changed files. diff could work off of that directly, without the need to generate a whole duplicate bugdir. I'm stuck on how to handle upgrades though... Also removed trailing whitespace from all python files.
Diffstat (limited to 'libbe/util/subproc.py')
-rw-r--r--libbe/util/subproc.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/libbe/util/subproc.py b/libbe/util/subproc.py
index 8806e26..06716b3 100644
--- a/libbe/util/subproc.py
+++ b/libbe/util/subproc.py
@@ -61,7 +61,7 @@ def invoke(args, stdin=None, stdout=PIPE, stderr=PIPE, expect=(0,),
else:
assert _MSWINDOWS==True, 'invalid platform'
# win32 don't have os.execvp() so have to run command in a shell
- q = Popen(args, stdin=PIPE, stdout=stdout, stderr=stderr,
+ q = Popen(args, stdin=PIPE, stdout=stdout, stderr=stderr,
shell=True, cwd=cwd)
except OSError, e:
raise CommandError(args, status=e.args[0], stderr=e)
@@ -133,7 +133,7 @@ class Pipe (object):
thread.start()
threads.append(thread)
std_X_arrays.append(stderr_array)
-
+
# also listen to the last processes stdout
stdout_array = []
thread = Thread(target=proc._readerthread,
@@ -142,11 +142,11 @@ class Pipe (object):
thread.start()
threads.append(thread)
std_X_arrays.append(stdout_array)
-
+
# join threads as they die
for thread in threads:
thread.join()
-
+
# read output from reader threads
std_X_strings = []
for std_X_array in std_X_arrays: