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

svn update/diff handles renames confusingly

From: Daniel Quinlan <quinlan_at_pathname.com>
Date: 2004-02-15 09:36:06 CET

If a working copy of a file has been modified locally and moved in the
repository, the behavior of svn when updating the tree (to HEAD) makes
no sense and is at best confusing.

First, you do the update:

  $ svn update
  [bunch of normally updated files]
  svn: Won't delete locally modified file 'old_name_of_file'

The state of the tree is then bizarre:

1. new_name_of_file and old_name_of_file both exist
2. new_name_of_file and old_name_of_file are neither versioned nor
   exported

After some confusion, I just copied the working copy elsewhere, updated
the tree, and tried the two "obvious" things:

1. diff the working copy of the file under the new name against an old
   revision and you get the entire file back in the diff -- because the
   file doesn't exist in the old revision (of course)

2. diff the working copy of the file under the old name and you get back
   "svn: 'old_name_of_file' is not under version control"

The only way I could get a simple diff to work was to do the diff while
the tree is in the bizarre intermediate state where both files exist,
but this is entirely non-obvious from the original warning message. I
didn't actually figure this out until a few minutes after I had given up
and updated my entire tree to the old revision so I could do the diff
before the update (so I suppose I figured out two ways, but one is a
very small window and the second was very non-optimal).

How do you diff a working copy of a file against a version of the file
prior to the rename?

Also, why doesn't "svn update" handle renames? After this and previous
experiences, I now feel the need to warn other developers when I'm about
to rename a file.

Daniel

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Feb 15 16:13:19 2004

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

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