Capabilities with better moved files support
Review Request #2918 — Created Feb. 26, 2012 and submitted
Added post-review client capability checking and git moved-files support.
Tested the following cases: 1. Posted a review with up-to-date RB and rbtools. Moved files were tracked. 2. Posted a review where the RB server has moved_files=False. Moved files were not tracked. 3. Posted a review where the RB server has no "compatabilities". Moved files were not tracked. 4. Posted a review where the RB server has no "moved_files" capability (and again with no "diffs" category). Moved files were not tracked. Unit tests pass, don't really know how to write tests for this since it requires a server (mock objects?).
Description | From | Last Updated |
---|---|---|
Summary should be on the same line. Since this all fits on one line, just put the text right up … |
chipx86 | |
Should specifically catch a KeyError. |
chipx86 | |
Too much repeat code. I'd suggest something like: cmdline = [self.git, "diff", .....] if has_capability(...): cmdline.append('-M') return execute(cmdline) |
chipx86 | |
I'd prefer we set the server instead. There may be other useful objects later. Given that, we'd probably want to … |
chipx86 | |
Should just call this capabilities, or caps, or something. |
chipx86 | |
I'd imagine this could fit on one line. if not, perhaps rename capability_list to capabilities or caps. |
chipx86 | |
This could just be return execute(cmdline). i.e: if (self.server and self.server.capabilities.has_capability('diffs', 'moved_files')): cmdline.append('-M') return execute(cmdline) |
ME medanat | |
We always pass a value to this, right? Probably no need for a default. |
chipx86 | |
Blank line above this. |
chipx86 | |
See below on this, but I don't think capabilities should be a default parameter. I think it should always take … |
chipx86 |
- Change Summary:
-
Added capabilities changes.
- Summary:
-
Better moved files (RBTools)Capabilities and better moved files (RBTools)
- Description:
-
~ Pass the -M flag to git diff so RB can track moved files.
~ Added Review Board server capabilities checking and git moved-files support.
- Testing Done:
-
~ Posting review to a local server, moved files were tracked fine.
~ Tested the following cases:
+ 1. Posted a review with up-to-date RB and rbtools. Moved files were tracked. + 2. Posted a review where the RB server has moved_files=False. Moved files were not tracked. + 3. Posted a review where the RB server has no "compatabilities". Moved files were not tracked. + 4. Posted a review where the RB server has no "moved_files" capability (and again with no "diffs" category). Moved files were not tracked. - Branch:
-
master
-
-
Summary should be on the same line. Since this all fits on one line, just put the text right up against the """. Probably makes more sense to say "Retrieves and stores"
-
-
Too much repeat code. I'd suggest something like: cmdline = [self.git, "diff", .....] if has_capability(...): cmdline.append('-M') return execute(cmdline)
-
I'd prefer we set the server instead. There may be other useful objects later. Given that, we'd probably want to rename get_capabilities() to load_capabilities(), and put that call after check_api_version(). Then things can just access server.capabilities.
- Change Summary:
-
Now capabilities are held on the server, and scmtools are passed a server pointer.
- Description:
-
~ Added Review Board server capabilities checking and git moved-files support.
~ Added post-review client capability checking and git moved-files support.
- Change Summary:
-
Renamed 'capabilities_list' to 'caps'. Git client is resilient to server being None.
- Testing Done:
-
Tested the following cases:
1. Posted a review with up-to-date RB and rbtools. Moved files were tracked. 2. Posted a review where the RB server has moved_files=False. Moved files were not tracked. 3. Posted a review where the RB server has no "compatabilities". Moved files were not tracked. 4. Posted a review where the RB server has no "moved_files" capability (and again with no "diffs" category). Moved files were not tracked. + + Unit tests pass, don't really know how to write tests for this since it requires a server (mock objects?).
- Change Summary:
-
Fixed formatting issues. Pass capabilities as a default parameter instead of a kwarg.