Commits

Anonymous committed 5fe5839

commit: Add workaround for messages that begin with '-' (closes #1712)

Comments (0)

Files changed (1)

tortoisehg/hgtk/commit.py

         files += self.opts['include']
         if not files and not self.is_merge():
             cmdline += ['-X', self.repo.root]
-        cmdline += ['--message', hglib.fromutf(self.opts['message'])]
+        message = hglib.fromutf(self.opts['message'])
+        if message.startswith('-'):
+            message = ' ' + message
+        cmdline += ['--message', message]
         if self.qnew:
             cmdline += [hglib.fromutf(self.get_qnew_name())]
         if files: