Login | Register
My pages Projects Community openCollabNet
Click here to access Issue tracker direct from Eclipse or Visual Studio
and to obtain other CollabNet integrations.

subversion
Issue 3623

Query | Reports

Issue 3623

Issue #: 3623   Platform: All   Reporter: cmpilato (C. Michael Pilato)
Component: subversion   OS: All  
Subcomponent: libsvn_client   Version: 1.5.x   CC: None defined
Status: RESOLVED   Priority: P2  
Resolution: FIXED   Issue type: DEFECT  
 Target milestone:1.6.13 
Assigned to: cmpilato (C. Michael Pilato)

This user has been disabled.

URL:
* Summary: Files added via merge from foreign repositories lose properties
Status whiteboard:
Keywords:
Attachments:
Issue 3623 depends on: Show dependency tree
Issue 3623 blocks:

View issue activity   |   Format for printing   |   Format as XML

Description: Opened: Thu Apr 29 09:35:00 -0700 2010 Sort by: Oldest first | Newest first

Tobias Bading <tbading{_AT_}web.de> reports on the dev-list that when performing
a foreign repository merge, new files added via the merge lose all their properties.

Here's a modified version of his recipe script:

#!/bin/sh

##############################################################################
##                                                                          ##
##  Script to reproduce a bug where properties are lost in merges           ##
##  between two repositories.                                               ##
##                                                                          ##
##############################################################################

SVN=`which svn`
SVNADMIN=`which svnadmin`
SVN=/home/cmpilato/projects/subversion/trunk/subversion/svn/svn
SVNADMIN=/home/cmpilato/projects/subversion/trunk/subversion/svnadmin/svnadmin

URL1=file:///`pwd`/lost-props-repos1
URL2=file:///`pwd`/lost-props-repos2

rm -rf lost-props-repos1 lost-props-repos2 lost-props-wc1 lost-props-wc2

${SVNADMIN} create lost-props-repos1
${SVNADMIN} create lost-props-repos2

# setting up the first repository:

echo ""
echo "### Checking out working copy of first empty repository..."
${SVN} co -q ${URL1} lost-props-wc1
echo ""

echo "### Creating file 'configure' and assigning properties..."
echo "echo This sucks..." > lost-props-wc1/configure
chmod 755 lost-props-wc1/configure
${SVN} add -q lost-props-wc1/configure
${SVN} propset -q svn:eol-style native lost-props-wc1/configure
echo ""

echo "### Properties of file 'configure' in first working copy:"
${SVN} proplist -v lost-props-wc1/configure
echo ""

echo "### Commiting changes to first repository..."
${SVN} ci -m "file configure added" lost-props-wc1
echo ""

echo "### Properties of file 'configure' in first repository:"
echo "### (svn:executable and svn:eol-style should be set and are indeed set)"
${SVN} proplist -v ${URL1}/configure
echo ""

# merging into a working copy of the second repository:

echo "### Checking out working copy of second empty repository..."
${SVN} co -q ${URL2} lost-props-wc2
echo ""

echo "### Merging r1 of first repository into working copy of second repository..."
${SVN} merge -c 1 ${URL1} lost-props-wc2
echo ""

echo "### Properties of file 'configure' in second working copy:"
${SVN} proplist -v lost-props-wc2/configure
echo ""

echo "### Commiting changes to second repository..."
${SVN} ci -m "r1 merged" lost-props-wc2
echo ""

echo "### Properties of file 'configure' in second working copy after the commit:"
${SVN} proplist -v lost-props-wc2/configure
echo ""

echo "### Properties of file 'configure' in second repository:"
echo "### (svn:executable and svn:eol-style should be set but are NOT)"
${SVN} proplist -v ${URL2}/configure
echo ""

echo "### Diff of r1 in second repository:"
echo "### (should show property changes but does NOT)"
${SVN} diff -c 1 ${URL2}
echo ""

------- Additional comments from C. Michael Pilato Thu Apr 29 09:36:30 -0700 2010 -------

Original post:  http://svn.haxx.se/dev/archive-2010-03/0596.shtml

------- Additional comments from C. Michael Pilato Thu Apr 29 09:41:32 -0700 2010 -------

I've isolated the cause of this bug.

The code in the merge callbacks (merge_file_added) which handles newly added
files needs to treat adds from foreign repositories as pure adds -- without
history, with no base data, only working data scheduled for addition.  (This is
different from same-repos merges, where adds are treated as copies from the
repository source, perhaps with local mods atop them.)  But the code was doing a
part of this work differently from the same-repos case.  (Specifically, it was
handling the copyfrom_url/rev correctly, but was still installing file contents
and props as base data, resulting in a working copy that appeared to have no
property changes.  (It's puzzling to me why such files didn't also show up as
having no content, but...)

------- Additional comments from C. Michael Pilato Thu Apr 29 09:48:51 -0700 2010 -------

Extended a foreign repos merge test to catch this problem:

   Sending        cmdline/merge_tests.py
   Transmitting file data .
   Committed revision 939375.

------- Additional comments from C. Michael Pilato Thu Apr 29 09:50:12 -0700 2010 -------

And fix the bug on trunk:

   Sending        trunk/subversion/libsvn_client/merge.c
   Transmitting file data .
   Committed revision 939376.

------- Additional comments from C. Michael Pilato Thu Apr 29 09:57:05 -0700 2010 -------

And proposed for backport to 1.6.x.

------- Additional comments from Hyrum K. Wright Wed Feb 2 13:42:23 -0700 2011 -------

Updating milestone to match release.