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

Re: @REV vs -r REV

From: David Weintraub <qazwart_at_gmail.com>
Date: Wed, 22 Apr 2009 11:57:36 -0400

All this talk of -r<rev> vs. @<rev> reminds me of something the
ClearCase people referred to as "Evil Twins".

In ClearCase parlance, Evil Twins are two different files in two
different revisions that share the same directory name and file name,
but have no history in common. It looks like we're getting the same
problem in Subversion.

For example:

Create a new repository and add a directory called foo with a file
called foobar.txt. Commit your changes.

Your repository looks like this:


Now create a directory called bar that is a sibling of foo and move
the file foobar.txt to the bar directory and rename it barfoo.txt.
Commit your changes.

Your repository looks like this:


Now create a new file called foobar.txt under the foo directory.
Commit your changes. Your repository will now look like this:


To our mortal eyes, we assume that foo/foobar.txt in Rev 1 of the
repository is an ancestor of foo/foobar.txt in Rev 3 of the
repository. However, this is not true, and Subversion knows this.

If I do a log on foo/foobar.txt, I don't see that there was a file
called foo/foobar.txt in Rev 1 of the repository, and doing a diff
between the working copy and revision 1 doesn't work:

$ svn diff -r1 foo/foobar.txt
svn: Unable to find repository location for foobar.txt in revision 1.

If, however, I do this:

$ svn diff -r1 foo/foobar.txt_at_1
--- foobar.txt (revision 1)
+++ foobar.txt (working copy)
- This is a file
+ This is a different file from before

This works because I am now specifying not the file, but the file of
the same name that was there at revision 1 of the repository.

ClearCase administrators dreaded Evil Twins because they caused so
much confusion with users. In fact, some sites went so far as to
design triggers (hooks in Subversion) that would actually prevent you
from creating Evil Twins. I believe this is why many version control
systems to this day still do not deal with directory versioning.

David Weintraub
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-04-22 18:06:18 CEST

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