public SynchronizerTest() { m_Instance = new Synchronizer(EqualityComparer<IFileReference>.Default, new ChangeFilterFactory()); var gitGroup = CreateGroup(); m_Group = gitGroup; m_MultiFileSystemHistory = new GitBasedMultiFileSystemHistoryService(gitGroup, gitGroup.GetHistoryService()); }
bool TryResolveConflict(ChangeGraphBuilder changeGraphBuilder, IMultiFileSystemHistoryService historyService, ConflictInfo conflict, out IFileReference resolved) { var graph = changeGraphBuilder.GetChangeGraphs(GetDiff(historyService, conflict)).Single(); var sinks = graph.GetSinks().ToArray(); return TryResolveConflict(sinks, out resolved); }
IMultiFileSystemDiff GetDiff(IMultiFileSystemHistoryService historyService, ConflictInfo conflict) { return historyService.GetChanges(conflict.SnapshotId, historyService.LatestSnapshot.Id, new[] {conflict.FilePath}); }
IMultiFileSystemDiff GetDiff(IMultiFileSystemHistoryService historyService, ISyncPoint syncPoint, IMultiFileSystemChangeFilter filter) { var fromSnapshotId = syncPoint?.MultiFileSystemSnapshotId; var toSnapshotId = historyService.LatestSnapshot.Id; var diff = fromSnapshotId == null ? historyService.GetChanges(toSnapshotId) : historyService.GetChanges(fromSnapshotId, toSnapshotId); return new FilteredMultiFileSystemDiff(diff, filter); }