Commits

Yuya Nishihara committed 9c873f3

wctxcleaner: do not report branch change as dirty working directory (refs #3822)

Mercurial allows backout, graft, merge and rebase onto new branch.

  • Participants
  • Parent commits 21e3fd6
  • Branches stable

Comments (0)

Files changed (1)

tortoisehg/hgqt/wctxcleaner.py

 from PyQt4.QtCore import pyqtSignal, pyqtSlot
 from PyQt4.QtGui import QMessageBox, QWidget
 
-from mercurial import hg
+from mercurial import cmdutil, hg, util
 
 from tortoisehg.hgqt.i18n import _
 from tortoisehg.hgqt import cmdcore, cmdui, qtlib, thgrepo
 
+def _checkchanged(repo):
+    try:
+        cmdutil.bailifchanged(repo)
+        return False
+    except util.Abort:
+        return True
+
+
 class CheckThread(QThread):
     def __init__(self, repo, parent):
         QThread.__init__(self, parent)
                 break
         wctx = self.repo[None]
         try:
-            dirty = bool(wctx.dirty()) or unresolved
+            dirty = _checkchanged(self.repo) or unresolved
             self.results = (dirty, len(wctx.parents()))
         except EnvironmentError:
             self.results = (True, len(wctx.parents()))