TFS 丢弃不适用于回滚变更集
我们遇到过这样的情况:工作已经在系统的主干中完成,但随后被拉到下一个版本。我们创建了一个分支,其中的更改仍在主干中,然后仅回滚主干中的更改。
但这留给我们的是,每当我们想要用最近的工作更新分支时,它都会尝试合并我们不想要的回滚变更集。
我尝试在 TFS 命令提示符下使用 /discard 命令,但不断收到“没有要合并的更改”。下面是我的语法:
D:\Projects\Big Project\Trunk>tf merge /discard /version:C28350~C28350 /recursive "D:\Projects\Big Project\Trunk" "D:\Projects\Big Project\Branch"
我什至尝试切换源和目标,但无济于事:)
该变更集出现在从主干到分支的潜在合并的候选变更集列表中。自初始分支以来,已经对工作分支进行了几次签入,但没有对分支进行签入。
有谁有丢弃命令的经验以及为什么它可能无法在这里工作?
感谢您的建议
We have a situation where work had been done in the trunk of our system but was then pulled for our next release. We created a branch with the changes still in the trunk and then rolled back the changes in the trunk only.
What that's left us with though is that whenever we want to update the branch with recent work from working, it tries to merge the rollback changesets which we don't want.
I've tried using the /discard command from the TFS command prompt but keep getting "There are no changes to merge". Here is my syntax below:
D:\Projects\Big Project\Trunk>tf merge /discard /version:C28350~C28350 /recursive "D:\Projects\Big Project\Trunk" "D:\Projects\Big Project\Branch"
I even tried switching around the source and the destination to no avail :)
The changeset appears in the list of candidate changesets for the potential merge from trunk to branch. There have been a few checkins to the working branch since the initial branching but none to the branch.
Does anyone have experience with the discard command and why it may not be working here??
Thanks for your suggestions
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
通读
tf rollback
MSDN 选项 < code>/keepmergehistory 正是针对这些场景。 (请参阅帮助doco末尾的相关示例)。您的情况有所不同,以下是我将遵循的步骤(省略命令提示符):
有关步骤的注释:
不使用
/discard
选项检查该更改,即使您对此不感兴趣;记下下一步中 XXXX 的变更集编号...
现在回滚该特定更改,并使用
/keepmergehistory
以便 TFS 不会再次询问您有关合并此更改的信息。< /p>或者,您应该能够回滚主干中的回滚,然后使用此标志重新应用 - 但我不确定
/keepmergehistory
是否可以双向工作..这里是:(不确定我正确地将参数放在那里...)希望这有帮助:-)
Reading through
tf rollback
MSDN the option/keepmergehistory
is there exactly for these scenarios. (Please see the relevant example at the end of the help doco).Your scenario is different, here are the steps I would follow (command prompt omitted):
Comments about the steps:
Without the
/discard
optionCheck that change in, even though you're not interested in it; note the changeset number for the XXXX in the next step...
Now rollback that particular change, and use
/keepmergehistory
so that TFS won't ever ask you again about merging this change.Alternatively, you should be able to rollback the rollback in the trunk, then re-apply with this flag - but I'm not sure the
/keepmergehistory
works both ways.. here goes: (not sure I put the parameters there correctly...)Hope this helps :-)
这可以通过告诉 TFS 在执行合并时忽略历史记录来完成。换句话说,可以使用无基础合并来完成:
This can be accomplished by telling TFS to ignore history while performing the merge. In other words, it can be done using a baseless merge: