You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Jim Paris <ji...@jtan.com> on 2004/02/24 08:24:04 UTC

Accessing history after copy?

I had a file foo/NEWS that I removed a few revisions ago.
Then, I restructured my repository a bit:

$ svn mkdir trunk
$ svn mkdir tags
$ svn move foo trunk
$ svn commit
$ svn update
At revision 84.

Then I decided that I wanted to see what I had in NEWS:

$ cd trunk/foo
$ svn cat -r 80 NEWS
svn: Entry has no URL
svn: 'NEWS' has no URL

Hmm, not going to happen.  I tried to look at an old revision of a
file that still exists:

$ svn cat -r 83 debug.h
svn: HTTP Path Not Found
svn: PROPFIND request failed on '/svn/blah/!svn/bc/83/trunk/foo/debug.h'
svn: '/svn/blah/!svn/bc/83/trunk/foo/debug.h' path not found

This seems very weird to me.  I can still get the old revisions if I
remember the old directory structure and go straight to the server:

$ svn cat -r 80 https://example.com/svn/blah/foo/NEWS
(correct output...)

The question: is this expected behavior?  I thought Subversion was
supposed to track history even when moving a directory around like
that.  It seems a little weird that "svn log" shows all of the old
history but you can't actually access it directly with "cat" or
"merge".  Am I doing something wrong?

-jim

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

Re: Accessing history after copy?

Posted by Ben Collins-Sussman <su...@collab.net>.
On Tue, 2004-02-24 at 11:56, Robert Guthrie wrote:

> My diff command outputs the entire file:
> rguthr@rguthr4:~/MySync/Writing$ svn diff -r245 A_Veil_Torn.lyx | head
> Index: A_Veil_Torn.lyx
> ===================================================================
> --- A_Veil_Torn.lyx     (revision 0)
> +++ A_Veil_Torn.lyx     (revision 266)

This is a known bug with 'svn diff', I believe.  You're saying, "please
diff my working file with r245 of a certain repos path".  Any other
subcommand would have said, "error:  that path doesn't exist in r245". 
But this particular usage of 'svn diff' instead says, "Oh, ok, the path
doesn't exist, so therefore I'll just show the whole file being
added."  I don't like this behavior, but some other developers do.

 
> rguthr@rguthr4:~/MySync/Writing$ svn diff -r245:HEAD A_Veil_Torn.lyx
> svn: 
> 'svn+ssh://me@my.server/home/subversion/personal/trunk/MySync/Writing/A_Veil_Torn.lyx' 
> was not found in the repository at revision 245

Now, instead of asking for a comparison between a repository file and
working file, you're asking for a comparison between two repository
files:  the path in r245, and the path in HEAD.  And now svn is giving
a more intelligible error (what I wish it had done in the previous
case):  that the path doesn't exist in r245.

The fundamental problem is still the fact that like every other
subcommand (other than 'svn log'), 'svn diff' doesn't follow rename/copy
history as it should.  It's a very high priority for us to fix.  

To do the diff you want, do a diff of two urls:

   $ svn diff oldURL@X newURL@HEAD

The trick is to use 'svn log -v A_Veil_Torn.lyx' to figure out the
precise (rev, path) coordinates of the older version of the file. 
That's what you'll substitute in for 'oldURL' and 'X' above.



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

Re: Accessing history after copy?

Posted by Robert Guthrie <th...@pobox.com>.
I'm having a similar problem, but following your advice isn't helping.
Here's a fragment from my log, showing that I moved /trunk/rguthrie to 
/trunk/MySync.  In the previous revision, I checked in a short story I'm 
writing, and I want to compare that against my current one (see after 
the log):

rguthr@rguthr4:~/MySync$ svn log -v | grep -C5 r245
    D /trunk/rguthrie

Moved "rguthrie" directory to "MySync"

------------------------------------------------------------------------
r245 | rguthrie | 2004-02-16 17:46:32 -0600 (Mon, 16 Feb 2004) | 2 lines
Changed paths:
    M /trunk/rguthrie/Writing/A_Veil_Torn.lyx

My diff command outputs the entire file:
rguthr@rguthr4:~/MySync/Writing$ svn diff -r245 A_Veil_Torn.lyx | head
Index: A_Veil_Torn.lyx
===================================================================
--- A_Veil_Torn.lyx     (revision 0)
+++ A_Veil_Torn.lyx     (revision 266)
@@ -0,0 +1,376 @@
+#LyX 1.3 created this file. For more info see http://www.lyx.org/
+\lyxformat 221
+\textclass book
+\language english
+\inputencoding auto

Note that it's comparing revision 0 to revision 266, but not to revision 
245 (when it was actually created) and HEAD.  If I try to force it:
rguthr@rguthr4:~/MySync/Writing$ svn diff -r245:HEAD A_Veil_Torn.lyx
svn: 
'svn+ssh://me@my.server/home/subversion/personal/trunk/MySync/Writing/A_Veil_Torn.lyx' 
was not found in the repository at revision 245

So, what gives?  I don't think my head revision has changed, except in 
location, but shouldn't that just result in no output?

Note that I've tried using the full URL for revision 245, and that 
resulted in the same error.


Ben Collins-Sussman wrote:
> 
> No, you're not doing anything wrong.  This is one of the big annoyances 
> of subversion 1.0, a feature we haven't yet implemented.  The repository 
> tracks copy/move history, but of all the client subcommands, only 'svn 
> log' can follow that history.  Really, 'svn diff', 'svn merge', 'svn 
> cat/ls', and a whole bunch of other commands ought to follow history as 
> well.
> 
> The workaround for svn 1.0 is to use 'svn log' to discover the item's 
> history, then provide the proper (revision, URL) coordinates to the 
> subcommand you really want to run.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org

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

Re: Accessing history after copy?

Posted by Ben Collins-Sussman <su...@collab.net>.
Jim Paris wrote:
> The question: is this expected behavior?  I thought Subversion was
> supposed to track history even when moving a directory around like
> that.  It seems a little weird that "svn log" shows all of the old
> history but you can't actually access it directly with "cat" or
> "merge".  Am I doing something wrong?

No, you're not doing anything wrong.  This is one of the big annoyances 
of subversion 1.0, a feature we haven't yet implemented.  The repository 
tracks copy/move history, but of all the client subcommands, only 'svn 
log' can follow that history.  Really, 'svn diff', 'svn merge', 'svn 
cat/ls', and a whole bunch of other commands ought to follow history as 
well.

The workaround for svn 1.0 is to use 'svn log' to discover the item's 
history, then provide the proper (revision, URL) coordinates to the 
subcommand you really want to run.

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