You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Lawrence Bruhmuller <lb...@activegrid.com> on 2006/02/07 02:10:46 UTC

Confusion about "special" revisions and svn log

So I thought I understood exactly what HEAD, COMMITTED, BASE, etc. all 
stood for, how they behaved, particularly in relation svn log.  Turns 
out that I don't, and I am thoroughly confused.  Please correct my 
understanding if the below is incorrect.

Looks to me like HEAD is a repository-wide variable.  No matter where in 
my working copy I go, HEAD is always the same, absolute latest in the 
repos.  Hence, if I do svn log -r HEAD in some subdirectory, I might not 
get anything back if those files weren't touched as part of the single 
HEAD revision.

Seems like BASE works the same way (i.e. sometimes I get nothing, if I 
get a revision it is always the same, assuming that I don't selectively 
update my working copy).

Now, COMMITTED seems like it varies depending on where I am.  If I do 
svn log -r COMMITTED in one subdirectory, I'll get a different revision 
than if I do it in another directory, and the revisions returned did 
indeed include at least one file from the directory.  And these two 
directories are updated to latest, as part of the same call to svn update.

This is very confusing!  I can't believe the documentation (that I've 
found) doesn't call out this location sensitive behavior of COMMITTED, 
if that is in fact the case.

However, now I'm totally befuddled because I have a new directory 
(something was just added and committed, nothing since) and svn log -r 
COMMITTED gives me no results!  So maybe my assumption above is flawed.

The goal of all this is I want have an automated build machine, which 
svn updates to the latest (HEAD) and then I want to produce version 
strings for various subdirectories, where the version string is the 
latest revision (either in my copy or in the repos, I'll take either as 
long as I know which I am getting) that included a file or files from 
that subdirectory (or child subdirectories).

Someone please help me grok this behavior!

Thanks,

Lawrence



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

Re: Confusion about "special" revisions and svn log

Posted by Lawrence Bruhmuller <lb...@activegrid.com>.
OK, so your explanation makes sense, thanks. 

But given that, I still don't see how I could ever get svn log -r 
COMMITTED to not give me a result at all, on any directory.  When I saw 
that happen, it was a more complicated scenario, involving wholesale 
"svn move"s all over our repository, and I was getting this result after 
a clean checkout.  Was that a bug of some sort, or are there cases where 
I could get nothing back from the svn log -r COMMITTED command?

And if you don't mind answering a "why are things this way" question, is 
there a reason that there is no "local" analog to HEAD (e.g. find me the 
latest in the repository that included a path at this directory or 
underneath)?  As far as I can tell, HEAD is global, and COMMITTED is 
always underneath the current directrory.  Is this correct?

Thanks again,

Lawrence

Blair Zajac wrote:

> On Feb 8, 2006, at 10:32 PM, Lawrence Bruhmuller wrote:
>
>> So is this is a known issue?  Should I report it through some other  
>> means or will one of the developers pick this up?
>>
>> Also (to anyone) would appreciate any insight to the other part of  
>> my post, thanks in advance ...
>>
>> - Lawrence
>>
>
> It's not a bug.
>
> Directories have their own revision numbers, and just because you add  
> a subdirectory, the containing directory does not have an implicit  
> 'svn update' run on it, so it's still at revision 3.  Remember,  
> Subversion will not pull any updates down from the server to your  
> client unless you request it, and this can include any changes on  
> directories.
>
> So in this example, the COMMITTED revision is 3 for the containing  
> directory.
>
> It goes to the same reason why you need to run 'svn update' in a  
> directory after doing 'svn commit' to get the 'svn log' to show the  
> revision.
>
> I'm on a plane while writing this, but there's a section in the  
> Subversion book that describes how directories are versioned.  I  
> would check that out.
>
> Regards,
> Blair
>


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

Re: Confusion about "special" revisions and svn log

Posted by Blair Zajac <bl...@orcaware.com>.
On Feb 8, 2006, at 10:32 PM, Lawrence Bruhmuller wrote:

> So is this is a known issue?  Should I report it through some other  
> means or will one of the developers pick this up?
>
> Also (to anyone) would appreciate any insight to the other part of  
> my post, thanks in advance ...
>
> - Lawrence
>

It's not a bug.

Directories have their own revision numbers, and just because you add  
a subdirectory, the containing directory does not have an implicit  
'svn update' run on it, so it's still at revision 3.  Remember,  
Subversion will not pull any updates down from the server to your  
client unless you request it, and this can include any changes on  
directories.

So in this example, the COMMITTED revision is 3 for the containing  
directory.

It goes to the same reason why you need to run 'svn update' in a  
directory after doing 'svn commit' to get the 'svn log' to show the  
revision.

