test-check-code: prevent files being added to the root directory
authorJun Wu <quark@fb.com>
Wed, 29 Mar 2017 12:14:20 -0700
changeset 31731 bdb72dd3957e
parent 31730 c777b12cdc9b
child 31732 6be6e4becaaf
test-check-code: prevent files being added to the root directory Adding new files in the root directory is probably a mistake, and is usually discouraged [1]. The test catches it to avoid mistakes like [2]. Modify the test if files need to be added in the root. [1]: https://www.mercurial-scm.org/pipermail/mercurial-devel/2016-July/086442.html [2]: https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-March/095836.html
tests/test-check-code.t
--- a/tests/test-check-code.t	Wed Mar 29 09:54:34 2017 -0400
+++ b/tests/test-check-code.t	Wed Mar 29 12:14:20 2017 -0700
@@ -57,3 +57,20 @@
   ...         print('commands in debugcommands.py not sorted; first differing '
   ...               'command is %s; expected %s' % (commands[i], command))
   ...         break
+
+Prevent adding new files in the root directory accidentally.
+
+  $ hg files 'glob:*'
+  .editorconfig
+  .hgignore
+  .hgsigs
+  .hgtags
+  CONTRIBUTING
+  CONTRIBUTORS
+  COPYING
+  Makefile
+  README
+  hg
+  hgeditor
+  hgweb.cgi
+  setup.py