Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.9, 0.9.1, and 0.9.1.1

history: disable strip and qimport on mq and mq ancestor changesets

Previously repositories with mq changesets applied could have them stripped
causing mq to go into a "bad" state that would require manual update of the mq
state file to reflect the modified layout of the repository. This fix makes it
impossible to strip or qimport an ancestor to an applied mq changeset.

Changeset 4f7142691c9c

Parent 1658b6c58d4f

by Henrik Stuart

Changes to one file · Browse files at 4f7142691c9c Showing diff from parent 1658b6c58d4f Diff from another changeset...

 
609
610
611
612
613
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
614
615
616
 
609
610
611
 
 
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
@@ -609,8 +609,23 @@
    # need mq extension for strip command   if 'mq' in self.exs: - m.append(create_menu(_('qimport'), self.qimport_rev)) - m.append(create_menu(_('strip revision'), self.strip_rev)) + cmenu_qimport = create_menu(_('qimport'), self.qimport_rev) + cmenu_strip = create_menu(_('strip revision'), self.strip_rev) + + try: + ctx = self.repo[self.currevid] + qbase = self.repo['qbase'] + actx = ctx.ancestor(qbase) + if actx == qbase or actx == ctx: + # we're in the mq revision range or the mq + # is a descendant of us + cmenu_qimport.set_sensitive(False) + cmenu_strip.set_sensitive(False) + except: + pass + + m.append(cmenu_qimport) + m.append(cmenu_strip)     m.show_all()   return m