You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Jon DeVree <ja...@mtu.edu> on 2010/03/29 17:55:59 UTC

svn copy not updating Last Changed Rev

I noticed that when you svn copy a directory (like for branching and
tagging) the 'Last Changed Rev' in svn info only moves forward on the
root of the copy and not every file. The most recent revision in svn log
will show up as the copy revision though. Shouldn't the 'Last Changed
Rev' on a path always be the same as the most recent revision shown in
svn log for the same path?

I noticed this on svn 1.4.2, but it shows up in 1.6.9 as well.
Here is an example from svn 1.6.9 operating with a local repository, but
I originally noticed this on svn 1.4.2 with the svn+ssh protocol.

$ svn copy -m "test branch" file:///tmp/svn-repo/trunk
file:///tmp/svn-repo/branches/mine

Committed revision 5.

SVN info on the root of the copy shows the expected information:

$ svn info file:///tmp/svn-repo/branches/mine
Path: mine
URL: file:///tmp/svn-repo/branches/mine
Repository Root: file:///tmp/svn-repo
Repository UUID: f5a3ca28-02f1-438b-b454-8e94791581c1
Revision: 5
Node Kind: directory
Last Changed Author: jadevree
Last Changed Rev: 5
Last Changed Date: 2010-03-29 13:43:06 -0400 (Mon, 29 Mar 2010)

But SVN info on the file that got copied with the branch is wrong:

$ svn info file:///tmp/svn-repo/branches/mine/file
Path: file
Name: file
URL: file:///tmp/svn-repo/branches/mine/file
Repository Root: file:///tmp/svn-repo
Repository UUID: f5a3ca28-02f1-438b-b454-8e94791581c1
Revision: 5
Node Kind: file
Last Changed Author: jadevree
Last Changed Rev: 2
Last Changed Date: 2010-03-29 13:40:30 -0400 (Mon, 29 Mar 2010)

SVN log shows revision 5 as the most recent:

$ svn log file:///tmp/svn-repo/branches/mine/file
------------------------------------------------------------------------
r5 | jadevree | 2010-03-29 13:43:06 -0400 (Mon, 29 Mar 2010) | 1 line

test branch
------------------------------------------------------------------------
r2 | jadevree | 2010-03-29 13:40:30 -0400 (Mon, 29 Mar 2010) | 1 line

foo
------------------------------------------------------------------------


Interestingly enough, this doesn't happen if you do a local copy +
commit instead of a server side copy. Having peeked at the fsfs revision
files, it seems the two types of copies are represented quite a bit
differently internally.

$ svn copy trunk branches/bar
A         branches/bar
$ svn commit -m "bar"
Adding         branches/bar
Adding         branches/bar/file

Committed revision 3.
$ svn info file:///tmp/svn-repo/branches/bar/file
Path: file
Name: file
URL: file:///tmp/svn-repo/branches/bar/file
Repository Root: file:///tmp/svn-repo
Repository UUID: f5a3ca28-02f1-438b-b454-8e94791581c1
Revision: 3
Node Kind: file
Last Changed Author: jadevree
Last Changed Rev: 3
Last Changed Date: 2010-03-29 13:40:53 -0400 (Mon, 29 Mar 2010)

-- 
Jon
"lib64 is a wart on history and should never have been there."
        -Tollef Fog Heen

Re: svn copy not updating Last Changed Rev

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Jon DeVree wrote on Mon, 29 Mar 2010 at 17:57 -0400:
> On Mon, Mar 29, 2010 at 23:53:43 +0300, Daniel Shahaf wrote:
> >     % svn info iota2 iota3 | grep "Last Changed Rev"
> >     Last Changed Rev: 2
> >     Last Changed Rev: 3
> > 
> 
> Try it with a directory that includes files and subdirectories and
> you'll be able to reproduce it. The actual directory used as the root of
> the copy operation has the correct Last Changed Rev, as I noted already:
> 

