Commits

Michael Diamond committed 97c0153

Improved default details file construction

Comments (0)

Files changed (3)

.bugs/details/9ce51de4c80014f8cf09e97041a8ae1d9cc001e4.txt

+# Lines starting with '#' and sections without content
+# are not displayed by a call to 'details'
+#
+[paths]
+# Paths related to this bug.
+# suggested format: REPO_PATH:LINENUMBERS
+
+
+[details]
+# Additional details
+
+
+[expected]
+# The expected result
+
+
+[actual]
+# What happened instead
+
+
+[reproduce]
+# Reproduction steps
+
+
+[comments]
+# Comments and updates - leave your name
+
+By: Michael
+On: Friday, December 23 2011 03:01AM
+Added reporter and stacktrace fields, and improved how the default details file string is constructed.  New fields must be manually uncommented.
         self.assertTrue(re.match('Title: new test\nID: ce91fd20f393d261ea86e97fa26c273d02d43b4b\n'
                                  '\*Resolved\* Owned By: User\n'
                                  'Filed On: \w+, \w+ \d\d \d\d\d\d \d\d:\d\d[A|P]M\n\n'
-                                 '\[comments\]\n\n\nBy: Another User\n'
+                                 '\[comments\]\n\nBy: Another User\n'
                                  'On: \w+, \w+ \d\d \d\d\d\d \d\d:\d\d[A|P]M\nResolved an issue.\n'
                                  'How nice!',
                                  self.bd.details('c')))
         self.bd.add('test')
         self.bd.comment('a', 'This is a comment')
         self.assertTrue(re.match('Title: test\nID: a94a8fe5ccb19ba61c4c0873d391e987982fbbd3'
-                        '\nFiled On: \w+, \w+ \d\d \d\d\d\d \d\d:\d\d[A|P]M\n\n\[comments\]\n\n\n'
+                        '\nFiled On: \w+, \w+ \d\d \d\d\d\d \d\d:\d\d[A|P]M\n\n\[comments\]\n\n'
                         'On: \w+, \w+ \d\d \d\d\d\d \d\d:\d\d[A|P]M\nThis is a comment',
                         self.bd.details('a')))
     
 #
 # Version
 #
-version = _("b Version 0.6.0 - built 11-7-11")
+version = _("b Version 0.6.1 - built 12-23-11")
 
 #
 # Static values / config settings
         self.file = 'bugs'
         self.detailsdir = 'details'
         self.bugs = {}
-        self.init_details = ("# Lines starting with '#' and sections without content\n# are not displayed by a call to 'details'\n#\n"
-        "[paths]\n# Paths related to this bug.\n# suggested format: REPO_PATH:LINENUMBERS\n\n\n"
-        "[details]\n# Additional details\n\n\n"
-        "[expected]\n# The expected result\n\n\n"
-        "[actual]\n# What happened instead\n\n\n"
-        "[reproduce]\n# Reproduction steps\n\n\n"
-        "[comments]\n# Comments and updates - leave your name\n")
+        # this is the default contents of the bugs directory.  If you'd like, you can
+        # modify this variable's contents.  Be sure to leave [comments] as the last field.
+        # Remember that storing metadata like [reporter] in the details file is not secure.
+        # it is recommended that you use Mercurial's excellent data-mining tools such as log
+        # and annotate to get such information.
+        self.init_details = '\n'.join([
+        "# Lines starting with '#' and sections without content\n# are not displayed by a call to 'details'\n#",
+        #"[reporter]\n# The user who created this file\n# This field can be edited, and is just a convenience\n%s\n" % self.user,
+        "[paths]\n# Paths related to this bug.\n# suggested format: REPO_PATH:LINENUMBERS\n\n",
+        "[details]\n# Additional details\n\n",
+        "[expected]\n# The expected result\n\n",
+        "[actual]\n# What happened instead\n\n",
+        #"[stacktrace]\n# A stack trace or similar diagnostic info\n\n",
+        "[reproduce]\n# Reproduction steps\n\n",
+        "[comments]\n# Comments and updates - leave your name"
+        ])
         path = os.path.join(os.path.expanduser(self.bugsdir), self.file)
         if os.path.isdir(path):
             raise InvalidTaskfile(_("The path where the bugs database should be is blocked and cannot be created."))