[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: RE: Seeking a way to do a full text search in a repository

From: Reedick, Andrew <jr9445_at_ATT.COM>
Date: Wed, 6 Feb 2008 12:13:53 -0600

> -----Original Message-----
> From: Reedick, Andrew
> Sent: Wednesday, February 06, 2008 1:09 PM
> To: Bicking, David (HHoldings, IT); users_at_subversion.tigris.org
> Cc: Kohlhepp, Justin (HHoldings, IT)
> Subject: RE: RE: Seeking a way to do a full text search in a
repository
>
 
> svn_search_hack.py
> ==================
> import sys
> import xml.etree.ElementTree as ET
>
> log = ET.parse(sys.stdin)
> #log = ET.parse('log.xml')
>
> for logentry in log.findall('logentry'):
>
> for path in log.findall('logentry/paths/path'):
> # we only want to cat added or modified files. No point
> cat'ing
> deleted ones
> if path.attrib['action'] == 'M' or path.attrib['action'] ==
> 'A':
> print 'svn cat -r %s "{REPOS}%s" | findstr {REGEX}' %
> (logentry.attrib['revision'], path.text)
>

The previous code contained a bug that generated too many 'svn cat's.
Use this instead.

log = ET.parse(sys.stdin)
#log = ET.parse('data.xml')

for logentry in log.findall('logentry'):
    for path in logentry.findall('paths/path'):
        # we only want to cat added or modified files. No point cat'ing
deleted ones
        if path.attrib['action'] == 'M' or path.attrib['action'] == 'A':
            print 'svn cat -r %s "{REPOS}%s" | findstr {REGEX}' %
(logentry.attrib['revision'], path.text)

*****

The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers. GA625

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-02-06 19:14:56 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.