Commits

Anonymous committed 5018ca4

patchctx: make phase info available for patches

  • Participants
  • Parent commits 8a4d0fc
  • Branches stable

Comments (0)

Files changed (1)

File tortoisehg/util/patchctx.py

         self._mtime = None
         self._fsize = 0
         self._parseerror = None
+        self._phase = 'draft'
 
         try:
             self._mtime = os.path.getmtime(patchpath)
         try:
             self._branch = ph.branch or ''
             self._node = binascii.unhexlify(ph.nodeid)
+            if self._repo.ui.configbool('mq', 'secret'):
+                self._phase = 'secret'
         except TypeError:
             pass
         except AttributeError:
             ph.diffstartline = len(ph.comments)
             if ph.message:
                 ph.diffstartline += 1
+        except error.ConfigError:
+            pass
+
         self._user = ph.user or ''
         self._desc = ph.message and '\n'.join(ph.message).strip() or ''
         try:
             return buf.getvalue()
         return ''
 
+    def phasestr(self):
+        return self._phase
+
     @propertycache
     def _files(self):
         if not hasattr(self, '_ph') or not self._ph.haspatch: