On Mon, May 21, 2012 at 9:01 AM, Johan Corveleyn <jcor...@gmail.com> wrote:
> [ Redirecting back to the list -- please always use "reply all" to
> keep the discussion on the list. More below ... ]

Sorry about that... see below.

>
> On Mon, May 21, 2012 at 3:54 PM, Brian Neal <bgn...@gmail.com> wrote:
>> On Mon, May 21, 2012 at 5:15 AM, Johan Corveleyn <jcor...@gmail.com> wrote:
>>> On Fri, May 18, 2012 at 9:48 PM, Brian Neal <bgn...@gmail.com> wrote:
>>>> Hello -
>>>>
>>>> My question is basically the same as this one:
>>>>
>>>> http://svn.haxx.se/users/archive-2010-04/0097.shtml
>>>>
>>>> We are forced to use an unwieldy and inconvenient directory structure.
>>>> Spare checkouts are a big help to us. But it seems that (in the few
>>>> times I have tried) to reintegrate a feature branch to trunk it has
>>>> failed if either of the working copies are sparse. I believe I
>>>> understand why this is; when you merge from trunk to your branch, the
>>>> merge info cannot get applied to the directories you have omitted from
>>>> your branch working copy. And when you finally go to reintegrate your
>>>> branch back to trunk, the reintegrate fails because SVN sees you have
>>>> not applied all the changes to certain directories.
>>>>
>>>> Perhaps I have done this wrong. If I have the same sparse directory
>>>> structures in my trunk & branch working copies (i.e. I made them
>>>> sparse in exactly the same way), should the reintegrate merge work?
>>>>
>>>> Otherwise is there a way to tell SVN that the directories I omitted
>>>> from my working copies are irrelevant and do not need to be merged?
>>>
>>> Which version of svn did you use (client-side)? What do you mean by 
>>> "failed"?
>>
>> SVN 1.7.4.
>>
>> "Failed" as in the reintegrate merge back to trunk was prevented from
>> happening. I regret not writing down the error message, but the gist
>> of it was SVN could not find merge info on the directories I did not
>> have in my sparse working copies. To work around it, we either have to
>> reintegrate merge sub-directories multiple times, or just remove the
>> --reintegrate flag and deal with the less than ideal results (tree
>> conflicts).
>>
>> When I get some time I will try to come up with a toy example that
>> reproduces the issue.
>
> Yes, that would be very useful.

I was able to reproduce the issue, please see the attached
sparse-merge.txt and I captured the output and error that I see in the
attached file out.txt. (Note that I had to rename sparse-merge.bat to
sparse-merge.txt before Gmail would send it).

I am using SVN 1.7.4 on Windows XP.

The high level description of what is going on in the script is:

1. Create a repo using your sample greek tree.
2. Make a sparse working copy of trunk, omitting the A\B directory (trunk_wc)
3. Copy trunk to a feature branch.
4. Make a sparse working copy of the feature branch (omitting A\B -- branch_wc)
5. Make a full working copy of trunk (trunk_b_wc).
6. Now change files in all three working copies and commit (but don't
create conflicts). In particular, in trunk_b_wc, change a file under
A\B.
7. Merge trunk to the feature branch.
8. Reintegrate merge the feature branch back to trunk.
9. Observe that the merge fails, presumably because the changes to A\B
never made it to the feature branch.

Thanks for your time and consideration.

-BN
Base url for repo: file:///C:/Project_Files/svn_tests/sparse_merge/repos
Making a Greek Tree for import...
Importing it...
Checking out a sparse working copy (omitting the A\B directory)..
A    trunk_wc\A
A    trunk_wc\iota
Checked out revision 1.
Updating 'trunk_wc\A\C':
A    trunk_wc\A\C
Updated to revision 1.
Updating 'trunk_wc\A\D':
A    trunk_wc\A\D
A    trunk_wc\A\D\gamma
A    trunk_wc\A\D\G
A    trunk_wc\A\D\G\pi
A    trunk_wc\A\D\G\rho
A    trunk_wc\A\D\G\tau
A    trunk_wc\A\D\H
A    trunk_wc\A\D\H\chi
A    trunk_wc\A\D\H\omega
A    trunk_wc\A\D\H\psi
Updated to revision 1.
Making a branch of trunk called 'feature'...

