subversion-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johan Corveleyn <jcor...@gmail.com>
Subject Re: Merge from a branch of a branch to trunk, losing files
Date Fri, 24 Apr 2015 11:07:06 GMT
On Tue, Apr 21, 2015 at 7:20 PM, Robert Voliva <rvoliva@gmail.com> wrote:
> Hello,
>
> I created a branch off of trunk.  Files were added to that branch.  A branch
> was created off of that branch.  Files were added/changed in that branch.
> The second branch was merged back to trunk.  The files added in the first
> branch, before the second branch was cut from it, were not included in the
> merge.
>
> Slightly more visual:
>
> trunk
> ----project1
> --------file1
> (make branch)
> branches
> ----branch1
> --------file1
> --------branchfile1
> (make branch of branch1)
> ----branch2
> --------file1
> --------branchfile1
> --------branchfile2
> --------branchfile3
>
> When you go to merge branch2 into trunk, branchfile1 is not merged.  Can
> someone explain this to me as to what is going on?  Bug in svn?
> Documentation to why you can't do this?

Hi Robert,

Sorry it took a while to get a response. However, I cannot reproduce
what you are seeing, when trying something like this with svn 1.8.11
(see below).

What version are you using? Maybe this was a bug in older versions of
svn that has since been fixed ... Alternatively, maybe I'm missing
something in my scenario. In that case, can you show a series of steps
or a transcript to reproduce this?

Below is a transcript of what I tried (I tried doing exactly what you
described above). At the end you can see that both branchfile1 (from
branch1) and branchfile2 (from branch2) are merged to trunk.

[[[
C:\Temp\svntest>svn --version -q
1.8.11

C:\Temp\svntest>svnadmin create repos

C:\Temp\svntest>svn mkdir -mm file:///c:/temp/svntest/repos/trunk
file:///c:/temp/svntest/repos/branches

Committed revision 1.

C:\Temp\svntest>svn co file:///c:/temp/svntest/repos/trunk wc-trunk
Checked out revision 1.

C:\Temp\svntest>cd wc-trunk

C:\Temp\svntest\wc-trunk>echo test > file1

C:\Temp\svntest\wc-trunk>svn add file1
A         file1

C:\Temp\svntest\wc-trunk>svn ci -mm
Adding         file1
Transmitting file data .
Committed revision 2.

C:\Temp\svntest\wc-trunk>cd ..

C:\Temp\svntest>svn cp -mm file:///c:/temp/svntest/repos/trunk
file:///c:/temp/svntest/repos/branches/branch1

Committed revision 3.

C:\Temp\svntest>svn co file:///c:/temp/svntest/repos/branches/branch1 wc-branch1
A    wc-branch1\file1
Checked out revision 3.

C:\Temp\svntest>cd wc-branch1

C:\Temp\svntest\wc-branch1>echo test > branchfile1

C:\Temp\svntest\wc-branch1>svn add branchfile1
A         branchfile1

C:\Temp\svntest\wc-branch1>svn ci -mm
Adding         branchfile1
Transmitting file data .
Committed revision 4.

C:\Temp\svntest\wc-branch1>cd ..

C:\Temp\svntest>svn cp -mm
file:///c:/temp/svntest/repos/branches/branch1
file:///c:/temp/svntest/repos/branches/branch2


Committed revision 5.

C:\Temp\svntest>svn co file:///c:/temp/svntest/repos/branches/branch2 wc-branch2
A    wc-branch2\branchfile1
A    wc-branch2\file1
Checked out revision 5.

C:\Temp\svntest>cd wc-branch2

C:\Temp\svntest\wc-branch2>echo test > branchfile2

C:\Temp\svntest\wc-branch2>svn add branchfile2
A         branchfile2

C:\Temp\svntest\wc-branch2>svn ci -mm
Adding         branchfile2
Transmitting file data .
Committed revision 6.

C:\Temp\svntest\wc-branch2>cd ..\wc-trunk

C:\Temp\svntest\wc-trunk>svn merge
file:///c:/temp/svntest/repos/branches/branch2 .
svn: E195020: Cannot merge into mixed-revision working copy [1:2]; try
updating first

C:\Temp\svntest\wc-trunk>svn up
Updating '.':
At revision 6.

C:\Temp\svntest\wc-trunk>svn merge
file:///c:/temp/svntest/repos/branches/branch2 .
--- Merging r3 through r4 into '.':
A    branchfile1
--- Recording mergeinfo for merge of r3 through r4 into '.':
 U   .
--- Merging r5 through r6 into '.':
A    branchfile2
--- Recording mergeinfo for merge of r5 through r6 into '.':
 G   .

C:\Temp\svntest\wc-trunk>dir /b
branchfile1
branchfile2
file1

C:\Temp\svntest\wc-trunk>svn st
 M      .
A  +    branchfile1
A  +    branchfile2

C:\Temp\svntest\wc-trunk>svn ci -m"merged branch2 to trunk"
Sending        .
Adding         branchfile1
Adding         branchfile2

Committed revision 7.
]]]

-- 
Johan

Mime
View raw message