Closed Bug 1039522 Opened 10 years ago Closed 10 years ago

Include command to pull review request head

Categories

(MozReview Graveyard :: General, defect)

Development/Staging
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mcote, Unassigned)

References

Details

Attachments

(1 file)

A really useful feature would be a URL in the review request (squashed or otherwise) that would allow you to check out that "branch" (head, I guess).  This would make it simple to test the code under review and would bring this system into closer parity with GitHub.

A separate field would probably be best, but in the interest of getting things done, I'm totally okay with the link being in the Description field.
Blocks: 1021929
The commits view being introduced in bug 1034171 is probably a good place for these links.
Depends on: 1034175
/r/96 - Bug 1039522 - Include pull command in description of squashed request.
Attachment #8464229 - Flags: review?(smacleod)
Attachment #8464229 - Flags: review?(gps)
Assignee: nobody → mcote
Status: NEW → ASSIGNED
Summary: Link to review repo head for review-request commit → Include command to pull review request head
::: pylib/reviewboardmods/reviewboardmods/pushhooks.py
(Diff revision 1)
> +        ['', 'hg pull -r %s reviews' % commits['individual'][-1]['id']])

We don't know for certain that the user has aliased *reviews* as the remote name. But this is easy enough to implement.

::: pylib/reviewboardmods/reviewboardmods/pushhooks.py
(Diff revision 1)
> +        squashed_description[-1] += 'these commits:'

Do none of these changes to squash_description cause a test failure? I'm almost certain they would.
::: pylib/reviewboardmods/reviewboardmods/pushhooks.py
(Diff revision 1)
> +        squashed_description[-1] += 'these commits:'

> Do none of these changes to squash_description cause a test failure? I'm almost certain they would.
Whoops, of course.  Will fix them up.

::: pylib/reviewboardmods/reviewboardmods/pushhooks.py
(Diff revision 1)
> +        ['', 'hg pull -r %s reviews' % commits['individual'][-1]['id']])

> We don't know for certain that the user has aliased *reviews* as the remote name. But this is easy enough to implement.
smacleod suggested we just standardize on a path name and implement it in the client later, so that's what I'm doing. :)
::: pylib/reviewboardmods/reviewboardmods/pushhooks.py
(Diff revision 1)
> +        ['', 'hg pull -r %s reviews' % commits['individual'][-1]['id']])

> We don't know for certain that the user has aliased *reviews* as the remote name. But this is easy enough to implement.
Can we make it *review* instead of *reviews*? One less character to type :) And, *hg push review* kinda sounds more like a sentence: *Mercurial, push this for review.*
Comment on attachment 8464229 [details]
Review for review ID: bz://1039522/mcote

/r/96 - Bug 1039522 - Include pull command in description of squashed request.
/r/97 - Bug 1039522 - Update tests, change repo nick from 'reviews' to 'review'.
Looks good to me, after fixing the one issue. Please fold the two commits together before landing, they should really be one.

::: pylib/reviewboardmods/reviewboardmods/pushhooks.py
(Diff revision 2)
> +        ['', 'hg pull -r %s review' % commits['individual'][-1]['id']])

nit: can we please make this:
            ['', 'hg pull review -r %s' % commits['individual'][-1]['id']])
            
Having "review" before the -r argument makes it flow really nicely in english :D

Along with the magic gps wants to add where the "review" path is auto detected and added, I wonder if in the future it'd be worth adding extra magic so that you could specify "-r <reviewid>" instead of the sha1... so it would be something like "hg pull review -r bz://1234/mcote" to pull down the commits. Could be a nice to have down the road.
Attachment #8464229 - Flags: review?(smacleod) → review+
Agreed, would be nice.  File a bug? :)
Pushed: http://hg.mozilla.org/hgcustom/version-control-tools/rev/79aea0531ff0

Then I realized I forgot to update the tests for the little change, so fixed those: http://hg.mozilla.org/hgcustom/version-control-tools/rev/d94741da4f19 :)
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Regarding magic with -r identifiers, Mercurial does this via protocol handlers. e.g. bz://. One of the reasons I wanted to use proto:// handlers for the identifiers was to facilitate this kind of magic in the future :)

We could probably introduce rb://<number> to magically map RB review requests into known commit IDs. Good follow-up.
Attachment #8464229 - Flags: review?(gps)
Product: bugzilla.mozilla.org → Developer Services
Product: Developer Services → MozReview
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: