You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Vincent Lefevre <vi...@vinc17.org> on 2003/06/25 09:53:33 UTC

Meaning of LastChangedRevision

I use the Id keyword in files and the LastChangedRevision component
(the number after the file name) is quite strange: in general, it
seems to be the revision where the file has changed, e.g. if the
"current" revision is 17 and the file is committed to revision 59,
then LastChangedRevision will be 17, not 59. But after a new checkout
of the repository (this sometimes happens), LastChangedRevision will
no longer be 17, but the last current revision or something like that.

Wouldn't it be better if LastChangedRevision would always refer to
the committed revision, like with RCS/CVS? At least something that
is fixed (like the date), i.e. that doesn't depend on how or when
the file has been checked out.

(BTW, I've been using Subversion for a few days. Thanks to all the
developers for this wonderful software.)

-- 
Vincent Lefèvre <vi...@vinc17.org> - Web: <http://www.vinc17.org/> - 100%
validated HTML - Acorn Risc PC, Yellow Pig 17, Championnat International des
Jeux Mathématiques et Logiques, TETRHEX, etc.
Work: CR INRIA - computer arithmetic / SPACES project at LORIA

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

Re: Meaning of LastChangedRevision

Posted by Ben Collins-Sussman <su...@collab.net>.
Vincent Lefevre <vi...@vinc17.org> writes:

> ay:~/wd/www> svn -v list Makefile
> P      20  lefevre     5122 Jun 19 01:39 Makefile
> ay:~/wd/www> grep Id Makefile
> # $Id: Makefile 71 2003-06-18 23:39:56Z lefevre $
> 
> because I checked out revision 71. But I suppose that one should have had:
> 
> # $Id: Makefile 20 2003-06-18 23:39:56Z lefevre $

Yes, this is exactly the keyword-expansion bug.  It has been fixed in
HEAD.  Sorry it bit you.  

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

Re: Meaning of LastChangedRevision

Posted by Vincent Lefevre <vi...@vinc17.org>.
On Wed, Jun 25, 2003 at 14:57:31 -0500, kfogel@collab.net wrote:
> Vincent Lefevre <vi...@vinc17.org> writes:
> > I use the Id keyword in files and the LastChangedRevision component
> > (the number after the file name) is quite strange: in general, it
> > seems to be the revision where the file has changed, e.g. if the
> > "current" revision is 17 and the file is committed to revision 59,
> > then LastChangedRevision will be 17, not 59. But after a new checkout
> > of the repository (this sometimes happens), LastChangedRevision will
> > no longer be 17, but the last current revision or something like that.

The problem I've described is that the value of $LastChangedRevision$
can be different for a same version of a file (it depends on the
operations that have been performed).

> If by '"current" revision' you mean the revision your working copy
> is at,

Yes, just before the commit.

> then there is no way a working copy file at revision 17 can have a
> LastChangedRevision of 59.  It could have a LastChangedRevision of
> anything up to and including 17, but not higher.

This is currently not true (the bug, I assume). For instance:

ay:~/wd/www> svn -v list Makefile
P      20  lefevre     5122 Jun 19 01:39 Makefile
ay:~/wd/www> grep Id Makefile
# $Id: Makefile 71 2003-06-18 23:39:56Z lefevre $

because I checked out revision 71. But I suppose that one should have had:

# $Id: Makefile 20 2003-06-18 23:39:56Z lefevre $

Another example: I have another file I committed when the current
revision was 100 and the commit produced revision 102. The $Id$
keyword says rev. 100 and 'svn list -v' says rev. 102. Again, a
mismatch (I suppose that 102 is the correct value).

So, both commit and checkout give wrong values.

> I was also assuming that "the file is committed to revision 59" means
> that in the *repository*, the last time the file was changed was in
> revision 59 (which is much later than 17, the revision of your working
> copy).

Yes, it is normal that it is no longer 17, but it isn't 59 either!

-- 
Vincent Lefèvre <vi...@vinc17.org> - Web: <http://www.vinc17.org/> - 100%
validated HTML - Acorn Risc PC, Yellow Pig 17, Championnat International des
Jeux Mathématiques et Logiques, TETRHEX, etc.
Work: CR INRIA - computer arithmetic / SPACES project at LORIA

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

Re: Meaning of LastChangedRevision

Posted by kf...@collab.net.
Vincent Lefevre <vi...@vinc17.org> writes:
> I understand that a same version of a file exists in several revisions.
> But even if I check out some revision, I do not expect the $Rev$ keyword
> to always be that revision. I want it to be the *first* revision for
> which this version of the file exists, a bit like the behavior of the
> $Date$ keyword (one gets the date of the first revision containing this
> version of the file, even if one checks out a later revision).
> 
> I think that this corresponds to the bug mentioned by Ben.

Now I'm confused :-).

The behavior you described in your original mail is consistent with
the behavior you say you want (above), and behavior you say you want
is also the behavior we want.

Your original post said this:

> I use the Id keyword in files and the LastChangedRevision component
> (the number after the file name) is quite strange: in general, it
> seems to be the revision where the file has changed, e.g. if the
> "current" revision is 17 and the file is committed to revision 59,
> then LastChangedRevision will be 17, not 59. But after a new checkout
> of the repository (this sometimes happens), LastChangedRevision will
> no longer be 17, but the last current revision or something like that.

