/// <summary> /// Returns a VersionData that contains only those children contained in a changelog /// </summary> /// <param name="changelog"></param> /// <param name="prefix"></param> /// <returns></returns> public VersionData Trim(Changelog changelog, string prefix = "") { if (Filetype != FileType.Directory) { throw new InvalidOperationException("Trim cannot operate on a FileType.File"); } var vdcollection = new VDKeyedCollection(); foreach (var vd in children) { string fpath = PrefixFilename(prefix, vd.Filename); if (changelog.Added.ContainsKey(fpath) || changelog.Modified.ContainsKey(fpath)) { if (vd.Filetype == FileType.Directory) { vdcollection.Add(vd.Trim(changelog, fpath)); } else { vdcollection.Add(new VersionData(vd.Filename, vd.Data)); } } } return(new VersionData(Filename, vdcollection)); }
public Commit(Commit parent, Changelog changelog, Version version, Metadata metadata, string hash) { parents = parent != null? new Commit[] { parent } : new Commit[0]; this.changelog = changelog; this.metadata = metadata; this.version = version; commitHash = hash; }
public Commit(Commit parent, Changelog changelog, Version version, Metadata metadata) { parents = new Commit[] { parent }; this.changelog = changelog; this.metadata = metadata; this.version = version; commitHash = GenerateHash(); }
public Commit(Commit[] parents, Changelog changelog, Version version, Metadata metadata, string hash) { this.parents = parents; this.changelog = changelog; this.metadata = metadata; this.version = version; commitHash = hash; }
public Commit(Commit[] parents, Changelog changelog, Version version, Metadata metadata) { this.parents = parents; this.changelog = changelog; this.metadata = metadata; this.version = version; commitHash = GenerateHash(); }
/// <summary> /// Constructs a Version object from the specified hash, and stores proxies with a changelog dependency /// </summary> /// <param name="hash"></param> /// <param name="changelog"></param> /// <returns></returns> public Version GetVersion(string hash, Changelog changelog) { return(directory.GetVersion(hash, changelog)); }
/// <summary> /// Deletes a Changelog from the file directory /// </summary> /// <param name="changelog"></param> public void DeleteChangelog(Changelog changelog) { directory.DeleteChangelog(changelog); }
/// <summary> /// Saves a Changelog to the file directory /// </summary> /// <param name="changelog"></param> public void CreateChangelog(Changelog changelog) { directory.CreateChangelog(changelog); }
public DiffChangelog(Changelog first, Changelog second) { DiffInit(new Changelog[] { first, second }); }
public Build(Build parent, Changelog changelog, Version version, BuildMetadata metadata) : base(parent, changelog, version, metadata) { }
public Build(Build parent, Changelog changelog, Version version, BuildMetadata metadata, string hash) : base(parent, changelog, version, metadata, hash) { }
/// <summary> /// Returns a subset of this Version that contains only VersionData contained in changelog /// </summary> /// <param name="changelog"></param> /// <returns></returns> public Version GetChangelogVersion(Changelog changelog) { var vd = data.Trim(changelog); return(new Version(vd, vd.Hash)); }