Commits

Steve Borho committed 28f12c4

wctxactions: do not prompt for revert --discard unless at least one file is 'M'

  • Participants
  • Parent commits 8ebeb19
  • Branches stable

Comments (0)

Files changed (1)

File tortoisehg/hgqt/wctxactions.py

             return
         commands.revert(ui, repo, *files, **revertopts)
     else:
-        res = qtlib.CustomPrompt(
+        wctx = repo[None]
+        if [file for file in files if file in wctx.modified()]:
+            res = qtlib.CustomPrompt(
                 _('Confirm Revert'),
                 _('Revert local file changes?'), parent,
                 (_('&Revert with backup'), _('&Discard changes'),
                 _('Cancel')), 2, 2, files).run()
-        if res == 2:
-            return False
-        if res == 1:
-            revertopts['no_backup'] = True
+            if res == 2:
+                return False
+            if res == 1:
+                revertopts['no_backup'] = True
         commands.revert(ui, repo, *files, **revertopts)
         return True