[PATCH v3 1/2] parsemail.py: Avoid skipping patches when parsing

Damien Lespiau damien.lespiau at intel.com
Mon Oct 26 23:32:01 AEDT 2015


Hi Jose,

On Thu, Sep 24, 2015 at 12:09:57PM -0500, Jose Lamego wrote:
> Avoids some email patch notifications to be wrongly
>  skipped when the pull URL includes the branch.
> 
> An example of an email patch notification that would
> be skipped can be found in [1].
> 
> [1] http://patchwork.openembedded.org/patch/96385/
> 
> Signed-off-by: Jose Lamego <jose.a.lamego at linux.intel.com>

I'm not quite sure why this pull request was skipped, but the commit
message doesn't seem to be the reason and [^\n]+$ matches everything
until the end of the line, which includes the branch name.

I doubled checked that:
  - Your test still passes with this commit reverted,
  - patchwork/tests/mail/0003-git-pull-request-with-diff.mbox and
    GitPullWithDiffTest test a pull URL with a branch name already,
  - The current version of find_pull_request() work on the example
    above. Here is the interactive session:

	>>> content = '''
	... The following changes since commit 968973d55d4b33e1a929ed4cdf9387fcaba2d93f:
	... 
	...   qt4: unconditionally disable gstreamer 0.10 support in qt webkit (2015-05-30 22:25:12 +0100)
	... 
	... are available in the git repository at:
	... 
	...   git://git.openembedded.org/openembedded-core-contrib rbt/PU
	...   http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/PU
	... 
	... Robert Yang (6):
	...   liberror-perl: 0.17023 -> 0.17024
	...   python-mako: 0.9.1 -> 1.0.1
	...   python-nose: 1.2.1 -> 1.3.6
	...   debianutils: 4.5 -> 4.5.1
	...   ethtool: 3.16 -> 4.0
	...   glib-2.0: 2.44.0 -> 2.44.1
	... '''
	>>> from patchwork.bin.parsemail import find_pull_request
	>>> find_pull_request(content)
	'git://git.openembedded.org/openembedded-core-contrib rbt/PU'

So I don't think this commit fixes anything. There must be another
explanation?

HTH,

-- 
Damien

> ---
>  patchwork/bin/parsemail.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/patchwork/bin/parsemail.py b/patchwork/bin/parsemail.py
> index e66b557..5378dc6 100755
> --- a/patchwork/bin/parsemail.py
> +++ b/patchwork/bin/parsemail.py
> @@ -137,7 +137,7 @@ def mail_headers(mail):
>  def find_pull_request(content):
>      git_re = re.compile('^The following changes since commit.*' +
>                          '^are available in the git repository at:\n'
> -                        '^\s*([\S]+://[^\n]+)$',
> +                        '^\s*([\S]+://[^\n]+)',
>                             re.DOTALL | re.MULTILINE)
>      match = git_re.search(content)
>      if match:
> -- 
> 1.9.1
> 
> _______________________________________________
> Patchwork mailing list
> Patchwork at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/patchwork


More information about the Patchwork mailing list