[PATCH 3 of 3] debugfsinfo: use util.getfstype
Jun Wu
quark at fb.com
Thu Mar 23 15:07:46 EDT 2017
# HG changeset patch
# User Jun Wu <quark at fb.com>
# Date 1490295799 25200
# Thu Mar 23 12:03:19 2017 -0700
# Node ID 1dbe21f38b4c3242f85e0af4772ca715a3eaab10
# Parent bff5a7461d770ed6db75b446d518b272fe423a47
# Available At https://bitbucket.org/quark-zju/hg-draft
# hg pull https://bitbucket.org/quark-zju/hg-draft -r 1dbe21f38b4c
debugfsinfo: use util.getfstype
This changes the behavior slightly. It now always prints fstype, regardless
of whether osutil.getfstype exists.
diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -791,8 +791,5 @@ def debugfsinfo(ui, path="."):
util.writefile('.debugfsinfo', '')
ui.write(('exec: %s\n') % (util.checkexec(path) and 'yes' or 'no'))
- from . import osutil
- if util.safehasattr(osutil, 'getfstype'):
- fstype = osutil.getfstype('.')
- ui.write(('fstype: %s\n') % (fstype or '(unknown)'))
+ ui.write(('fstype: %s\n') % (util.getfstype('.') or '(unknown)'))
ui.write(('symlink: %s\n') % (util.checklink(path) and 'yes' or 'no'))
ui.write(('hardlink: %s\n') % (util.checknlink(path) and 'yes' or 'no'))
More information about the Mercurial-devel
mailing list