-->

为什么在有警卫搁置检查不会影响挂起的变化?(Why checking in a gated shel

2019-10-21 04:40发布

我使用的门控签入一个几乎空白的工作流程,只是为了了解内部运作播放。

这里是我的情况:

  1. 做出改变。
  2. 入住,触发门控签入 - 工作流什么都不做。
  3. 转到与门控签入相关的代理及玩了一下与搁置 - 见下文。

所以,我创建了一个新文件(1.txt的),并检查了它的变化记录在一个新的搁置,现在我要代理,并首先确保没有任何变化是有,并且搁置可用:

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)

到目前为止好 - 没有变化,该文件不存在,搁置已准备就绪。 现在我unshelving搁置:

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命令显示正确的挂起的更改和新的文件被创建。 接下来,我检查搁置:

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>

看起来不错 - 该文件是存在的,一个新的变更被添加到历史和搁置被删除。

然而,这部分我不明白,还存在着悬而未决的变化:

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> 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做当然没什么,)

这是可怕的。 我一定是混乱的东西,因为它不能是这样的设计。

请解释给我什么我收到错在这里。

Answer 1:

这是所有关于容器,搁置集和工作区。

  • 创建文件,并提交到搁置(容器A)。
  • 然后,后藤生成代理和获取搁置到本地工作区(容器B)
  • 然后,您提交搁置(从容器A到源控制)从容器中的检查是成功的和容器中的被删除,以反映封闭式搁置已完成它的生命周期(如果失败,将保持不变)
  • 然后,再回到工作区代理(容器B),你有没有做过任何工作,因为unshevling文件。

所以在这一点上,你有一个New是TFS注意到作为一个悬而未决的文件ADD的(它没有在源代码控制存在,但(没有其他人可以访问它,它只存在于你的工作空间(容器B),当你由于从容器A中的检入没有操纵它)

撤消文件是消除对您的工作区文件的ADD Not the same file that was commited from the shelveset ,但现在在TFS文件具有相同的名称为您在当地的工作空间(容器B)有一个。 所以TFS做什么它认为是正确的,并从源代码管理的一个替换本地文件。

如果您正在使用TFS2010工作按标签,然后这个声音是正确的,你将与服务器的工作区,所以只能更改/那TFS已经被通知将被检测挂起的编辑合作。 在二千零十三分之二千零一十二本地工作区可以使用能够检测已通过用户而不TFS被通知完成在工作区中的变化。



文章来源: Why checking in a gated shelveset does not effect the pending changes?
标签: tfs tfs2010