public DirectoryPatcher(XdeltaPatcher filePatcher, string targetPath, string backupPath, string tempPath, IPatchSource patchSource) { FilePatcher = filePatcher; TargetPath = targetPath; BackupPath = backupPath; TempPath = tempPath; PatchSource = patchSource; }
private void AddPatchSource(IPatchSource patchSource) { Assert.IsNotNull(patchSource); var item = new PatchSourceListItem(patchSource); item.CheckedState = Framework.Controls.CheckedState.Checked; _lstPatches.Items.Add(item); item.FocusAndSelect(); }
/// <summary>Apply patch.</summary> /// <param name="patchSource">Patch source.</param> /// <param name="applyTo">Patch target.</param> /// <param name="reverse">Reverse patches.</param> public void ApplyPatch(IPatchSource patchSource, ApplyPatchTo applyTo, bool reverse) { Verify.Argument.IsNotNull(patchSource, "patchSource"); using (Repository.Monitor.BlockNotifications( RepositoryNotifications.IndexUpdated, RepositoryNotifications.WorktreeUpdated)) { using (var patch = patchSource.PreparePatchFile()) { Repository.Accessor.ApplyPatch.Invoke( new ApplyPatchParameters() { Patches = new[] { patch.FileName }, ApplyTo = applyTo, Reverse = reverse, }); } } Refresh(); }
public Patcher(IPatchSource patchSource, IndexFile index, ArchiveFile coreData = null, string target = null) { PatchSource = patchSource; Index = index; if (target == null) { target = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(index.FileName), "..", Path.GetFileNameWithoutExtension(index.FileName))); } if (Path.GetExtension(target).TrimStart('.').ToLower() != "archive") { PatchWriter = new FolderPatchWriter(target, coreData); } else { // TODO: Implement actual archive writing. throw new InvalidOperationException(); } PatchWriter.ProgressUpdated += PatchWriter_ProgressUpdated; }
public PatchSourceFixture() { PatchSource = new HttpPatchSource("https://patch.logg.coffee/"); }
public HttpPatchSourceTests(ITestOutputHelper output, PatchSourceFixture patchSourceFixture) { Output = output; Output.WriteLine("New test instance constructed"); PatchSource = patchSourceFixture.PatchSource; }
/// <summary>Apply patch.</summary> /// <param name="patchSource">Patch source.</param> /// <param name="applyTo">Patch target.</param> /// <param name="reverse">Reverse patches.</param> public void ApplyPatch(IPatchSource patchSource, ApplyPatchTo applyTo, bool reverse) { Verify.Argument.IsNotNull(patchSource, "patchSource"); using(Repository.Monitor.BlockNotifications( RepositoryNotifications.IndexUpdated, RepositoryNotifications.WorktreeUpdated)) { using(var patch = patchSource.PreparePatchFile()) { Repository.Accessor.ApplyPatch.Invoke( new ApplyPatchParameters() { Patches = new[] { patch.FileName }, ApplyTo = applyTo, Reverse = reverse, }); } } Refresh(); }