André Sintzoff avatar André Sintzoff committed 4491162

bugreport: adapt generated bugreport text to new Bitbucket code block marker

On 9 October 2012, the marker for code block in Bitbucket issue tracker has
been changed: no more {{{ and }}} but 4 spaces indent (Markdown syntax).

Comments (0)

Files changed (1)


 import os
 import sys
+import re
 from mercurial import encoding, extensions
 from tortoisehg.util import hglib, version
     def gettext(self, opts):
         # TODO: make this more uniformly unicode safe
-        text = '{{{\n#!python\n' # Wrap in Bitbucket wiki preformat markers
+        text = '#!python\n' # Bitbucket wiki marker for python code
         text += '** Mercurial version (%s).  TortoiseHg version (%s)\n' % (
                 hglib.hgversion, version.version())
         text += '** Command: %s\n' % (hglib.tounicode(opts.get('cmd', 'N/A')))
             text += self.getarch()
         text += '** Qt-%s PyQt-%s\n' % (QT_VERSION_STR, PYQT_VERSION_STR)
         text += hglib.tounicode(opts.get('error', 'N/A'))
-        text += '\n}}}'
+        # Bitbucket wiki marker for code: 4 spaces indent (Markdown syntax)
+        regexp = re.compile(r'^', re.MULTILINE)
+        text = regexp.sub(r'    ', text)
         return text
     def copyText(self):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.