From 89b7a1411e4658e831f5d635534b24355dbb941d Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 15 Dec 2009 06:44:20 -0500 Subject: 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. --- libbe/storage/vcs/bzr.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libbe/storage/vcs/bzr.py') diff --git a/libbe/storage/vcs/bzr.py b/libbe/storage/vcs/bzr.py index 04cc6c1..6f3e840 100644 --- a/libbe/storage/vcs/bzr.py +++ b/libbe/storage/vcs/bzr.py @@ -49,7 +49,7 @@ class Bzr(base.VCS): def _vcs_version(self): status,output,error = self._u_invoke_client('--version') - return output + return output def _vcs_get_user_id(self): status,output,error = self._u_invoke_client('whoami') @@ -88,7 +88,7 @@ class Bzr(base.VCS): return base.VCS._vcs_get_file_contents(self, path, revision) else: status,output,error = \ - self._u_invoke_client('cat', '-r', revision,path) + self._u_invoke_client('cat', '-r', revision, path) return output def _vcs_commit(self, commitfile, allow_empty=False): @@ -123,7 +123,7 @@ class Bzr(base.VCS): return str(index) # bzr commit 0 is the empty tree. return str(current_revision+index+1) - + if libbe.TESTING == True: base.make_vcs_testcase_subclasses(Bzr, sys.modules[__name__]) -- cgit