Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.0, 2.0.1, and 2.0.2

stable repowidget: new "Modify history" contextmenu submenu entry

- Allow comma separated list of extensions for enbling cmenu entries (OR'ed)
- Add a new "Modify history" submenu, which is shown if the mq or
the rebase extension is enabled

The "Modify history" submenu contains the following entries:

QGoto
Import to MQ
Finish patch
---
Rebase...
---
Strip...

Changeset ca8440023435

Parent bca1f46f71df

by Adrian Buehlmann

Changes to one file · Browse files at ca8440023435 Showing diff from parent bca1f46f71df Diff from another changeset...

 
885
886
887
888
889
890
891
 
892
893
894
 
 
 
895
896
897
898
899
900
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
901
902
903
904
905
906
907
 
 
 
908
 
909
910
911
 
916
917
918
 
919
920
921
 
885
886
887
 
888
889
 
890
891
892
893
894
895
896
897
898
899
 
 
 
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
 
 
920
921
922
923
924
925
926
927
 
932
933
934
935
936
937
938
@@ -885,27 +885,43 @@
  (0, None, None, None, None, None),   (0, None, isrev, _('Copy hash'), 'copy-hash', self.copyHash),   (0, None, None, None, None, None), - (0, 'rebase', fixed, _('Rebase...'), None, self.rebaseRevision),   (0, 'transplant', fixed, _('Transplant to local'), 'hg-transplant',   self.transplantRevision), - (1, 'mq', None, _('Patch Queue'), None, None), + (1, 'mq,rebase', None, _('Modify history'), None, None),   (2, 'mq', qgoto, _('QGoto'), 'hg-qgoto', self.qgotoRevision),   (2, 'mq', fixed, _('Import to MQ'), 'qimport', self.qimportRevision),   (2, 'mq', applied, _('Finish patch'), 'qfinish', self.qfinishRevision), + (2, None, None, None, None, None), + (2, 'rebase', fixed, _('Rebase...'), None, self.rebaseRevision), + (2, None, None, None, None, None),   (2, 'mq', fixed, _('Strip...'), 'menudelete', self.stripRevision),   (0, 'reviewboard', fixed, _('Post to Review Board...'),   'reviewboard', self.sendToReviewBoard)): - if ext and ext not in exs: - continue - if type == 1: # start submenu + + if ext: + enable = False + for e in ext.split(','): + if e in exs: + enable = True + break + if not enable: + continue + + if type == 0: # normal entry + m = menu + submenu = None + elif type == 1: # start submenu + m = menu   if icon:   submenu = menu.addMenu(icon, desc)   else:   submenu = menu.addMenu(desc)   continue - m = menu - if type == 2: # submenu entry + elif type == 2: # submenu entry + if submenu is None: + continue   m = submenu +   if desc is None:   m.addSeparator()   else: @@ -916,6 +932,7 @@
  act.enableFunc = func   m.addAction(act)   items.append(act) +   self.singlecmenu = menu   self.singlecmenuitems = items