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

Directory replaced by symlink breaks merge

From: <subversion.mexon_at_spamgourmet.com>
Date: 2007-06-13 10:36:46 CEST

I'm trying to merge some changes from a branch back to the trunk. On
the branch, a directory was moved elsewhere in the repository, and a
link was made to the old location for backwards compatibility. But it
seems that svn merge fails when it tries to merge this kind of thing.

Here's a greatly simplified procedure that shows the same problem (this
time merging trunk to branch):

> mkdir temp
> cd temp
> mkdir repos
> svnadmin create repos/my-repository
> svn co file://$HOME/temp/repos/my-repository
  Checked out revision 0.
> cd my-repository/
> mkdir trunk
> mkdir trunk/directory
> svn add trunk
  A trunk
  A trunk/directory
> svn commit -m 'Created trunk'
  Adding trunk
  Adding trunk/directory

  Committed revision 1.
> svn copy trunk branch
  A branch
> svn commit branch -m 'Created branch'
  Adding branch

  Committed revision 2.
> cd trunk
> svn move directory new-directory
  A new-directory
  D directory
> svn commit -m 'Renamed directory'
  Deleting trunk/directory
  Adding trunk/new-directory

  Committed revision 3.
> svn update
  At revision 3.
> ln -s new-directory directory
> svn add directory
  A directory
> svn commit -m 'Added link in place of old directory'
  Adding trunk/directory
  Transmitting file data .
  Committed revision 4.
> cd ../branch/
> ls -l
  total 4
  drwxr-xr-x 3 username username 4096 2007-06-13 10:07 directory
> svn merge -r 2:4 ../trunk .
  D directory
  Skipped 'directory'
  A new-directory
> ls -l
  total 8
  drwxr-xr-x 3 username username 4096 2007-06-13 10:15 directory
  drwxr-xr-x 3 username username 4096 2007-06-13 10:15 new-directory
> ls -l ../trunk
  total 4
  lrwxrwxrwx 1 username username 13 2007-06-13 10:15 directory ->
new-directory
  drwxr-xr-x 3 username username 4096 2007-06-13 10:15 new-directory
> svn commit -m 'Merge from trunk'
  Deleting branch/directory
  Adding branch/new-directory

  Committed revision 5.
> ls -l
  total 4
  drwxr-xr-x 3 mexon mexon 4096 2007-06-13 10:15 new-directory

As you can see, after doing the merge my link is completely missing.
I've tried using --ignore-ancestry and --force, but neither of them make
a difference. It's not a problem when ordinary files are renamed, only
when directories are renamed.

The fundamental problem is that when "svn merge" merges in a deletion of
a directory, it doesn't actually delete the directory. Then when it
tries to create the link it finds something in the way, and skips it to
avoid clobbering something that might be important. I really need a
"yes, really delete things that were deleted, even directories" option
to pass to svn.

I'm finding this problem with 1.4.0 and 1.4.3. Does anyone know a
workaround I can use?

Thanks,
Mat

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Jun 13 10:37:27 2007

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