Repository: pypa/pipenv

Issue:
Hashes are mixed up in "Pipfile.lock out of date" warning
### Issue description

When running any command that changes the Pipfile and triggers locking, the hashes in the `Pipfile.lock (abc123) out of date, updating to (def456)…` warning are the wrong way around

### Expected result

The first hash is the outdated hash found in Pipfile.lock

The second hash is the new hash

### Actual result

The first hash is the new hash

The second hash is the outdated hash found in Pipfile.lock

### Steps to replicate

```
$ echo > Pipfile
$ pipenv update
Running $ pipenv lock then $ pipenv sync.
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Updated Pipfile.lock (3cbc06)!
Installing dependencies from Pipfile.lock (3cbc06)…
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 0/0 — 00:00:00
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
All dependencies are now up-to-date!
```

```
$ pipenv install six
Installing six…
Adding six to Pipfile's [packages]…
✔ Installation Succeeded 
Pipfile.lock (978aaa) out of date, updating to (3cbc06)…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
✔ Success! 
Updated Pipfile.lock (978aaa)!
Installing dependencies from Pipfile.lock (978aaa)…
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 1/1 — 00:00:00
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
```

-------------------------------------------------------------------------------

<details><summary>$ pipenv --support</summary>

Pipenv version: `'2018.11.26'`

Pipenv location: `'/home/codl/.local/venvs/pipenv/lib/python3.7/site-packages/pipenv'`

Python location: `'/home/codl/.local/venvs/pipenv/bin/python'`

Python installations found:

  - `3.7.2`: `/usr/bin/python3.7`
  - `3.7.2`: `/usr/bin/python3.7m`
  - `3.5.4`: `/usr/bin/python3.5`
  - `3.5.4`: `/usr/bin/python3.5m`
  - `3.5.3`: `/usr/bin/pypy3`
  - `3.4.7`: `/usr/bin/python3.4`
  - `3.4.7`: `/usr/bin/python3.4m`
  - `2.7.15`: `/usr/bin/python2.7`
  - `2.7.13`: `/usr/bin/pypy`

PEP 508 Information:

```
{'implementation_name': 'cpython',
 'implementation_version': '3.7.2',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '4.19.14-1-lts',
 'platform_system': 'Linux',
 'platform_version': '#1 SMP Wed Jan 9 19:15:22 CET 2019',
 'python_full_version': '3.7.2',
 'python_version': '3.7',
 'sys_platform': 'linux'}
```

System environment variables:

  - `ANKI_NOHIGHDPI`
  - `B2_ACCOUNT_ID`
  - `B2_ACCOUNT_KEY`
  - `BORG_REPO`
  - `COLORTERM`
  - `DBUS_SESSION_BUS_ADDRESS`
  - `DESKTOP_SESSION`
  - `DISPLAY`
  - `EDITOR`
  - `EMSCRIPTEN`
  - `EMSCRIPTEN_FASTCOMP`
  - `GLADE_CATALOG_PATH`
  - `GLADE_MODULE_PATH`
  - `GLADE_PIXMAP_PATH`
  - `GTK_IM_MODULE`
  - `GTK_MODULES`
  - `HOME`
  - `INVOCATION_ID`
  - `JOURNAL_STREAM`
  - `LANG`
  - `LOGNAME`
  - `MAIL`
  - `MAVEN_OPTS`
  - `MOZ_PLUGIN_PATH`
  - `MPD_MUSIC_DIR`
  - `PAGER`
  - `PATH`
  - `PWD`
  - `QT_IM_MODULE`
  - `RBENV_SHELL`
  - `RESTIC_PASSWORD`
  - `RESTIC_REPOSITORY`
  - `SESSION_MANAGER`
  - `SHELL`
  - `SHLVL`
  - `SSH_AGENT_PID`
  - `SSH_AUTH_SOCK`
  - `TERM`
  - `USER`
  - `VTE_VERSION`
  - `WINDOWID`
  - `WINDOWPATH`
  - `XAUTHORITY`
  - `XDG_CONFIG_DIRS`
  - `XDG_CURRENT_DESKTOP`
  - `XDG_DATA_DIRS`
  - `XDG_DESKTOP_DIR`
  - `XDG_DOCUMENTS_DIR`
  - `XDG_DOWNLOAD_DIR`
  - `XDG_MENU_PREFIX`
  - `XDG_MUSIC_DIR`
  - `XDG_PICTURES_DIR`
  - `XDG_PUBLICSHARE_DIR`
  - `XDG_RUNTIME_DIR`
  - `XDG_SEAT`
  - `XDG_SESSION_CLASS`
  - `XDG_SESSION_ID`
  - `XDG_SESSION_TYPE`
  - `XDG_TEMPLATES_DIR`
  - `XDG_VIDEOS_DIR`
  - `XDG_VTNR`
  - `XMODIFIERS`
  - `PIP_DISABLE_PIP_VERSION_CHECK`
  - `PYTHONDONTWRITEBYTECODE`
  - `PIP_SHIMS_BASE_MODULE`
  - `PIP_PYTHON_PATH`
  - `PYTHONFINDER_IGNORE_UNSUPPORTED`

Pipenv–specific environment variables:


Debug–specific environment variables:

  - `PATH`: `/home/codl/.rbenv/shims:/home/codl/.rbenv/bin:/home/codl/.rbenv/shims:/home/codl/.rbenv/bin:/home/codl/bin:/home/codl/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/lib/emscripten:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl`
  - `SHELL`: `/usr/bin/fish`
  - `EDITOR`: `nvim`
  - `LANG`: `en_GB.UTF-8`
  - `PWD`: `/home/codl/scratch`


---------------------------

Contents of `Pipfile` ('/home/codl/scratch/Pipfile'):

```toml
[packages]
six = "*"

```


Contents of `Pipfile.lock` ('/home/codl/scratch/Pipfile.lock'):

```json
{
    "_meta": {
        "hash": {
            "sha256": "83b3df86404322b5e9c6d1f3a782fd8510f976dafa4940f849d7e79258978aaa"
        },
        "pipfile-spec": 6,
        "requires": {},
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "six": {
            "hashes": [
                "sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c",
                "sha256:d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73"
            ],
            "index": "pypi",
            "version": "==1.12.0"
        }
    },
    "develop": {}
}

```
</details>



Discussion:
So it should be swapped to ```Pipfile.lock (3cbc06) out of date, updating to (978aaa)…```. Thanks for the issue.

Resolving patch:
diff --git a/pipenv/core.py b/pipenv/core.py
--- a/pipenv/core.py
+++ b/pipenv/core.py
@@ -1186,9 +1186,9 @@ def do_init(
                 )
             else:
                 if old_hash:
-                    msg = fix_utf8("Pipfile.lock ({1}) out of date, updating to ({0})…")
+                    msg = fix_utf8("Pipfile.lock ({0}) out of date, updating to ({1})…")
                 else:
-                    msg = fix_utf8("Pipfile.lock is corrupted, replaced with ({0})…")
+                    msg = fix_utf8("Pipfile.lock is corrupted, replaced with ({1})…")
                 click.echo(
                     crayons.red(msg.format(old_hash[-6:], new_hash[-6:]), bold=True),
                     err=True,


Test patch: