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

Re: examining repository for files that only I have changed

From: B Smith-Mannschott <bsmith.occs_at_gmail.com>
Date: Sat, 22 Jan 2011 16:51:18 +0100

On Fri, Jan 21, 2011 at 17:18, Woodworth, James
<JWoodworth_at_flr.follett.com> wrote:
> Hello,
>
> Over the past three weeks I have changed and committed some files.  I need
> to somehow recurse through the directories and show me only the files I have
> changed.  How do I do this?
>
> I suppose I could write a script to do this, but I suspect Subversion is
> sophisticated enough, and I am just missing something.

Subversion will give you the log as XML, if you ask for it:

    svn log --verbose --xml svn://server/repository

Here's an XSLT that will extract the names of *files* added, deleted
or modified by a given *author*:

-- files-modified-by-author.xsl --
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:output method="text"/>
  <xsl:param name="author">smithma</xsl:param>
  <xsl:template match="/log/logentry">
    <xsl:if test="author=$author">
      <xsl:apply-templates select="paths/path[@kind='file']"/>
    </xsl:if>
  </xsl:template>
  <xsl:template match="/log/logentry/paths/path">
    <xsl:value-of select="text()"/>
    <xsl:text>&#x000a;</xsl:text>
  </xsl:template>
  <xsl:template match="text()"/>
</xsl:stylesheet>
-- end file --

Here's a BASH script which will call svn for the log, pull out the
files using xsltproc and the above XSL transformation and then toss
out duplicates using sort:

-- files-modified-by-author.bash --
REPOSITORY=svn://server/repository
AUTHOR=username

function get_log () {
    svn log --xml --verbose $REPOSITORY
}

function select_files () {
    xsltproc --stringparam author $AUTHOR files-modified-by-author.xsl -
}

get_log | select_files | sort -u
-- end file --

Edit the values of REPOSITORY and AUTHOR as necessary for your
repository and user name.

Then, you can call the script as follows and record the resulting list
of file names in a file for perusal at your leisure:

    bash files-modified-by-author.bash > files-modified-by-author.txt

HTH

// Ben
Received on 2011-01-22 16:51:55 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.