[PATCH] jcheck: allow bug id line to be ignored

mark.reinhold at oracle.com mark.reinhold at oracle.com
Mon Apr 8 15:53:42 PDT 2013


2013/4/8 8:36 -0700, omajid at redhat.com:
> On 04/08/2013 06:19 PM, mark.reinhold at oracle.com wrote:
>> This is a fine change in principle.  I don't understand, though, why
>> you need your first patch (embedded in this patch) to store bugids as
>> strings rather than numbers.  You're not going to validate bugids that
>> aren't pure numbers, so why bother with that change?
> 
> Even thought the bug ids are never used, repo_bugids is called when the
> checker object is created:
> 544     ch = checker(ui, repo, repo_bugids(ui, repo), strict, lax)
> 
> And repo_bugids method ends up doing:
> 209                 b = int(m.group(1))
> 
> To find the bug 'number'.

Ah, got it.

> I can avoid this by delaying the invocation of repo_bugids until
> necessary, but I went with minimal changes for this patch.

I think it'd be cleaner just to load the bugids lazily.  As a side
benefit that will save a bit of time too.

- Mark


More information about the hg-tools-dev mailing list