You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Rafael Garcia-Suarez rg...@free.fr on 2003/01/20 10:05:11 UTC
Re: COMMITTED and subdir recursion
Karl Fogel kfogel@newton.ch.collab.net wrote:
Rafael Garcia-Suarez rgarciasuarez@free.fr writes:
The Book says (tersely) that COMMITTED is The last revision in which
an item changed.
It seems that the command
$ svn log -r COMMITTED .
gives the log message for the last revision for which '.' changed --
non-recursively.
Hence there is no efficient way to have the last revision for which
an item under '.' changed. Am I right ? Is this intended behavior
or should the meaning of COMMITTED for directory items be adjusted ?
Could you give some concrete examples, just so there is no possibility
for misunderstanding here?
I've looked a bit at this. In fact this is a well-known behavior : the
last-changed-revision of a directory is not updated when a commit is
done. Since COMMITTED reads its value from .svn/entries (right ?)
a svn update is necessary to update the last-changed-rev of this
directory.
Here is a small test that demonstrates the behavior :
(I've only 0.16.0 here, but I don't think this has changed recently)
$ svnadmin create repos
$ svn co file:///home/rafael/tmp/repos wc
Checked out revision 0.
$ cd wc
$ touch foo; svn add foo; svn ci -m 'add foo'
A foo
Adding foo
Transmitting file data .
Committed revision 1.
[rafael@rafael wc]$ svn log -r COMMITTED .
No commit for revision 0.
------------------------------------------------------------------------
$ svn info .
Path:
Url: file:///home/rafael/tmp/repos
Revision: 0
Node Kind: directory
Schedule: normal
Last Changed Rev: 0
Last Changed Date: 2003-01-20 10:33:19 +0100 (Mon, 20 Jan 2003)
$ svn up
At revision 1.
$ svn log -r COMMITTED .
------------------------------------------------------------------------
rev 1: rafael | 2003-01-20 10:44:33 +0100 (Mon, 20 Jan 2003) | 1 line
add foo
------------------------------------------------------------------------
I suggest that this behavior of COMMITTED should be documented.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: COMMITTED and subdir recursion
Posted by Benjamin Pflugmann be...@pflugmann.de.
Hi.
On Mon 2003-01-20 at 14:04:00 -0600, Karl Fogel wrote:
[...]
But directories have mixed revisions, so the COMMITTED rev is,
essentially, a set. It could be a very wide distribution of numbers,
depending on how much committing one has done under that tree without
updating from the top.
I'd expected simply the lastest (highest) revision to count. In other
words: the latest changeset affecting the directory.
But as I said, it isn't important to me. I just consider the current
behaviour inconsistent (although I am aware that it follows some
consistent rules).
Regards,
Benjamin.
Re: COMMITTED and subdir recursion
Posted by Rafael Garcia-Suarez ra...@hexaflux.com.
andreas.koenig@anima.de (Andreas J. Koenig) wrote:
On 20 Jan 2003 14:51:09 -0600, Karl Fogel kfogel@newton.ch.collab.net said:
Rafael Garcia-Suarez rgarciasuarez@free.fr writes:
The real-life problem is to answer this question : What is the
last revision in which something under the foo/ directory has been modified.
(in other words, a branch-local HEAD) (I haven't tried svnversion yet.)
Then just use HEAD, that does what you want.
It doesn't if you think of branches. HEAD refers to the whole
repository. Try 'svn log -r HEAD' in a branch and you get something
like
subversion/libsvn_ra_dav/util.c:358: (apr_err=175002)
svn: RA layer request failed
svn: REPORT request failed on /svn/perl/trunk
subversion/libsvn_ra_dav/util.c:343: (apr_err=175002)
svn: The REPORT request returned invalid XML in the response: XML parse error at line 1: xmlParseStartTag: invalid element name
.. (/svn/perl/trunk)
Regression ? I get simply an empty log : (0.16.0, hadn't time to upgrade yet)
$ svn log -r HEAD
------------------------------------------------------------------------
Currently I have the impression, to get the last revision within the
current branch you need something like
svn info -R | grep '^Last Changed Rev' | sed -e 's/.*: //' | sort -nr | head -1
Gee, Andreas, learn awk or something ;-)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: COMMITTED and subdir recursion
Posted by Karl Fogel kf...@newton.ch.collab.net.
andreas.koenig@anima.de (Andreas J. Koenig) writes:
It doesn't if you think of branches. HEAD refers to the whole
repository. Try 'svn log -r HEAD' in a branch and you get something
like
No, HEAD just means the youngest revision -- it is independent of
paths. This error:
subversion/libsvn_ra_dav/util.c:358: (apr_err=175002)
svn: RA layer request failed
svn: REPORT request failed on /svn/perl/trunk
subversion/libsvn_ra_dav/util.c:343: (apr_err=175002)
svn: The REPORT request returned invalid XML in the response: XML parse error at line 1: xmlParseStartTag: invalid element name
.. (/svn/perl/trunk)
...I think has been fixed. Upgrade your repository and try again
(we'll be upgrading ours soon, too).
-K
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: COMMITTED and subdir recursion
Posted by Karl Fogel kf...@newton.ch.collab.net.
Rafael Garcia-Suarez rgarciasuarez@free.fr writes:
The real-life problem is to answer this question : What is the
last revision in which something under the foo/ directory has been modified.
(in other words, a branch-local HEAD) (I haven't tried svnversion yet.)
Then just use HEAD, that does what you want.
COMITTED doesn't require network access, does it ?
Not to determine the local COMMITTED revision, it doesn't. But to get
log data, of course, it does :-).
But HEAD requires network access. I don't think that requiring that
COMMITTED on dirs has network access is consistent. Moreoever,
treating it like HEAD may confuse users. So, forbidding it on
directories is fine with me.
Okay.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: COMMITTED and subdir recursion
Posted by Rafael Garcia-Suarez rg...@free.fr.
Karl Fogel wrote:
The real issue is that '-r COMMITTED' isn't really meaningful for
directories.
The real-life problem is to answer this question : What is the
last revision in which something under the foo/ directory has been modified.
(in other words, a branch-local HEAD) (I haven't tried svnversion yet.)
For files, it means show the logs for the base revision of that file
in your current working copy (that is, for the revision of the text
base, which may have resulted from an update or from a commit). This
is the same as the committed-rev in the .svn/entries file.
But directories have mixed revisions, so the COMMITTED rev is,
essentially, a set. It could be a very wide distribution of numbers,
depending on how much committing one has done under that tree without
updating from the top.
COMITTED doesn't require network access, does it ?
Frankly, I think we should either error when it is used with a
directory, or treat it like HEAD. Thoughts?
But HEAD requires network access. I don't think that requiring that
COMMITTED on dirs has network access is consistent. Moreoever,
treating it like HEAD may confuse users. So, forbidding it on
directories is fine with me.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: COMMITTED and subdir recursion
Posted by Benjamin Pflugmann be...@pflugmann.de.
On Mon 2003-01-20 at 21:02:57 +0000, Philip Martin wrote:
Karl Fogel kfogel@newton.ch.collab.net writes:
Benjamin Pflugmann benjamin-svn-dev@pflugmann.de writes:
Given that using COMMITTED makes only sense with network access, why
don't query the server for that info? I do not think that it makes
much sense to have a COMMITTED that is fetched from a place that can
be out of date (I realize that this only affects dirs, but my point
stands anyhow).
COMMITTED is *not* the most recent committed revision on the server,
it is the last change at or before the BASE revision in the working
copy.
Probably my fault: I got confused by the description COMMITTED: The
last revision in which an item changed. in the docbook.
So I suppose to update the description a bit. It wouldn't hurt to
mention the WC like in the description of BASE. I would suggest
something, but I am still not 100% sure what exactly COMMITTED is
meant to be.
What you see is a consequence of Subversions mixed revision
policy,
I was aware of that.
the COMMITTED value is not out of date,
I did not say that. I did say that it can be fetched from a place that
can be out of date, namely the reference to the lazy base revision.
it still has the correct value given the base revision of the
directory.
Well, the The last revision in which an item changed. has no
reference to base revisions. So if your defintion is correct, the docs
are lacking.
The real issue is that '-r COMMITTED' isn't really meaningful for
directories.
[snip]
Frankly, I think we should either error when it is used with a
directory, or treat it like HEAD. Thoughts?
According to the docs, I would have expected the last change at or
before HEAD, as you probably already understood from my mail. An
error would be fine with me (as I did not use that feature yet), but
maybe others have a use case for it.
Regards,
Benjamin.
Re: COMMITTED and subdir recursion
Posted by Philip Martin ph...@codematters.co.uk.
Karl Fogel kfogel@newton.ch.collab.net writes:
Benjamin Pflugmann benjamin-svn-dev@pflugmann.de writes:
Given that using COMMITTED makes only sense with network access, why
don't query the server for that info? I do not think that it makes
much sense to have a COMMITTED that is fetched from a place that can
be out of date (I realize that this only affects dirs, but my point
stands anyhow).
COMMITTED is *not* the most recent committed revision on the server,
it is the last change at or before the BASE revision in the working
copy. What you see is a consequence of Subversions mixed revision
policy, the COMMITTED value is not out of date, it still has the
correct value given the base revision of the directory.
The real issue is that '-r COMMITTED' isn't really meaningful for
directories.
[snip]
Frankly, I think we should either error when it is used with a
directory, or treat it like HEAD. Thoughts?
I think the current behaviour is correct.
--
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: COMMITTED and subdir recursion
Posted by Karl Fogel kf...@newton.ch.collab.net.
Benjamin Pflugmann benjamin-svn-dev@pflugmann.de writes:
Given that using COMMITTED makes only sense with network access, why
don't query the server for that info? I do not think that it makes
much sense to have a COMMITTED that is fetched from a place that can
be out of date (I realize that this only affects dirs, but my point
stands anyhow).
The real issue is that '-r COMMITTED' isn't really meaningful for
directories.
For files, it means show the logs for the base revision of that file
in your current working copy (that is, for the revision of the text
base, which may have resulted from an update or from a commit). This
is the same as the committed-rev in the .svn/entries file.
But directories have mixed revisions, so the COMMITTED rev is,
essentially, a set. It could be a very wide distribution of numbers,
depending on how much committing one has done under that tree without
updating from the top.
Frankly, I think we should either error when it is used with a
directory, or treat it like HEAD. Thoughts?
-K
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: COMMITTED and subdir recursion
Posted by Benjamin Pflugmann be...@pflugmann.de.
On Mon 2003-01-20 at 09:30:34 -0600, Karl Fogel wrote:
Ah, now I understand. Mmm, yes -- Rafael or Andreas, care to write
the doc patches (for 'svn help' and for the static docs)?
Given that using COMMITTED makes only sense with network access, why
don't query the server for that info? I do not think that it makes
much sense to have a COMMITTED that is fetched from a place that can
be out of date (I realize that this only affects dirs, but my point
stands anyhow).
Or complain if the entries file is not up-to-date or whatever. While I
have no special problem with learning about lazy updates, I think it
is quite unexpected that this would affect how I have to specify
revision numbers in commands like
svn log -r COMMITTED
Thanks for listing. :-)
Benjamin.
Re: COMMITTED and subdir recursion
Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Ah, now I understand. Mmm, yes -- Rafael or Andreas, care to write
the doc patches (for 'svn help' and for the static docs)?
-K
andreas.koenig@anima.de (Andreas J. Koenig) writes:
> Let me point out that especially the svn manpage is misleading. When I
> leave the "." off as in:
>
> % svn log -r COMMITTED
> No commit for revision 0.
> ------------------------------------------------------------------------
>
> this seems to be a contradiction to what I read in the manpage:
>
> log [url] [file|dir] [New-Repository-Entry] [--targets
> file] [--username name] [--password pass]
> [--no-auth-cache] [--strict] [--xml] [-rqv]
> Show log messages (and affected entities) for com#
> mits in which any of the entities in question
> changed. If none were specified, then recursive
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> inclusion is the default. [...]
> ^^^^^^^^^^^^^^^^^^^^^^^^
>
> Reading the last sentence, one could conceivably expect that 'svn log
> -r COMMITTED' should find out that the last commit was rev 1. Actually
> I did believe it would.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: COMMITTED and subdir recursion
Posted by Karl Fogel kf...@newton.ch.collab.net.
Ah, now I understand. Mmm, yes -- Rafael or Andreas, care to write
the doc patches (for 'svn help' and for the static docs)?
-K
andreas.koenig@anima.de (Andreas J. Koenig) writes:
Let me point out that especially the svn manpage is misleading. When I
leave the . off as in:
% svn log -r COMMITTED
No commit for revision 0.
------------------------------------------------------------------------
this seems to be a contradiction to what I read in the manpage:
log [url] [file|dir] [New-Repository-Entry] [--targets
file] [--username name] [--password pass]
[--no-auth-cache] [--strict] [--xml] [-rqv]
Show log messages (and affected entities) for com#
mits in which any of the entities in question
changed. If none were specified, then recursive
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
inclusion is the default. [...]
^^^^^^^^^^^^^^^^^^^^^^^^
Reading the last sentence, one could conceivably expect that 'svn log
-r COMMITTED' should find out that the last commit was rev 1. Actually
I did believe it would.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: COMMITTED and subdir recursion
Posted by "Andreas J. Koenig" <an...@anima.de>.
On Mon, 20 Jan 2003 11:05:11 +0100, Rafael Garcia-Suarez rgarciasuarez@free.fr said:
Here is a small test that demonstrates the behavior :
(I've only 0.16.0 here, but I don't think this has changed recently)
$ svnadmin create repos
$ svn co file:///home/rafael/tmp/repos wc
Checked out revision 0.
$ cd wc
$ touch foo; svn add foo; svn ci -m 'add foo'
A foo
Adding foo
Transmitting file data .
Committed revision 1.
[rafael@rafael wc]$ svn log -r COMMITTED .
No commit for revision 0.
------------------------------------------------------------------------
Ah, thanks Rafael, now I understand. We have the lagging directoy
problem once again.
Let me point out that especially the svn manpage is misleading. When I
leave the . off as in:
% svn log -r COMMITTED
No commit for revision 0.
------------------------------------------------------------------------
this seems to be a contradiction to what I read in the manpage:
log [url] [file|dir] [New-Repository-Entry] [--targets
file] [--username name] [--password pass]
[--no-auth-cache] [--strict] [--xml] [-rqv]
Show log messages (and affected entities) for com#
mits in which any of the entities in question
changed. If none were specified, then recursive
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
inclusion is the default. [...]
^^^^^^^^^^^^^^^^^^^^^^^^
Reading the last sentence, one could conceivably expect that 'svn log
-r COMMITTED' should find out that the last commit was rev 1. Actually
I did believe it would.
--
andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org