1

I'm managing a software package that is under heavy development by many people. However, some parts of the package may be no longer needed and could possibly be removed. A good indicator for this would be if no change happened for a long time. [You'll have to trust me on this. The collaboration I'm in has very strange working habits...]

How can I find out which files in an SVN repo did not change for a certain timespan?

I've found this question, which describes the inverse of my problem: List of files changed since a certain date using SVN

However, it's not clear to me how I could use the answers given to solve my problem. Any suggestions?

Community
  • 1
  • 1
carsten
  • 1,315
  • 2
  • 13
  • 27

3 Answers3

0

You have some options

  1. get svn info file , extract revision from output. If file revision << repostory revision, then this file is too old
  2. get svn info --xml and parse the xml results for file/folder revisions
  3. do the svn checkout with use-commit-times options and search for old files in working copy
Y.N
  • 4,989
  • 7
  • 34
  • 61
0

If you have grep (and you have to have grep even on Windows), you can

  • Get list of changed paths in file FILE (see linked answer)
  • Pipe list of all files in repo into special grep: svn ls -R | grep -v -f FILE (TBT!!! I have not grep in hands right now)
    • svn ls -R in the root of WC output the full tree
    • grep -f uses patterns for search from file (line per line), -v inverse results, i.e. I expect in output strings from ls, not found in FILE, as it was requested
Lazy Badger
  • 94,711
  • 9
  • 78
  • 110
0

First, get a list unique list of files/folders that have been recently changed. Go to the root of your working copy and execute

 svn log <url> -qv -r {startdate}:{enddate} | grep "^ " | awk '{print $2}' | sort -u | cut -c<N>- > changed.txt

Please note that this command assumes that you have no spaces in your filenames. If there are spaces, you need to replace the awk command with something more sophisticated. The integer <N> in the cut command should be chosen such that all paths in changed.txt are relative to the current directory.

Then, get a similar list of all currently existing files:

find . -type f -not -path "*/.svn*" | sort -u  | cut -c3- > current.txt

Finally, get the list of currently existing files that have not been changed recently (i.e. files that are present in current.txt but not in changed.txt):

comm -23 current.txt changed.txt