From 2c90f55e263b3abcda2bba0ca3711ed8f2d61d5b Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sat, 30 Sep 2017 09:34:06 -0400 Subject: [PATCH] add shas to lockfile out of date warnings Signed-off-by: Kenneth Reitz --- pipenv/cli.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/pipenv/cli.py b/pipenv/cli.py index f4f9b04a..91eae110 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -1238,11 +1238,28 @@ def do_init( # Check that the hash of the Lockfile matches the lockfile's hash. if not lockfile['_meta'].get('hash', {}).get('sha256') == p.hash: + + old_hash = lockfile['_meta'].get('hash', {}).get('sha256')[-6:] + new_hash = p.hash[-6:] if deploy: - click.echo(crayons.red('Your Pipfile.lock is out of date. Aborting deploy.')) + click.echo( + crayons.red( + 'Your Pipfile.lock ({0}) is out of date. Aborting deploy.'.format( + old_hash + ) + ) + ) sys.exit(1) else: - click.echo(crayons.red(u'Pipfile.lock out of date, updating…', bold=True), err=True) + click.echo( + crayons.red( + u'Pipfile.lock ({0}) out of date, updating to ({1})…'.format( + old_hash, + new_hash + ), + bold=True), + err=True + ) do_lock(system=system)