大型并行提交 [英] Large parallel commits

查看:68
本文介绍了大型并行提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于你们中的某些人来说,这听起来像是一个非常基本的问题,但我是新来的颠覆者,希望您就此问题提供建议:

This may sound like a very basic question to some of you but I am new to subversion and would like your advice on this question:

我应该如何处理如果B人也修改并在我之前提交了他的更改,那么花了几天时间才能完成的大型提交?

How should I handle a large commit that took several days of work to code if person B also modified and committed his changes before me? His commit concerned the same files as me.

总而言之,工作流程如下:

To sum up, here is the workflow:


  • 基于版本1提交A,尚未推送

  • 基于版本0的提交B,已经推送,创建版本2

给定版本1和版本2之间已更改的代码量,推送提交A是否有风险?

Is it risky to push commit A given the amount of code that has been changed between rev.1 and rev.2?

很抱歉出现noob问题,但我只是想避免破坏项目的代码。最坏的情况是,我重写了代码的一部分,之前检查了版本2的存储库。

Sorry for the noob question but I just want to avoid breaking the project's code. Worst case scenario, I rewrite my part of the code, checking out the repo to rev.2 before.

推荐答案

SVN不会如果检测到您要提交的任何文件自上次更新以来都是由其他人提交的,则允许您进行提交。相反,它会出错,并显示一条错误消息,告诉您在提交之前需要进行 svn更新。当您执行 svn更新时,其他人的更改将被集成到您的本地文件中,而不会丢失任何数据,并且一旦您确认一切仍然有效,就可以继续进行自己的提交。

SVN won't allow you to do a commit if it detects that any of the files you want to commit were committed by someone else since the last time you updated. Instead, it will error out with an error message telling you that you need to do an "svn update" before committing. When you do the "svn update", the other person's changes will be integrated into your local files without any data loss, and once you've verified that everything still works, you can go ahead and do your own commit.

这不太冒险;最坏的情况是,如果另一个人在您所做的相同文件中修改了很多相同的行;在这种情况下, svn更新将导致冲突,您必须进入有冲突的文件,手动编辑它们以选择要保留的行以及要删除的行(文件将同时包含您的版本和这些行的其他版本,并且它们会在文件中清楚地标记出来,因此这听起来并不那么糟糕),然后对有冲突的文件执行 svn解析,以使SVN知道您已经照顾好冲突。之后,您可以像往常一样编译,测试和提交代码。

This isn't too risky; the worst-case scenario would be if the other guy modified a lot of the same lines in the same files that you did; in that case, the "svn update" will result in conflicts and you will have to go into the conflicted files, manually edit them to choose which lines you want to keep and which to get rid of (the files will contain both your version and the other guy's version of these lines, and they will be clearly marked in the file, so this isn't as bad as it sounds), and then do an "svn resolved" on the conflicted files to let SVN know that you've taken care of the conflicts. After that you can compile, test, and commit your code as usual.

这篇关于大型并行提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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