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

Re: How to know if a file was ever in the repository

From: Ryan Schmidt <subversion-2009d_at_ryandesign.com>
Date: Mon, 23 Nov 2009 01:48:23 -0600

On Nov 23, 2009, at 00:31, Olivier Sannier wrote:

> I'm wondering if there is a possibility to know if a file was present in
> a repository at any given time, even if it was deleted later on.
> Basically, if I had this URL :
>
> http://host/myrepos/folder/to/file/myfile.txt
>
> I would like a command, or series of command that could tell me if the
> file was ever present, even if it is presently absent from HEAD.
> Then end goal is to avoid readding a file that got removed without
> actually reading the log message for its removal.
> Ideally, this series of command would work for folders as well.

There isn't a single built-in command that does that. If the file doesn't exist in head, you would use "svn log -q -v" on the folder, if it still exists; if it doesn't or you're not sure, then get the log of the entire repository. Search the output for the filename; if it occurs, then you'll see the revision in which it was deleted.

Since this is obviously not straightforward, if this is something you want to do often or be able to script, you may want to have a post-commit hook that records the names of every file in the commit elsewhere, like to a database of your own creation. That way you can more easily query it in the future.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2423227

Please start new threads on the <users_at_subversion.apache.org> mailing list.
To subscribe to the new list, send an empty e-mail to <users-subscribe_at_subversion.apache.org>.
Received on 2009-11-23 08:49:32 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.