840: post-review can't diff correctly Perforce paths with spaces?
- Fixed
- Review Board
btse****@gmai***** (Google Code) (Is this you? Claim this profile.) | |
|
|
May 28, 2009 |
What's the URL of the page containing the problem? N/A What steps will reproduce the problem? 1. Have Perforce 2. In your perforce system, have a path like //depot/dev/proj1/path with spaces/file.cpp 3. Edit the file and setup to post-review the change list 4. Review board interprets it as a change of "deleted content" What is the expected output? What do you see instead? - I would have expected it to properly do the diffs and handle the path with spaces. - When doing post-review -d, the problem looks to be that the path agurment to the diff command is not-escaped or complete so i've seen something like diff -urNp /cygdrive/c/TEMP/tmpatI2gl //btse-ws2//dev/proj1/path - just 'path' instead of 'path with space/file.cpp' What operating system are you using? What browser? Windows XP, Firefox 3.0.1 Please provide any additional information below. Is there some patch in the python script to properly escape these depot paths?
Ahh. After looking at the post-review script I see the comments in function: _depot_to_local() # XXX: This breaks on filenames with spaces. return last_line.split(' ')[2] Rats.
I'm attaching a patch that I believe fixes the "spaces in paths" problem with Perforce. At a high level, it passes the "-ztag" flag to the "p4 where" command to split the Perforce and local paths onto separate lines. This has only been tested briefly on Mac OS X (and I'm not a Python expert) so YMMV, especially on other platforms.
-
+
I was facing the same issue with Perforce on windows a couple of days back. I applied the patch and it worked nicely.