comparison mercurial/debugcommands.py @ 31578:6262e30b0c09

debugfsinfo: print fstype information Since we have osutil.getfstype, it'll be handy if "debugfsinfo" prints it.
author Jun Wu <quark@fb.com>
date Sun, 12 Mar 2017 01:34:17 -0800
parents b71143b10f74
children e8bd005c0af7
comparison
equal deleted inserted replaced
31577:e7a02e9ad162 31578:6262e30b0c09
788 @command('debugfsinfo', [], _('[PATH]'), norepo=True) 788 @command('debugfsinfo', [], _('[PATH]'), norepo=True)
789 def debugfsinfo(ui, path="."): 789 def debugfsinfo(ui, path="."):
790 """show information detected about current filesystem""" 790 """show information detected about current filesystem"""
791 util.writefile('.debugfsinfo', '') 791 util.writefile('.debugfsinfo', '')
792 ui.write(('exec: %s\n') % (util.checkexec(path) and 'yes' or 'no')) 792 ui.write(('exec: %s\n') % (util.checkexec(path) and 'yes' or 'no'))
793 from . import osutil
794 if util.safehasattr(osutil, 'getfstype'):
795 fstype = osutil.getfstype('.')
796 ui.write(('fstype: %s\n') % (fstype or '(unknown)'))
793 ui.write(('symlink: %s\n') % (util.checklink(path) and 'yes' or 'no')) 797 ui.write(('symlink: %s\n') % (util.checklink(path) and 'yes' or 'no'))
794 ui.write(('hardlink: %s\n') % (util.checknlink(path) and 'yes' or 'no')) 798 ui.write(('hardlink: %s\n') % (util.checknlink(path) and 'yes' or 'no'))
795 ui.write(('case-sensitive: %s\n') % (util.fscasesensitive('.debugfsinfo') 799 ui.write(('case-sensitive: %s\n') % (util.fscasesensitive('.debugfsinfo')
796 and 'yes' or 'no')) 800 and 'yes' or 'no'))
797 util.tryunlink('.debugfsinfo') 801 util.tryunlink('.debugfsinfo')