public void GetChangelog() { Changelog c = directory.GetChangelog("mergeOtherMain"); Assert.IsTrue(c.Added.ContainsKey("file6.txt")); Assert.IsTrue(c.Modified.ContainsKey("file2.txt")); c.Renamed.TryGetValue("file1.txt", out string f4txt); Assert.AreEqual(f4txt, "file4.txt"); Assert.IsTrue(c.Removed.Contains("file3.txt")); }
/// <summary> /// Converts this object to a Commit object /// </summary> /// <param name="directory">The directory dependency for proxies</param> /// <param name="loader">The loader object which specifies which objects to load</param> /// <returns></returns> public Commit GetCommit(DirectoryStructure directory, CommitDependencyLoader loader) { Commit[] parents = new Commit[Parents.Length]; for (int i = 0; i < parents.Length; i++) { string p = Parents[i]; if (loader.LoadParents && loader.ShouldLoadParent(p)) { parents[i] = directory.GetCommit(p, loader.GetParent(p)); } else { parents[i] = new CommitProxy(p, directory); } } Changelog changelog = loader.LoadChangelog ? directory.GetChangelog(Changelog) : new ChangelogProxy(Changelog, directory); Version version = loader.LoadVersion ? directory.GetVersion(Hash, loader.LoadVersionData) : new VersionProxy(Version, directory); CommitMetadata metadata = Metadata != null?Metadata.GetMetadata() : throw new FormatException("Commit must contain metadata"); return(new Commit(parents, changelog, version, metadata, Hash)); }
public Build GetBuild(DirectoryStructure directory) { var parent = directory.GetBuild(Parent); var changelog = directory.GetChangelog(Changelog); var version = directory.GetVersion(Version); var metadata = Metadata.GetBuildMetadata(); return(new Build(parent, changelog, version, metadata)); }
/// <summary> /// Loads a Changelog /// </summary> /// <param name="hash">The hash of the changelog to load</param> /// <returns></returns> public Changelog GetChangelog(string hash) { return(directory.GetChangelog(hash)); }