Add local branch information to rbt status
Review Request #7951 — Created Feb. 7, 2016 and submitted
Modified
rbt post
to append current local branch to the POST request, modified therbt status
to obtain the saved local branch from the GET request, and altered the formatting ofrbt status
to show the last local branch that was used to post the review request.
I tested both
rbt post
andrbt status
manually.
rbt post
- Create branches in both git and bzr repos and do
rbt post
and ensure thatlocal_branch
is added to the review request asextra_data
- Create bookmark in hg repo and do
rbt post
and ensure thatlocal_bookmark
is added to the review request asextra_data
- Do an
rbt post
in and hg repo without specifying a bookmark and ensure that nolocal_bookmark
is not added to the review request as extra data - Do an
rbt post
with an SCM that doesn't have branching/bookmarking capabilities (I used svn) and ensure no unintendedextra_data
is being added
rbt status
- Run
rbt status
in repos that support branching (both git and bzr) and ensure that only the 'Branch' column shows up - Run
rbt status
in repos that support branching (hg) and ensure that only the 'Bookmark' column shows up - Run
rbt status
in a repo that don't support branching/bookmarking (I used svn) and ensure that neither 'Branch' nor 'Bookmark' columns show up - Run
rbt status --all
and ensure that both the 'Branch' and 'Bookmark' columns show up, and also that each branch and bookmark shows up properly associated with the correct review request - Make terminal large enough to fit each record of the
rbt status
output in one line and ensure that it outputs properly - Shrink terminal small enough to require word wraps for various records in the
rbt status
output and ensure that it outputs properly
Description | From | Last Updated |
---|---|---|
I think we should print a blank string instead of "None" |
david | |
I wouldn't mind other opinions on this, it looks like TextTable will try to limit the size of the table … |
EV evanhunzinger | |
This should be extra_data.local_branch. |
brennie | |
Col: 30 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 30 W503 line break before binary operator |
reviewbot | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
Col: 30 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 30 W503 line break before binary operator |
reviewbot | |
Col: 80 E501 line too long (121 > 79 characters) |
reviewbot | |
This should just be None, in my opinion. |
brennie | |
This should just be None, in my opinion. |
brennie | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
Col: 30 E113 unexpected indentation |
reviewbot | |
Col: 30 E111 indentation is not a multiple of four |
reviewbot | |
Col: 30 E111 indentation is not a multiple of four |
reviewbot | |
This should just be blank, actually. That way, if a user did have an actual None branch, it wouldnt be … |
brennie | |
Col: 80 E501 line too long (99 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (102 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (99 > 79 characters) |
reviewbot | |
We're not consistent (especially in old code like this file), but docstrings should be in the imperative mood rather than … |
david | |
This is getting pretty ugly and repetitive. Can we abstract this somehow so we store the table and then print … |
david | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
I wasn't sure about this solution, should I be utilizing the SCMClient Capabilities object instead? |
EV evanhunzinger | |
Col: 17 W503 line break before binary operator |
reviewbot | |
Col: 17 W503 line break before binary operator |
reviewbot | |
Col: 17 E128 continuation line under-indented for visual indent |
reviewbot | |
Pretty close. Formatting should be: Returns: bytes: A string with ... |
david | |
Same here with the "type" |
david | |
This is a third party import It should be in its own group. Also, you'll have to update setup.py to … |
brennie | |
Hmm. What happens in the case where a user does --all with both git and hg repos? In that case … |
david | |
This doesn't handle the can_bookmark case. Perhaps we should just have if 'branch' in request: ? |
david | |
Dedent this 4 spaces ('local_bookmark' should start on the same column as self.tool.can_bookmark) |
david | |
Dedent this 2 spaces. |
david | |
The len fields are no longer required, right? |
david | |
This is no longer required, right? |
david | |
Missing trailing comma. |
brennie | |
This can be simplified a bit. We don't need to have the not has_* checks in there (we can always … |
david | |
If you reorder this a bit, it becomes simpler: request_stats = { 'status': status, 'summary': 'r/%s - %s' % (request.id, … |
david | |
Col: 68 E502 the backslash is redundant between brackets |
reviewbot | |
Col: 59 E703 statement ends with a semicolon |
reviewbot | |
Col: 17 E128 continuation line under-indented for visual indent |
reviewbot | |
This should be grouped with the other 3rd party imports (the texttable one) |
david | |
Is it possible to skip all this and just pass in the max width to the Texttable constructor? |
david | |
Please keep this is alphabetical order. |
david | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot |
- Change Summary:
-
Fixed formatting issues addressed by Review Bot as well as suggested change from Barret.
-
Tool: Pyflakes Processed Files: rbtools/commands/status.py rbtools/commands/post.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/status.py rbtools/commands/post.py
- Change Summary:
-
Added bazaar integration, fixed formatting bug with
rbt status
if the review request summary length was less than the length of the related header, and changed initial value ofbranch
to be empty when fetching the data from the request.
-
Tool: Pyflakes Processed Files: rbtools/commands/status.py rbtools/commands/post.py rbtools/clients/bazaar.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/status.py rbtools/commands/post.py rbtools/clients/bazaar.py
-
-
-
- Change Summary:
-
Did the
max()
calls seperately to make the code more explicit and also to fit within the line criteria.
-
Tool: PEP8 Style Checker Processed Files: rbtools/commands/status.py rbtools/commands/post.py rbtools/clients/bazaar.py Tool: Pyflakes Processed Files: rbtools/commands/status.py rbtools/commands/post.py rbtools/clients/bazaar.py
-
-
We're not consistent (especially in old code like this file), but docstrings should be in the imperative mood rather than the passive ("Return the ..." vs. "Returns ...")
Can you also add the new "Returns:" section as per https://www.reviewboard.org/docs/codebase/dev/docs/writing-codebase-docs/#returns ?
-
This is getting pretty ugly and repetitive. Can we abstract this somehow so we store the table and then print it out in a more generic way?
- Change Summary:
-
Added
texttable
module to clean up table creation code, modified method comments, and check to see if the SCM is either Git, Mercurial, or Bazaar before drawing the last column.
-
Tool: Pyflakes Processed Files: rbtools/commands/status.py rbtools/clients/mercurial.py rbtools/commands/post.py rbtools/clients/bazaar.py rbtools/clients/git.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/status.py rbtools/clients/mercurial.py rbtools/commands/post.py rbtools/clients/bazaar.py rbtools/clients/git.py
-
-
-
-
-
Tool: Pyflakes Processed Files: rbtools/commands/status.py rbtools/clients/mercurial.py rbtools/commands/post.py rbtools/clients/bazaar.py rbtools/clients/git.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/status.py rbtools/clients/mercurial.py rbtools/commands/post.py rbtools/clients/bazaar.py rbtools/clients/git.py
- Testing Done:
-
+ Added
can_branch
andcan_bookmark
properties to SCMClient for determining capabilities in bothstatus
andpost
commands.
-
Tool: Pyflakes Processed Files: rbtools/commands/status.py rbtools/commands/post.py rbtools/clients/__init__.py rbtools/clients/mercurial.py rbtools/clients/git.py rbtools/clients/bazaar.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/status.py rbtools/commands/post.py rbtools/clients/__init__.py rbtools/clients/mercurial.py rbtools/clients/git.py rbtools/clients/bazaar.py
-
Tool: Pyflakes Processed Files: rbtools/commands/status.py rbtools/commands/post.py rbtools/clients/__init__.py rbtools/clients/mercurial.py rbtools/clients/git.py rbtools/clients/bazaar.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/status.py rbtools/commands/post.py rbtools/clients/__init__.py rbtools/clients/mercurial.py rbtools/clients/git.py rbtools/clients/bazaar.py
- Change Summary:
-
Removed dependency on self.tool and based table creation based off of the contents of 'local_branch' and 'local_bookmark' in
extra_data
instead.
-
Tool: Pyflakes Processed Files: rbtools/commands/status.py rbtools/commands/post.py rbtools/clients/__init__.py rbtools/clients/mercurial.py rbtools/clients/git.py rbtools/clients/bazaar.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/status.py rbtools/commands/post.py rbtools/clients/__init__.py rbtools/clients/mercurial.py rbtools/clients/git.py rbtools/clients/bazaar.py
-
Tool: Pyflakes Processed Files: rbtools/commands/status.py rbtools/commands/post.py rbtools/clients/__init__.py rbtools/clients/mercurial.py rbtools/clients/git.py rbtools/clients/bazaar.py setup.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/status.py rbtools/commands/post.py rbtools/clients/__init__.py rbtools/clients/mercurial.py rbtools/clients/git.py rbtools/clients/bazaar.py setup.py
- Change Summary:
-
Added a trailing comma to the third party install list.
- Summary:
-
[WIP] Add local branch information to rbt statusAdd local branch information to rbt status
-
Tool: Pyflakes Processed Files: rbtools/commands/status.py rbtools/commands/post.py rbtools/clients/__init__.py rbtools/clients/mercurial.py rbtools/clients/git.py rbtools/clients/bazaar.py setup.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/status.py rbtools/commands/post.py rbtools/clients/__init__.py rbtools/clients/mercurial.py rbtools/clients/git.py rbtools/clients/bazaar.py setup.py
-
This is looking pretty good. You said you uploaded three examples of output but I don't see them.
-
This can be simplified a bit. We don't need to have the
not has_*
checks in there (we can always just set to True if it's present). We can also skip the early break because it doesn't buy very much.for request in request_stats: if 'branch' in request: has_branches = True if 'bookmark' in request: has_bookmarks = True
-
If you reorder this a bit, it becomes simpler:
request_stats = { 'status': status, 'summary': 'r/%s - %s' % (request.id, request.summary), } if 'local_branch' in request.extra_data: request_stats['branch'] = \ request.extra_data['local_branch'] if 'local_bookmark' in request.extra_data: request_stats['bookmark'] = \ request.extra_data['local_bookmark']
-
-
I wouldn't mind other opinions on this, it looks like TextTable will try to limit the size of the table (and therefore columns) if you don't manually set size constraints on the column, which leads to crunched up columns like this in the
--all
case. I was thinking of determining column size at run time based off the largest values, but then that could mean really wide tables which probably won't print well if someone is running a small console.
-
Tool: Pyflakes Processed Files: rbtools/commands/status.py rbtools/commands/post.py rbtools/clients/__init__.py rbtools/clients/mercurial.py rbtools/clients/git.py rbtools/clients/bazaar.py setup.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/status.py rbtools/commands/post.py rbtools/clients/__init__.py rbtools/clients/mercurial.py rbtools/clients/git.py rbtools/clients/bazaar.py setup.py
-
Tool: Pyflakes Processed Files: rbtools/commands/status.py rbtools/commands/post.py rbtools/clients/__init__.py rbtools/clients/mercurial.py rbtools/clients/git.py rbtools/clients/bazaar.py setup.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/status.py rbtools/commands/post.py rbtools/clients/__init__.py rbtools/clients/mercurial.py rbtools/clients/git.py rbtools/clients/bazaar.py setup.py
-
-
-
-
Tool: Pyflakes Processed Files: rbtools/commands/status.py rbtools/commands/post.py rbtools/clients/__init__.py rbtools/clients/mercurial.py rbtools/clients/git.py rbtools/clients/bazaar.py setup.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/status.py rbtools/commands/post.py rbtools/clients/__init__.py rbtools/clients/mercurial.py rbtools/clients/git.py rbtools/clients/bazaar.py setup.py
- Change Summary:
-
Removed logic to set column widths manually since
texttable
can do it. Also rearranged import and alphabetized installs in setup script. - Diff:
-
Revision 17 (+85 -17)
- Added Files:
-
Tool: Pyflakes Processed Files: rbtools/commands/status.py rbtools/commands/post.py rbtools/clients/__init__.py rbtools/clients/mercurial.py rbtools/clients/git.py rbtools/clients/bazaar.py setup.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/status.py rbtools/commands/post.py rbtools/clients/__init__.py rbtools/clients/mercurial.py rbtools/clients/git.py rbtools/clients/bazaar.py setup.py
-
- Change Summary:
-
Fixed line length issue and removed images that shouldn't have been associated with the update.
- Diff:
-
Revision 18 (+87 -17)
- Removed Files:
-
Tool: Pyflakes Processed Files: rbtools/commands/status.py rbtools/commands/post.py rbtools/clients/__init__.py rbtools/clients/mercurial.py rbtools/clients/git.py rbtools/clients/bazaar.py setup.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/status.py rbtools/commands/post.py rbtools/clients/__init__.py rbtools/clients/mercurial.py rbtools/clients/git.py rbtools/clients/bazaar.py setup.py
- Testing Done:
-
+ I tested both
rbt post
andrbt status
manually.+ + rbt post
+ + - Create branches in both git and bzr repos and do
rbt post
and ensure thatlocal_branch
is added to the review request asextra_data
+ - Create bookmark in hg repo and do
rbt post
and ensure thatlocal_bookmark
is added to the review request asextra_data
+ - Do an
rbt post
in and hg repo without specifying a bookmark and ensure that nolocal_bookmark
is not added to the review request as extra data
+ - Do an
rbt post
with an SCM that doesn't have branching/bookmarking capabilities (I used svn) and ensure no unintendedextra_data
is being added
+ + rbt status
+ + - Run
rbt status
in repos that support branching (both git and bzr) and ensure that only the 'Branch' column shows up
+ - Run
rbt status
in repos that support branching (hg) and ensure that only the 'Bookmark' column shows up
+ - Run
rbt status
in a repo that don't support branching/bookmarking (I used svn) and ensure that neither 'Branch' nor 'Bookmark' columns show up
+ - Run
rbt status --all
and ensure that both the 'Branch' and 'Bookmark' columns show up, and also that each branch and bookmark shows up properly associated with the correct review request
+ - Make terminal large enough to fit each record of the
rbt status
output in one line and ensure that it outputs properly
+ - Shrink terminal small enough to require word wraps for various records in the
rbt status
output and ensure that it outputs properly
- Create branches in both git and bzr repos and do