2009-11-09 10 views

Odpowiedz

11

Korzystanie Team Explorer:

  1. Open Source sterowania Explorer
  2. Przejdź do pożądanego źródła folderu kontrola
  3. prawym przyciskiem myszy i wybierz polecenie Widok Historia

Pokazuje wszystkie z zestawy zmian, które zostały zaznaczone na tym poziomie w drzewie lub poniżej.


Korzystanie z narzędzia TF:

tf history c:\localFolder -r -format:detailed

Oto link do dokumentacji historii TF więcej szczegółów na temat użycia: link


Używanie TFS SDK do zrób to programowo ly:

Oto przykładowa metoda oparta na niektórych z naszego kodu. Bierze ścieżkę, czas rozpoczęcia i czas zakończenia i podaje wszystkie szczegóły zestawu zmian poniżej tej ścieżki pomiędzy dwoma określonymi czasami:

private StringBuilder GetTfsModifications(string tfsPath, DateTime startTime, DateTime endTime) 
{ 
    StringBuilder bodyContent = new StringBuilder(); 

    TeamFoundationServer tfs = new TeamFoundationServer("YourServerNameHere"); 
    VersionControlServer vcs = (VersionControlServer)tfs.GetService(typeof(VersionControlServer)); 

    // Get collection of changesets below the given path 
    System.Collections.IEnumerable changesets = vcs.QueryHistory(
      tfsPath, 
      VersionSpec.Latest, 
      0, 
      RecursionType.Full, 
      null, 
      new DateVersionSpec(startTime), 
      new DateVersionSpec(endTime), 
      int.MaxValue, 
      true, 
      false); 

    // Iterate through changesets and extract any data you want from them 
    foreach (Changeset changeset in changesets) 
    { 
     StringBuilder changes = new StringBuilder(); 
     StringBuilder assocWorkItems = new StringBuilder(); 

     // Create a list of the associated work items for the ChangeSet 
     foreach (WorkItem assocWorkItem in changeset.WorkItems) 
     { 
      assocWorkItems.Append(assocWorkItem.Id.ToString()); 
     } 

     // Get details from each of the changes in the changeset 
     foreach (Change change in changeset.Changes) 
     { 
      changes.AppendLine(string.Format(CultureInfo.InvariantCulture, "\t{0}\t{1}", 
        PendingChange.GetLocalizedStringForChangeType(change.ChangeType), 
        change.Item.ServerItem)); 
     } 

     // Get some details from the changeset and append the individual change details below it 
     if (changes.Length > 0) 
     { 
      bodyContent.AppendLine(string.Format(CultureInfo.InvariantCulture, "{0}\t{1}\t{2}\t{3}\t{4}", 
        changeset.ChangesetId, 
        changeset.Committer.Substring(changeset.Committer.IndexOf('\\') + 1), 
        changeset.CreationDate, 
        changeset.Comment, 
        assocWorkItems.ToString())); 
      bodyContent.Append(changes.ToString()); 
     } 
    } 

    return bodyContent; 
} 
1

Jeśli dobrze rozumiem, że odpowiedź może być tak proste, jak:

tf history c:\some\subdir -r -format:detailed -noprompt 

odpowiedź, jeśli to nie jest wystarczająco dobre.

Powiązane problemy