Add ability to post a path with Perforce.
Review Request #753 — Created Feb. 26, 2009 and submitted
Add ability to post a path with Perforce. We have some use cases where it would be nice to review entire files post-commit in reviewboard. Some examples: - Our documentation needs to be checked in before it is reviewed. If multiple people are working on it, or if it is created as a series of multiple checkins, reviewing specific change numbers is difficult. With this, we can do "post-review //docs/main/some/project/...". - If you work on a side branch for a while, possibly with multiple checkins or with multiple people, reviewing the changes on the side branch before integration to the main branch can be tricky. With this, you can now do "post-review //path/to/my/branch/...@100,@120" where "100" would be the initial revision that created the branch and "120" is the last revision on that branch. This allows you to easily review all changes on a branch in one review request. - If you want to review an old, existing file that has had little or no reviews, you can now do this with "post-review //path/to/some/file" to review the whole thing. The specific path types supported are: post-review //path/to/file # Upload file as a "new" file. post-review //path/to/dir/... # Upload all files as "new" files. post-review //path/to/file[@#]rev # Upload file from that rev as a "new" file. # (Not a very useful scenario, but it works.) post-review //path/to/file[@#]rev,[@#]rev # Upload a diff between revs. post-review //path/to/dir/...[@#]rev,[@#]rev # Upload a diff of all files between revs in that directory. You can specify multiple paths on the command line. I didn't use the range revision option because the Perforce path syntax is a little more flexible, especially if you post multiple paths.
Tried all the various path types with added/modified/deleted files. Also made sure didn't break existing changenum posting.
EH
- Change Summary:
-
Updated diff based on comments and added docstrings to some things. I can't tell if you use any particular docstring style in reviewboard, hopefully it's at least readable. Also, fixed a semi-major bug where changenum posting wasn't working. Thought I would also mention that in the future we could consider using the _run_p4 method for the other perforce commands ('p4 describe', etc.). This would fix the problem where spaces in filenames don't work with "p4 where". Using the marshal interface seems to work on Windows, so I think it's relatively reliable and stable.
- Diff:
-
Revision 2 (+253 -81)
EH
- Change Summary:
-
Migrating my changes from contrib/tools to rbtools (no other changes).
- Diff:
-
Revision 3 (+254 -81)