# HG changeset patch # User Augie Fackler # Date 1594659972 14400 # Node ID 3a6ec080b5210c8f219a1b6d517a56f5b8b7e986 # Parent b6afe1c5296451aa3aa633722a2457797078e9bb# Parent 2c0043977b6d640d237e52abb75562a741c0c919 merge with stable diff -r b6afe1c52964 -r 3a6ec080b521 hgdemandimport/__init__.py --- a/hgdemandimport/__init__.py Fri Jul 10 10:12:56 2020 +0200 +++ b/hgdemandimport/__init__.py Mon Jul 13 13:06:12 2020 -0400 @@ -56,6 +56,7 @@ '__builtin__', 'builtins', 'urwid.command_map', # for pudb + 'lzma', } _pypy = '__pypy__' in sys.builtin_module_names diff -r b6afe1c52964 -r 3a6ec080b521 mercurial/archival.py --- a/mercurial/archival.py Fri Jul 10 10:12:56 2020 +0200 +++ b/mercurial/archival.py Mon Jul 13 13:06:12 2020 -0400 @@ -189,7 +189,12 @@ name, pycompat.sysstr(mode), gzfileobj ) else: - return tarfile.open(name, pycompat.sysstr(mode + kind), fileobj) + try: + return tarfile.open( + name, pycompat.sysstr(mode + kind), fileobj + ) + except tarfile.CompressionError as e: + raise error.Abort(pycompat.bytestr(e)) if isinstance(dest, bytes): self.z = taropen(b'w:', name=dest) diff -r b6afe1c52964 -r 3a6ec080b521 tests/hghave.py --- a/tests/hghave.py Fri Jul 10 10:12:56 2020 +0200 +++ b/tests/hghave.py Mon Jul 13 13:06:12 2020 -0400 @@ -1061,3 +1061,14 @@ return matchoutput( '`rustup which --toolchain nightly rustfmt` --version', b'rustfmt' ) + + +@check("lzma", "python lzma module") +def has_lzma(): + try: + import _lzma + + _lzma.FORMAT_XZ + return True + except ImportError: + return False diff -r b6afe1c52964 -r 3a6ec080b521 tests/test-archive.t --- a/tests/test-archive.t Fri Jul 10 10:12:56 2020 +0200 +++ b/tests/test-archive.t Mon Jul 13 13:06:12 2020 -0400 @@ -576,12 +576,18 @@ test xz support only available in Python 3.4 -#if py3 +#if lzma $ hg archive ../archive.txz $ which xz >/dev/null && xz -l ../archive.txz | head -n1 || true Strms Blocks Compressed Uncompressed Ratio Check Filename (xz !) $ rm -f ../archive.txz -#else +#endif +#if py3 no-lzma + $ hg archive ../archive.txz + abort: lzma module is not available + [255] +#endif +#if no-py3 $ hg archive ../archive.txz abort: xz compression is only available in Python 3 [255]