diff options
author | W. Trevor King <wking@drexel.edu> | 2010-01-18 12:25:17 -0500 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2010-01-18 12:25:17 -0500 |
commit | 7ae29f930fe73adada5174a2ce74266411809ac7 (patch) | |
tree | ae850b985fab14974d3eca393907cc3a098156fa /libbe/storage/vcs/bzr.py | |
parent | c7945daa3e1413b7c789df182b39c12dfbe2b4db (diff) | |
download | bugseverywhere-7ae29f930fe73adada5174a2ce74266411809ac7.tar.gz |
Added VCS._u_find_id_from_manifest for faster id->path calculation
Diffstat (limited to 'libbe/storage/vcs/bzr.py')
-rw-r--r-- | libbe/storage/vcs/bzr.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libbe/storage/vcs/bzr.py b/libbe/storage/vcs/bzr.py index 285ecf1..e1cd2e5 100644 --- a/libbe/storage/vcs/bzr.py +++ b/libbe/storage/vcs/bzr.py @@ -134,7 +134,9 @@ class Bzr(base.VCS): return cmd.outf.getvalue() def _vcs_path(self, id, revision): - return self._u_find_id(id, revision) + manifest = self._vcs_listdir( + self.repo, revision=revision, recursive=True) + return self._u_find_id_from_manifest(id, manifest, revision=revision) def _vcs_isdir(self, path, revision): try: @@ -145,13 +147,13 @@ class Bzr(base.VCS): raise return True - def _vcs_listdir(self, path, revision): + def _vcs_listdir(self, path, revision, recursive=False): path = os.path.join(self.repo, path) revision = self._parse_revision_string(revision) cmd = bzrlib.builtins.cmd_ls() cmd.outf = StringIO.StringIO() try: - cmd.run(revision=revision, path=path) + cmd.run(revision=revision, path=path, recursive=recursive) except bzrlib.errors.BzrCommandError, e: if 'not present in revision' in str(e): raise base.InvalidPath(path, root=self.repo, revision=revision) @@ -252,8 +254,7 @@ class Bzr(base.VCS): new = [] modified = [] removed = [] - lines = diff_text.splitlines() - for i,line in enumerate(lines): + for line in diff_text.splitlines(): if not line.startswith('=== '): continue fields = line.split() |