last local or current changeset id

坚强是说给别人听的谎言 提交于 2019-12-11 08:28:37

问题


This question is related to the last change set id available in TFS, my query is , our tfs collection has multiple branches.I create a work space for each branch and build them.

Now my question is: i wanted to know the last local changeset id of the workspace with which i builded the solution.

For example, i build MAIN branch 2 days back, now i wanted to know the last local change set id that is available locally. I used History command but some how it is giving the server changeset not the local changeset id. Please help me in solving the problem.

here is my arguments

tf history  $/MAIN /collection:tfscollection /format:Detailed /sort:Descending /stopafter:1" ;

thanks and best regards, vidya.


回答1:


In this case, you want to look at the history of your workspace version. TFS tracks (server-side) the versions of files you have locally and defines your workspace version to be the version of the files that you have locally. Contrast that with the latest version which is the current version on the server.

You can use a version spec to indicate what version you want to query, T for the latest version and W for your workspace version.

Another problem, however, is that your current query will only look at the history for the folder you're specifying - that is, when it was added or branched. You will need to perform a recursive query to example all changesets that affect (are beneath) the specified folder.

Thus, your query to get the latest version on the server becomes:

tf history $/MAIN /collection:tfscollection /version:T /recursive /stopafter:1 /format:detailed /noprompt

And to get your workspace version:

tf history $/MAIN /collection:tfscollection /version:W /recursive /stopafter:1 /format:detailed /noprompt


来源:https://stackoverflow.com/questions/17275709/last-local-or-current-changeset-id

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!