什么是TFS货架?

    技术2022-07-16  90

    本文翻译自:What is Shelving in TFS?

    Is shelving in TFS merely a soft checkin so other team members can see the source code? 托管在TFS中仅仅是一个软签入,所以其他团队成员可以看到源代码?

    ie the shelved code will not be compiled right? 即搁置的代码不会被编译好吗?


    #1楼

    参考:https://stackoom.com/question/2KtZ/什么是TFS货架


    #2楼

    One point that is missed in a lot of these discussions is how you revert back on the SAME machine on which you shelved your changes. 在很多这些讨论中遗漏的一点是你如何恢复你搁置你的更改的SAME机器。 Perhaps obvious to most, but wasn't to me. 对大多数人来说也许是显而易见的,但对我来 I believe you perform an Undo Pending Changes - is that right? 我相信您执行撤消待定更改 - 是吗?

    I understand the process to be as follows: 我理解的过程如下:

    To shelve your current pending changes, right click the project, Shelve, add a shelve name 要搁置当前挂起的更改,请右键单击项目Shelve,添加搁置名称 This will save (or Shelve) the changes to the server (no-one will see them) 这将保存(或搁置)对服务器的更改(没有人会看到它们) You then do Undo Pending Changes to revert your code back to the last check-in point 然后,您可以执行“撤消待处理更改”以将代码还原为最后一个登记点 You can then do what you need to do with the reverted code baseline 然后,您可以执行恢复代码基线所需的操作 You can Unshelve the changes at any time (may require some merge confliction) 您可以随时取消隐藏更改 (可能需要一些合并冲突)

    So, if you want to start some work which you may need to Shelve, make sure you check-in before you start, as the check-in point is where you'll return to when doing the Undo Pending Changes step above. 因此,如果您想开始一些您可能需要搁置的工作,请确保在开始之前办理登机手续,因为登记点是您在执行上述撤消待处理更改步骤时返回的位置。


    #3楼

    @JaredPar: Yes you can use Shelvesets for reviews but keep in mind that shelvesets can be overwritten by yourself/others and therefore are not long term stable. @JaredPar:是的,您可以使用Shelvesets进行评论,但请记住,搁置集可以被自己/其他人覆盖,因此不会长期稳定。 Therefore for regulatory relevant reviews you should never use a Shelveset as base but rather a checkin (Changeset). 因此,对于监管相关的审查,您不应该使用Shelveset作为基础,而是使用checkin(Changeset)。 For an informal review it is ok but not for a formal (Eg FTA relevant) review! 对于非正式的审查,这是正常的,但不适用于正式(例如FTA相关)审查!


    #4楼

    If you're using Gated builds, when a build is triggered, it creates a shelveset of your workspace that is submitted for build. 如果您正在使用Gated构建,则在触发构建时,它会创建工作区的搁置集,并将其提交以进行构建。 If the build fails, the shelveset is rejected. 如果构建失败,则拒绝搁置集。 If the build is successful, a changeset is created and committed to TFS. 如果构建成功,则创建变更集并将其提交到TFS。 In either event, the person doing that check-in/build will have to reconcile the workspace, which is as simple as performing a Get Latest. 在任何一种情况下,执行该签入/构建的人员都必须协调工作区,这与执行Get Latest一样简单。


    #5楼

    Shelving is like your changes have been stored in the source control without affecting the existing changes. 搁置就像您的更改已存储在源代码管理中而不影响现有更改。 Means if you check in a file in source control it will modify the existing file but shelving is like storing your changes in source control but without modifying the actual changes. 意味着如果您在源代码管理中签入文件,它将修改现有文件,但搁置就像将更改存储在源代码管理中,但不修改实际更改。


    #6楼

    Shelving is a way of saving all of the changes on your box without checking in. The changes are persisted on the server. 搁置是一种在不签入的情况下保存盒子上所有更改的方法。更改将保留在服务器上。 At any later time you or any of your team-mates can "unshelve" them back onto any one of your machines. 在任何以后,您或您的任何队友都可以“取消”他们的任何一台机器。

    It's also great for review purposes. 它也非常适合审查目的。 On my team for a check in we shelve up our changes and send out an email with the change description and name of the changeset. 在我的团队办理入住手续时,我们会搁置我们的更改并发送一封电子邮件,其中包含更改说明和变更集的名称。 People on the team can then view the changeset and give feedback. 然后,团队成员可以查看变更集并提供反馈。

    FYI: The best way to review a shelveset is with the following command 仅供参考:审查搁置集的最佳方法是使用以下命令

    tfpt review /shelveset:shelvesetName;userName tfpt review / shelveset:shelvesetName; userName

    tfpt is a part of the Team Foundation Power Tools tfpt是Team Foundation Power Tools的一部分

    Processed: 0.012, SQL: 9