Support automatic retrieval of multiple patches

RESOLVED FIXED

Status

Developer Services
Mercurial: qimportbz
RESOLVED FIXED
7 years ago
3 years ago

People

(Reporter: Rick Reitmaier, Assigned: Rick Reitmaier)

Tracking

Details

Attachments

(1 attachment)

(Assignee)

Description

7 years ago
Created attachment 486958 [details] [diff] [review]
auto choose, with 'bugdesc' and bz://xxxx/aaaa fix

Currently qimport will prompt the user if multiple patches exist for a bug.

Propose to add a configuration option 'auto_choose_all' that if set to True results in all patches being retrieved without the user being prompted.

Related is the addition of exposing 'bugdesc' as a metadata element of the formatting string.

An example .hgrc entry :

[qimportbz]
msg_format = Bug %(bugnum)s - %(title)s (%(flags)s)
 .
 . attachment %(id)s - %(desc)s
 .
 %(bugdesc)s


Also included is a fix for selecting a particular attachment via the URL syntax:

  bz://xxxxx/axxaa  , where xxxxx is the bug # and aaaaa is the attachment #
(Assignee)

Updated

7 years ago
Attachment #486958 - Attachment is patch: true
Attachment #486958 - Attachment mime type: application/octet-stream → text/plain
Attachment #486958 - Flags: review?(tellrob)
Regarding the auto_choose_all option, don't you get burned by the ill-defined ordering of the patches, since that can change as patches are revised and uploaded to bugzilla?  When I use the interactive retrieval, I choose the order.

+1 to being able to select particular attachments via URL syntax; I assume that that technique is able to download even the attachments that have been obsoleted, right?  (A capability that has pro's and con's, I imagine; but its a cool property nonetheless.)
(Assignee)

Comment 2

7 years ago
(In reply to comment #1)
> Regarding the auto_choose_all option, don't you get burned by the ill-defined
> ordering of the patches

Possibly, but qpush can be used to select a particular patch to applied, so the 'natural' ordering can be overridden.

> 
> +1 to being able to select particular attachments via URL syntax; I assume that
> that technique is able to download even the attachments that have been
> obsoleted, right?  

Probably, although I haven't tried as this feature already existed it was just broken.
(In reply to comment #2)
> (In reply to comment #1)
> > Regarding the auto_choose_all option, don't you get burned by the ill-defined
> > ordering of the patches
> 
> Possibly, but qpush can be used to select a particular patch to applied, so the
> 'natural' ordering can be overridden.

Hmm, I thought the argument to qpush meant to apply *up to* that patch, not to apply it out of order. Oh, I see, there's the "--move" argument to qpush.
Comment on attachment 486958 [details] [diff] [review]
auto choose, with 'bugdesc' and bz://xxxx/aaaa fix

Looks good - much simpler than I expected! Only nit is that I'd prefer you use str(n) instead of `n`.
Attachment #486958 - Flags: review?(tellrob) → review+
(Assignee)

Updated

7 years ago
Assignee: nobody → rreitmai
Status: NEW → ASSIGNED
(Assignee)

Comment 6

7 years ago
updated and pushed patch; changed `n` usage to str(n) as suggested by Rob.  

Thanks again Rob for creating such a handy tool.
(Assignee)

Updated

7 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
Product: Other Applications → Developer Services
You need to log in before you can comment on or make changes to this bug.