使用Team Foundation Server中的Team Foundation版本控制将分支的最新版本合并到其根中

我们在尝试使用Visual Studio 2017中的Team Foundation版本控制进行合并时遇到了问题,我们不知道这样做是否可行,甚至不明智。

我将解释我的问题的简化版本:

我们在Source Control中有一个根分支,我们称它为Root,我们有一个Root分支,我将其称为Branch。

我们正在对Branch进行更改,并且当我们确定要在Root上进行更改时,我们将从Branch合并到Root(我们执行反向集成)。事实是,过去我们进行了一些合并,在该分支中,我们只选择了Branch中变更集的一个子集来将它们合并到Root中。

现在,在对Branch进行其他一些更改之后,我们知道Branch的最新版本正在运行,并且我们希望将该版本合并到Root中。

问题是,当我们进行合并时,它将采用修改该文件的最后一个变更集上的文件版本,并且该变更集未合并到Root中。但是我们知道,Branch中该文件的最后一个版本是我们想要的版本,即使它没有出现是因为以前可以合并处于该状态的更改集(实际上,大多数tieme,最后一个该文件在“分支”和“根目录”中的版本完全相同,我们不希望对此进行更改。

示例:

我们将Changeset 1制作为Branch,然后将其合并到Root。

我们将Changeset 2设置为Branch,修改File1(但不将其合并到Root中)。

我们将Changeset 3设置为Branch,再次修改File1,然后将其合并到Root中。现在Branch和Root具有相同版本的File。

我们将Changeset 4、5、6设置为Branch,与File1无关。

现在我们要做的是将分支中的任何文件的最新版本合并到Root中。

但是,如果我尝试将Branch合并到Root中,它将提示存在冲突,并且在“冲突解决器”中显示的内容是:

以Changeset 2之后的文件1作为源(即在没有合并到最后一个Changeset之后的文件版本),并且

作为目标的根目录中的File1(并且恰好与我在上一个Branch版本中具有的File1完全相同,并且我想保持这种方式)。

顺便说一句,我们是否标记“选择所有更改直到...”为最新版本,更改集(使用最新版本),日期(现在),工作区等,还是“选定的更改集”都没关系。 ”,然后选择所有内容(当然,以前合并的内容不会出现在这里)。 是否通过某种方式告诉Source Control,无论先前是否合并了变更集,我们都希望将Branch中每个文件的最新版本合并到Root中?这一切都有意义吗?还是我错过了什么?

sdadaadfaaf 回答:使用Team Foundation Server中的Team Foundation版本控制将分支的最新版本合并到其根中

TFS合并引擎依赖于历史记录,而不是文件内容。您可以检查 private fun openDownloadLinkAndKill(url: String) { Log.d("test","url: $url") // startActivity(Intent(Intent.ACTION_VIEW,Uri.parse(url))) // val promptInstall = Intent(Intent.ACTION_VIEW).setDataAndType(Uri.parse(url),"application/vnd.android.package-archive") // startActivity(promptInstall) //get destination to update file and set Uri //TODO: First I wanted to store my update .apk file on internal storage for my app but apparently android does not allow you to open and install //aplication with existing package from there. So for me,alternative solution is Download directory in external storage. If there is better //solution,please inform us in comment var destination = "${Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)}/" Log.d("test","$destination") val fileName = "my_android.apk" destination = "$destination$fileName" val uri = Uri.parse("content://$destination"); //Delete update file if exists val file = File(destination); if (file.exists()) //file.delete() - test this,I think sometimes it doesn't work file.delete() //set downloadmanager val request = DownloadManager.Request(Uri.parse(url)) request.setDescription("App is updating.") request.setTitle(APPLICATION_NAME) //set destination request.setDestinationUri(uri) // get download service and enqueue file val manager = getSystemService(Context.DOWNLOAD_SERVICE) as DownloadManager val downloadId = manager.enqueue(request) //set BroadcastReceiver to install app when .apk is downloaded val onComplete: BroadcastReceiver = object : BroadcastReceiver() { override fun onReceive(context: Context?,intent: Intent?) { val install = Intent(Intent.ACTION_VIEW) install.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP install.setDataAndType(uri,manager.getMimeTypeForDownloadedFile(downloadId)) startActivity(install) unregisterReceiver(this) finish() } } //register receiver for when .apk download is compete registerReceiver(onComplete,IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE)); overridePendingTransition(R.anim.abc_fade_in,R.anim.abc_fade_out) MyApp.getInstance().killAllActivities(this) } 命令以列出源中尚未合并到目标中的变更集。并使用java.lang.IllegalArgumentException: Not a file URI: content:///storage/emulated/0/Download/my_android.apk 合并更改。检查以下链接:

https://docs.microsoft.com/en-us/azure/devops/repos/tfvc/merge-command?view=azure-devops

顺便说一句,总会有一些情况需要手动合并。

本文链接:https://www.f2er.com/2769828.html

大家都在问