On Sun, 08 Mar 2020 22:06:54 +0100, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.da...@octobus.net>
> # Date 1583507190 -3600
> #      Fri Mar 06 16:06:30 2020 +0100
> # Node ID 5736e8d4a0d8bdbecb8dfd0572233e47c27784f5
> # Parent  b6ea7a94cdaea348eff4bc232a732e24f43469a8
> # EXP-Topic rust-test-option
> # Available At https://dev.heptapod.net/octobus/mercurial-devel/
> #              hg pull https://dev.heptapod.net/octobus/mercurial-devel/ -r 
> 5736e8d4a0d8
> setup-rust: add a --no-rust flag

>  class hgdist(Distribution):
>      pure = False
> -    rust = hgrustext is not None
> +    rust = False
> +    no_rust = False
>      cffi = ispypy
>  
>      global_options = Distribution.global_options + [
>          ('pure', None, "use pure (slow) Python code instead of C 
> extensions"),
>          ('rust', None, "use Rust extensions additionally to C extensions"),
> +        (
> +            'no-rust',
> +            None,
> +            "do not use Rust extensions additionally to C extensions",
> +        ),
>      ]
>  
> +    negative_opt = Distribution.negative_opt.copy()
> +    boolean_options = ['pure', 'rust', 'no-rust']
> +    negative_opt['no-rust'] = 'rust'
> +
> +    def _set_command_options(self, command_obj, option_dict=None):
> +        command_obj.boolean_options += self.boolean_options
> +        return Distribution._set_command_options(
> +            self, command_obj, option_dict=option_dict
> +        )
> +
> +    def parse_command_line(self):
> +        ret = Distribution.parse_command_line(self)
> +        if not (self.rust and self.no_rust):
                             ^^^
not self.rust and not self.no_rust?

setup.py --rust appears not working.
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to