Committed revision 2.
Making a working copy of the feature branch...
A    branch_wc\A
A    branch_wc\iota
Checked out revision 2.
Updating 'branch_wc\A\C':
A    branch_wc\A\C
Updated to revision 2.
Updating 'branch_wc\A\D':
A    branch_wc\A\D
A    branch_wc\A\D\gamma
A    branch_wc\A\D\G
A    branch_wc\A\D\G\pi
A    branch_wc\A\D\G\rho
A    branch_wc\A\D\G\tau
A    branch_wc\A\D\H
A    branch_wc\A\D\H\chi
A    branch_wc\A\D\H\omega
A    branch_wc\A\D\H\psi
Updated to revision 2.
Make a full working copy of trunk for fiddling with B...
A    trunk_b_wc\A
A    trunk_b_wc\A\B
A    trunk_b_wc\A\B\lambda
A    trunk_b_wc\A\B\E
A    trunk_b_wc\A\B\E\alpha
A    trunk_b_wc\A\B\E\beta
A    trunk_b_wc\A\B\F
A    trunk_b_wc\A\mu
A    trunk_b_wc\A\C
A    trunk_b_wc\A\D
A    trunk_b_wc\A\D\gamma
A    trunk_b_wc\A\D\G
A    trunk_b_wc\A\D\G\pi
A    trunk_b_wc\A\D\G\rho
A    trunk_b_wc\A\D\G\tau
A    trunk_b_wc\A\D\H
A    trunk_b_wc\A\D\H\chi
A    trunk_b_wc\A\D\H\omega
A    trunk_b_wc\A\D\H\psi
A    trunk_b_wc\iota
Checked out revision 2.
Change some files on both trunk and branch and commit...
Sending        trunk_wc\iota
Transmitting file data .
Committed revision 3.
Sending        trunk_b_wc\A\B\lambda
Transmitting file data .
Committed revision 4.
Sending        branch_wc\A\D\H\psi
Transmitting file data .
Committed revision 5.
Now merging the trunk to the feature branch...
Updating 'branch_wc':
At revision 5.
Skipped 'branch_wc\A\B'
--- Merging r2 through r5 into 'branch_wc':
U    branch_wc\iota
--- Recording mergeinfo for merge of r2 through r5 into 'branch_wc':
 U   branch_wc
--- Recording mergeinfo for merge of r2 through r5 into 'branch_wc\A':
 U   branch_wc\A
Summary of conflicts:
  Skipped paths: 1
Sending        branch_wc
Sending        branch_wc\A
Sending        branch_wc\iota
Transmitting file data .
Committed revision 6.
Now doing the reintegrate merge to trunk wc...
Updating 'trunk_wc':
At revision 6.
svn: E195016: Reintegrate can only be used if revisions 2 through 6 were 
previously merged from 
file:///C:/Project_Files/svn_tests/sparse_merge/repos/trunk to the reintegrate 
source, but this is not the case:
  branches/feature/A
    Missing ranges: /trunk/A:4

@echo off

rem 
##############################################################################
rem ##                                                                          
##
rem ##  This is a template for writing Subversion bug reproduction scripts.     
##
rem ##                                                                          
##
rem ##  It creates a repository containing the standard Greek Tree (see         
##
rem ##  
http://svn.apache.org/repos/asf/subversion/trunk/subversion/tests/greek-tree.txt)
 ##
rem ##  and checks out a working copy containing that tree.  Please adjust      
##
rem ##  this script however you need to to demonstrate your bug.  When it's     
##
rem ##  ready, post the bug report to d...@subversion.apache.org -- after       
 ##
rem ##  
http://subversion.apache.org/docs/community-guide/issues.html#reporting-bugs, ##
rem ##  of course.                                                              
##
rem ##                                                                          
##
rem 
##############################################################################

