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

Re: History of erased file

From: William Uther <willu.mailingLists_at_cse.unsw.edu.au>
Date: 2002-12-11 02:15:19 CET

On Wednesday, December 11, 2002, at 02:18 AM, Nuutti Kotivuori wrote:

> Jani Averbach wrote:
>> What do you think?
>
> Well, there's one thing which needs to be considered here.
>
> There can be several different files named a.txt - that might have no
> relation what so ever to each other.
>
> So what you in fact want to know is "tell me the life-cycle of every
> item that has ever been named /trunk/a.txt".

Possibly... My thought was that you'd use a name/revision pair to
identify which a.txt the user is referring to. At the moment, the
'a.txt' from the largest revision in a range is always used. e.g.:

svn log -r 3:6 a.txt

and

svn log -r 6:3 a.txt

return the same thing. Both take the file a.txt at revision 6 and
return its log between revisions 3 and 6.

One possible change would be to alter this to use the 'a.txt' file from
the first revision named. e.g.:

svn log -r 3:6 a.txt # uses the a.txt from revision 3 and shows its
history forward to revision 6
svn log -r 6:3 a.txt # uses the a.txt from revision 6 and shows its
history between revs 3 and 6

or perhaps another argument supplying the revision to use?

svn log -r 3:6 --base-rev 4 a.txt # uses the a.txt from revision 4 and
shows its history from revision 3 to revision 6.

later,

\x/ill :-}

P.S. I just read
http://subversion.tigris.org/issues/show_bug.cgi?id=928 (thanks Eric
for the pointer). I believe that that bug is (somewhat) orthogonal to
what I'm discussing in this email. That bug handles how you trace a
history from a given starting point. This email is all about
identifying the starting point. The --follow-paths option is related,
but it will only tell you about the first move... I'm talking about
--follow-copies starting from a file in an older revision. This is
somewhat bikeshedesque though... so I'll be quiet now :)

Here is a longer example:

% mkdir stuff
% cd stuff
% svnadmin create repos
% svn mkdir file://`pwd`/repos/trunk -m "make trunk"

Committed revision 1.
% svn co file://`pwd`/repos/trunk
Checked out revision 1.
% cd trunk
% cat > a.txt
This is file a
% svn add a.txt
A a.txt
% svn commit -m "added a"
Adding a.txt
Transmitting file data .
Committed revision 2.
% cat >> a.txt
Added to a
% svn commit -m "added to a"
Sending a.txt
Transmitting file data .
Committed revision 3.
% svn mv a.txt b.txt
A b.txt
D a.txt
% svn commit -m "moved a to b"
Deleting a.txt
Adding b.txt

Committed revision 4.
% cat >> b.txt
added to b
% svn commit -m "added to b"
Sending b.txt
Transmitting file data .
Committed revision 5.
% cat > a.txt
Made a new a
% svn add a.txt
A a.txt
% svn commit -m "added a new a"
Adding a.txt
Transmitting file data .
Committed revision 6.
% svn log a.txt
------------------------------------------------------------------------
rev 6: willu | 2002-12-11 11:26:34 +1100 (Wed, 11 Dec 2002) | 1 line

added a new a
------------------------------------------------------------------------
% svn log b.txt
------------------------------------------------------------------------
rev 5: willu | 2002-12-11 11:26:09 +1100 (Wed, 11 Dec 2002) | 1 line

added to b
------------------------------------------------------------------------
rev 4: willu | 2002-12-11 11:25:44 +1100 (Wed, 11 Dec 2002) | 1 line

moved a to b
------------------------------------------------------------------------
rev 3: willu | 2002-12-11 11:25:24 +1100 (Wed, 11 Dec 2002) | 1 line

added to a
------------------------------------------------------------------------
rev 2: willu | 2002-12-11 11:24:59 +1100 (Wed, 11 Dec 2002) | 1 line

added a
------------------------------------------------------------------------
% svn log -r 3 a.txt
------------------------------------------------------------------------
rev 3: willu | 2002-12-11 11:25:24 +1100 (Wed, 11 Dec 2002) | 1 line

added to a
------------------------------------------------------------------------
% svn log -r 3 b.txt
subversion/libsvn_fs/tree.c:185: (apr_err=160013, src_err=0)
svn: Filesystem has no item
svn: file not found: revision `3', path `/trunk/b.txt'
% svn log -r 3:6 a.txt
------------------------------------------------------------------------
rev 6: willu | 2002-12-11 11:26:34 +1100 (Wed, 11 Dec 2002) | 1 line

added a new a
------------------------------------------------------------------------
% svn log -r 6:3 a.txt
------------------------------------------------------------------------
rev 6: willu | 2002-12-11 11:26:34 +1100 (Wed, 11 Dec 2002) | 1 line

added a new a
------------------------------------------------------------------------

Note that both 'svn log -r 3:6 a.txt' and 'svn log -r 6:3 a.txt' take
the file 'a.txt' from revision 6 and shows its history between revs 3
and 6. What you want is a way to take the a.txt from revision 3 and
show that history between revision 3 and 6. e.g.:

% svn log -r 3:6 a.txt # simulated output from changed command
------------------------------------------------------------------------
rev 5: willu | 2002-12-11 11:26:09 +1100 (Wed, 11 Dec 2002) | 1 line

added to b
------------------------------------------------------------------------
rev 4: willu | 2002-12-11 11:25:44 +1100 (Wed, 11 Dec 2002) | 1 line

moved a to b
------------------------------------------------------------------------
rev 3: willu | 2002-12-11 11:25:24 +1100 (Wed, 11 Dec 2002) | 1 line

added to a
------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Dec 11 02:16:12 2002

This is an archived mail posted to the Subversion Dev mailing list.