首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >为什么签入门控搁置集不会影响挂起的更改?

为什么签入门控搁置集不会影响挂起的更改?
EN

Stack Overflow用户
提问于 2014-10-23 20:56:14
回答 1查看 2K关注 0票数 1

我正在玩门控签入使用几乎空的工作流程,只是为了了解内部工作。

下面是我的场景:

  1. 做个改变。
  2. 签入,触发门控签入-工作流什么也不做。
  3. 转到与门控签入相关的代理,并对搁置集进行一点播放-请参见下面。

因此,我创建了一个新文件(1.txt)并将其签入。更改记录在一个新的搁置集中,现在我要到代理中,首先确保没有任何更改,并确保搁置集是可用的:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
PS D:\tfs\DFGatedCheckInTest2> tf status /recursive
There are no pending changes.
PS D:\tfs\DFGatedCheckInTest2> dir 1.txt -ErrorAction SilentlyContinue
PS D:\tfs\DFGatedCheckInTest2> tf history ..\..\..\ /version:T /stopafter:1 /recursive /noprompt
Changeset User              Date       Comment
--------- ----------------- ---------- ------------------------------------------------------------------------------------------------------------------------
105631    DAYFORCE\mkhar... 10/24/2014
PS D:\tfs\DFGatedCheckInTest2> tf shelvesets "Gated_2014-10-24_12.09.49.4626;DAYFORCE\mkharitonov" /format:detailed
===============================================================================================================================================================
Shelveset: Gated_2014-10-24_12.09.49.4626
Owner    : DAYFORCE\mkharitonov
Date     : Friday, October 24, 2014 12:09:49 AM
Comment  :
  Adding 1.txt
PS D:\tfs\DFGatedCheckInTest2> tf status /shelveset:"Gated_2014-10-24_12.09.49.4626;DAYFORCE\mkharitonov"
File name Change User                 Shelveset
--------- ------ -------------------- -------------------------------------------------------------------------------------------------------------------------
$/DFDev/mark
1.txt     add    DAYFORCE\mkharitonov Gated_2014-10-24_12.09.49.4626

1 change(s)

到目前为止,没有变化,文件不存在,搁置集已经准备好了。现在我要拆下架子:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
PS D:\tfs\DFGatedCheckInTest2> tf unshelve "Gated_2014-10-24_12.09.49.4626;DAYFORCE\mkharitonov" /noprompt

$/DFDev/mark/1.txt:
   opened for add in CANWS212;DAYFORCE\mkharitonov
Unshelving add: 1.txt
PS D:\tfs\DFGatedCheckInTest2> tf status /recursive
File name Change Local path
--------- ------ ----------------------------------------------------------------------------------------------------------------------------------------------
$/DFDev/mark
1.txt     add    D:\TFS\DFGatedCheckInTest2\1.txt

1 change(s)
PS D:\tfs\DFGatedCheckInTest2> dir 1.txt


    Directory: D:\tfs\DFGatedCheckInTest2


Mode                LastWriteTime     Length Name
----                -------------     ------ ----
-a---        10/24/2014  12:16 AM          0 1.txt

同样,一切都如期而至-- status命令显示了正确的挂起的更改,并创建了新文件。接下来,我将检查搁置集:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
PS D:\tfs\DFGatedCheckInTest2>  tf checkin /shelveset:"Gated_2014-10-24_12.09.49.4626;DAYFORCE\mkharitonov" /bypass /force
Changeset #105632 checked in.
PS D:\tfs\DFGatedCheckInTest2> dir 1.txt


    Directory: D:\tfs\DFGatedCheckInTest2


Mode                LastWriteTime     Length Name
----                -------------     ------ ----
-a---        10/24/2014  12:16 AM          0 1.txt


PS D:\tfs\DFGatedCheckInTest2> tf history ..\..\..\ /version:T /stopafter:1 /recursive /noprompt
Changeset User              Date       Comment
--------- ----------------- ---------- ------------------------------------------------------------------------------------------------------------------------
105632    DAYFORCE\mkhar... 10/24/2014 Adding 1.txt
PS D:\tfs\DFGatedCheckInTest2> tf shelvesets "Gated_2014-10-24_12.09.49.4626;DAYFORCE\mkharitonov" /format:detailed
No shelvesets found matching Gated_2014-10-24_12.09.49.4626;DAYFORCE\mkharitonov
PS D:\tfs\DFGatedCheckInTest2>

