Commits

Niels Kühnel committed 53bc2c2

"Force" option when pushing and popping MQ patches

  • Participants
  • Parent commits 6833e43
  • Branches stable

Comments (0)

Files changed (1)

tortoisehg/hgtk/thgmq.py

                             'ShowQParent',
                             "Show 'qparent'",
                             False,
+                            gobject.PARAM_READWRITE),
+        'force-pushpop': (gobject.TYPE_BOOLEAN,
+                            'ForcePushPop',
+                            "Force",
+                            False,
                             gobject.PARAM_READWRITE)
     }
 
         if not self.is_operable():
             return
         cmdline = ['hg', 'qpop']
+
+        if self.get_property('force-pushpop'):
+            cmdline.append('-f')
+
         if all:
             cmdline.append('--all')
         self.cmd.execute(cmdline, self.cmd_done)
         if not self.is_operable():
             return
         cmdline = ['hg', 'qpush']
+
+        if self.get_property('force-pushpop'):
+            cmdline.append('-f')
+
         if all:
             cmdline.append('--all')
         self.cmd.execute(cmdline, self.cmd_done)
                         ascheck=True, check=True)
         self.vmenu['show-qparent'] = item
 
+        item = m.append(_("Force"), lambda item: self.refresh(),
+                        ascheck=True, check=False)
+        self.vmenu['force-pushpop'] = item
+
+
         menu = m.build()
         menu.show_all()
         return menu