<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Sep 17, 2019 at 7:16 AM Augie Fackler <<a href="mailto:raf@durin42.com">raf@durin42.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
> On Sep 17, 2019, at 06:48, David Demelier <<a href="mailto:markand@malikania.fr" target="_blank">markand@malikania.fr</a>> wrote:<br>
> <br>
> # HG changeset patch<br>
> # User David Demelier <<a href="mailto:markand@malikania.fr" target="_blank">markand@malikania.fr</a>><br>
> # Date 1568717251 0<br>
> #      Tue Sep 17 10:47:31 2019 +0000<br>
> # Node ID c0398aef7f0977b5f076b15638762773dde7d5b6<br>
> # Parent  181ee2118a96c4b52bbd6d7b5a47e87f2e1d77e9<br>
> archive: add XZ support if built with Python 3<br>
<br>
queued, thanks<br>
<br>
> <br>
> diff -r 181ee2118a96 -r c0398aef7f09 mercurial/archival.py<br>
> --- a/mercurial/archival.py   Wed Sep 11 15:03:08 2019 -0700<br>
> +++ b/mercurial/archival.py   Tue Sep 17 10:47:31 2019 +0000<br>
> @@ -67,6 +67,7 @@<br>
>     'tbz2': ['.tbz2', '.tar.bz2'],<br>
>     'tgz': ['.tgz', '.tar.gz'],<br>
>     'zip': ['.zip'],<br>
> +    'txz': ['.txz', '.tar.xz']<br>
>     }<br>
> <br>
> def guesskind(dest):<br>
> @@ -270,6 +271,7 @@<br>
>     'tar': tarit,<br>
>     'tbz2': lambda name, mtime: tarit(name, mtime, 'bz2'),<br>
>     'tgz': lambda name, mtime: tarit(name, mtime, 'gz'),<br>
> +    'txz': lambda name, mtime: tarit(name, mtime, 'xz'),<br>
>     'uzip': lambda name, mtime: zipit(name, mtime, False),<br>
>     'zip': zipit,<br>
>     }<br>
> @@ -295,6 +297,9 @@<br>
>     subrepos tells whether to include subrepos.<br>
>     '''<br>
> <br>
> +    if kind == 'txz' and not pycompat.ispy3:<br>
> +        raise error.Abort(_('xz compression is only available in Python 3'))<br>
> +<br>
>     if kind == 'files':<br>
>         if prefix:<br>
>             raise error.Abort(_('cannot give prefix when archiving to files'))<br>
> diff -r 181ee2118a96 -r c0398aef7f09 mercurial/commands.py<br>
> --- a/mercurial/commands.py   Wed Sep 11 15:03:08 2019 -0700<br>
> +++ b/mercurial/commands.py   Tue Sep 17 10:47:31 2019 +0000<br>
> @@ -514,6 +514,7 @@<br>
>     :``tar``:   tar archive, uncompressed<br>
>     :``tbz2``:  tar archive, compressed using bzip2<br>
>     :``tgz``:   tar archive, compressed using gzip<br>
> +    :``txz``:   tar archive, compressed using lzma (only in Python 3)<br>
>     :``uzip``:  zip archive, uncompressed<br>
>     :``zip``:   zip archive, compressed using deflate<br>
> <br>
> diff -r 181ee2118a96 -r c0398aef7f09 tests/test-archive.t<br>
> --- a/tests/test-archive.t    Wed Sep 11 15:03:08 2019 -0700<br>
> +++ b/tests/test-archive.t    Tue Sep 17 10:47:31 2019 +0000<br>
> @@ -566,6 +566,21 @@<br>
>   *172*80*00:00*old/.hg_archival.txt (glob)<br>
>   *0*80*00:00*old/old (glob)<br>
> <br>
> +test xz support only available in Python 3.4<br>
> +<br>
> +#if py3<br>
> +  $ hg archive ../archive.txz<br>
> +  $ xz -l ../archive.txz | head -n1<br>
> +  Strms  Blocks   Compressed Uncompressed  Ratio  Check   Filename (py3 !)<br></blockquote><div><br></div><div>I'll drop the "(py3 !)" here.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> +  $ rm -f ../archive.txz<br>
> +#endif<br>
> +<br>
> +#if no-py3<br></blockquote><div><br></div><div>And I'll replace these three lines by "#else"</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> +  $ hg archive ../archive.txz<br>
> +  abort: xz compression is only available in Python 3<br>
> +  [255]<br>
> +#endif<br>
> +<br>
> show an error when a provided pattern matches no files<br>
> <br>
>   $ hg archive -I file_that_does_not_exist.foo ../empty.zip<br>
> @@ -607,3 +622,4 @@<br>
>   456789012<br>
> <br>
>   $ cd ..<br>
> +<br></blockquote><div><br></div><div>And I'll drop this unrelated change.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> _______________________________________________<br>
> Mercurial-devel mailing list<br>
> <a href="mailto:Mercurial-devel@mercurial-scm.org" target="_blank">Mercurial-devel@mercurial-scm.org</a><br>
> <a href="https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel" rel="noreferrer" target="_blank">https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel</a><br>
<br>
_______________________________________________<br>
Mercurial-devel mailing list<br>
<a href="mailto:Mercurial-devel@mercurial-scm.org" target="_blank">Mercurial-devel@mercurial-scm.org</a><br>
<a href="https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel" rel="noreferrer" target="_blank">https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel</a><br>
</blockquote></div></div>