0

I am a beginner with subversions. I want ot know if it is apossible to redirect the output of the command svn log in order to put it in a file. In fact, I want to see the history of the users and check some info about a specific user (name of the added files in a specific date), which is possible I think by using awk with the resulting file.
when I do

svn log file:///var/svn/repository/myproject>file

I get an error message:

bash: file: Permission denied

if anyone can help me thnx

3
  • 4
    try: svn log file:///var/svn/repository/myproject > /tmp/file.txt Commented Jan 16, 2011 at 17:04
  • 2
    @Nishant is right -- the problem is almost certainly that you don't have write access to the current directory. Generally all users have write access to /tmp. Commented Jan 16, 2011 at 17:06
  • 2
    My suggestion regarding the log output processing is to check the --xml option for the svn log command. Unless you are an awk hacker, it might be easier to process the XML output using a stylesheet than awk for the plain text output :) Commented Jan 16, 2011 at 19:25

1 Answer 1

4

Well, I thought that it is an easy job to identify the files added by a specific user in a specific date, using awk with the output (mylogfile), but the problem is that I can't distinguish between added and removed files!

Sure you can...

svn log -v REPOURL > ~/reposvn.log

You will then see output kinda like this:

------------------------------------------------------------------------
r1 | svnuser | 2010-10-20 18:56:07 -0400 (Wed, 20 Oct 2010) | 1 line
Changed paths:
   A /trunk/file/that/was/added.txt
   D /trunk/file/that/was/removed.txt

Commit comment.

A means added, M means modified, D means deleted. awk on that :-)

Also you might want to think about Antonio's comment above to use the xml format and parse that as opposed to using awk... might be easier. Ive never tried to do either so i cant say.


That has nothing to do with SVN you dont have permission to write to the file youre trying to write to. Try throwing it in your home directory or in /tmp as Nishant suggested in his comment.

Sign up to request clarification or add additional context in comments.

2 Comments

A shorthand abbreviation for your home directory is ~, so like this: svn log file:///var/svn/repository/myproject > ~/mylogfile.txt
Well, I thought that it is an easy job to identify the files added by a specific user in a specific date, using awk with the output (mylogfile), but the problem is that I can't distinguish between added and removed files!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.