// Helper method for setting the state of the given tracked object to the corresponding // state in the given commit private void LoadStateOfCommitForTrackedObject(ICommit commit, VersionController trackedObject, int trackedObjectIndex) { if (commit.ObjectIsTrackedInThisCommit(trackedObject)) { trackedObject.ResetToVersion(commit.getObjectVersion(trackedObject)); } else { trackedObject.ResetToInitialState(); trackedObjects.RemoveAt(trackedObjectIndex); } }
public bool ObjectWasChangedInThisCommit(VersionController controller) { if (ObjectIsTrackedInThisCommit(controller)) { if (parent == null) { return(true); } else if (!parent.ObjectIsTrackedInThisCommit(controller)) { return(true); } else { return(!getObjectVersion(controller).Equals(parent.getObjectVersion(controller))); } } else { return(false); } }
// Helper method for adding a new object to the tracked objects when loading a commit where the object is tracked but was not private void LoadStateOfCommitForNewTrackedObject(ICommit commit, VersionController versionableObject) { trackedObjects.Add(versionableObject); versionableObject.ResetToVersion(commit.getObjectVersion(versionableObject)); }