You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Roman Rytov <rr...@entopia.com> on 2002/12/10 10:09:51 UTC

History of erased file

I had a file called a.txt which I renamed it to b.txt. Looking at
history of b.txt I see that it hails from a.txt and all history belonged
to a.txt obviously transferred to (b.txt)'s history. But since there is
no file a.txt anymore is it possible to figure out somehow where a.txt
became b.txt?

Roman

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

Re: History of erased file

Posted by Peter Davis <pe...@pdavis.cx>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tuesday 10 December 2002 02:09, Roman Rytov wrote:
> it possible to figure out somehow where a.txt
> became b.txt?

One way would be to use "svn log --strict b.txt" to find out where b.txt was 
created, which is presumably the last (earliest) revision shown in the list 
of logs.  The "--strict" option prevents any logs for revisions that existed 
before the copy from being displayed.  Use the "--verbose" option to make 
sure.

- -- 
Peter Davis
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE99cPmhDAgUT1yirARAqnpAJ9/vT/Q7XDQnTdX6A+s6HXOHbkwZgCdEBst
RQlZVpH7nPtc0idnvIiQXrk=
=te5R
-----END PGP SIGNATURE-----


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

Re: History of erased file

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Eric Gillespie <ep...@pretzelnet.org> writes:
> > 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".
> > 
> > As such, it sounds a very handy command. Just needs someone to code
> > it.
> 
> http://subversion.tigris.org/issues/show_bug.cgi?id=928

Ah -- that was eloquent :-).

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

Re: History of erased file

Posted by Eric Gillespie <ep...@pretzelnet.org>.
Nuutti Kotivuori <na...@iki.fi> writes:

> 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".
> 
> As such, it sounds a very handy command. Just needs someone to code
> it.

http://subversion.tigris.org/issues/show_bug.cgi?id=928

--  
Eric Gillespie <*> epg@pretzelnet.org

Build a fire for a man, and he'll be warm for a day.  Set a man on
fire, and he'll be warm for the rest of his life. -Terry Pratchett

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

Re: History of erased file

Posted by William Uther <wi...@cse.unsw.edu.au>.
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

Re: History of erased file

Posted by Nuutti Kotivuori <na...@iki.fi>.
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".

As such, it sounds a very handy command. Just needs someone to code
it.

-- Naked


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

Re: History of erased file

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Jani Averbach <ja...@cc.jyu.fi> writes:
> (Precond: a dosen't exist at the moment)
> 
> $ svn please_tell_me_what_has_happened_to_this_item a.txt
> svn:
> a -> b at revision xyz
> 
> Even better:
> 
> $ svn please_tell_me_what_has_happened_to_this_item a.txt
> svn:
> a -(21)->  b
> b -(42)->  c
> c -(xyz)-> d
> d is a's incarnation at the moment
> 
> Where inside parenthesis is revision number when this happened.

Hmmm, maybe this is

   $ svn log --quiet

...what do you think? :-)

-K

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

Re: History of erased file

Posted by Jani Averbach <ja...@cc.jyu.fi>.
On 10 Dec 2002, Ben Collins-Sussman wrote:

> "Roman Rytov" <rr...@entopia.com> writes:
>
> > I had a file called a.txt which I renamed it to b.txt. Looking at
> > history of b.txt I see that it hails from a.txt and all history belonged
> > to a.txt obviously transferred to (b.txt)'s history. But since there is
> > no file a.txt anymore is it possible to figure out somehow where a.txt
> > became b.txt?
>
> Run 'svn log b.txt --verbose'.

Ok, but what if you don't know that a has been became to b?
How do you find this out? If there is myriad files it would be real pita
to try find out what has happened to a.

I think that it would be really nice if there is something like that:

(Precond: a dosen't exist at the moment)

$ svn please_tell_me_what_has_happened_to_this_item a.txt
svn:
a -> b at revision xyz

Even better:

$ svn please_tell_me_what_has_happened_to_this_item a.txt
svn:
a -(21)->  b
b -(42)->  c
c -(xyz)-> d
d is a's incarnation at the moment

Where inside parenthesis is revision number when this happened.

$ svn please_tell_me_what_has_happened_to_this_item a.txt
svn:
a has been deleted at revision xyz


What do you think?

BR, Jani

--
Jani Averbach




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

Re: History of erased file

Posted by Ben Collins-Sussman <su...@collab.net>.
"Roman Rytov" <rr...@entopia.com> writes:

> I had a file called a.txt which I renamed it to b.txt. Looking at
> history of b.txt I see that it hails from a.txt and all history belonged
> to a.txt obviously transferred to (b.txt)'s history. But since there is
> no file a.txt anymore is it possible to figure out somehow where a.txt
> became b.txt?

Run 'svn log b.txt --verbose'.  You will see the history of b, traced
back all the way through a's history as well (as you've noticed.)  But
the --verbose (-v) switch also shows which files were changed in each
revision.  In the revision where the copy happened, you'll see an
"added" b.txt with a description of its copy source next to it.


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