[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: "svn commit" followed by "svn log" doesn't show new revision

From: Niels Skou Olsen <nso_at_manbw.dk>
Date: 2004-11-16 17:45:44 CET

"Dale Worley" <dworley@pingtel.com> writes:

> This is a side-effect of one of the weirder aspects of Subversion: When you
> check out a tree, it is at, say, rev 1, and all the directories and all the
> files have BASE = rev 1.
>
> Now say you check in a new file. That new file now has BASE = rev 2. But
> the directory containing it is still at BASE = rev 1, because you didn't
> change it. But when you do an update, the directory is updated to BASE =
> rev 2.

If you add a new file to a directory you have indeed changed the directory!
So with your example I would expect that, after the commit, if the new file
has BASE=r2, then the directory it was added to must also have BASE=r2.

In my original example, this is also what happened in the repository. The
problem is that a vanilla "svn log" does not show the new revision of the
directory until an "svn update" has been done. But the explicit "svn log
-rHEAD:1" *DOES* show the new revision. And to add to the confusion, an
"svn status -u" gives no hint that the working copy needs an update. I
agree that this is not intuitive.

Btw. if you do my example in TortoiseSVN, the new file shows up in the log
after the commit. So I guess that TortoiseSVN always specfies -rHEAD:1 in
the log command.

Best regards,

Niels

> -----Original Message-----
> From: Niels Skou Olsen [mailto:nso@manbw.dk]
>
> Here's a little scenario that confuses new users: Add a new file to a
> working copy directory, commit, and then do an "svn log". The log output
> will *not* show the new revision just made. "Hmm", the newbie frowns, and
> he does an "svn status -u", just to be absolutely sure that the working
> copy is entirely up-to-date. As no discrepancies against the repository is
> reported, the newbie enters a state of confusion.
>
> BUT,
>
> svn log -rHEAD:1
>
> shows the new revision, whereas
>
> svn log
>
> does not. So apparently these two commands are not equivalent? I would have
> thought that omitting a revision specification to "svn log" would imply
> "-rHEAD:1".
>
> To see the new revision with a plain "svn log" command, you have to do an
> "svn update" first, even though "svn status -u" says it's not
> necessary. Very confusing for a newbie. What is the reason for this
> behaviour?
>
> If there really is a compelling reason, then the book should mention it in
> the "newbie" pedagogical sections, and maybe also point it out in the
> reference section.
>
> Here is a sample shell session to illustrate the confusing behaviour:
>
> nso@SBMA:/tmp> svn --version | head -1
> svn, version 1.1.1 (r11581)
> nso_at_SBMA:/tmp> svn co file:///tmp/rep work
> A work/mydir
> Checked out revision 1.
> nso@SBMA:/tmp> cd work
> nso@SBMA:/tmp/work> cd mydir
> nso@SBMA:/tmp/work/mydir> svn log
> ------------------------------------------------------------------------
> r1 | nso | 2004-11-16 10:27:42 +0100 (Tue, 16 Nov 2004) | 1 line
>
> Added mydir
> ------------------------------------------------------------------------
> nso@SBMA:/tmp/work/mydir> svn st -u
> Status against revision: 1
> nso@SBMA:/tmp/work/mydir> ls >f1
> nso@SBMA:/tmp/work/mydir> svn add f1
> A f1
> nso@SBMA:/tmp/work/mydir> svn commit -m"add f1"
> Adding mydir/f1
> Transmitting file data .
> Committed revision 2.
> nso@SBMA:/tmp/work/mydir> svn log
> ------------------------------------------------------------------------
> r1 | nso | 2004-11-16 10:27:42 +0100 (Tue, 16 Nov 2004) | 1 line
>
> Added mydir
> ------------------------------------------------------------------------
> nso@SBMA:/tmp/work/mydir> svn st
> nso@SBMA:/tmp/work/mydir> svn st -u
> Status against revision: 2
> nso@SBMA:/tmp/work/mydir> svn log -rHEAD:1
> ------------------------------------------------------------------------
> r2 | nso | 2004-11-16 10:30:13 +0100 (Tue, 16 Nov 2004) | 1 line
>
> add f1
> ------------------------------------------------------------------------
> r1 | nso | 2004-11-16 10:27:42 +0100 (Tue, 16 Nov 2004) | 1 line
>
> Added mydir
> ------------------------------------------------------------------------
> nso@SBMA:/tmp/work/mydir> svn update
> At revision 2.
> nso@SBMA:/tmp/work/mydir> svn log
> ------------------------------------------------------------------------
> r2 | nso | 2004-11-16 10:30:13 +0100 (Tue, 16 Nov 2004) | 1 line
>
> add f1
> ------------------------------------------------------------------------
> r1 | nso | 2004-11-16 10:27:42 +0100 (Tue, 16 Nov 2004) | 1 line
>
> Added mydir
> ------------------------------------------------------------------------
> nso@SBMA:/tmp/work/mydir>
>
>
> Best regards,
>
> Niels
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>
>

-- 
Niels Skou Olsen, M.Sc.
Intelligent Engine, R&D
MAN B&W Diesel A/S
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Nov 16 17:46:30 2004

This is an archived mail posted to the Subversion Users mailing list.