cvs2svn bug - regex can match partial symbol

"O'Brien, Jason K" <[email protected]> Mon, 17 Dec 2012 15:51:16 -0500
Newsgroups gmane.comp.version-control.subversion.cvs2svn.devel
Message-ID <8FB99964BA0BCE478ED6A990EA33DBA8028657057B09@EXM-MSW-07.Ceg.Corp.Net>
I'd submit this to the issue tracker, but it says to email here first, so h=
ere I go:

Seems that the _RegexpStrategyRule class tacks '^' and '$' around a regex t=
o match full lines only, which doesn't work when the regex contains a top l=
evel OR ("|") due to order of operations.

For example, "foo|bar" becomes "^foo|bar$", which matches "foobaz" and "baz=
bar". This causes some confusion, as branches I explicitly excluded were bl=
ocking other branches from being excluded (apparently matching a ForceBranc=
h rule overrides an exclusion rule). I figure putting a non-capturing group=
 around it should do the trick.

Thanks for an amazing product! Hope this helps.
Jason O'Brien

NOTE: I haven't tested this, but I applied the same workaround to my regex =
strings themselves and it fixed the issue for me.

Index: cvs2svn_lib/symbol_strategy.py
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- cvs2svn_lib/symbol_strategy.py      (revision 5408)
+++ cvs2svn_lib/symbol_strategy.py      (working copy)
@@ -86,7 +86,7 @@
     ACTION(name, id); otherwise it returns SYMBOL unchanged."""

     try:
-      self.regexp =3D re.compile('^' + pattern + '$')
+      self.regexp =3D re.compile('^(?:' + pattern + ')$')
     except re.error:
       raise FatalError("%r is not a valid regexp." % (pattern,))
>>> This e-mail and any attachments are confidential, may contain legal,
professional or other privileged information, and are intended solely for t=
he
addressee.  If you are not the intended recipient, do not use the informati=
on
in this e-mail in any way, delete this e-mail and notify the sender. -IP2

------------------------------------------------------
http://cvs2svn.tigris.org/ds/viewMessage.do?dsForumId=3D1667&dsMessageId=3D=
3036591

To unsubscribe from this discussion, e-mail: [[email protected]=
s.org].