[PATCH] blackbox: add an option to customize the name of the log file

Yuya Nishihara yuya at tcha.org
Thu Jun 16 09:55:45 EDT 2016


On Mon, 13 Jun 2016 20:32:05 +0100, Jun Wu wrote:
> # HG changeset patch
> # User Jun Wu <quark at fb.com>
> # Date 1465846020 -3600
> #      Mon Jun 13 20:27:00 2016 +0100
> # Node ID 9af8429456793d482c670b0aa7c829b1513b2025
> # Parent  c27dc3c31222c7f74331221a3d25566146feecac
> # Available At https://bitbucket.org/quark-zju/hg-draft
> #              hg pull https://bitbucket.org/quark-zju/hg-draft -r 9af842945679
> blackbox: add an option to customize the name of the log file

> +  [blackbox]
> +  # use a different file name: blackbox-bot.log. only a-z and 0-9 can be used
> +  filesuffix = bot

It seems confusing that filesuffix isn't a suffix. Is there a reason to
not allow specifying the full file name? Invalid path components such as
'..' will be rejected by pathauditor.

> +def _getname(ui):
> +    suffix = ui.config('blackbox', 'filesuffix')
> +    if suffix is not None:
> +        suffix = re.sub(r'[^a-z0-9]', '', suffix)

Perhaps it would be better to report error than stripping bad characters
silently.


More information about the Mercurial-devel mailing list