Benoît Allard  committed 405b203

Improve documentation

  • Participants
  • Parent commits 24dd0aa

Comments (0)

Files changed (2)

 files the most succeptible to have issues. Or at least, the one that
 contained issues in the late time.
-This command can takes two parameters:
+This command can takes up to four parameters:
--r REV, --revision=REV
+-r REV, --revision REV
     This stop the computation at a particular revision and displays
     the *hot* files at that moment in time. By default, the current
     parent revision will be used.
--p REGEX, --pattern=REGEX
+-p REGEX, --pattern REGEX
     This is a regular expression used on the commit message to filter
     only the changesets that are related to issues.
+-I PATTERN, --include PATTERN
+    The specified files will be explicitely included in the computation
+    (the rest will be excluded).
+-X PATTERN, --exclude PATTERN
+    The specified files will be excluded from the included files.
    hg hotfiles -p 'issue\d+'
 """detect hot files
-Based on the following blog article:
+This work is based on the following blog article:
+This extension can be configured through the configuration file to avoid
+repeating the same parameters again and again on the command line. The
+configuration keys have to be under the ``hotfiles`` section, and can have
+one of the following values::
+    [hotfiles]
+    pattern = issue\d+
+    include.glob = 
+      **/*.py
+    exclude.glob =
+      README*
+      .hg*
 import re
          _('[-r REV] [-p REGEX]')
 def hotfiles(ui, repo, node=None, rev='.', pattern=None, **opts):
-    """
-    Files are hot.
+    """ Print the ten files the most susceptible to contains issues.
+    The calculation is based on the number of time a file was touched during
+    a bug-fixing commit, later commits weight more than earlier ones.
+    The list of files analysed is based on the files present in the sepcified
+    revision, this list can be filtered through the usage of include/exclude
+    patterns on the command line or in the configuration file.
+    The list of revisions analysed is by default all the non-merge revision.
+    This list can be filtered by using a pattern given through the command line
+    or the configuration file.
     if not pattern:
         pattern = ui.config('hotfiles', 'pattern')
         if pattern is None:
-            ui.debug('No pattern configured, taking all (non-merge) commits\n')
+            ui.debug('No pattern configured, taking all non-merge commits\n')
             pattern = '.*'
     ui.debug('using %s as pattern to filter changesets\n' % pattern)
         for t in ts:
             s += 1 / (1 + exp((-12 * t) + 12))
         d.append((f, s))
-        ui.progress('score', pos, f,total=len(data))
+        ui.progress('score', pos, f, total=len(data))
         pos += 1
     ui.progress('score', None)