public SyncData(FileData fD, SyncConflictState sCS, SyncDirection sP, SyncActionState sAS) { FD = fD; SCS = sCS; SD = sP; SAS = sAS; }
public static void IsInState(SyncActionState expectedState, params SyncAction[] actions) { foreach (var action in actions) { Assert.Equal(expectedState, action.State); } }
public IEnumerable<SyncAction> this[SyncActionState state, string filePath] { get { PathValidator.EnsureIsValidFilePath(filePath); PathValidator.EnsureIsRootedPath(filePath); // branch does not exist => result is empty if (!GitGroup.Repository.LocalBranchExists(BranchName)) { return Enumerable.Empty<SyncAction>(); } // load the root directory of the branch var gitDirectory = new GitDirectory(null, "root", GitGroup.Repository.GetLocalBranch(BranchName).Tip); // determine if the directory for action with the specified state and path exists and load actions from it var directoryPath = GetRelativeSyncActionDirectoryPath(state, filePath); if (!gitDirectory.DirectoryExists(directoryPath)) { return Enumerable.Empty<SyncAction>(); } else { var directory = gitDirectory.GetDirectory(directoryPath); return LoadSyncActions(directory); } } }
public SyncData(FileData fD, SyncConflictState sCS, SyncDirection sP) { FD = fD; SCS = sCS; SD = sP; SAS = SyncActionState.Skip; }
private void SetTableItemSASValueTo(SyncActionState SAS) { var selectedRows = dataGridView1.SelectedRows; for (int i = 0; i < selectedRows.Count; i++) { dataGridView1[0, selectedRows[i].Index].Value = SAS.ToString(); CurrentSession[selectedRows[i].Index].SAS = SAS; } }
public SyncAction(ChangeType type, IFileReference fromVersion, IFileReference toVersion, Guid id, string target, SyncActionState state, int syncPointId) : base(type, fromVersion, toVersion) { if (syncPointId <= 0) { throw new ArgumentOutOfRangeException(nameof(syncPointId), "Id must be a positive integer"); } this.Target = target; this.Id = id; this.State = state; this.SyncPointId = syncPointId; }
public static void ActionsExist(ISyncActionService service, string path, SyncActionState? expectedState = null, int? expectedCount = null, ChangeType? expectedChangeType = null) { var actions = service[path].ToArray(); Assert.NotEmpty(actions); if (expectedCount.HasValue) { Assert.Equal(expectedCount, actions.Length); } if (expectedState.HasValue) { SyncAssert.IsInState(expectedState.Value, actions); } if (expectedChangeType != null) { SyncAssert.HasChangeType(expectedChangeType.Value, actions); } }
public static SyncAction CreateReplaceFileSyncAction(string target, SyncActionState state, int syncPointId, IFileReference oldVersion, IFileReference newVersion) { return new SyncAction(ChangeType.Modified, oldVersion, newVersion, Guid.NewGuid(), target, state, syncPointId); }
public static SyncAction CreateRemoveFileSyncAction(string target, SyncActionState state, int syncPointId, IFileReference removedFile) { return new SyncAction(ChangeType.Deleted, removedFile, null, Guid.NewGuid(), target, state, syncPointId); }
public static SyncAction CreateAddFileSyncAction(Guid id, string target, SyncActionState state, int syncPointId, IFileReference toVersion) { return new SyncAction(ChangeType.Added, null, toVersion, id, target, state, syncPointId); }
public static SyncAction CreateAddFileSyncAction(string target, SyncActionState state, int syncPointId, IFileReference toVersion) { return CreateAddFileSyncAction(Guid.NewGuid(), target, state, syncPointId, toVersion); }
public SyncAction WithState(SyncActionState state) { return new SyncAction(Type, FromVersion, ToVersion, Id, Target, state, SyncPointId); }
string GetRelativeSyncActionDirectoryPath(SyncActionState state) => state.ToString();
string GetRelativeSyncActionDirectoryPath(SyncActionState state, string filePath) => state + filePath;
//public static void PrioritizeConflictFileDataListSingle(List<SyncData> SDList, SyncDirection SPToSet) //{ //} /// <summary> /// Function that assigns specific SyncData to specific SyncActionState. /// </summary> /// <param name="SD">The list of the SyncData to be prioritized.</param> /// <param name="SASToSet">Specific SyncActionState that will be applied to this SyncData.</param> public static void AssignActionStateToSyncData(SyncData SD, SyncActionState SASToSet) { SD.SAS = SASToSet; }