[issue972] Regexp back references in .hgignore work counterintuitively
wigy
mercurial-bugs at selenic.com
Fri Feb 8 05:06:07 CST 2008
New submission from wigy <va_ad at freemail.hu>:
When using regexp syntax in .hgignore files, there is a possibility to use back
references. For example if you use a wizard in Visual Studio to create ATL class
projects, the build will generate some source files, which you want to ignore
with for example the following rules:
^src/(.+)/\1\.h$
^src/(.+)/\1_i\.c$
^src/(.+)/\1_p\.c$
The current implementation just appends all the ignore rules in one big regexp,
so the above will not work. As a workaround, I used
^src/build/(?P<projectname1>.+)/(?P=projectname1)\.h$
^src/build/(?P<projectname2>.+)/(?P=projectname2)_i\.c$
^src/build/(?P<projectname3>.+)/(?P=projectname3)_p\.c$
so that the groupnames do not clash. I feel that this problem should be either
corrected or documented.
----------
messages: 5154
nosy: wigy
priority: bug
status: unread
title: Regexp back references in .hgignore work counterintuitively
____________________________________________________
Mercurial issue tracker <mercurial-bugs at selenic.com>
<http://www.selenic.com/mercurial/bts/issue972>
____________________________________________________
More information about the Mercurial-devel
mailing list