Android的工作室 - 无法从SVN分支合并 [英] Android Studio - unable to merge from SVN branch

查看:1827
本文介绍了Android的工作室 - 无法从SVN分支合并的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经决定要遵循,我们加入到我们的移动应用程序每一个新功能创建一个新的分支SVN的过程。这背后的最终目标是preserve史为每一个code更改(当我们手动复制项目文件夹到SVN,而不是创建和放大器不会发生这种情况;合并分支)。

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.

我已经提到以下职位没有成功:

Android的工作室更新项目:合并衍合VS VS分公司默认

如何合并分行SVN与Android工作室

如何从分支合并的具体SVN修订干线Android Studio中2.0

这里是我到目前为止已经试过:

Here is what I have tried so far:

我有两个特性分支可以看出下方乌龟SVN

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

在这里输入的形象描述

我要在分支机构的 Feature_A3 的修改合并到分支的 Feature_A2 。要做到这一点,我使用Android Studio中的VCS从A2工作拷贝合并选项:

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:

在这里输入的形象描述

然后,它要求我选择分支从(A3)合并或配置其他分支:

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

在这里输入的形象描述

我点击配置分行,只是向你展示现有的分支配置:

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

在这里输入的形象描述

正如你所看到的,A2是的干线的和A3是的的。 这是正确的?

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

,然后会询问我,我要合并到A2 A3哪一部分。我选择 / src目录目录(其中相关的变化是present):

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):

在这里输入的形象描述

然后,它慷慨地给了我三种不同的方式进行合并操作:

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

在这里输入的形象描述

我选择第三个选项,因为它直接给我,我需要合并更改:

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

在这里输入的形象描述

我点击合并所选 BAM!每次我得到这个错误:

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

在这里输入的形象描述

有没有线索,什么是未解决的冲突或跳过项目是。为什么我得到这个错误,而我应该怎么办合并的变化A3到A2?是否有人可以帮忙吗?所有的答案将是AP preciated。谢谢...

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 ...

我一直在关注低于官方的IntelliJ IDEA文档:

I have been following the official Intellij IDEA documentation below:


  • <一个href=\"https://www.jetbrains.com/help/idea/2016.1/integrating-changes-to-from-feature-branches.html?origin=old_help\"相对=nofollow> 集成更改到/从功能
    分行

<一个href=\"https://www.jetbrains.com/help/idea/2016.1/merging-deleting-and-comparing-branches.html?origin=old_help\"相对=nofollow> 合并,删除和比较
分行

请注意:

Please note that:


  • 目前我使用的颠覆,不混帐。

  • Currently I am using Subversion, not Git.

我的本地工作副本的目录结构是不完全
相同的,SVN回购协议的。难道这是错误的原因是什么?

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 ?

答案...

感谢彼得·帕克特别的约阿夫Aharoni 的宝贵意见。由于约阿夫正确地指出的那样,它的确是在指定的分支机构文件夹的方式。它需要包含分支的文件夹,而不是分支文件夹本身:正如彼得说得很有道理,选中包含合并版本显示的是合并后的历史。我现在可以从IDE本身合并,并查看合并历史TortoiseSVN的。
没有命令行! YAY !!!

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!!!

不过,最后一个问题是,我无法查看合并后的历史中的查看合并来源。有谁知道如何在Android Studio中实现这一目标?

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?

推荐答案

唷,没有在使用了一段时间SVN ...:)

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).

您看,通常是SVN回购遵循一个标准的命名规则和文件夹结构:

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...

主干是主要的发展发生,而分支是功能,长期或风险项目,或针对不同阶段(如QA和pre-PROD)。

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).

所以,据我记得,Android的工作室希望你设置分支机构分支文件夹中。你的情况,我认为它应该是 http://192.168.0.64/svn/.../Android/Feature

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.

另外,你的主干不是 Feature_A2 - Feature_A2只是另一个分支结果
虽然我不能看到的内容,我觉得 http://192.168.0.64/svn/.../Android/Development 可能是你的躯干。

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.

该不该打扰你了,因为你不必合并你的躯干,你也可以分支之间的合并(例如合并Feature_A3到Feature_A2)。

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. 虽然不是强制性的,我建议重新命名文件夹,以匹配约定(你可以很容易地通过右击做在乌龟SVN,但只有在所有队友的提交,否则合并将是他们的地狱)。

  2. 尝试设置分支机构 http://192.168.0.64/svn/.../Android/Feature

  3. 干线 http://192.168.0.64/svn/.../Android/Development (只有当它确实包含源码,类似Feature_A2 / 3)

  4. 考虑在标签贴标签的发布文件夹(它的pretty简单,只是复制主干/分支文件夹标签,但你有一个该命令)。

  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).

如果你这样做,你也可以添加标记文件夹分支机构,这样,你会能够比较当前的任何previous释放源(这是很方便的)。

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:未解决的冲突的错误也意味着你有未解决的冲突(咄:))。冲突通常被创建时,你和队友更改文件的同一行(或者,如果他删除了一个文件,你改变),并更新得到他的变化。

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不会让你合并,直到手动解决这些冲突/更改。

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!

这篇关于Android的工作室 - 无法从SVN分支合并的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