I'm on a plane while writing this, but there's a section in the  
Subversion book that describes how directories are versioned.  I  
would check that out.

Regards,
Blair

-- 
Blair Zajac, Ph.D.
CTO, OrcaWare Technologies
<bl...@orcaware.com>
Subversion training, consulting and support
http://www.orcaware.com/svn/



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

Re: Confusion about "special" revisions and svn log

Posted by Lawrence Bruhmuller <lb...@activegrid.com>.
So is this is a known issue?  Should I report it through some other 
means or will one of the developers pick this up?

Also (to anyone) would appreciate any insight to the other part of my 
post, thanks in advance ...

- Lawrence

Lares Moreau wrote:

>On Mon, 2006-02-06 at 19:20 -0800, Lawrence Bruhmuller wrote:
>  
>
>>Yes, that would definitely explain the last thing I saw.  Looks like a 
>>bug to me, what do you think?
>>    
>>
>
>It looks like a bug to me.
>
>[cc'd back to users@,  <insert reply-to header comment here>]
>
>-Lares
>
>  
>
>>Lares Moreau wrote:
>>
>>    
>>
>>>On Mon, 2006-02-06 at 18:10 -0800, Lawrence Bruhmuller wrote:
>>> 
>>>
>>>      
>>>
>>>>So I thought I understood exactly what HEAD, COMMITTED, BASE, etc. all 
>>>>stood for, how they behaved, particularly in relation svn log.  Turns 
>>>>out that I don't, and I am thoroughly confused.  Please correct my 
>>>>understanding if the below is incorrect.
>>>>
>>>>Looks to me like HEAD is a repository-wide variable.  No matter where in 
>>>>my working copy I go, HEAD is always the same, absolute latest in the 
>>>>repos.  Hence, if I do svn log -r HEAD in some subdirectory, I might not 
>>>>get anything back if those files weren't touched as part of the single 
>>>>HEAD revision.
>>>>
>>>>Seems like BASE works the same way (i.e. sometimes I get nothing, if I 
>>>>get a revision it is always the same, assuming that I don't selectively 
>>>>update my working copy).
>>>>
>>>>Now, COMMITTED seems like it varies depending on where I am.  If I do 
>>>>svn log -r COMMITTED in one subdirectory, I'll get a different revision 
>>>>than if I do it in another directory, and the revisions returned did 
>>>>indeed include at least one file from the directory.  And these two 
>>>>directories are updated to latest, as part of the same call to svn update.
>>>>
>>>>This is very confusing!  I can't believe the documentation (that I've 
>>>>found) doesn't call out this location sensitive behavior of COMMITTED, 
>>>>if that is in fact the case.
>>>>
>>>>However, now I'm totally befuddled because I have a new directory 
>>>>(something was just added and committed, nothing since) and svn log -r 
>>>>COMMITTED gives me no results!  So maybe my assumption above is flawed.
>>>>   
>>>>
>>>>        
>>>>
>>>Something like this?  I don't know if it's a bug or not.
>>>
>>>+++
>>>lares@jarita test % svn log -r HEAD
>>>------------------------------------------------------------------------
>>>r3 | lares | 2006-02-06 20:11:46 -0700 (Mon, 06 Feb 2006) | 2 lines
>>>Added bar/
>>>------------------------------------------------------------------------
>>>lares@jarita test % svn mkdir some_dir
>>>A         some_dir
>>>lares@jarita test % svn ci -m "Added some_dir/"
>>>Adding         some_dir
>>>Committed revision 4.
>>>lares@jarita test % svn log -r HEAD            
>>>------------------------------------------------------------------------
>>>r4 | lares | 2006-02-06 20:15:35 -0700 (Mon, 06 Feb 2006) | 1 line
>>>Added some_dir/
>>>------------------------------------------------------------------------
>>>lares@jarita test % svn log -r COMMITED
>>>svn: Syntax error in revision argument 'COMMITED'
>>>lares@jarita test % svn log -r COMMITTED
>>>------------------------------------------------------------------------
>>>r3 | lares | 2006-02-06 20:11:46 -0700 (Mon, 06 Feb 2006) | 2 lines
>>>Added bar/
>>>------------------------------------------------------------------------
>>>lares@jarita test % svn up
>>>At revision 4.
>>>lares@jarita test % svn log -r COMMITTED
>>>------------------------------------------------------------------------
>>>r4 | lares | 2006-02-06 20:15:35 -0700 (Mon, 06 Feb 2006) | 1 line
>>>Added some_dir/
>>>------------------------------------------------------------------------
>>>+++
>>>
>>>-Lares
>>>
>>> 
>>>
>>>      
>>>


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

