# HG changeset patch
# User Adrian Buehlmann <adr...@cadifra.com>
# Date 1253188983 -7200
# Node ID dd5872243ab07348344b119a41d7758122a48f5a
# Parent  c395252797ab8f09bf681e296218d67aada78f4c
status: introduce 'fixed' file type and use it for '!' files

There's hardly ever a reason to hide deleted ('!') files
(note that 'hg help status' calls them 'missing').

Having deleted ('!') files is just a plain user error that
they should fix in the first place.

Let's not provide users the opportunity to suppress them
("Oh. I inadvertantly unchecked the 'deleted' files. So
I couldn't see that I forgot to hg remove them!")

So we don't provide a checkbox for it, just provide
the explanation for the '!' status code in form of a label.

diff --git a/tortoisehg/hgtk/status.py b/tortoisehg/hgtk/status.py
--- a/tortoisehg/hgtk/status.py
+++ b/tortoisehg/hgtk/status.py
@@ -472,19 +472,19 @@ class GStatus(gdialog.GDialog):
 
     def get_status_types(self):
         # Tuple: (onmerge, ctype, translated label)
-        allchecks = [(False, 'unknown',  _('?: unknown')),
-                     (True,  'modified', _('M: modified')),
-                     (False, 'ignored',  _('I: ignored')),
-                     (True,  'added',    _('A: added')),
-                     (False, 'clean',    _('C: clean')),
-                     (True,  'removed',  _('R: removed')),
-                     (False, 'deleted',  _('!: deleted')) ]
+        allchecks = [(False, False, 'unknown',  _('?: unknown')),
+                     (True,  False, 'modified', _('M: modified')),
+                     (False, False, 'ignored',  _('I: ignored')),
+                     (True,  False, 'added',    _('A: added')),
+                     (False, False, 'clean',    _('C: clean')),
+                     (True,  False, 'removed',  _('R: removed')),
+                     (False, True,  'deleted',  _('!: deleted')) ]
 
         checks = []
         nomerge = (self.count_revs() <= 1)
-        for onmerge, button, text in allchecks:
+        for onmerge, fixed, button, text in allchecks:
             if onmerge or nomerge:
-                checks.append((button, text))
+                checks.append((fixed, button, text))
 
         table = gtk.Table(rows=2, columns=3)
         table.set_col_spacings(8)
@@ -492,11 +492,14 @@ class GStatus(gdialog.GDialog):
         self._show_checks = {}
         row, col = 0, 0
 
-        for name, labeltext in checks:
-            check = gtk.CheckButton(labeltext)
-            check.connect('toggled', self.show_toggle, name)
-            table.attach(check, col, col+1, row, row+1)
-            self._show_checks[name] = check
+        for fixed, name, labeltext in checks:
+            button = gtk.CheckButton(labeltext)
+            widget = button
+            if fixed:
+                widget = gtk.Label(labeltext)
+            button.connect('toggled', self.show_toggle, name)
+            self._show_checks[name] = button
+            table.attach(widget, col, col+1, row, row+1)
             col += row
             row = not row
 

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Tortoisehg-develop mailing list
Tortoisehg-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop

Reply via email to