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

Re: Help with Revision Numbers

From: Toby Johnson <toby_at_etjohnson.us>
Date: 2005-03-29 22:48:35 CEST

In Subversion, working copies (WC) can have their elements at different
revision numbers. Some files might be at lower revision numbers, while
others are at higher revision numbers.

When you first check out a WC, all items are at the same revision number
(usually HEAD unless you specified a different revision). As you make
changes to individual files/directories, and commit those changes, then
those particular files are at a newer revision than the rest of the WC.
You can bring the entire WC up to the latest revision using "svn update".

All those "44"s in your printout indicate that the "working revision" of
those files is 44. You must have either just checked out the WC, or
recently did an "svn update" to version 44.

The "other" revision is the last-changed revision. For trout.c, even
though its local copy has been updated to revision 44, the last time it
was actually *changed* was back in revision 35. This duality exists
because revision numbers are global, i.e. they pertain to the entire
repository and not just one file. So even though your local copy of
trout.c is at revision 44, it wasn't changed in revisions 36-44.

The "Status against revision: 46" is due to the --show-updates, which
checks for changes from the repository as well as local changes. This
means that the repository is currently at revision 46 (its current
HEAD). That means some files might have changed since you checked out or
updated your WC (and indeed they have, as seen by the "*" on a couple
files). If you were to run "svn update" at this point, all "working
revisions" would be brought to 46, and the appropriate (remote) changes
would be brought down locally.

You can picture why a branch can be at a newer revision than some of its
member files by remembering that branches are simply cheap copies. So if
the branch took place at revision 35, and some (but not all) of its
members were modified after that, then those members which haven't been
modified at all can still be at revision 35 (at least until another "svn
update" is made).

Roberto Nucera wrote:

>Can anyone explain to me what a "working-revision" is? We are new to Subversion.
>
>This is the example from the book (on svn status)
>
>$ svn status --show-updates --verbose
> M * 44 23 sally README
> M 44 20 harry bar.c
> * 44 35 harry stuff/trout.c
> D 44 19 ira stuff/fish.c
> A 0 ? ? stuff/things/bloo.h
>
>Status against revision: 46
>
>1. How can the branch be at revision 44 while the highest revision for
> a file is 35?
>2. What is the working revision (44?)
>3. What is the other revision (say 35 for file trout.c)?
>4. How are they related?
>5. What is the 46 below (Status against revision)? Which revision is that?
>
>// --
>
>Thanks in advance!
>
>roberto
>
>---------------------------------------------------------------------
>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 Mar 29 22:51:23 2005

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.