Oh, sorry.  Here's the output for a directory with children:

    [[[
    % svn cp -q A A2

    % svn ci -q -m "r2: add A2"

    % svn cp -q ^/trunk/A ^/trunk/A3 -m "r3: add A3"

    % svn up -q

    % svn info A2 A3 | grep "Last Changed Rev"
    Last Changed Rev: 2
    Last Changed Rev: 3

    ### why do the following two differ?
    % svn info A2/mu A3/mu | grep "Last Changed Rev"
    Last Changed Rev: 2
    Last Changed Rev: 1

    % svn --version -q
    1.7.0-dev-r925148

    %
    ]]]

The second 'info' command treats A2/mu and A3/mu differently, and
I don't see any reason for it do do so.  (i.e., this seems to be a bug.)

> > SVN info on the root of the copy shows the expected information:
> > 
> > $ svn info file:///tmp/svn-repo/branches/mine
> > Last Changed Author: jadevree
> > Last Changed Rev: 5
> > Last Changed Date: 2010-03-29 13:43:06 -0400 (Mon, 29 Mar 2010)
> 

*nod*

> It is the files and subdirectories of this that are wrong:
> 
> > But SVN info on the file that got copied with the branch is wrong:
> > 
> > $ svn info file:///tmp/svn-repo/branches/mine/file
> > Last Changed Author: jadevree
> > Last Changed Rev: 2
> > Last Changed Date: 2010-03-29 13:40:30 -0400 (Mon, 29 Mar 2010)
> 
> And this is inconsistent with what svn log reports as the last change:
> 
> > $ svn log file:///tmp/svn-repo/branches/mine/file
> > ------------------------------------------------------------------------
> > r5 | jadevree | 2010-03-29 13:43:06 -0400 (Mon, 29 Mar 2010) | 1 line
> > 
> > test branch
> > ------------------------------------------------------------------------
> > r2 | jadevree | 2010-03-29 13:40:30 -0400 (Mon, 29 Mar 2010) | 1 line
> > 
> > foo
> > ------------------------------------------------------------------------
> 
> 

So, 'log' does consider the copy-of-a-parent as a change to the child,
while 'info' doesn't.  I'm not sure whether or not this is intentional.

> 

Re: svn copy not updating Last Changed Rev

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Jon DeVree wrote on Mon, 29 Mar 2010 at 18:47 -0400:
> In fact, it occured to me that this should be visible on any public
> subversion repository that used a server side svn copy operation. Even
> the repository of svn itself:
> 
> Here is the most recent log entry for the build subdirectory of
> subversion in the 1.6.9 tag:
> 
> svn log --stop-on-copy http://svn.apache.org/repos/asf/subversion/tags/1.6.9/build
> ------------------------------------------------------------------------
> r901401 | hwright | 2010-01-20 17:08:30 -0500 (Wed, 20 Jan 2010) | 1
> line
> 
> Tag 1.6.9 release with svn_version.h matching tarball.

Actually, that's a wc-to-repos copy, not a server-side copy operation.

> ------------------------------------------------------------------------
> 
> But if you request svn info on the same URL it shows a different
> revision as the most recent change:
> 
> $ svn info http://svn.apache.org/repos/asf/subversion/tags/1.6.9/build | grep ^Last
> Last Changed Author: hwright
> Last Changed Rev: 884204
> Last Changed Date: 2009-11-25 12:23:50 -0500 (Wed, 25 Nov 2009)
> 
> 
> 
> 

Re: svn copy not updating Last Changed Rev

Posted by Jon DeVree <ja...@mtu.edu>.
On Mon, Mar 29, 2010 at 18:15:19 -0400, Bob Archer wrote:
> You don't show what your pwd is when you do these commands. but I think the default range is 1:BASE if you are in a working copy. Does the log change if you use:
> 
> svn log -r HEAD :///tmp/svn-repo/branches/mine/fil
> 