看起来不错--文件在那里,一个新的变更集被添加到历史记录中,搁置集被删除。

然而,,这部分我不明白,还有一些悬而未决的更改:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
PS D:\tfs\DFGatedCheckInTest2> tf status /recursive
File name Change Local path
--------- ------ ----------------------------------------------------------------------------------------------------------------------------------------------
$/DFDev/mark
1.txt     add    D:\TFS\DFGatedCheckInTest2\1.txt

1 change(s)

为什么?

消除这个挂起的更改的唯一方法是撤消并显式地获取新的变更集:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
PS D:\tfs\DFGatedCheckInTest2> tf undo /noprompt /recursive .
Undoing add: 1.txt
PS D:\tfs\DFGatedCheckInTest2> dir 1.txt -ErrorAction SilentlyContinue


    Directory: D:\tfs\DFGatedCheckInTest2


Mode                LastWriteTime     Length Name
----                -------------     ------ ----
-a---        10/24/2014  12:16 AM          0 1.txt


PS D:\tfs\DFGatedCheckInTest2> tf status /recursive /noprompt
There are no pending changes.
PS D:\tfs\DFGatedCheckInTest2> tf status 1.txt
There are no pending changes.
PS D:\tfs\DFGatedCheckInTest2> tf history 1.txt /noprompt
Changeset Change                     User              Date       Comment
--------- -------------------------- ----------------- ---------- ---------------------------------------------------------------------------------------------
105632    add                        DAYFORCE\mkhar... 10/24/2014 Adding 1.txt
PS D:\tfs\DFGatedCheckInTest2> tf get /version:C105632
D:\TFS\DFGatedCheckInTest2:
Getting 1.txt
PS D:\tfs\DFGatedCheckInTest2> dir 1.txt


    Directory: D:\tfs\DFGatedCheckInTest2


Mode                LastWriteTime     Length Name
----                -------------     ------ ----
-ar--        10/24/2014  12:44 AM          0 1.txt


PS D:\tfs\DFGatedCheckInTest2>

在这里,我不明白另外一件事。如果我已经撤消了更改,那么为什么1.txt仍然是版本的呢?我在这干嘛?

获得新的变更集,重写文件或只更改其最后的修改时间(从上午12:16更改为12:44 ),这也同样糟糕。实际上,假设我在取消搁置之后构建了无数个文件。现在,它们将在下一个门控签入中再次构建,因为源文件的最后修改时间戳是由tf get命令弹出的。(当然,第二个tf get /version:C105632什么也不做)

这太可怕了。我一定是把事情搞糊涂了,因为这不可能是故意的。

请向我解释我在这里出了什么错。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-10-24 00:27:48

这一切都是关于容器,架子和工作空间。

  • 创建文件并将其提交到搁置集(容器A)。
  • 然后转到构建代理,并将该Shelveset放到本地工作区(容器B)中。
  • 然后提交搁置集(从容器A到源代码管理),容器A的签入是成功的,容器A被删除,以反映封闭的shelveset已经完成了它的生命周期(如果失败,它将保持完整)
  • 然后回到代理工作区(Container ),在解压缩文件后,您还没有做过任何工作。

因此,此时您有一个New文件,TFS已经指出它是一个挂起的ADD (它在源代码管理中还不存在(没有其他人可以访问它,它只存在于您的工作区(容器B)中,因为您从容器A签入后就没有对它进行操作)

撤消该文件将删除工作区Not the same file that was commited from the shelveset中的文件添加,但现在在TFS中有一个文件的名称与您在本地工作区中的名称相同(容器B)。因此,TFS执行它认为正确的操作,并将您的本地文件替换为来自源代码管理的文件。

如果您正在按照标记使用TFS2010,那么这听起来是正确的,您将使用服务器工作区,因此只会检测到通知了TFS的更改/挂起编辑。在2012 /2013年,可以使用本地工作区来检测用户在没有通知TFS的情况下对工作区所做的更改。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26541731

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
查看详情【社区公告】 技术创作特训营有奖征文