Re: Confusion about "special" revisions and svn log

Posted by Lares Moreau <la...@gmail.com>.
Added to Issuezilla.
Issue 2498.
http://subversion.tigris.org/issues/show_bug.cgi?id=2498

-Lares

-- 
Lares Moreau <la...@gmail.com>  | LRU: 400755 http://counter.li.org
lares/irc.freenode.net                 |               ::0 Alberta, Canada
Public Key: 0D46BB6E @ subkeys.pgp.net |          Encrypted Mail Preferred
Key fingerprint = 0CA3 E40D F897 7709 3628  C5D4 7D94 483E 0D46 BB6E

Re: Confusion about "special" revisions and svn log

Posted by Lares Moreau <la...@gmail.com>.
On Mon, 2006-02-06 at 20:31 -0700, Lares Moreau wrote:

For the sake of completeness,
What version of svn are you using?

-Lares

> On Mon, 2006-02-06 at 19:20 -0800, Lawrence Bruhmuller wrote:
> > Yes, that would definitely explain the last thing I saw.  Looks like a 
> > bug to me, what do you think?
> 
> It looks like a bug to me.
> 
> [cc'd back to users@,  <insert reply-to header comment here>]
> 
> -Lares
> 
> > Lares Moreau wrote:
> > 
> > >On Mon, 2006-02-06 at 18:10 -0800, Lawrence Bruhmuller wrote:
> > >  
> > >
> > >>So I thought I understood exactly what HEAD, COMMITTED, BASE, etc. all 
> > >>stood for, how they behaved, particularly in relation svn log.  Turns 
> > >>out that I don't, and I am thoroughly confused.  Please correct my 
> > >>understanding if the below is incorrect.
> > >>
> > >>Looks to me like HEAD is a repository-wide variable.  No matter where in 
> > >>my working copy I go, HEAD is always the same, absolute latest in the 
> > >>repos.  Hence, if I do svn log -r HEAD in some subdirectory, I might not 
> > >>get anything back if those files weren't touched as part of the single 
> > >>HEAD revision.
> > >>
> > >>Seems like BASE works the same way (i.e. sometimes I get nothing, if I 
> > >>get a revision it is always the same, assuming that I don't selectively 
> > >>update my working copy).
> > >>
> > >>Now, COMMITTED seems like it varies depending on where I am.  If I do 
> > >>svn log -r COMMITTED in one subdirectory, I'll get a different revision 
> > >>than if I do it in another directory, and the revisions returned did 
> > >>indeed include at least one file from the directory.  And these two 
> > >>directories are updated to latest, as part of the same call to svn update.
> > >>
> > >>This is very confusing!  I can't believe the documentation (that I've 
> > >>found) doesn't call out this location sensitive behavior of COMMITTED, 
> > >>if that is in fact the case.
> > >>
> > >>However, now I'm totally befuddled because I have a new directory 
> > >>(something was just added and committed, nothing since) and svn log -r 
> > >>COMMITTED gives me no results!  So maybe my assumption above is flawed.
> > >>    
> > >>
> > >
> > >Something like this?  I don't know if it's a bug or not.
> > >
> > >+++
> > >lares@jarita test % svn log -r HEAD
> > >------------------------------------------------------------------------
> > >r3 | lares | 2006-02-06 20:11:46 -0700 (Mon, 06 Feb 2006) | 2 lines
> > >Added bar/
> > >------------------------------------------------------------------------
> > >lares@jarita test % svn mkdir some_dir
> > >A         some_dir
> > >lares@jarita test % svn ci -m "Added some_dir/"
> > >Adding         some_dir
> > >Committed revision 4.
> > >lares@jarita test % svn log -r HEAD            
> > >------------------------------------------------------------------------
> > >r4 | lares | 2006-02-06 20:15:35 -0700 (Mon, 06 Feb 2006) | 1 line
> > >Added some_dir/
> > >------------------------------------------------------------------------
> > >lares@jarita test % svn log -r COMMITED
> > >svn: Syntax error in revision argument 'COMMITED'
> > >lares@jarita test % svn log -r COMMITTED
> > >------------------------------------------------------------------------
> > >r3 | lares | 2006-02-06 20:11:46 -0700 (Mon, 06 Feb 2006) | 2 lines
> > >Added bar/
> > >------------------------------------------------------------------------
> > >lares@jarita test % svn up
> > >At revision 4.
> > >lares@jarita test % svn log -r COMMITTED
> > >------------------------------------------------------------------------
> > >r4 | lares | 2006-02-06 20:15:35 -0700 (Mon, 06 Feb 2006) | 1 line
> > >Added some_dir/
> > >------------------------------------------------------------------------
> > >+++
> > >
> > >-Lares
> > >
> > >  
> > >
> > 
-- 
Lares Moreau <la...@gmail.com>  | LRU: 400755 http://counter.li.org
lares/irc.freenode.net                 |               ::0 Alberta, Canada
Public Key: 0D46BB6E @ subkeys.pgp.net |          Encrypted Mail Preferred
Key fingerprint = 0CA3 E40D F897 7709 3628  C5D4 7D94 483E 0D46 BB6E