:defineCommands
rem You might need to adjust these lines to point to your
rem compiled-from-source Subversion binaries, if using those:
for %%i in (svn.exe) do set SVN="%%~$PATH:i"
for %%i in (svnadmin.exe) do set SVNADMIN="%%~$PATH:i"

:defineUrls
rem Only supported access method: file://. If http:// or svn://, then
rem you'll have to configure it yourself first.
set URL=file:///%CD%/repos
set URL=%URL:\=/%
echo Base url for repo: %URL%

:cleanAllDirsAndCreateRepo
if exist repos rmdir /s /q repos
if exist import-me rmdir /s /q import-me
if exist trunk_wc rmdir /s /q trunk_wc
if exist branch_wc rmdir /s /q branch_wc
if exist trunk_b_wc rmdir /s /q trunk_b_wc
%SVNADMIN% create repos

:prepareGreekTree
echo Making a Greek Tree for import...
mkdir import-me
mkdir import-me\trunk
mkdir import-me\tags
mkdir import-me\branches
mkdir import-me\trunk\A
mkdir import-me\trunk\A\B\
mkdir import-me\trunk\A\C\
mkdir import-me\trunk\A\D\
mkdir import-me\trunk\A\B\E\
mkdir import-me\trunk\A\B\F\
mkdir import-me\trunk\A\D\G\
mkdir import-me\trunk\A\D\H\
echo This is the file 'iota'.        > import-me\trunk\iota
echo This is the file 'A\mu'.        > import-me\trunk\A\mu
echo This is the file 'A\B\lambda'.  > import-me\trunk\A\B\lambda
echo This is the file 'A\B\E\alpha'. > import-me\trunk\A\B\E\alpha
echo This is the file 'A\B\E\beta'.  > import-me\trunk\A\B\E\beta
echo This is the file 'A\D\gamma'.   > import-me\trunk\A\D\gamma
echo This is the file 'A\D\G\pi'.    > import-me\trunk\A\D\G\pi
echo This is the file 'A\D\G\rho'.   > import-me\trunk\A\D\G\rho
echo This is the file 'A\D\G\tau'.   > import-me\trunk\A\D\G\tau
echo This is the file 'A\D\H\chi'.   > import-me\trunk\A\D\H\chi
echo This is the file 'A\D\H\omega'. > import-me\trunk\A\D\H\omega
echo This is the file 'A\D\H\psi'.   > import-me\trunk\A\D\H\psi
echo Importing it...
cd import-me
%SVN% import -q -m "Initial import." %URL%
cd ..

:checkoutTrunk
echo Checking out a sparse working copy (omitting the A\B directory)..
%SVN% co --depth immediates %URL%/trunk trunk_wc
%SVN% update --set-depth infinity trunk_wc/A/C
%SVN% update --set-depth infinity trunk_wc/A/D

echo Making a branch of trunk called 'feature'...
%SVN% copy %URL%/trunk %URL%/branches/feature -m "Making feature branch"

echo Making a working copy of the feature branch...
%SVN% co --depth immediates %URL%/branches/feature branch_wc
%SVN% update --set-depth infinity branch_wc/A/C
%SVN% update --set-depth infinity branch_wc/A/D

echo Make a full working copy of trunk for fiddling with B...
%SVN% co %URL%/trunk trunk_b_wc

echo Change some files on both trunk and branch and commit...
echo New content for iota. > trunk_wc\iota
echo New content for psi. > branch_wc\A\D\H\psi
echo New content for lambda. > trunk_b_wc\A\B\lambda
%SVN% ci trunk_wc -m "Some trunk changes"
%SVN% ci trunk_b_wc -m "Some trunk changes (B)"
%SVN% ci branch_wc -m "Some branch changes"

echo Now merging the trunk to the feature branch...
%SVN% update branch_wc
%SVN% merge %URL%/trunk branch_wc
%SVN% ci branch_wc -m "Merging with trunk"

echo Now doing the reintegrate merge to trunk wc...
%SVN% update trunk_wc
%SVN% merge --reintegrate %URL%/branches/feature trunk_wc

Reply via email to