public void MakeChangelog() { Version v1 = directory.GetVersion("updateTest"); Version v2 = directory.GetVersion("originalTest"); Changelog changelog = v2.GetChangelog(v1); int count = changelog.Added.Count; }
public void DiffWorkingVersion() { Version v1 = directory.GetVersion("updateTest"); Version v2 = directory.GetVersion("originalTest"); Changelog changelog = v2.GetChangelog(v1); Version v = v1.GetChangelogVersion(changelog); directory.CreateVersion(v); }
public void Create(string message) { //Loads the files in the working directory Version working = directory.GetWorkingVersion(); //Aggregates the files from all commits up to HEAD Head head = directory.GetHead(); Commit parentCommit = head.GetTarget(); AggregatedChangelog parentAggregate = parentCommit.AggregateChangelog(); Version parent = directory.AggregateVersion(parentAggregate); //Creates the data fields for commit Changelog diffChangelog = parent.GetChangelog(working); Version diffVersion = working.GetChangelogVersion(diffChangelog); CommitMetadata metadata = new CommitMetadata(message); //Creates the commit Commit newCommit = new Commit(parentCommit, diffChangelog, diffVersion, metadata); //Adds the data fields to the file directory directory.CreateVersion(diffVersion); directory.CreateChangelog(diffChangelog); directory.CreateCommit(newCommit); //Update the position of the HEAD directory.UpdateHead(head, newCommit); }