1

I recreated my issue in a new empty SVN repository:

Revision 1:

  • /trunk/
  • /branches/

Operation: add text file "init.txt" to branch "trunk"

Revision 2:

  • /trunk/init.txt
  • /branches/

Operation: create feature branch based on trunk

Revision 3:

  • /trunk/init.txt
  • /branches/featureA/init.txt

Operation: add unstable feature to branch

Revision 4:

  • /trunk/init.txt
  • /branches/featureA/init.txt
  • /branches/featureA/unstable.txt

Operation: fix bug in feature branch by adding file "bugfix.conf"

Revision 5:

  • /trunk/init.txt
  • /branches/featureA/init.txt
  • /branches/featureA/unstable.txt
  • /branches/featureA/bugfix.conf

Operation: merge "bugfix.conf" back into trunk but skip "unstable.txt"

Screenshot of first merge dialog page

Screenshot of second merge dialog page

Revision 6:

  • /trunk/ [svn:mergeinfo=/branches/featureA:3,5]
  • /trunk/init.txt
  • /trunk/bugfix.conf
  • /branches/ [no svn:mergeinfo]
  • /branches/featureA/init.txt
  • /branches/featureA/unstable.txt
  • /branches/featureA/bugfix.conf

Operation: continue working at file "init.txt" trunk

Revision 7:

  • /trunk/ [svn:mergeinfo=/branches/featureA:3,5]
  • /trunk/init.txt (new content)
  • /trunk/bugfix.conf
  • /branches/ [no svn:mergeinfo]
  • /branches/featureA/init.txt (old content)
  • /branches/featureA/unstable.txt
  • /branches/featureA/bugfix.conf

Operation: try to synchronize the feature branch with the trunk

Expected outcome: Revision 8:

  • /trunk/ [svn:mergeinfo=/branches/featureA:4]
  • /trunk/init.txt (new content)
  • /trunk/bugfix.conf
  • /branches/ [svn:mergeinfo=/trunk:6]
  • /branches/featureA/init.txt (new content)
  • /branches/featureA/bugfix.conf

First attempt

On feature branch choose "Merge a range of revisions -> all revisions"

Error: "Reintegrate can only be used if revisions 3 through 7 were previously merged from /branches/featureA to the reintegrate source, but this is not the case: trunk Missing ranges /branches/featureA:4"

Why does SVN need revision 4 to also be merged? The whole point of having a separate branch for stable and unstable is to keep some commits away from the other branch. The change (adding file unstable.txt) is completely independent of the other changes.

Second attempt

On feature branch choose "Merge a range of revisions -> Revisions 2-7" (all the revisions I can manually select)

Error: "Tree conflict: The last merge operation tried to add the file 'bugfix.txt', but the file was obstructed in the working copy."

TortoiseSVN allows me to select Revision 6 for merging even though it makes no sense to merge this change because it is already contained in the target branch because it was initially commited there in Revision 5. Why does TortoiseSVN not handle this automatically? Is cherry-picking/merging single commits between the trunk and a feature branches not supported?

Spacy
  • 85
  • 10
  • How did you merge the bugfix.conf file with the trunk? – royalTS Aug 30 '17 at 17:32
  • What svn client and server version do you use? – bahrep Aug 31 '17 at 07:47
  • I used the latest TortoiseSVN 1.9.7 on the client side and the Server is a fresh installation of the latest VisualSVN Server 3.6.4 with a brand new repository. – Spacy Aug 31 '17 at 09:39
  • @royalTS First I "switch" my local working copy to "/trunk" then I right clicked on the local working copy and selected "TortoiseSVN->Merge...". In the dialog that appeared I selected "Merge a range of revisions". In the text box "URL to merge from" I enter "https://andrethinkpad/svn/test2/branches/featureA" and for "Revision range to merge" I select "specific range" and "4". The I leave the next dialog at defaults and accept. The merge succeeds. Then I select the working copy in Windows Explorer and commit it ("SVN Commit..."). I edited my question to include screenshots of the merge dialog. – Spacy Aug 31 '17 at 10:03
  • 1
    @Spacy Then I suppose the problem comes from the fact, that you did not merge the revision 3 as well. I would try to do the same thing and this time leave the revision range empty. SVN then automatically calculates the revision range. Then you should not encounter the later problem that the revision 3 was not merged (synced). – royalTS Aug 31 '17 at 12:17
  • @royalTS Thank you, merging revision 3 as well fixed the later problem I described. Unfortunately, if between revisions 3 and 4 I would have done a commit where I add a file that should never get into the trunk, I still get problems later on if I want to skip that commit from reaching trunk: Error: Reintegrate can only be used if revisions 3 through 7 were previously merged from https://andrethinkpad/svn/test4/branches/featureA to the reintegrate source, but this is not the case: trunk Missing ranges: /branches/featureA:4 I will edit my question to include that new commit. – Spacy Sep 01 '17 at 09:45
  • @spacy if the additional file should never reach the trunk, then delete it before reintegration. I would recommend to make it not to complicated. Just create a branch work with it as needed, maybe sync with trunk sometime and in the end prepare the branch for reintegration and the reintegrate him. In most cases you can let SVN decided which versions should be merged all the way – royalTS Sep 01 '17 at 15:22

0 Answers0