-
-
We've been slowly transitioning to Google Python-style docstrings. Can you write this as:
Run the hook. Args: node (unicode): The hex node ID of the first changeset.
-
-
Can we wrap this so each condition is on its own line? You can also combine the second two:
if (revreq.branch == branch and 'diff_hash' in revreq.extra_data.get('diff_hash', '')):
-
-
-
-
-
-
Add mercurial hook for posting review requests automatically
Review Request #7824 — Created Dec. 23, 2015 and discarded
A Mercurial hook to post to Review Board on push to a central server. The hook only allows the push if all commits have been approved in a review requests, otherwise it rejects it and creates a review request for the (new) commits. This is similar to "rbt post", but 1. does not require the user to install RBTools locally 2. makes sure any changes pushed to the central server have been reviewed and approved 3. makes links of all references to tickets/bugs/issues, which rbt post doesn't do. 4. automatically finds the right review request to update if there are any new commits, based the commit ID and a date/author hash. This does not require the user to confirm anything, which rbt post (often) requires. This also allows the hook to recognize rebased/amended changesets, because the date/author hash is unchanged. Patch is based on work of Halvor Lund!
Replacing this: https://reviews.reviewboard.org/r/7100/
We use this commit hook since february 2015 as a gatekeeper like gerrit codereview.
Description | From | Last Updated |
---|---|---|
We've been slowly transitioning to Google Python-style docstrings. Can you write this as: Run the hook. Args: node (unicode): The … |
david | |
Can you use the Args: format as described above? |
david | |
Can we wrap this so each condition is on its own line? You can also combine the second two: if … |
david | |
Args: |
david | |
r before s. |
david | |
ids is already a list here. |
david | |
We put full-package imports before from ... imports. |
david | |
Process return codes should be int, not bool. |
david | |
Please reformat as: revisions = { 'base': rev1, 'tip': rev2, 'parent_base': parent, } |
david | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 9 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 13 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 23 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 25 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 5 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 5 E122 continuation line missing indentation or outdented |
reviewbot | |
Col: 22 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 24 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 5 E122 continuation line missing indentation or outdented |
reviewbot | |
Col: 1 E122 continuation line missing indentation or outdented |
reviewbot | |
Col: 15 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 17 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 20 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 22 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 15 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 17 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 11 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 13 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 21 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 23 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 15 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 17 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 26 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 28 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 18 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 20 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 19 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 21 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 80 E501 line too long (89 > 79 characters) |
reviewbot | |
It's a little weird to call this LOGGER, since it's not a constant. How about logger? |
david | |
Can you surround the whole conditional in parentheses instead of using the continuation character? |
david | |
These should be at the top of the file. |
david | |
Can we swap the order of these? |
david | |
This should be grouped with the other stdlib imports. |
david | |
Call this "logger" (since it's not really a constant) |
david | |
Put this import at the top of the file. |
david | |
Rather than implementing a new execute method, we should use rbtools.utils.process.execute |
david | |
This should use the approval API. See https://www.reviewboard.org/docs/manual/2.5/webapi/2.0/resources/review-request/#fields |
david | |
Can you wrap the whole conditional in parens instead of using the continuation character? Please also put the "and" on … |
david | |
Why doesn't this use rbtools.utils.users.get_authenticated_session ? |
david | |
Put this import at the top of the file. |
david |
-
Tool: PEP8 Style Checker Processed Files: rbtools/hooks/common.py rbtools/hooks/mercurial.py contrib/tools/mercurial_push.py rbtools/clients/mercurial.py rbtools/hooks/tests.py WARNING: Number of comments exceeded maximum, showing 30 of 69. Tool: Pyflakes Processed Files: rbtools/hooks/common.py rbtools/hooks/mercurial.py contrib/tools/mercurial_push.py rbtools/clients/mercurial.py rbtools/hooks/tests.py
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Tool: PEP8 Style Checker Processed Files: rbtools/hooks/common.py rbtools/hooks/mercurial.py contrib/tools/mercurial_push.py rbtools/clients/mercurial.py rbtools/hooks/tests.py
-
Thanks for taking the time to submit this again. What are the main differences from my original submission?
-
Tool: PEP8 Style Checker Processed Files: rbtools/hooks/common.py rbtools/hooks/mercurial.py contrib/tools/mercurial_push.py rbtools/clients/mercurial.py rbtools/hooks/tests.py Tool: Pyflakes Processed Files: rbtools/hooks/common.py rbtools/hooks/mercurial.py contrib/tools/mercurial_push.py rbtools/clients/mercurial.py rbtools/hooks/tests.py
-
Tool: Pyflakes Processed Files: rbtools/hooks/common.py rbtools/hooks/mercurial.py contrib/tools/mercurial_push.py rbtools/clients/mercurial.py rbtools/hooks/tests.py Tool: PEP8 Style Checker Processed Files: rbtools/hooks/common.py rbtools/hooks/mercurial.py contrib/tools/mercurial_push.py rbtools/clients/mercurial.py rbtools/hooks/tests.py
-
-
Tool: Pyflakes Processed Files: rbtools/hooks/common.py rbtools/hooks/mercurial.py contrib/tools/mercurial_push.py rbtools/clients/mercurial.py rbtools/hooks/tests.py Tool: PEP8 Style Checker Processed Files: rbtools/hooks/common.py rbtools/hooks/mercurial.py contrib/tools/mercurial_push.py rbtools/clients/mercurial.py rbtools/hooks/tests.py
- Change Summary:
-
Save final changeset id in close description like "rbt land".
Could someone review this to get it finally merged? :-)
-
Tool: Pyflakes Processed Files: rbtools/hooks/common.py rbtools/hooks/mercurial.py contrib/tools/mercurial_push.py rbtools/clients/mercurial.py rbtools/hooks/tests.py Tool: PEP8 Style Checker Processed Files: rbtools/hooks/common.py rbtools/hooks/mercurial.py contrib/tools/mercurial_push.py rbtools/clients/mercurial.py rbtools/hooks/tests.py
-
Tool: Pyflakes Processed Files: rbtools/hooks/common.py rbtools/hooks/mercurial.py contrib/tools/mercurial_push.py rbtools/clients/mercurial.py rbtools/hooks/tests.py Tool: PEP8 Style Checker Processed Files: rbtools/hooks/common.py rbtools/hooks/mercurial.py contrib/tools/mercurial_push.py rbtools/clients/mercurial.py rbtools/hooks/tests.py