2008-11-06 20 views
2

當我在VS2008中右鍵點擊一個解決方案並選擇檢入時...我帶有一個帶有複選框和註釋區域的已更改文件列表。 (這是針對TFS完成的。)在VS2008/TFS中掛起更改的文件列表到剪貼板

我們的檢入過程要求我們將這個已更改文件列表輸入到錯誤跟蹤標籤。這需要輸入每個文件的名稱:耗時且容易出錯。

理想情況下,我希望能夠選擇該列表並將其複製到剪貼板,以便將其粘貼到缺陷跟蹤系統中。

有沒有人有辦法讓我可以輕鬆地將該列表放入剪貼板?

回答

2

我使用SnagIt這樣的事情,它真的是一個了不起的應用程序。他們有非免費版本和免費版本(說明here)。誠實地說,我不知道我沒有這樣的生活。

它的功能之一是能夠從窗口(如Windows資源管理器文件夾視圖)刮取文本,這可能會滿足您的需求。

1

爲什麼不把截圖(alt + Prnt Scrn)的檢入對話框上傳到bug跟蹤系統?

+0

我曾經想過這件事,並且很想去,但那已經被排除了 - 謝謝你的想法。 – Guy 2008-11-06 18:10:53

2

我不知道沒有標準的方式,怎麼做。但是你可以創建一個工具來做到這一點。

  string strServer = startInfo.Server; 
      string strWorkspace = startInfo.Workspace; 

      Microsoft.TeamFoundation.Client.TeamFoundationServer tfsServer = null; 
      if (false == string.IsNullOrEmpty(strServer)) { 
       tfsServer = new Microsoft.TeamFoundation.Client.TeamFoundationServer(startInfo.Server); 
       tfsServer.Authenticate(); 
      } 

      Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer vcServer = null; 
      if (tfsServer != null) { 
       object obj = tfsServer.GetService(typeof(Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer)); 
       vcServer = obj as Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer; 
      } 

      Microsoft.TeamFoundation.VersionControl.Client.Workspace workspace = null; 
      if (tfsServer != null && vcServer != null && false == string.IsNullOrEmpty(strWorkspace)) { 
       workspace = vcServer.GetWorkspace(strWorkspace, tfsServer.AuthenticatedUserName); 
      } 

      List<string> pendingItems = new List<string>(); 
      foreach (Microsoft.TeamFoundation.VersionControl.Client.WorkingFolder folder in workspace.Folders) { 
       pendingItems.Add(folder.ServerItem); 
      } 

      List<string> localFilePaths = new List<string>(); 
      string userName = tfsServer.AuthenticatedUserIdentity.AccountName; 
      Microsoft.TeamFoundation.VersionControl.Client.PendingSet[] pendingSets = workspace.QueryPendingSets(pendingItems.ToArray(), Microsoft.TeamFoundation.VersionControl.Client.RecursionType.Full, null, userName, false); 
      foreach (Microsoft.TeamFoundation.VersionControl.Client.PendingSet ps in pendingSets) { 
       foreach (Microsoft.TeamFoundation.VersionControl.Client.PendingChange change in ps.PendingChanges) { 
        localFilePaths.Add(change.LocalItem); 
       } 
      } 
2

顯然,一個很大的優勢您的組織本來就是,如果他們也搬到bug跟蹤系統到TFS那麼當你在檢查文件,你可以,入住與工作項(錯誤,任務關聯等等)和協會將照顧你。它也會允許大量的報告等等 - 所有的好東西。

+0

我認爲我們之所以沒有這麼做的原因是因爲有許多基於其他技術(PHP等)的項目沒有使用TFS,但需要使用bug跟蹤系統。 – Guy 2008-11-07 19:53:57

2

如果你的公司已經安裝了Web訪問電動工具爲TFS,那麼你可以只粘貼網址到你的bug跟蹤系統,連回的支票。

它看起來像這樣...

http://mytfs:8090/cs.aspx?cs=1234

節省時間和對錯誤的機會非常少。

Ta。

史蒂夫·波特

1

在VS 2010中選擇所有文件,然後按CTRL+C到文件的詳細信息複製到剪貼板。