Mercurial > public > mercurial-scm > hg
diff mercurial/debugcommands.py @ 30525:86ebd2f61c31
debugcommands: move 'debugfsinfo' in the new module
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 17 Aug 2016 20:58:16 -0700 |
parents | 1ee358c3ed26 |
children | 9c10905f4b48 |
line wrap: on
line diff
--- a/mercurial/debugcommands.py Wed Aug 17 20:57:57 2016 -0700 +++ b/mercurial/debugcommands.py Wed Aug 17 20:58:16 2016 -0700 @@ -8,6 +8,7 @@ from __future__ import absolute_import import operator +import os import random from .i18n import _ @@ -585,3 +586,14 @@ for f in ctx.getfileset(expr): ui.write("%s\n" % f) + +@command('debugfsinfo', [], _('[PATH]'), norepo=True) +def debugfsinfo(ui, path="."): + """show information detected about current filesystem""" + util.writefile('.debugfsinfo', '') + ui.write(('exec: %s\n') % (util.checkexec(path) and 'yes' or 'no')) + ui.write(('symlink: %s\n') % (util.checklink(path) and 'yes' or 'no')) + ui.write(('hardlink: %s\n') % (util.checknlink(path) and 'yes' or 'no')) + ui.write(('case-sensitive: %s\n') % (util.fscasesensitive('.debugfsinfo') + and 'yes' or 'no')) + os.unlink('.debugfsinfo')