Reputation: 5469
Use of "svn merge --reintegrate" successfully merged branch back to trunk with regards to branch files deleted being deleted on the trunk as well. This is what I expected and wanted. Good.
However it did not add files to trunk that were added on the branch. While "svn merge --reintegrate" copied the added file to the trunk working directory they were not added to svn and of course were not committed. I did not expect this. Bad.
How can I safely merge branch to trunk changes including file deletes and file adds?
Here Is What I Did
The my-bug-fix branch was created from the last official release on the trunk. This is a single developer project but I still managed to mess up the merge and break the build.
Before merging I checked out both branch and trunk into a "staging" folder to make it easy to a diff. I was hoping the diff would assure me the merge was what I expected before committing. Unfortunately diff had no knowledge that the added file had not been added to svn.
mkdir merge-staging
cd merge-staging
svn co https://myserver.com:8443/svn/myproject/branches/my-bug-fix/ branch
svn co https://myserver.com:8443/svn/myproject/trunk/ trunk
cd trunk
svn merge --reintegrate https://myserver.com:8443/svn/myproject/branches/my-bug-fix/
echo Perform diff between branch and trunk to verify the trunk now matches branch.
diff -r --exclude=".svn" branch/ trunk/
svn --version
svn, version 1.6.15 (r1038135)
compiled Nov 25 2010, 00:08:34
[esutton@esutton-vm-rhel merge]$ svn status trunk
X trunk/common/externals
? trunk/common/scripts/strip-dbg-sym.sh
Thanks in advance for any direction, -Ed
Upvotes: 0
Views: 1375
Reputation: 97375
merge --reintegrate
, why I can't see merged trunk to my-bug-fix branch before it?svn --version
?svn status
instead of diff will be usableBack to problem:
I can't confirm or reproduce described effect
>svn log -v file:///Z:/Repo
------------------------------------------------------------------------
r9 | Badger | 2013-04-23 07:32:26 +0600 (Вт, 23 апр 2013) | 1 line
Changed paths:
M /trunk
M /trunk/fleA.txt
D /trunk/fleB.txt
A /trunk/fleC.txt (from /branches/corrections/fleC.txt:8)
Reintegrated branch to trunk
------------------------------------------------------------------------
r8 | Badger | 2013-04-23 07:30:04 +0600 (Вт, 23 апр 2013) | 1 line
Changed paths:
M /branches/corrections
M /branches/corrections/fleA.txt
Merged trunk to branches/corrections
------------------------------------------------------------------------
r7 | Badger | 2013-04-23 07:25:40 +0600 (Вт, 23 апр 2013) | 1 line
Changed paths:
D /branches/corrections/fleB.txt
Deleted fleB.txt
------------------------------------------------------------------------
r6 | Badger | 2013-04-23 07:24:57 +0600 (Вт, 23 апр 2013) | 1 line
Changed paths:
A /branches/corrections/fleC.txt
Added fleC.txt
------------------------------------------------------------------------
r5 | Badger | 2013-04-23 07:23:37 +0600 (Вт, 23 апр 2013) | 2 lines
Changed paths:
M /branches/corrections/fleA.txt
Added string to fleA.txt
------------------------------------------------------------------------
r4 | Badger | 2013-04-23 07:22:12 +0600 (Вт, 23 апр 2013) | 2 lines
Changed paths:
M /trunk/fleA.txt
Edited fleA.txt
------------------------------------------------------------------------
r3 | Badger | 2013-04-23 07:20:25 +0600 (Вт, 23 апр 2013) | 1 line
Changed paths:
A /branches/corrections (from /trunk:2)
Branch for changes
------------------------------------------------------------------------
r2 | Badger | 2013-04-23 07:17:25 +0600 (Вт, 23 апр 2013) | 1 line
Changed paths:
A /trunk/fleA.txt
A /trunk/fleB.txt
Starting point
------------------------------------------------------------------------
r1 | Badger | 2013-04-23 07:15:06 +0600 (Вт, 23 апр 2013) | 1 line
Changed paths:
A /branches
A /tags
A /trunk
Imported folder structure
------------------------------------------------------------------------
>svn ls -v file:///Z:/Repo/trunk
9 Badger апр 23 07:32 ./
9 Badger 52 апр 23 07:32 fleA.txt
9 Badger 40 апр 23 07:32 fleC.txt
Upvotes: 1