Android Studio - unable to merge from SVN branch

Y.S

We have decided to follow the process of creating a new SVN branch for every new feature that we add to our mobile app. The ultimate goal behind this is to preserve the history for every single code change (this doesn't happen when we manually copy project folders into SVN instead of creating & merging branches).

My problem is that so far I am unable to merge changes from one branch to another.

I have already referred the following posts without success:

Here is what I have tried so far:

I have two feature branches as can be seen below in Tortoise SVN:

enter image description here

I want to merge the changes in the branch Feature_A3 into branch Feature_A2. To do this, I am using the Merge from option in Android Studio's VCS from the A2 working copy:

enter image description here

It then asks me to select the branch to merge from (A3) or configure other branches:

enter image description here

I click on Configure Branches, just to show you the existing branch config:

enter image description here

As you can see, A2 is the Trunk and A3 is the Branch. Is this correct?

It then asks me what part of A3 I want to merge into A2. I select the /src directory (where the relevant changes are present):

enter image description here

It then generously gives me three different ways to perform the merge operation:

enter image description here

I select the third option as it directly gives me the changes I need to merge:

enter image description here

I click on Merge Selected and BAM!!! I get this error every time:

enter image description here

There is no clue as to what the "unresolved conflicts" or "skipped items" are. Why am I getting this error, and what should I do to merge the changes in A3 into A2 ??? Can someone please help ? All answers will be appreciated. Thanks ...

I have been following the official Intellij IDEA documentation below:

Please note that:

  • Currently I am using Subversion, not Git.

  • The directory structure of my local working copies is not exactly identical to that of the SVN repos. Could this be the cause of the error ?

THE ANSWER ...

Thanks to Peter Parker and especially Yoav Aharoni for their valuable feedback. As Yoav correctly pointed out, it was indeed the manner in which the branch locations folder was specified. It needs to be the folder containing the branches, not the branch folders themselves: And as Peter rightly said, checking "Include merged revisions" shows the merged history. I am now able to merge from within the IDE itself, and view the merged history in TortoiseSVN. NO command line! YAY!!!

However, one last problem is that I am unable to view the merged history in Android Studio (Intellij IDEA) as described in Viewing Merge Sources. Does anyone know how to achieve this in Android Studio?

Yoav Aharoni

Phew, haven't used SVN in a while... :)

But from what I can remember Branch locations should be the folder containing your branches folders (and not each individual branch folder).

You see, typically a SVN repo follows a standard naming convention and folder structure:

trunk/
branches/
  Feature_A2/
  Feature_A3/
tags/
  v1.01/
  v1.02/

and so on...

trunk is where the main development takes place, and branches are for features, long-term or risky projects, or for different stages (such as QA and pre-prod).

So, as far as I remember, Android Studio expects you to set Branch locations to branches folder. In your case I think it should be http://192.168.0.64/svn/.../Android/Feature.

Also, your trunk is not Feature_A2 - Feature_A2 is just another branch.
Although I can't see the content, I think http://192.168.0.64/svn/.../Android/Development might be your trunk.

Which shouldn't bother you much, since you don't have to merge to your trunk, you can also merge between branches (e.g. merge Feature_A3 into Feature_A2).

So, to recap:

  1. Although not mandatory, I recommend renaming your folders to match the conventions (you can easily do it by right clicking in Tortoise SVN, but only AFTER all teammates commit, otherwise merge will be a HELL for them).
  2. Try setting Branch locations to http://192.168.0.64/svn/.../Android/Feature
  3. And Trunk to http://192.168.0.64/svn/.../Android/Development (only if it indeed contains sources, similar to Feature_A2/3)
  4. Consider "tagging" your releases in a tags folder (it's pretty much just copying the trunk/branch folder to tags, but you have a command for that).

    If you do so, you can also add tags folder to Branch locations, that way you'll be able to compare your current source with any previous release (which is handy).

P.S: "unresolved conflicts" error can also mean you have unresolved conflicts (duh :)). Conflicts are are usually created when both you and a teammate change the same lines in file (or if he deletes a file you changed) and you update to get his changes.

SVN won't let you merge until you manually resolve these conflicts/changes.

You can find conflicts in the Version Control tab at the bottom, they'll be mark in red.
(But I don't think that was the problem in your case)


Let me know if that works for you!

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How do merge specific svn revisions from branch to trunk in Android Studio 2.0

From Dev

Reintegrating from branch to trunk, then merge back into branch in SVN .. what happens?

From Dev

svn to merge trunk into branch

From Dev

svn to merge trunk into branch

From Dev

Unable to merge branch in in-house TFS GIT from Visual Studio 2013

From Dev

Svn can't merge a directory move operation from trunk to branch

From Dev

SVN automatic merge from trunk to branch by specifying JIRA ticket id

From Dev

Merge Local Branch with Remote Branch using Git in Android Studio

From Dev

How to merge SVN branch to trunk?

From Dev

SVN replace branch with another - NO merge

From Dev

SVN Branch To Trunk Merge Issue

From Dev

Create a Tag and Merge with a branch SVN

From Dev

svn merge with renamed directory in branch

From Dev

merge svn feature branch to release branch

From Dev

Unable to merge Dex in Android Studio 3.0

From Dev

Android studio Unable to merge dex only on rebuild

From Dev

Android studio/IntelliJ import project from svn

From Dev

Merge or Rebase or Branch Default In Android Studio? What are the differences?

From Dev

Android Studio Update Project: Merge vs Rebase vs Branch Default

From Dev

Android Studio - checkout a *branch* from GitHub

From Dev

svn merge from trunk

From Dev

Tortoise SVN - Merge Trunk into Branch - Tree Conflict

From Dev

SVN Merge branch to trunk with ignored versioned files

From Dev

SVN - Merge working copy into another branch

From Dev

SVN Switch from branch to trunk

From Dev

GIT SVN: fetching a recreated SVN branch without the wrong merge parent

From Dev

Git-svn: how to partially merge svn-branch in git

From Dev

Migrating SVN to Android Studio

From Dev

SVN merging with android studio

Related Related

  1. 1

    How do merge specific svn revisions from branch to trunk in Android Studio 2.0

  2. 2

    Reintegrating from branch to trunk, then merge back into branch in SVN .. what happens?

  3. 3

    svn to merge trunk into branch

  4. 4

    svn to merge trunk into branch

  5. 5

    Unable to merge branch in in-house TFS GIT from Visual Studio 2013

  6. 6

    Svn can't merge a directory move operation from trunk to branch

  7. 7

    SVN automatic merge from trunk to branch by specifying JIRA ticket id

  8. 8

    Merge Local Branch with Remote Branch using Git in Android Studio

  9. 9

    How to merge SVN branch to trunk?

  10. 10

    SVN replace branch with another - NO merge

  11. 11

    SVN Branch To Trunk Merge Issue

  12. 12

    Create a Tag and Merge with a branch SVN

  13. 13

    svn merge with renamed directory in branch

  14. 14

    merge svn feature branch to release branch

  15. 15

    Unable to merge Dex in Android Studio 3.0

  16. 16

    Android studio Unable to merge dex only on rebuild

  17. 17

    Android studio/IntelliJ import project from svn

  18. 18

    Merge or Rebase or Branch Default In Android Studio? What are the differences?

  19. 19

    Android Studio Update Project: Merge vs Rebase vs Branch Default

  20. 20

    Android Studio - checkout a *branch* from GitHub

  21. 21

    svn merge from trunk

  22. 22

    Tortoise SVN - Merge Trunk into Branch - Tree Conflict

  23. 23

    SVN Merge branch to trunk with ignored versioned files

  24. 24

    SVN - Merge working copy into another branch

  25. 25

    SVN Switch from branch to trunk

  26. 26

    GIT SVN: fetching a recreated SVN branch without the wrong merge parent

  27. 27

    Git-svn: how to partially merge svn-branch in git

  28. 28

    Migrating SVN to Android Studio

  29. 29

    SVN merging with android studio

HotTag

Archive