Patchwork [3,of,3] debugfsinfo: use util.getfstype

login
register
mail settings
Submitter Jun Wu
Date March 23, 2017, 7:07 p.m.
Message ID <1dbe21f38b4c3242f85e.1490296066@localhost.localdomain>
Download mbox | patch
Permalink /patch/19614/
State Accepted
Headers show

Comments

Jun Wu - March 23, 2017, 7:07 p.m.
# HG changeset patch
# User Jun Wu <quark@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.

Patch

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'))