On Thu, Aug 3, 2017 at 12:15 PM, Michał Górny <mgo...@gentoo.org> wrote:
> On czw, 2017-08-03 at 11:18 -0400, Alec Warner wrote: > > On Thu, Aug 3, 2017 at 10:18 AM, Michał Górny <mgo...@gentoo.org> wrote: > > > > > Support two new options: --bug (-b) and --closes (-c) to add a plain > > > 'Bug' reference and a 'Closes' footer for a GitHub pull request. Both > > > options can be specified multiple times, resulting in multiple footer > > > tags being written. > > > > > > The --bug option accepts either a Gentoo Bugzilla bug number or an URL > > > to any bug tracker. In the latter case, it performs two trivial > > > transformations automatically: replaces long 'show_bug.cgi' Bugzilla > > > URLs with the short 'https://bugs.gentoo.org/NNNNNN', and forces > > > https:// for a few known services. > > > > > > The --closes option accepts either a GitHub Gentoo repository pull > > > request number or an URL to any pull request (or bug) that uses > > > the 'Closes' tag. In the latter case, https:// is forced for a few > known > > > services. > > > --- > > > repoman/pym/repoman/actions.py | 29 +++++++++++++++++++++++++++++ > > > repoman/pym/repoman/argparser.py | 16 +++++++++++++++- > > > 2 files changed, 44 insertions(+), 1 deletion(-) > > > > > > diff --git a/repoman/pym/repoman/actions.py > b/repoman/pym/repoman/actions. > > > py > > > index 00bb5b2ca..869ca7031 100644 > > > --- a/repoman/pym/repoman/actions.py > > > +++ b/repoman/pym/repoman/actions.py > > > @@ -324,6 +324,11 @@ class Actions(object): > > > return (changes.new, changes.changed, changes.removed, > > > changes.no_expansion, > changes.expansion) > > > > > > + long_bugzilla_url_re = re.compile( > > > + r'https?://bugs\.gentoo\.org/ > > > show_bug\.cgi\?id=(\d+(#.*)?)') > > > + http_bugtracker_url_re = re.compile( > > > + r'http://(bugs\.gentoo\.org| > bitbucket\.org|git(hub|lab)\. > > > com)/') > > > + > > > > > > > Would you consider using the urlparse module here, instead of regexp? > > Sure. Just for the second case, or for both? > I was actually more concerned about parsing the id query string than the hostname; so I'd say both; but I leave it to your judgement. -A > > -- > Best regards, > Michał Górny >