Good question, I was using the repository URLs just to be sure of cases
like this, but apparently that isn't enough. I have gone back and
confirmed that this occurs even when I'm outside of a working copy.

In fact, it occured to me that this should be visible on any public
subversion repository that used a server side svn copy operation. Even
the repository of svn itself:

Here is the most recent log entry for the build subdirectory of
subversion in the 1.6.9 tag:

svn log --stop-on-copy http://svn.apache.org/repos/asf/subversion/tags/1.6.9/build
------------------------------------------------------------------------
r901401 | hwright | 2010-01-20 17:08:30 -0500 (Wed, 20 Jan 2010) | 1
line

Tag 1.6.9 release with svn_version.h matching tarball.
------------------------------------------------------------------------

But if you request svn info on the same URL it shows a different
revision as the most recent change:

$ svn info http://svn.apache.org/repos/asf/subversion/tags/1.6.9/build | grep ^Last
Last Changed Author: hwright
Last Changed Rev: 884204
Last Changed Date: 2009-11-25 12:23:50 -0500 (Wed, 25 Nov 2009)



-- 
Jon
"lib64 is a wart on history and should never have been there."
        -Tollef Fog Heen

RE: svn copy not updating Last Changed Rev

Posted by Bob Archer <Bo...@amsi.com>.
> On Mon, Mar 29, 2010 at 23:53:43 +0300, Daniel Shahaf wrote:
> >     [[[
> >     % svn up
> >     At revision 1.
> >
> >     % svnversion
> >     1
> >
> >     % svn cp -q iota iota2
> >
> >     % svn ci -q -m "r2: add iota2"
> >
> >     % svn cp -q ^/trunk/iota ^/trunk/iota3 -m "r3: add iota3"
> >
> >     % svn up -q
> >
> >     % svn info iota2 iota3 | grep "Last Changed Rev"
> >     Last Changed Rev: 2
> >     Last Changed Rev: 3
> >
> 
> Try it with a directory that includes files and subdirectories and
> you'll be able to reproduce it. The actual directory used as the root of
> the copy operation has the correct Last Changed Rev, as I noted already:
> 
> > SVN info on the root of the copy shows the expected information:
> >
> > $ svn info file:///tmp/svn-repo/branches/mine
> > Last Changed Author: jadevree
> > Last Changed Rev: 5
> > Last Changed Date: 2010-03-29 13:43:06 -0400 (Mon, 29 Mar 2010)
> 
> It is the files and subdirectories of this that are wrong:
> 
> > But SVN info on the file that got copied with the branch is wrong:
> >
> > $ svn info file:///tmp/svn-repo/branches/mine/file
> > Last Changed Author: jadevree
> > Last Changed Rev: 2
> > Last Changed Date: 2010-03-29 13:40:30 -0400 (Mon, 29 Mar 2010)
> 
> And this is inconsistent with what svn log reports as the last change:
> 
> > $ svn log file:///tmp/svn-repo/branches/mine/file
> > ------------------------------------------------------------------------
> > r5 | jadevree | 2010-03-29 13:43:06 -0400 (Mon, 29 Mar 2010) | 1 line
> >
> > test branch
> > ------------------------------------------------------------------------
> > r2 | jadevree | 2010-03-29 13:40:30 -0400 (Mon, 29 Mar 2010) | 1 line
> >
> > foo
> > ------------------------------------------------------------------------
> 

You don't show what your pwd is when you do these commands. but I think the default range is 1:BASE if you are in a working copy. Does the log change if you use:

svn log -r HEAD :///tmp/svn-repo/branches/mine/fil

BOb


Re: svn copy not updating Last Changed Rev

Posted by Jon DeVree <ja...@mtu.edu>.
On Mon, Mar 29, 2010 at 23:53:43 +0300, Daniel Shahaf wrote:
>     [[[
>     % svn up
>     At revision 1.
> 
>     % svnversion
>     1
> 
>     % svn cp -q iota iota2
> 
>     % svn ci -q -m "r2: add iota2"
> 
>     % svn cp -q ^/trunk/iota ^/trunk/iota3 -m "r3: add iota3"
> 
>     % svn up -q
> 
>     % svn info iota2 iota3 | grep "Last Changed Rev"
>     Last Changed Rev: 2
>     Last Changed Rev: 3
> 

Try it with a directory that includes files and subdirectories and
you'll be able to reproduce it. The actual directory used as the root of
the copy operation has the correct Last Changed Rev, as I noted already:

> SVN info on the root of the copy shows the expected information:
> 
> $ svn info file:///tmp/svn-repo/branches/mine
> Last Changed Author: jadevree
> Last Changed Rev: 5
> Last Changed Date: 2010-03-29 13:43:06 -0400 (Mon, 29 Mar 2010)

It is the files and subdirectories of this that are wrong:

> But SVN info on the file that got copied with the branch is wrong:
> 
> $ svn info file:///tmp/svn-repo/branches/mine/file
> Last Changed Author: jadevree
> Last Changed Rev: 2
> Last Changed Date: 2010-03-29 13:40:30 -0400 (Mon, 29 Mar 2010)

And this is inconsistent with what svn log reports as the last change:

> $ svn log file:///tmp/svn-repo/branches/mine/file
> ------------------------------------------------------------------------
> r5 | jadevree | 2010-03-29 13:43:06 -0400 (Mon, 29 Mar 2010) | 1 line
> 
> test branch
> ------------------------------------------------------------------------
> r2 | jadevree | 2010-03-29 13:40:30 -0400 (Mon, 29 Mar 2010) | 1 line
> 
> foo
> ------------------------------------------------------------------------


-- 
Jon
"lib64 is a wart on history and should never have been there."
        -Tollef Fog Heen

Re: svn copy not updating Last Changed Rev

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Jon DeVree wrote on Mon, 29 Mar 2010 at 14:19 -0400:
> On Mon, Mar 29, 2010 at 14:02:06 -0400, Bob Archer wrote:
> > Why would you expect the last changed rev of a file to change just
> > because you coppied it to another path? You didn't actually change 
> > that file right?
> 
> First, the value changes if you use svn copy locally and commit the
> results. So I would expect the behavior of using svn copy using two URLs
> to have the same behavior.

I don't see any difference:

    [[[
    % svn up
    At revision 1.

    % svnversion
    1

    % svn cp -q iota iota2

    % svn ci -q -m "r2: add iota2"

    % svn cp -q ^/trunk/iota ^/trunk/iota3 -m "r3: add iota3"

    % svn up -q

    % svn info iota2 iota3 | grep "Last Changed Rev"
    Last Changed Rev: 2
    Last Changed Rev: 3

    %
    ]]]

In both cases, the "Last Changed Rev" is the revision of the copy.

> I should add that I only showed this on a file, but it actually happens
> to both files and directories beneath the root of the copy operation.

Hmmm.

Re: svn copy not updating Last Changed Rev

Posted by Jon DeVree <ja...@mtu.edu>.
On Mon, Mar 29, 2010 at 14:02:06 -0400, Bob Archer wrote:
> Why would you expect the last changed rev of a file to change just
> because you coppied it to another path? You didn't actually change 
> that file right?

First, the value changes if you use svn copy locally and commit the
results. So I would expect the behavior of using svn copy using two URLs
to have the same behavior.

Second, the revision shows up in the log for that file. So there is an
inconsistency here. Either the file was changed and the log is correct,
or nothing changed and the log shouldn't really be there either.

Finally, you could just as easily argue that branches/mine/ is a copy of
trunk/ and did not actually change either. So why would that have an
updated revision number but nothing else does?

I should add that I only showed this on a file, but it actually happens
to both files and directories beneath the root of the copy operation.

-- 
Jon
"lib64 is a wart on history and should never have been there."
        -Tollef Fog Heen

RE: svn copy not updating Last Changed Rev

Posted by Bob Archer <Bo...@amsi.com>.
Why would you expect the last changed rev of a file to change just because you coppied it to another path? You didn't actually change that file right?

BOb


> -----Original Message-----
> From: Jon DeVree [mailto:jadevree@mtu.edu]
> Sent: Monday, March 29, 2010 1:56 PM
> To: users@subversion.apache.org
> Subject: svn copy not updating Last Changed Rev
> 
> I noticed that when you svn copy a directory (like for branching and
> tagging) the 'Last Changed Rev' in svn info only moves forward on the
> root of the copy and not every file. The most recent revision in svn log
> will show up as the copy revision though. Shouldn't the 'Last Changed
> Rev' on a path always be the same as the most recent revision shown in
> svn log for the same path?
> 
> I noticed this on svn 1.4.2, but it shows up in 1.6.9 as well.
> Here is an example from svn 1.6.9 operating with a local repository, but
> I originally noticed this on svn 1.4.2 with the svn+ssh protocol.
> 
> $ svn copy -m "test branch" file:///tmp/svn-repo/trunk
> file:///tmp/svn-repo/branches/mine
> 
> Committed revision 5.
> 
> SVN info on the root of the copy shows the expected information:
> 
> $ svn info file:///tmp/svn-repo/branches/mine
> Path: mine
> URL: file:///tmp/svn-repo/branches/mine
> Repository Root: file:///tmp/svn-repo
> Repository UUID: f5a3ca28-02f1-438b-b454-8e94791581c1
> Revision: 5
> Node Kind: directory
> Last Changed Author: jadevree
> Last Changed Rev: 5
> Last Changed Date: 2010-03-29 13:43:06 -0400 (Mon, 29 Mar 2010)
> 
> But SVN info on the file that got copied with the branch is wrong:
> 
> $ svn info file:///tmp/svn-repo/branches/mine/file
> Path: file
> Name: file
> URL: file:///tmp/svn-repo/branches/mine/file
> Repository Root: file:///tmp/svn-repo
> Repository UUID: f5a3ca28-02f1-438b-b454-8e94791581c1
> Revision: 5
> Node Kind: file
> Last Changed Author: jadevree
> Last Changed Rev: 2
> Last Changed Date: 2010-03-29 13:40:30 -0400 (Mon, 29 Mar 2010)
> 
> SVN log shows revision 5 as the most recent:
> 
> $ svn log file:///tmp/svn-repo/branches/mine/file
> ------------------------------------------------------------------------
> r5 | jadevree | 2010-03-29 13:43:06 -0400 (Mon, 29 Mar 2010) | 1 line
> 
> test branch
> ------------------------------------------------------------------------
> r2 | jadevree | 2010-03-29 13:40:30 -0400 (Mon, 29 Mar 2010) | 1 line
> 
> foo
> ------------------------------------------------------------------------
> 
> 
> Interestingly enough, this doesn't happen if you do a local copy +
> commit instead of a server side copy. Having peeked at the fsfs revision
> files, it seems the two types of copies are represented quite a bit
> differently internally.
> 
> $ svn copy trunk branches/bar
> A         branches/bar
> $ svn commit -m "bar"
> Adding         branches/bar
> Adding         branches/bar/file
> 
> Committed revision 3.
> $ svn info file:///tmp/svn-repo/branches/bar/file
> Path: file
> Name: file
> URL: file:///tmp/svn-repo/branches/bar/file
> Repository Root: file:///tmp/svn-repo
> Repository UUID: f5a3ca28-02f1-438b-b454-8e94791581c1
> Revision: 3
> Node Kind: file
> Last Changed Author: jadevree
> Last Changed Rev: 3
> Last Changed Date: 2010-03-29 13:40:53 -0400 (Mon, 29 Mar 2010)
> 
> --
> Jon
> "lib64 is a wart on history and should never have been there."
>         -Tollef Fog Heen