Issue #32 resolved

Extension v0.2.2 fails with command line Mercurial installation.

Nathan Durnan
repo owner created an issue

Can not restore timestamps from v0.2.x JSON timestamp file. Timestamps from v0.1.5 CSV file format still work correctly.

Fails to import JSON library.

Error: {{{ Exception: (<type 'exceptions.ImportError'>, ImportError('No module named json',), <traceback object at 0x00c62d28>) }}}

Comments (5)

  1. Nathan Durnan reporter
    • changed status to open

    The library.zip file distributed with the command line Mercurial package for Windows does not have the JSON modules included! The Python sys.version indicates that the library is v2.6.6, but there are obviously some elements missing from the library.

    One possible solution would be to expand the TimestampMod extension's requirements to include Python 2.6+ (when used with the stand-alone command line Mercurial package) and add some way to inform the extension of the Python installation path. The Python path could then be appended to sys.path, and the extension would then have access to the complete Python library. The drawback of this method is that it places more configuration responsibility on the end-user. However, it would likely be a one-time configuration modification to point the extension to the Python 2.6+ installation path. Updates to the Mercurial installation should not require the configuration to be done again. The only time the configuration would need to be updated would be to point it to a new Python installation.

    Another possible solution may be to have the end-user "borrow" the json section from the TortoiseHg library.zip and insert it into the Mercurial library.zip. However, this requires that a command-line-only user would need to install TortoiseHg just to get the library.zip contents. This seems like it might have even more potential for confusion and mistakes. And it would have to be repeated every time the Mercurial installation is updated.

  2. Nathan Durnan reporter

    Don't attempt to run Post-Merge or Post-Resolve hooks if there are still unresolved files.

    Command Line merge tools can leave non-JSON lines in the middle of the timestamp file. This means the timestamp file can not be read reliably unless the merge is completed. Once all files have been resolved, the Post-Merge and Post-Resolve hooks should run OK.

    67695dc0a674

  3. Nathan Durnan reporter

    Close Issue #32 - Extension working with Command Line Mercurial. No feedback from user that originally reported the issue in almost two weeks, so I am considering the issue sufficiently addressed and the fixes ready for release.

    2f20963dabef

  4. Log in to comment