If by '"current" revision' you mean the revision your working copy is
at, then there is no way a working copy file at revision 17 can have a
LastChangedRevision of 59.  It could have a LastChangedRevision of
anything up to and including 17, but not higher.

I was also assuming that "the file is committed to revision 59" means
that in the *repository*, the last time the file was changed was in
revision 59 (which is much later than 17, the revision of your working
copy).

Did I misunderstand you?

-K

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

Re: Meaning of LastChangedRevision

Posted by Vincent Lefevre <vi...@vinc17.org>.
On Wed, Jun 25, 2003 at 14:00:49 -0500, kfogel@collab.net wrote:
> Ben Collins-Sussman <su...@collab.net> writes:
> > The bug was exactly what Vincent is describing:  in certain keyword
> > expansion situations, $Rev$ was being accidentally expanded to the
> > working-rev, rather than the last-changed-rev.
> 
> It's not clear to me that that's what Vincent was describing.  I
> thought he was saying that the working copy revision was at 17, and
> the file's most recent commit (in the repository) was in revision 59.
> If the file was also committed in revision 17, then the behavior he
> describes above is expected -- no bug necessary.

I understand that a same version of a file exists in several revisions.
But even if I check out some revision, I do not expect the $Rev$ keyword
to always be that revision. I want it to be the *first* revision for
which this version of the file exists, a bit like the behavior of the
$Date$ keyword (one gets the date of the first revision containing this
version of the file, even if one checks out a later revision).

I think that this corresponds to the bug mentioned by Ben.

-- 
Vincent Lefèvre <vi...@vinc17.org> - Web: <http://www.vinc17.org/> - 100%
validated HTML - Acorn Risc PC, Yellow Pig 17, Championnat International des
Jeux Mathématiques et Logiques, TETRHEX, etc.
Work: CR INRIA - computer arithmetic / SPACES project at LORIA

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

Re: Meaning of LastChangedRevision

Posted by kf...@collab.net.
Ben Collins-Sussman <su...@collab.net> writes:
> > Vincent Lefevre <vi...@vinc17.org> writes:
> > > I use the Id keyword in files and the LastChangedRevision component
> > > (the number after the file name) is quite strange: in general, it
> > > seems to be the revision where the file has changed, e.g. if the
> > > "current" revision is 17 and the file is committed to revision 59,
> > > then LastChangedRevision will be 17, not 59. But after a new checkout
> > > of the repository (this sometimes happens), LastChangedRevision will
> > > no longer be 17, but the last current revision or something like that.
> 
> Actually, this was a keyword expansion bug fixed in HEAD a couple of
> days ago.  svn 0.24.2 still has the bug.
> 
> The bug was exactly what Vincent is describing:  in certain keyword
> expansion situations, $Rev$ was being accidentally expanded to the
> working-rev, rather than the last-changed-rev.

It's not clear to me that that's what Vincent was describing.  I
thought he was saying that the working copy revision was at 17, and
the file's most recent commit (in the repository) was in revision 59.
If the file was also committed in revision 17, then the behavior he
describes above is expected -- no bug necessary.

-K

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

Re: Meaning of LastChangedRevision

Posted by Ben Collins-Sussman <su...@collab.net>.
kfogel@collab.net writes:

> Vincent Lefevre <vi...@vinc17.org> writes:
> > I use the Id keyword in files and the LastChangedRevision component
> > (the number after the file name) is quite strange: in general, it
> > seems to be the revision where the file has changed, e.g. if the
> > "current" revision is 17 and the file is committed to revision 59,
> > then LastChangedRevision will be 17, not 59. But after a new checkout
> > of the repository (this sometimes happens), LastChangedRevision will
> > no longer be 17, but the last current revision or something like that.

Actually, this was a keyword expansion bug fixed in HEAD a couple of
days ago.  svn 0.24.2 still has the bug.

The bug was exactly what Vincent is describing:  in certain keyword
expansion situations, $Rev$ was being accidentally expanded to the
working-rev, rather than the last-changed-rev.

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

Re: Meaning of LastChangedRevision

Posted by kf...@collab.net.
Vincent Lefevre <vi...@vinc17.org> writes:
> I use the Id keyword in files and the LastChangedRevision component
> (the number after the file name) is quite strange: in general, it
> seems to be the revision where the file has changed, e.g. if the
> "current" revision is 17 and the file is committed to revision 59,
> then LastChangedRevision will be 17, not 59. But after a new checkout
> of the repository (this sometimes happens), LastChangedRevision will
> no longer be 17, but the last current revision or something like that.
> 
> Wouldn't it be better if LastChangedRevision would always refer to
> the committed revision, like with RCS/CVS? At least something that
> is fixed (like the date), i.e. that doesn't depend on how or when
> the file has been checked out.

Here's what LastChangedRevision is all about:

Since revision numbers are per-tree, its possible for "the same
revision" of a file to exist across a range of revision numbers.  For
example, in revision 10, you make a change to foo.c.  Then in
revisions 11-20, you change other things, but not foo.c.  Finally in
revision 21, you change foo.c again.

If you check out revision 15 of the tree, the $LastChangeRevision$
keyword in foo.c will say:

   $LastChangeRevision: 10 $

because the change in revision 10 gave foo.c the state it still has in
revision 15.  If you check out revision 21 or higher, you'll see

   $LastChangeRevision: 21 $

...for the same reason.

> (BTW, I've been using Subversion for a few days. Thanks to all the
> developers for this wonderful software.)

Thanks!

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