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

Re: rolling back my working copy

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2005-03-25 18:34:01 CET

On Mar 25, 2005, at 11:06 AM, Jill Pelavin wrote:

> Daniel-
> I totally agree with you. do you, or anyone else, know of any
> *simple* commands that I can use to solve my reverting problem?

All of the svn commands do very simple things... but you have to learn
this small vocabulary. If the vocabulary doesn't match your definition
of intuitive, then you're out of luck. But once you have this set of
small ideas in your head, it's easy to make them do complex things.

The confusion here is that there are 2 different definitions of the
phrase "change your working copy":

   1. If you edit a file, the working copy is "changed". It's called a
'local modification', and 'svn status' and 'svn diff' will show you
such changes. It represents edits that you intend on committing to the
server with 'svn commit'.

   2. If you run 'svn update -r 'OLDREV', the working copy is "changed",
but in a different way. The base-versions of the files are changed --
so it's useful for examining old states of the tree -- but it's *not*
same as local modifications. 'svn status' and 'svn diff' will show no
edits. And 'svn commit' will do nothing, because there are no edits to
commit. Your working copy is reflecting an older snapshot, but that's

So what you did was mix up the two types of changes. As chapter 4 in
the book explains: to undo commits, you need to create the *first*
type of change in your working copy, not the second type of change. In
other words, you need a working copy with the latest code, then you
need to make local edits so that it looks like some older snapshot of
the tree, then you commit.

The 'svn merge' command is exactly the tool for doing what I just
described. And other responses have already explained how to do it.

What you did -- backdate the working copy, then make local edits, is
doomed to fail. The commit command will scream that you're trying to
commit changes to a file which is out-of-date. It's exactly the same
'protection' that prevents you from committing when somebody sneaks a
commit into the server just before you run 'svn commit'.

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Mar 25 18:36:58 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.