perforce 是否跟踪变更集特有的增量,还是只存储整个文件?
我尝试将开发人员在工作分支中所做的一些工作合并到稳定分支中。自从 STABLE 和 HEAD 分支的共同祖先分离以来,文件 a、b 和 c 已被更改了至少十几个变更集。
我预计,由于该开发人员在文件 a、b 和 c 中分别更改了五行,因此当我从 HEAD 集成到 STABLE 分支时,我会在待处理的变更集中得到他的更改,然后我可以查看并提交这些更改。
相反,它似乎已经采取了文件 A 发生的所有更改,因为这两个文件是分支的,并且应用了我同事的工作副本中也存在的所有这些更改。
换句话说,在强制变更集中似乎没有记录我的同事实际更改的内容与之前文件包含的内容。
如果我浏览提交的变更集,我可以看到同事的文件版本与前一个版本之间的差异。但是,这似乎并不能决定合并的内容。
变更集不是意味着“文件的修订版 X 和修订版 X+1 之间所做的一组更改”吗? 任何人都可以帮助我理解“集成变更集”的含义吗?事实上,Perforce 似乎并不跟踪更改,而是跟踪文件。
我完全有可能做错了所有事情,并且希望任何有关如何在 Perforce 工作分支和稳定分支之间准确、安全地合并的指示,而无需将您不想集成到的内容稳定的分支正在整合。似乎无论产品中实际进行的更改多么简单,合并实际上对我来说都不起作用。
I tried to merge some work that a developer did in a working branch to a stable branch. The files a, b, and c had been changed by at least a dozen changesets since the common ancestor of STABLE and HEAD branches were separated.
I expected that since this developer changed five lines in each of file a, b, and c, that when I integrated from the HEAD to the STABLE branch, I would get his changes in my pending changset, which I could then review and commit.
Instead, it seems that it has taken every change that happened to file A, since the two were branched, and applied all of those changes that also existed in my colleague's working copy.
In other words, there seems to be no record in a perforce changeset, of what my colleague actually changed, versus what the file before contained.
If I browse the submitted changesets, I can see the difference between my colleague's version of the file, and the immediately preceding version. But then, that does not, it seems, determine what goes into the merge.
Doesn't a changeset mean, "a set of changes made between rev X and revision X+1 of a file"?
Can anybody help me understand what it means to "integrate a changeset" when in fact, what it seems is that Perforce doesn't track changes, it tracks files.
It is entirely possible that I am doing everything wrong, and would appreciate any pointer as to how it is that you can can merge accurately and safely between Perforce working branches and stable branches, without stuff that you don't want to get integrated to the stable branch getting integrated. It seems that no matter how simple the changes that actually get made in the product, the merge does not actually work for me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Perforce 确实将以增量形式保存对文本文件的更改(每次提交更改时都会完整保存二进制文件)。听起来您在集成过程中没有正确限制修订范围。
您说工作分支“……自从……分支分离以来,至少被十几个变更集更改了”。我们将它们称为变更列表 1-12。如果我理解正确的话,您正在尝试集成在其中一个更改列表中所做的修改,而不是所有更改列表。
在简单的集成操作期间,Perforce 将假设您想要集成自分支创建以来已提交的所有更改。如果您只需要这些更改的子集,则必须指定修订范围。因此,如果您只想集成更改列表 11 和 12 之间发生的更改,则可以指定修订范围,如屏幕截图中所示。 (注意:修订范围是包含在内的,因此指定范围 11-12,正如我在此屏幕截图中所做的那样,实际上将包括变更列表 11 和 12 中的更改。如果您只想集成更改在变更列表 12 中,在修订范围的两个字段中输入 12。)
请注意,不可避免地出现的冲突可能难以解决,具体取决于分支分歧的程度以及变更的性质。
Perforce does save changes to text files as deltas (binary files get saved in their entirety every time a change is submitted). It sounds like you're not properly restricting the revision range during your integration.
You say the working branch has "...been changed by at least a dozen changesets since the ...branches were separated." Let's call them changelists 1-12. If I understand you correctly you are trying to integrate the modifications made in just one of those changelists, not all of them.
During a simple integration operation Perforce will assume you want to integrate all of the changes that have been submitted since the branch was made. If you only want a subset of these changes, you have to specify a revision range. So, if you just want to integrate the changes that occurred between changelist 11 and 12, you would specify that revision range as shown in the screen capture. (Note: the revision range is inclusive, so specifying a range of 11-12, as I do in this screen shot will actually include changes in changelists 11 and 12. If you just want to integrate the changes made in changelist 12, enter 12 in both fields of the revision range.)
Just be aware that the inevitable conflicts that arise may be difficult to resolve, depending upon how far the branches have diverged and the nature of the changes.
您能否更具体地说明您是如何进行集成的?我的猜测是,您可能已经将所有更改集成到该更改列表中,而不仅仅是该更改列表。如果是这样,您所需要做的就是指定相同的变更列表作为集成的上限和下限。
在可视客户端中这很容易做到,但我不确定您需要使用的确切命令行开关。
Could you be more specific on how you did the integration? My guess is that you probably have integrated all the changes up to that changelist instead of just that changelist only. If so all you need to do is to specify the same changelist as both the upper and lower limit of the integration.
It's very easy to do in the visual client, but I'm not sure of the exact command line switch you need to use.