When updating the lockfile, we currently only print the old and the new
commit hashes. To make the output more meaningfull, we now also print
the commit log between both versions.
kas/plugins/lock.py | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/kas/plugins/lock.py b/kas/plugins/lock.py
index 05c5a8f1d..0676bd21b 100644
--- a/kas/plugins/lock.py
+++ b/kas/plugins/lock.py
@@ -80,6 +80,7 @@ from kas.context import get_context
from kas.includehandler import ConfigFile
from kas.plugins.checkout import Checkout
from kas.plugins.dump import Dump, IoTarget, LOCKFILE_VERSION_MIN
+from kas.plugins.diff import Diff
from kas.repos import Repo
__license__ = 'MIT'
@@ -106,6 +107,14 @@ class Lock(Checkout):
super().setup_parser(parser)
Dump.setup_parser_format_args(parser)
+ def _print_log_diff(self, repo, old_commit):
+ try:
+ diff = repo.diff(old_commit, None)
+ except NotImplementedError:
+ return
+ Diff.formatting_diff_output(
+ None, None, {'vcs': diff}, True, False, True, False)
+
def _update_lockfile(self, lockfile, repos_to_lock, update_only, args):
"""
Update all locks in the given lockfile.
@@ -138,6 +147,7 @@ class Lock(Checkout):
elif not lockfile.is_external:
logging.info('Updating lock of %s: %s -> %s',
r.name, v['commit'], r.revision)
+ self._print_log_diff(r, v['commit'])
v['commit'] = r.revision
changed = True
else:
--
2.51.0