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

Re: svn update problem

From: Dmitry Lumpov <dlumpov_at_yahoo.com>
Date: 2005-05-31 23:06:14 CEST

Hi Mark,

Thank you very much for you reply.
I see your point, and svn specifics in 'update' and 'revert' commands.

-----------
$ svn help up
update (up): Bring changes from the repository into the working copy.

So, "svn update" or "svn up" is exactly like "get latest version". The
difference is that svn is a copy-modify-merge system, so if you were at
version x, and made some changes, then ran "svn up", now you're at
"version y with changes", not just plain "version y". Subversion won't
throw away your changes.
-----------

However, what makes me confused, that 'svn update' is not VSS
'GetLatestversion". The reason is in VSS
if you do 'GetlatestVersion' it will overwrite your changes (if you made)
and bring yourself exactly to the latest version from repository - doesn't
matter whether your local changes are important or not.
'svn update' does the same, if we specify a subversion number -
it will overwrite your latest changes to bring you to the version
you specified. However, just calling 'svn update' makes me confused,
because it says - "you are at version n", but actually it is not,because
repository still has version n, but I have changes in my local copy.
I suggest, may be change this message to "version y with changes",
as you proposed, and then everything becomes clear.

----------
> It would be natural, if 'svn update' could just revert us to the latest
> revision.
> Certainly, we can remove some files and make 'svn update' find what to do,
> but imagine how dangerous it is in case of lots of files.

"svn update" changes your BASE revision, and merges in any changes that
might have happened in the repository between your old BASE and the new
BASE. It doesn't make your copy look exactly like the copy on the
server, because then you'd lose any changes you made. That would be Bad.
----------
Sometimes, developer really need to return back to version from repository.
For ex. he may make some mistakes, or just play with the code, or make a draft
version.
Then he may need to return to the version from repository.

I am just talking of robust way of synchronization between repository and local
copy. Also, since 'svn update -r<n>' and 'svn update' commands have different
semantics, it could be good to explain it in the manual.

------------

> 'svn revert' seems to be good, but it doesn't check the repository. So,
> if repository has changes, this command cannot tell us, therefore we need
> to use 'svn update' together with it.

$ svn help revert
revert: Restore pristine working copy file (undo most local edits).

svn revert is just like VSS "undo changes". It reverts your file back to
the BASE revision. It doesn't fetch updates from the server, that's what
"svn up" does.

I think we need to be clear about the words we're using. "Revert"
implies going back to something previous, or undoing what was done.
"Update" implies getting something new that wasn't there before. So, you
don't "revert" to the latest version, you "revert" back to what you had
before you started making changes. You "update" to the latest version,
by asking the server what's been changed and making those same changes
locally.
-----------

Exactly. To undo my changes, I want to use repository to overwrite them.
I think it is pretty convenient, because keeps synchronized all the time.
Imagine, we revert to our prev local state (or changes) by using 'svn revert',
and at the same time somebody made changes in repository.
Now, to make sure that we are synchronized, we need not to forget to use
'svn update' command, then work on merges. So, it may lead to lots
of confusions.

Please, understand, I don't intend to attack you, I just want to explain
confusions that I had, when first tried to work with svn. I might be wrong,
because svn phylosophy is different.

Thank you.
Regards,
Dmitry.

--- Mark Parker <mark@msdhub.com> wrote:

> Dmitry Lumpov wrote:
> > Hi, François
> >
> > Thank you for your detailed reply.
> >
> > Ok, finally, I found out how to do it.
> >
> > We need to use 'svn update -r<n>' in order to get back to version n.
> > My concern was, that just 'svn update' will always tell us, that
> > we are at the revision n, even we locally modified files.
> > Inconsistency seems to be a problem. Also, we need to know the last
> revision
> > number, which is not obvious and require additional things to do.
> >
>
> $ svn help up
> update (up): Bring changes from the repository into the working copy.
>
> So, "svn update" or "svn up" is exactly like "get latest version". The
> difference is that svn is a copy-modify-merge system, so if you were at
> version x, and made some changes, then ran "svn up", now you're at
> "version y with changes", not just plain "version y". Subversion won't
> throw away your changes.
>
> > It would be natural, if 'svn update' could just revert us to the latest
> > revision.
> > Certainly, we can remove some files and make 'svn update' find what to do,
> > but imagine how dangerous it is in case of lots of files.
>
> "svn update" changes your BASE revision, and merges in any changes that
> might have happened in the repository between your old BASE and the new
> BASE. It doesn't make your copy look exactly like the copy on the
> server, because then you'd lose any changes you made. That would be Bad.
>
> > 'svn revert' seems to be good, but it doesn't check the repository. So,
> > if repository has changes, this command cannot tell us, therefore we need
> > to use 'svn update' together with it.
>
> $ svn help revert
> revert: Restore pristine working copy file (undo most local edits).
>
> svn revert is just like VSS "undo changes". It reverts your file back to
> the BASE revision. It doesn't fetch updates from the server, that's what
> "svn up" does.
>
> I think we need to be clear about the words we're using. "Revert"
> implies going back to something previous, or undoing what was done.
> "Update" implies getting something new that wasn't there before. So, you
> don't "revert" to the latest version, you "revert" back to what you had
> before you started making changes. You "update" to the latest version,
> by asking the server what's been changed and making those same changes
> locally.
>
>
> Mark
>
>
>

                
__________________________________
Discover Yahoo!
Have fun online with music videos, cool games, IM and more. Check it out!
http://discover.yahoo.com/online.html

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue May 31 23:08:14 2005

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