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

Re: Trunk to branch merge error on renamed component

From: Stefan Sperling <stsp_at_elego.de>
Date: Fri, 6 Mar 2009 19:50:06 +0000

On Fri, Mar 06, 2009 at 09:01:20AM -0800, Murli Varadachari wrote:
> I personally ran this with svn 1.5.6. As I mentioned earlier this
> took me past the merge but crashed on commit.
> A developer here used 1.6.0-rc2 to test the same on a different
> host. [ I asked him to do so that would eliminate any environmental
> / host specific issues]. He got the same results.!!

So it looks like the problem is caused by a directory
being renamed on trunk, and merging this rename into
the branch, right?

I can reproduce the problem using the script below, with
1.5.6, some recent build from the 1.6.x branch, and trunk.

But in all cases svn does not stop me from committing
after running 'svn update'.

Is this what you are seeing, too? If not, you have a different
situation, and we need more information to reproduce this
problem locally. Can you try to tweak the script pasted below
so that it does reliably recreate your specific problem?

Thanks,
Stefan

1.5.6 allows me to commit after updating:

  --- Merging r2 through r5 into '.':
  A epsilon/gamma
  A epsilon/gamma/delta
  D gamma
  $ svn ci -m sync with trunk renamebug/branch
  Sending renamebug/branch
  svn: Commit failed (details follow):
  svn: Directory '/branch' is out of date
  $ cd renamebug/branch/
  $ svn up
  At revision 5.
  $ svn ci -mm
  Sending .
  Adding epsilon/gamma
  Adding epsilon/gamma/delta
  Deleting gamma
  
  Committed revision 6.

1.6.x and trunk detect a tree conflict and I can commit
after I mark it resolved:

  --- Merging r2 through r5 into '.':
  A epsilon/gamma
  A epsilon/gamma/delta
  D gamma
  $ svn ci -m sync with trunk renamebug/branch
  Sending renamebug/branch
  subversion/libsvn_client/commit.c:867: (apr_err=160028)
  svn: Commit failed (details follow):
  subversion/libsvn_repos/commit.c:124: (apr_err=160028)
  svn: Directory '/branch' is out of date
  $ cd renamebug/branch/
  $ svn up
     C gamma
  At revision 5.
  Summary of conflicts:
    Tree conflicts: 1
  $ svn status
   M .
  D C gamma
> local delete, incoming edit upon update
  D gamma/delta
  A + epsilon/gamma
  A + epsilon/gamma/delta
  $ svn resolved gamma
  Resolved conflicted state of 'gamma'
  $ svn ci -mm
  Sending .
  Adding epsilon/gamma
  Adding epsilon/gamma/delta
  Deleting gamma
  
  Committed revision 6.

renamebug.sh:
#!/bin/sh

set -e

cwd=`pwd`
basename=`basename $0`
scratch_area="`echo $basename | sed -e s/\.sh$//`"
repos=$scratch_area/repos
trunk=$scratch_area/trunk
branch=$scratch_area/branch
trunk_url=file:///$cwd/$repos/trunk
branch_url=file:///$cwd/$repos/branch

set -x

rm -rf $scratch_area
mkdir -p $scratch_area

mkdir -p $trunk
echo alpha > $trunk/alpha
echo beta > $trunk/beta
mkdir $trunk/gamma
echo delta > $trunk/gamma/delta
mkdir $trunk/epsilon
echo zeta > $trunk/epsilon/zeta

svnadmin create $cwd/$repos
svn import $trunk $trunk_url -m "importing project tree"
svn copy $trunk_url $branch_url -m "creating branch"
rm -rf $trunk
svn checkout $trunk_url $trunk
svn checkout $trunk_url ${trunk}2
svn checkout $branch_url $branch

svn mv $trunk/gamma $trunk/epsilon/
svn ci -m "moved dir gamma into epsilon" $trunk

echo "alpha, modified" > $branch/alpha
svn ci -m "changed alpha" $branch
echo "delta, modified" > $branch/gamma/delta
svn ci -m "changed delta" $branch

(cd $branch && svn merge $trunk_url)

# this causes an out-of-date error
svn ci -m "sync with trunk" $branch
Received on 2009-03-06 20:53:27 CET

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.