[PATCH 4 of 4 V2] debugfsinfo: print fstype information

Yuya Nishihara yuya at tcha.org
Thu Mar 23 10:34:41 EDT 2017


On Tue, 21 Mar 2017 19:00:56 -0700, Jun Wu wrote:
> # HG changeset patch
> # User Jun Wu <quark at fb.com>
> # Date 1489311257 28800
> #      Sun Mar 12 01:34:17 2017 -0800
> # Node ID ea4573691618ea1937cfe0c03c6caa4693b64b05
> # Parent  e960baabf0da65e84e99466d4be9acaa4b9b91b2
> # Available At https://bitbucket.org/quark-zju/hg-draft
> #              hg pull https://bitbucket.org/quark-zju/hg-draft -r ea4573691618
> debugfsinfo: print fstype information

These generally look good. Queued, thanks.

> diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
> --- a/mercurial/debugcommands.py
> +++ b/mercurial/debugcommands.py
> @@ -791,4 +791,8 @@ def debugfsinfo(ui, path="."):
>      util.writefile('.debugfsinfo', '')
>      ui.write(('exec: %s\n') % (util.checkexec(path) and 'yes' or 'no'))
> +    from . import osutil

Is there an import cycle?

> +    if util.safehasattr(osutil, 'getfstype'):
> +        fstype = osutil.getfstype('.')
> +        ui.write(('fstype: %s\n') % (fstype or '(unknown)'))

Let's add util.getfstype() so we don't have to test the existence of
getfstype(). It should be okay to print '(unknown)' if unsupported.


More information about the Mercurial-devel mailing list