diff options
author | chipx86 <chipx86@5efc13c4-1f27-0410-8691-ff2d1f55687e> | 2009-05-28 10:19:52 +0000 |
---|---|---|
committer | chipx86 <chipx86@5efc13c4-1f27-0410-8691-ff2d1f55687e> | 2009-05-28 10:19:52 +0000 |
commit | d2133965cecce9b4703ef15f6533fb89d3e2e859 (patch) | |
tree | 0fd0f59d8424aee4ecbbf45ca65d74f33e1639eb | |
parent | 8e40ef5ce4ab2dfe5348f4ae84db532e982227c0 (diff) |
Patch by Steven Russell to fix working with Perforce file paths containing
spaces.
Fixes bug #840.
Reviewed at http://reviews.review-board.org/r/815/
-rw-r--r-- | AUTHORS | 1 | ||||
-rwxr-xr-x | scripts/post-review | 18 |
2 files changed, 6 insertions, 13 deletions
@@ -14,3 +14,4 @@ Contributors: * Paul Scott * Raghu Kaippully * Stacey Sheldon + * Steven Russell diff --git a/scripts/post-review b/scripts/post-review index 6f8944a..e024cdd 100755 --- a/scripts/post-review +++ b/scripts/post-review @@ -1707,19 +1707,11 @@ class PerforceClient(SCMClient): def _depot_to_local(self, depot_path): """ Given a path in the depot return the path on the local filesystem to - the same file. - """ - # $ p4 where //user/bvanzant/main/testing - # //user/bvanzant/main/testing //bvanzant:test05:home/testing /home/bvanzant/home-versioned/testing - where_output = execute(["p4", "where", depot_path], split_lines=True) - # Take only the last line from the where command. If you have a - # multi-line view mapping with exclusions, Perforce will display - # the exclusions in order, with the last line showing the actual - # location. - last_line = where_output[-1].strip() - - # XXX: This breaks on filenames with spaces. - return last_line.split(' ')[2].rstrip() + the same file. If there are multiple results, take only the last + result from the where command. + """ + where_output = self._run_p4(['where', depot_path]) + return where_output[-1]['path'] class MercurialClient(SCMClient): |