我正在玩门控签入使用几乎空的工作流程,只是为了了解内部工作。
下面是我的场景:
因此,我创建了一个新文件(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)
到目前为止,没有变化,文件不存在,搁置集已经准备好了。现在我要拆下架子:
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
什么也不做)
这太可怕了。我一定是把事情搞糊涂了,因为这不可能是故意的。
请向我解释我在这里出了什么错。
发布于 2014-10-24 00:27:48
这一切都是关于容器,架子和工作空间。
因此,此时您有一个New
文件,TFS已经指出它是一个挂起的ADD
(它在源代码管理中还不存在(没有其他人可以访问它,它只存在于您的工作区(容器B)中,因为您从容器A签入后就没有对它进行操作)
撤消该文件将删除工作区Not the same file that was commited from the shelveset
中的文件添加,但现在在TFS中有一个文件的名称与您在本地工作区中的名称相同(容器B)。因此,TFS执行它认为正确的操作,并将您的本地文件替换为来自源代码管理的文件。
如果您正在按照标记使用TFS2010,那么这听起来是正确的,您将使用服务器工作区,因此只会检测到通知了TFS的更改/挂起编辑。在2012 /2013年,可以使用本地工作区来检测用户在没有通知TFS的情况下对工作区所做的更改。
https://stackoverflow.com/questions/26541731
复制相似问题