Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.0.1, 1.0.2, and 1.0.3

stable thgmq: fix case of reordering patch preceded by guarded one

MQ reorder fails in the following case:

0 foo # guarded, unapplied
1 bar # applied
---
2 baz # unapplied

Moving 'baz' up raises exception and breaks '.hg/patches/series'.

Changeset 437f9ffbd168

Parent d38af8bd2e69

by Yuya Nishihara

Changes to one file · Browse files at 437f9ffbd168 Showing diff from parent d38af8bd2e69 Diff from another changeset...

 
476
477
478
479
 
 
480
481
 
482
483
484
 
 
 
485
486
487
 
476
477
478
 
479
480
481
 
482
483
 
 
484
485
486
487
488
489
@@ -476,12 +476,14 @@
  if maxidx < idx:   maxidx = idx   - # find index of first unapplied patch in TreeView + # find index of first unapplied patch after last applied one in TreeView + uminidx = None   for i, row in enumerate(model): - if self.is_unapplied(row[MQ_NAME]): + if uminidx is None and self.is_unapplied(row[MQ_NAME]):   uminidx = i - break - else: + elif self.is_applied(row[MQ_NAME]): + uminidx = None + if uminidx is None:   return False     # check whether operation is possible