Changeset 命令

Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019

Visual Studio 2019 |Visual Studio 2022

顯示和的相關信息,可讓您變更與變更集相關聯的屬性,例如批注和簽入附註。

必要條件

若要使用 changeset 命令,您必須將 [讀取 ] 權限設定為 [允許 ] 變更集中的任何檔案或資料夾,以便顯示完整資訊。 唯一可以修改與變更集相關聯之附注和批注的使用者,就是建立變更集的使用者,或是擁有 修改其他用戶變更 全域許可權的使用者。

如需詳細資訊,請參閱 預設 TFVC 許可權

語法

tf changeset [/comment:("comment"|@commentfile)] 
[/notes:("NoteFieldName"="NoteFieldValue"|@notefile)] [/noprompt][/collection:TeamProjectCollectionUrl]] 
[changesetnumber | /latest][/login:username,[password]]

參數

引數

Argument 說明
comment 提供簽入的相關批注。
@<commentfile> 指定磁碟上檔案的路徑,其中包含用於簽入的批注。
<NoteFieldName>=<NoteFieldValue> 設定簽入附註欄位的值。 您可以提供多個分號分隔 field=value 表達式。
@<notefile> 提供磁碟上檔案的路徑,該檔案包含每行一行一個的簽入記事域名和值。field=value
<TeamProjectCollectionUrl> 專案集合的 URL,其中包含您要顯示資訊或其屬性要修改之變更集的變更集,例如 http://myserver:8080/tfs/DefaultCollection
<username> 提供 選項的值 /user 。 您可以將這個自變數指定為 Domain\usernameusername
<changesetnumber> 識別要檢閱或修改的變更集。 無法與 /latest 搭配使用。

選項

選項 說明
/comment 以新的批註取代簽入程式期間建立的變更集批注。
/notes 提供一或多個簽入附註,以便與變更集產生關聯。
/latest 指定最新的變更集。 無法與 <changesetnumber> 搭配使用。
/noprompt 隱藏您輸入的任何提示。
/collection 指定專案集合。
/login 指定要向 Azure DevOps 驗證使用者的使用者名稱和密碼。

備註

變更集是一組已認可至 Team Foundation 版本控制伺服器的檔案和資料夾修訂,做為相同簽入事件的一部分。 如需詳細資訊,請參閱 使用變更集

您可以使用 changeset 命令來檢視變更集的屬性,並修改其屬性。 您可以使用 history 命令來判斷您想要取得相關信息的變更集。 如需詳細資訊,請參閱 記錄命令

如需如何使用 tf 命令行公用程式的詳細資訊,請參閱 使用Team Foundation版本控制命令

範例

下列範例會在 [Visual Studio Details for Changeset 8675309 - Source Files] 對話框中,以可編輯的格式顯示變更集8675309的詳細資訊,並將現有的批註取代為 [這是新的批注]。

c:\projects>tf changeset /comment:"This is a new comment." 8675309

輸入命令之後,在 [Visual Studio Details for Changeset 8675309 - Source Files ] 對話框中,選取 [ 儲存 ] 以將批注與變更集產生關聯。

下列範例提供兩個簽入附注,以與變更集產生關聯。

c:\projects>tf changeset /notes:reviewer=Jo;Security = checked 8675309

下列範例提供兩個簽入附註,其中包含值和名稱中的空格,以與變更集產生關聯。

c:\projects>tf changeset /notes:"Code Reviewer"="John Smith";"Security Reviewer"="Chen Yang" 8675309

下列範例會將檔案notes.txt中包含的簽入附註與變更集8675309產生關聯。

c:\projects>tf changeset /notes:@notes.txt 8675309

其中notes.txt的格式如下:

field1=value1;
field2=value that
spans multiple
lines;
field3 = value3;

下列範例會取代變更集的現有批註8675309,並在命令提示字元視窗中顯示變更集的相關信息。 此範例不會開啟 [Visual Studio 變更集 ] 對話方塊。

c:\projects>tf changeset /comment:"This is an automatically generated comment." /noprompt 8675309

下列範例會在命令提示字元視窗中顯示變更集8675309不可編輯的資訊。

c:\projects>tf changeset 8675309 /noprompt

範例輸出:

Changeset: 8675309
User: DOMAIN\JohnG
Date: 01/21/2004 21:03:45
Comment:  This check-in fixes issues in several features.  I also refactored some items in buf.c into a new file named bif.c because buf.c was too hard to parse.
Items:
    $/baz/proj/bif.c           Added
    $/baz/proj/buf.c          Modified, Renamed
Work Items:
    34527     The "Access Denied" message isn't descriptive enough.
    35628     The UI flickers when I press the '8', 'y', 'Ctrl', and 'End' buttons at the same time.
Check-in Notes:
    Code Reviewer:  ShellM
    Performance Reviewer: ShellM
    Security Reviewer: ShellM