0

i got the problem, that i have to search for a file of a specific type( *.xxx ) within a massive 10 year wide svn history. I am not very familiar with the workings of svn. For the beginning, it would be enough to search over all repositories within the current state, and not in history depth. I think, something like this should be possible, because the TortoiseSVN Repobrowser is able to view the files in the current state, like a normal file browser. I found various other Q&A-Threads concering to the same problem, but i seems all of them assume access to the svn server.

Also, i tried a couple of tools which were referenced in those Threads, but non of them seem to fit my needs. For example, "SvnQuery 1.2.2.0" and "SVN Search 1.3.0.". Both require me to specify the local path to the SVN repository. But i thought the repository lives at the server, and the client just got working copies?! But I might be wrong...

Another (secondary) question would be: Is it possible to display all CheckIn's/Commit's of a specific user for a year-old history? (Again just with client access.) At the moment, i just execute the following command:

TortoiseProc.exe /command:log /path:"https://svn:9880/SvnRoot"

After this, i hit the "Next 100" button till i found what i am searching for; or my fingers rot off.

Can someone help me?

Yours sincerely,

Michael

Allgaeuer
  • 725
  • 1
  • 7
  • 12

3 Answers3

0

See the answer to my (similar) question, which shows how to dump the log with the -l switch (to get more than the default 100) and also svnquery: How to search SVN repository for a file when I'm not sure where I put it?

Community
  • 1
  • 1
Chris Thornton
  • 15,620
  • 5
  • 37
  • 62
0

If you have the command line client and PowerShell, you can do the following to get all log entries for a specific user thusly:

[xml]$log = svn log --xml --verbose https://svn:9880/SvnRoot/;
$log.log.logentry|where-object {$_.author -eq "USERNAME"};

I'm sure there's a way to make it a one-liner, but it's not coming to me right now.

If you want to restrict the revision range or dates, see the help for svn log

alroc
  • 27,574
  • 6
  • 51
  • 97
0

it would be enough to search over all repositories within the current state, and not in history depth

The command you're looking for is svn ls -R %REPO%. This will list all of the files in the repository, and the -R means recursively. From there, you can filter out only the files in the repository you're interested in via your suffix.

Is it possible to display all CheckIn's/Commit's of a specific user for a year-old history? (Again just with client access.

The command you're looking for is svn log -r{20120130}`:HEAD %REPO%. This will list all of the history since January 30, 2012 to today.

From there, you could filter out the log entire for the particular user.

If you're new to Subversion, check out the online Subversion manual. It's one of the best open source project manuals I've seen. Also, the command line Subversion tool has a lot of built in help:

$ svn help
usage: svn <subcommand> [options] [args]
Subversion command-line client, version 1.7.5.
Type 'svn help <subcommand>' for help on a specific subcommand.
Type 'svn --version' to see the program version and RA modules
 or 'svn --version --quiet' to see just the version number.

Most subcommands take file and/or directory arguments, recursing
on the directories.  If no arguments are supplied to such a
command, it recurses on the current directory (inclusive) by default.

Available subcommands:
   add
   blame (praise, annotate, ann)
   cat
   changelist (cl)
   checkout (co)
   cleanup
   commit (ci)
   ...

From there, you can get help for a particular command. Either one of these will work:

$ svn help checkout
$ svn checkout --help

TortoiseSVN comes with the Subversion command line client. Check C:\Program Files\TortoiseSVN\bin (or where ever TortoiseSVN was installed on your systems). I believe it even sets your PATH correctly to execute svn.

You can use PowerShell on your PC, or download Python or Perl. These languages allow you to better manipulate the command line output from the various svn commands, and Perl and Python have Subversion modules that access Subversion directly through the API.

However, I tend to use the BASH shell and Unix utilities for most Subversion reporting since I can usually do that right from the command line without too much fuss. If you're familiar with Unix utilities, and are on the PC, try Cygwin which will give you the BASH shell and most of the standard Unix/GNU utilities.

David W.
  • 105,218
  • 39
  • 216
  • 337