You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Christopher Baus <ch...@yahoo.com> on 2004/11/01 06:53:02 UTC

determining which revision a file was added

I am going through the API docs, but I can't figure
how to determine when a file was added to the
repository.  Basically I want to know the date when a
file was added.

Thanks,

Christopher

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: determining which revision a file was added

Posted by Christopher Ness <ch...@nesser.org>.
On Mon, 2004-11-01 at 01:53, Christopher Baus wrote:
> I am going through the API docs, but I can't figure
> how to determine when a file was added to the
> repository.  Basically I want to know the date when a
> file was added.

The date a file was added will be the first revision of the file.  The
first revision of the file can be found like so:

svn log <filename> | grep ^r[0-9] | tail -n 1

Notice the regular expression to get only lines that start with "r#" of
course there could be comments that have "r#" in them as well so this is
not fail proof.  As long as they do not appear in the first comment of
the file we should be ok.

Not sure if SVN has a property you could try to get (svn propget) or not
for this, you'd want that if you are in windows.  Or you could download
the GNU tools for windows so you can grep and tail.  There should be a
link on this list somewhere.

Here is the output of the command above for one of my repos.

[nesscg@woman latex-src]$ svn log srs.tex | grep ^r[0-9] | tail -n 1
r739 | nesscg | 2004-10-29 14:45:20 -0400 (Fri, 29 Oct 2004) | 3 lines

Cheers,
Chris
-- 
Software Engineering IV,
McMaster University
PGP Public Key: http://www.nesser.org/pgp-key/
08:27:18 up 17:07, 2 users, load average: 0.16, 0.06, 0.26 
http://www.fsf.org/philosophy/no-word-attachments.html