diff --git a/CHANGELOG.md b/CHANGELOG.md index b65bac30..213f4aa5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,16 @@ Jupytext ChangeLog ================== +1.16.6 (2024-12-16) +------------------- + +**Fixed** +- We fixed a "File Changed" warning when saving notebooks ([#1301](https://github.com/mwouts/jupytext/issues/1301)) + +**Changed** +- The original file name is easier to infer from the tmp file name in pre-commit hooks ([#1289](https://github.com/mwouts/jupytext/issues/1289)) - thanks to [Lunin Leonid](https://github.com/lrlunin) for making this change. + + 1.16.5 (2024-12-15) ------------------- diff --git a/src/jupytext/contentsmanager.py b/src/jupytext/contentsmanager.py index 1a5b8f32..f891f848 100644 --- a/src/jupytext/contentsmanager.py +++ b/src/jupytext/contentsmanager.py @@ -341,19 +341,22 @@ def read_one_file(alt_path, alt_fmt): model["last_modified"] = inputs.timestamp if require_hash: - if inputs.path is None or outputs.path is None: - return model - model_other = self.super.get( - inputs.path if path == outputs.path else outputs.path, - require_hash=True, - ) - # The hash of a paired file is the concatenation of - # the hashes of the input and output files - if path == outputs.path: - model["hash"] = model_other["hash"] + model["hash"] - else: - model["hash"] = model["hash"] + model_other["hash"] - return model + if ( + inputs.path is not None + and outputs.path is not None + and inputs.path != outputs.path + ): + model_other = self.super.get( + inputs.path if path == outputs.path else outputs.path, + content=False, + require_hash=True, + ) + # The hash of a paired file is the concatenation of + # the hashes of the input and output files + if path == outputs.path: + model["hash"] = model_other["hash"] + model["hash"] + else: + model["hash"] = model["hash"] + model_other["hash"] if not content: return model diff --git a/src/jupytext/version.py b/src/jupytext/version.py index ef2a7f5f..2b451da2 100644 --- a/src/jupytext/version.py +++ b/src/jupytext/version.py @@ -1,3 +1,3 @@ """Jupytext's version number""" -__version__ = "1.16.5" +__version__ = "1.16.6"