TFS 丢弃不适用于回滚变更集

发布于 2024-12-05 00:27:13 字数 520 浏览 0 评论 0原文

我们遇到过这样的情况:工作已经在系统的主干中完成,但随后被拉到下一个版本。我们创建了一个分支,其中的更改仍在主干中,然后仅回滚主干中的更改。

但这留给我们的是,每当我们想要用最近的工作更新分支时,它都会尝试合并我们不想要的回滚变更集。

我尝试在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

椒妓 2024-12-12 00:27:13

通读 tf rollback MSDN 选项 < code>/keepmergehistory 正是针对这些场景。 (请参阅帮助doco末尾的相关示例)。

您的情况有所不同,以下是我将遵循的步骤(省略命令提示符):

tf merge /version:C28350~C28350 /recursive "D:\Projects\Big Project\Trunk" "D:\Projects\Big Project\Branch"

tf checkin /recursive "D:\Projects\Big Project\Branch"

tf rollback /version:XXXX /recursive /keepmergehistory "D:\Projects\Big Project\Branch"

有关步骤的注释:

  1. 不使用 /discard 选项

  2. 检查该更改,即使您对此不感兴趣;记下下一步中 XXXX 的变更集编号...

  3. 现在回滚该特定更改,并使用 /keepmergehistory 以便 TFS 不会再次询问您有关合并此更改的信息。< /p>

或者,您应该能够回滚主干中的回滚,然后使用此标志重新应用 - 但我不确定 /keepmergehistory 是否可以双向工作..这里是:(不确定我正确地将参数放在那里...)

tf rollback /version:C28350 /toversion:C28349 /recursive "D:\Projects\Big Project\Trunk"

tf rollback /version:XXXX /toversion:XXXX-1 /recursive /keepmergehistory "D:\Projects\Big Project\Trunk"

希望这有帮助:-)

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

tf merge /version:C28350~C28350 /recursive "D:\Projects\Big Project\Trunk" "D:\Projects\Big Project\Branch"

tf checkin /recursive "D:\Projects\Big Project\Branch"

tf rollback /version:XXXX /recursive /keepmergehistory "D:\Projects\Big Project\Branch"

Comments about the steps:

  1. Without the /discard option

  2. Check that change in, even though you're not interested in it; note the changeset number for the XXXX in the next step...

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

tf rollback /version:C28350 /toversion:C28349 /recursive "D:\Projects\Big Project\Trunk"

tf rollback /version:XXXX /toversion:XXXX-1 /recursive /keepmergehistory "D:\Projects\Big Project\Trunk"

Hope this helps :-)

糖粟与秋泊 2024-12-12 00:27:13

这可以通过告诉 TFS 在执行合并时忽略历史记录来完成。换句话说,可以使用无基础合并来完成:

D:\Projects\Big Project\Trunk>tf merge /discard /version:C28350~C28350 /recursive /baseless "D:\Projects\Big Project\Trunk" "D:\Projects\Big Project\分支”

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:

D:\Projects\Big Project\Trunk>tf merge /discard /version:C28350~C28350 /recursive /baseless "D:\Projects\Big Project\Trunk" "D:\Projects\Big Project\Branch"

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文