> +    @contextlib.contextmanager
> +    def uninterruptable(self):
> +        """Mark an operation as unsafe.
> +
> +        Most operations on a repository are safe to interrupt, but a
> +        few are risky (for example repair.strip). This context manager
> +        lets you advise Mercurial that something risky is happening so
> +        that control-C etc can be blocked if desired.
> +        """
> +        enabled = self.configbool('experimental', 'nointerrupt')
> +        if (enabled and
> +            self.configbool('experimental', 'nointerrupt-interactiveonly')):
> +            enabled = self.interactive()
> +        if self._uninterruptible or not enabled:
> +            # if nointerrupt support is turned off, the process isn't
> +            # interactive, or we're already in an uninterruptable
> +            # block, do nothing.
> +            yield
> +            return
> +        def warn():
> +            self.warn(_("shutting down cleanly\n"))
> +            self.warn(
> +                _("press ^C again to terminate immediately (dangerous)\n"))

Missed `return True` ?

Other that that, the patch looks good to me.
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to