Merge lp:~salgado/terminator/fix-lp-code-plugin into lp:terminator/trunk

Proposed by Guilherme Salgado
Status: Merged
Merged at revision: 1314
Proposed branch: lp:~salgado/terminator/fix-lp-code-plugin
Merge into: lp:terminator/trunk
Diff against target: 12 lines (+1/-1)
1 file modified
terminatorlib/plugins/url_handlers.py (+1/-1)
To merge this branch: bzr merge lp:~salgado/terminator/fix-lp-code-plugin
Reviewer Review Type Date Requested Status
Chris Jones (community) Approve
Review via email: mp+107466@code.launchpad.net

Description of the change

I couldn't really find out why the original regex doesn't match a URL like 'lp:~user/foo-project/branch' since it does match if you do a re.match(LaunchpadCodeURLHandler.match, 'lp:~user/foo-project/branch'). However, after messing around I found that moving the order of things in lpfilters['project'] fixes it, so that's what I'm proposing here. I've also removed the escaping for the '.', '-' and '+' mostly for consistency with lpfilters['branch'], because it works either way.

To post a comment you must log in.
Revision history for this message
Chris Jones (cmsj) wrote :

Looks good, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'terminatorlib/plugins/url_handlers.py'
2--- terminatorlib/plugins/url_handlers.py 2012-01-14 20:09:25 +0000
3+++ terminatorlib/plugins/url_handlers.py 2012-05-25 20:12:19 +0000
4@@ -31,7 +31,7 @@
5 nameopen = "Open Launchpad branch"
6 namecopy = "Copy branch URL"
7 lpfilters = {}
8- lpfilters['project'] = '[a-z0-9]{1}[a-z0-9\.\-\+]+'
9+ lpfilters['project'] = '[a-z0-9]{1}[a-z0-9+.-]+'
10 lpfilters['group'] = '~%s' % lpfilters['project']
11 lpfilters['series'] = lpfilters['project']
12 lpfilters['branch'] = '[a-zA-Z0-9]{1}[a-zA-Z0-9_+@.-]+'