You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Greg Stein <gs...@lyra.org> on 2001/04/16 22:47:15 UTC

Re: CVS update: subversion/subversion/tests/clients/cmdline svn_output.py xml_tests.py

On Mon, Apr 16, 2001 at 10:18:01PM -0000, sussman@tigris.org wrote:
>...
>   +# General helper for compare_sets()
>   +
>   +# Useful regexp for checkout/update:  r"^(..)\s+(.+)"  ==> '_U /foo/bar'
>   +# Useful regexp for commit/import:    r"^(\w+)\s+(.+)" ==> "Changing /foo/bar'
>   +# Useful regexp for status:           r"^(..)\s+(\d+)\s+\(.+\)\s+(.+)"
>   +#                                        'MM     13      ( 24)   /foo/bar'
>   +def line_matches_regexp(line, regexp):
>   +  "Return 0 if LINE matches REGEXP, or 1 if not."
>    
>   -  # if we get here, then all groups matched.
>   -  return 0  # success
>   +  match = re.search(regexp, line)
>   +  if match is None:
>   +    return 1
>   +  else:
>   +    return 0

Maybe use re.match() ?

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/