+3

File Compare: option to Export as Patch

Bugged 5 years ago updated by Микола Моргун 5 years ago 1

Today it only has the option `Export as HTML`:

Image 467

The option Export as Patch, would create a diff file from the current file as:

```

From .... Mon Sep 17 00:00:00 2001
From: .....
Date: Sat, 29 Feb 2020 16:29:30 -0300

---
rslib/src/template.rs | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/rslib/src/template.rs b/rslib/src/template.rs
index cf38bce2..10a1b081 100644
--- a/rslib/src/template.rs
+++ b/rslib/src/template.rs
@@ -276,6 +276,7 @@ pub fn without_legacy_template_directives(text: &str) -> Cow {
impl ParsedTemplate<'_> {
/// true if provided fields are sufficient to render the template
pub fn renders_with_fields(&self, nonempty_fields: &HashSet<&str>) -> bool {
+ println!("nonempty_fields '{:?}'", nonempty_fields);
!template_is_empty(nonempty_fields, &self.0)
}
}
...

```

Exporting multiple diffs at once would be even better!