Adding uncommitted flag to support post staged but not commit changes

Review Request #6879 — Created Feb. 1, 2015 and discarded — Latest diff uploaded

Information

RBTools
master

Reviewers

Problem:
While the common workflow is to post committed changes, some people have workflows where they want to post changes that are uncommitted, and have to resort to generating a diff manually and posting it using rbt post --diff-filename=.

This work would add an --uncommitted flag to rbt post that would generate diffs for uncommitted changes instead.

Approach:
Adding can_diff_committed capability to all clients, and let git set that to True to support it.
This revision simulate the behavior of svn, where we specify the tip to be --rbtools-working-copy so that git client know to remove the revision range out of the git commands.
In addition, to support this flag, --update, --diff-filename, and --guess-fields can't coexists, so the error is thrown when the user specifies those commands along with --uncommitted.
In order to view staged but uncommitted files, we need to add --cached to the git diff command.

Write an extra unit test to check that the git post --uncommitted works.
Verify that it throws error when --uncommitted and other options like --diff-filename,

Diff Revision 2

This is not the most recent revision of the diff. The latest diff is revision 24. See what's changed.

orig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
rbtools/clients/__init__.py
rbtools/clients/git.py
rbtools/clients/tests.py
rbtools/commands/post.py
rbtools/utils/review_request.py
Loading...