DivDiff
DivDiff

Reputation: 983

SVN deletes newly added directories during merge

I'm developing a java application which leverages gradle for dependency management and SVN for version control in a windows environment. I also use the Eclipse IDE. I want to merge trunk into a working branch with SVN. I moved packages and files around in the working branch. When merging trunk into the working branch from the command line with the following command:

svn merge -r InitBranchRevision:FinalBranchRevision C:\DevTools\workspace\my_app

I get the following output:

---Merging InitBranchRevision through FinalBranchRevision into '.':
U     src\main\java\my_app\ApplicationWatcher.java
D     src\main\java\my_app\SomeUtil.Java
D     src\main\java\my_app\dependencies
C     build.gradle

How can I prevent the two deleted files above from being removed? I looked at this question, but it doesn't seem to fit this situation because our projects are configured differently.

Upvotes: 0

Views: 25

Answers (1)

Lazy Badger
Lazy Badger

Reputation: 97280

Preface

Parallel (to mainline) heavy refactoring in SVN is... well... The Bad Idea (tm) - you'll get a lot of headache and "Tree Conflicts" even on technically correct merges later

Face

I can't see any correct bit of data in your CLI-merge.

If you want to merge changes from trunk to branch and InitBranchRevision is branchpoint and C:\DevTools\workspace\my_app is WC of your branch and your SVN support mergeinfo-data (SVN 1.6+), then, accorging to svn help merge (1-st form, part "The 'Feature Branch' Merging Pattern") you have just (in C:\DevTools\workspace\my_app directory)

svn merge ^/trunk

because now you re-merge revisions from branch to this branch again (AFAICS): it have to be (at least I expected it) zero-changes or 100% merge-conflicts, but anyway - not requested results

Upvotes: 1

Related Questions