public IEnumerable<Changeset> GetChanges( string serverPath, ChangesetFilter filter, Action<int> progressReportHandler) { IEnumerable csList = m_versionControlServer.QueryHistory( serverPath, VersionSpec.Latest, 0, RecursionType.Full, null, //any user null, // from first changeset null, // to last changeset int.MaxValue, true, // with changes false, false, true); // sorted var enumerator = csList.GetEnumerator(); while (enumerator.MoveNext()) { var changeset = (Changeset)enumerator.Current; if (!filter.IsFilterPassed(changeset)) continue; yield return changeset; } }
static void Main(string[] args) { XmlConfigurator.Configure(new FileInfo("./log.config")); Log.Info("Initializing"); try { var netsh = new NetshCommand(new NetshProcess()); var versionControlServer = new VersionControlServer(Configuration.TfsServerUri, Configuration.TfsProject); var git = new GitCommand(new GitProcess(Configuration.GitRepoPath, Configuration.UserMappings), Configuration.GitRepoPath, Configuration.GitConfig, Configuration.GitOrigin); var changesetFilter = new ChangesetFilter(git, Configuration.ExcludedChangesets, Configuration.InitializeRepo); var historyWalker = new HistoryWalker(versionControlServer, git, changesetFilter, Configuration.BranchMappings, Configuration.ExcludedPaths); if (Configuration.ListUsers) { versionControlServer.ListUsers(Configuration.EntryPoint, Configuration.UserListingBaseHostName); } else { if (Configuration.InitializeRepo) { git.Init(); } netsh.ConfigureAvailablePorts(); netsh.Status(); git.Configure(false); historyWalker.Walk(Configuration.EntryPoint); } } catch (Exception e) { Log.Error(e); } Log.Info("Done, press any key to exit"); Console.ReadKey(); }
protected virtual void OneTimeSetUp() { XmlConfigurator.Configure(new FileInfo("./log.config")); RepoPath = GetGit.Git.Env.ExecutingDirectory() + "/Repo"; UserMappings = new Dictionary <string, UserMapping> { { OldUserAlice, new UserMapping(UserAlice, "*****@*****.**") }, { OldUserBob, new UserMapping(UserBob, "*****@*****.**") } }; GitProcess = new GitProcess(RepoPath, UserMappings); Git = new GitCommand(GitProcess, RepoPath, new string[] {}, "http://host/repo.git"); Git.Init(); Env = new MockEnvironment(); var changesetFilter = new ChangesetFilter(Git, Env.ExcludedChangesets, false); HistoryWalker = new HistoryWalker(Env.VersionControlServer.Object, Git, changesetFilter, Env.BranchMappings, Env.ExcludedPaths); }