[Merged!] [MERGE][1.6] Update repo description strings
John Arbash Meinel
john at arbash-meinel.com
Thu Aug 14 15:01:44 BST 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Aaron Bentley wrote:
> John Arbash Meinel wrote:
>> Bundle Buggy wrote:
>>> Bundle Buggy has detected this merge request.
>>> For details, see:
>>> http://bundlebuggy.aaronbentley.com/project/bzr/request/%3C20080813235228.11F4D626FB%40vm1.unixshell.com%3E
>>> Project: Bazaar
>
>
>> It seems Aaron's recent work to change the BB result forgot to update the
>> filter for it.
>
> Thanks for cleaning up my mess. I've changed BB to use [Success!]
> instead of [Merged!] for now.
>
>> I was curious why Aaron chose to use [MERGED!][MERGE] rather than [MERGED!]...
>
> I didn't. In the line "[Merged!][MERGE]", "[Merged!]" is a prefix that
> is prepended to the existing subject line. The existing subject line
> may contain "[Merge" or "[Merge/RFC" or "Patch", etc.
>
>> I also wonder if it isn't because he is using '\[MERGE' as the regex, rather
>> than '\[MERGE\>' as the regex.
>
> FWICT, r'\[MERGE\>' will only match the string "[MERGE>".
>>>> import re
>>>> re.match(r'\[Merge\>', '[Merge>')
> <_sre.SRE_Match object at 0xb7d22950>
>>>> re.match(r'\[Merge\>', '[Merge]')
>
> Aaron
So, it seems that Python's regex engine doesn't support "\>" and "\<" which
are: match at the end of a word, and match at the beginning of a word,
respectively.
However, it does have '\b' which is "match at a word boundary".
>>> re.match(r'\[Merge\b', '[Merge]')
<_sre.SRE_Match object at 0x81a53d8>
>>> re.match(r'\[Merge\b', '[Merge>]')
<_sre.SRE_Match object at 0x8393330>
>>> re.match(r'\[Merge\b', '[Merged]')
>>>
Anyway [Success!] is fine, but if you prefer [Merged!] the '\b' is a simple
way to fix it.
I really like \> and \<, and use them all the time in vim and grep (actually,
I learned it from vim, because when you do a * or # search, it searches for
\<foo\>).
It's a shame python doesn't have it, but at least it has \d rather than
[[:digit:]].
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFIpDrIJdeBCYSNAAMRAknNAJ9v0UDjlvFDff1tZoXq3j1HlRHXtQCeMw9p
VuWA6i2pp3OhGl627d4zVFw=
=LT68
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list