Re: Confusion about "special" revisions and svn log

Posted by Lares Moreau <la...@gmail.com>.
On Mon, 2006-02-06 at 19:20 -0800, Lawrence Bruhmuller wrote:
> Yes, that would definitely explain the last thing I saw.  Looks like a 
> bug to me, what do you think?

It looks like a bug to me.

[cc'd back to users@,  <insert reply-to header comment here>]

-Lares

> Lares Moreau wrote:
> 
> >On Mon, 2006-02-06 at 18:10 -0800, Lawrence Bruhmuller wrote:
> >  
> >
> >>So I thought I understood exactly what HEAD, COMMITTED, BASE, etc. all 
> >>stood for, how they behaved, particularly in relation svn log.  Turns 
> >>out that I don't, and I am thoroughly confused.  Please correct my 
> >>understanding if the below is incorrect.
> >>
> >>Looks to me like HEAD is a repository-wide variable.  No matter where in 
> >>my working copy I go, HEAD is always the same, absolute latest in the 
> >>repos.  Hence, if I do svn log -r HEAD in some subdirectory, I might not 
> >>get anything back if those files weren't touched as part of the single 
> >>HEAD revision.
> >>
> >>Seems like BASE works the same way (i.e. sometimes I get nothing, if I 
> >>get a revision it is always the same, assuming that I don't selectively 
> >>update my working copy).
> >>
> >>Now, COMMITTED seems like it varies depending on where I am.  If I do 
> >>svn log -r COMMITTED in one subdirectory, I'll get a different revision 
> >>than if I do it in another directory, and the revisions returned did 
> >>indeed include at least one file from the directory.  And these two 
> >>directories are updated to latest, as part of the same call to svn update.
> >>
> >>This is very confusing!  I can't believe the documentation (that I've 
> >>found) doesn't call out this location sensitive behavior of COMMITTED, 
> >>if that is in fact the case.
> >>
> >>However, now I'm totally befuddled because I have a new directory 
> >>(something was just added and committed, nothing since) and svn log -r 
> >>COMMITTED gives me no results!  So maybe my assumption above is flawed.
> >>    
> >>
> >
> >Something like this?  I don't know if it's a bug or not.
> >
> >+++
> >lares@jarita test % svn log -r HEAD
> >------------------------------------------------------------------------
> >r3 | lares | 2006-02-06 20:11:46 -0700 (Mon, 06 Feb 2006) | 2 lines
> >Added bar/
> >------------------------------------------------------------------------
> >lares@jarita test % svn mkdir some_dir
> >A         some_dir
> >lares@jarita test % svn ci -m "Added some_dir/"
> >Adding         some_dir
> >Committed revision 4.
> >lares@jarita test % svn log -r HEAD            
> >------------------------------------------------------------------------
> >r4 | lares | 2006-02-06 20:15:35 -0700 (Mon, 06 Feb 2006) | 1 line
> >Added some_dir/
> >------------------------------------------------------------------------
> >lares@jarita test % svn log -r COMMITED
> >svn: Syntax error in revision argument 'COMMITED'
> >lares@jarita test % svn log -r COMMITTED
> >------------------------------------------------------------------------
> >r3 | lares | 2006-02-06 20:11:46 -0700 (Mon, 06 Feb 2006) | 2 lines
> >Added bar/
> >------------------------------------------------------------------------
> >lares@jarita test % svn up
> >At revision 4.
> >lares@jarita test % svn log -r COMMITTED
> >------------------------------------------------------------------------
> >r4 | lares | 2006-02-06 20:15:35 -0700 (Mon, 06 Feb 2006) | 1 line
> >Added some_dir/
> >------------------------------------------------------------------------
> >+++
> >
> >-Lares
> >
> >  
> >
> 
-- 
Lares Moreau <la...@gmail.com>  | LRU: 400755 http://counter.li.org
lares/irc.freenode.net                 |
Gentoo x86 Arch Tester                 |               ::0 Alberta, Canada
Public Key: 0D46BB6E @ subkeys.pgp.net |          Encrypted Mail Preferred
Key fingerprint = 0CA3 E40D F897 7709 3628  C5D4 7D94 483E 0D46 BB6E