[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: Dale Worley <dworley_at_pingtel.com>
Date: 2004-11-16 15:27:46 CET

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.

This is rather counter-intuitive, but it's hard to see another way to do it
if you are going to version-ize directories as well as the files they
contain, and allow a tree to contain a mix of revisions.

Dale

-----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

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Nov 16 15:29:28 2004

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.