add debugfsinfo to check fs capabilities
authorMatt Mackall <mpm@selenic.com>
Thu, 27 Dec 2007 23:55:40 -0600
changeset 5741 8ee0de123989
parent 5740 9046a4f6a07c
child 5742 2bd4d56ff37c
add debugfsinfo to check fs capabilities
mercurial/commands.py
tests/test-debugcomplete.out
--- a/mercurial/commands.py	Thu Dec 27 23:55:40 2007 -0600
+++ b/mercurial/commands.py	Thu Dec 27 23:55:40 2007 -0600
@@ -489,6 +489,14 @@
     clist.sort()
     ui.write("%s\n" % "\n".join(clist))
 
+def debugfsinfo(ui, path = "."):
+    file('.debugfsinfo', 'w').write('')
+    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('case-sensitive: %s\n' % (util.checkfolding('.debugfsinfo')
+                                and 'yes' or 'no'))
+    os.unlink('.debugfsinfo')
+
 def debugrebuildstate(ui, repo, rev=""):
     """rebuild the dirstate as it would look like for the given revision"""
     if rev == "":
@@ -2717,6 +2725,7 @@
          [('e', 'extended', None, _('try extended date formats'))],
          _('debugdate [-e] DATE [RANGE]')),
     "debugdata": (debugdata, [], _('debugdata FILE REV')),
+    "debugfsinfo": (debugfsinfo, [], _('debugfsinfo [PATH]')),
     "debugindex": (debugindex, [], _('debugindex FILE')),
     "debugindexdot": (debugindexdot, [], _('debugindexdot FILE')),
     "debugrename":
@@ -2981,5 +2990,5 @@
 }
 
 norepo = ("clone init version help debugancestor debugcomplete debugdata"
-          " debugindex debugindexdot debugdate debuginstall")
+          " debugindex debugindexdot debugdate debuginstall debugfsinfo")
 optionalrepo = ("identify paths serve showconfig")
--- a/tests/test-debugcomplete.out	Thu Dec 27 23:55:40 2007 -0600
+++ b/tests/test-debugcomplete.out	Thu Dec 27 23:55:40 2007 -0600
@@ -62,6 +62,7 @@
 debugconfig
 debugdata
 debugdate
+debugfsinfo
 debugindex
 debugindexdot
 debuginstall