[issue699] interhg: substitute pattern specification needs more flexibility

Thomas Arendsen Hein mercurial-bugs at selenic.com
Mon Aug 20 12:20:40 CDT 2007


New submission from Thomas Arendsen Hein <thomas at intevation.de>:

Currently the only possible pattern specification is:
patN = s/foo/bar/

1. You can't use something else than "pat" followed by a number.
Because of this you can't give expressive names.

2. You can't use something else than "/" as delimiter.
Because of this you have to escape / in URLs which looks ugly.

Instead of
pat1 = s/(?<=\W)(issue\s*)(\d+)/<a
href="http:\/\/www.selenic.com\/mercurial\/bts\/issue\2">\1\2<\/a>/
I'd like to be able to write something like:
issues = s|(?<=\W)(issue\s*)(\d+)|<a
href="http://www.selenic.com/mercurial/bts/issue\2">\1\2</a>|


Additionally there is no way to reference the repositories base URL, so for
linking hashes to revision pages I need an absolute URL:
pat2 = s/(?<=\W)([a-fA-Z0-9]{12}([a-fA-Z0-9]{28})?)(?=(\W|$))/<a
href="\/mercurial\/crew\/rev\/\1">\1<\/a>/
Instead of something like:
pat2 = s/(?<=\W)([a-fA-Z0-9]{12}([a-fA-Z0-9]{28})?)(?=(\W|$))/<a
href="{baseurl}\/rev\/\1">\1<\/a>/

----------
messages: 3864
nosy: ThomasAH, ohachige, tonfa
priority: feature
status: unread
title: interhg: substitute pattern specification needs more flexibility

____________________________________________________
Mercurial issue tracker <mercurial-bugs at selenic.com>
<http://www.selenic.com/mercurial/bts/issue699>
____________________________________________________



More information about the Mercurial-devel mailing list