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

mq: more intelligent mixing of patch state and working directory state

A file could be added by the patch and modified by the working dir, we only
want to display that file once, as added. Qref will combine them this way.
If a file is marked added or removed in the working directory, they should be
shown as A or R respectively.

Changeset 7ac946ea294d

Parent 434b71f6a43a

by Steve Borho

Changes to one file · Browse files at 7ac946ea294d Showing diff from parent 434b71f6a43a Diff from another changeset...

 
600
601
602
 
 
 
 
 
 
 
 
 
603
604
605
606
607
608
609
610
 
 
 
 
 
 
 
 
 
 
 
611
612
613
614
 
 
 
615
616
617
 
600
601
602
603
604
605
606
607
608
609
610
611
612
 
 
 
 
 
 
 
613
614
615
616
617
618
619
620
621
622
623
624
 
 
 
625
626
627
628
629
630
@@ -600,18 +600,31 @@
  self.fileListWidget.clear()   pctx = self.repo.changectx('.')   newmode = self.newCheckBox.isChecked() + # Get patch file lists + if not newmode and 'qtip' in pctx.tags(): + M, A, R = self.repo.status(pctx.p1().node(), pctx.node())[:3] + pm, pa, pr = set(M), set(A), set(R) + elif newmode: + pm, pa, pr = set(), set(), set() + else: + return + # Get working directory file lists   M, A, R = self.repo[None].status()[:3] - if not newmode and 'qtip' in pctx.tags(): - pm, pa, pr = self.repo.status(pctx.p1().node(), pctx.node())[:3] - M = set(pm) or set(M) - A = set(pa) or set(A) - R = set(pr) or set(R) - elif not newmode: - return + for file in M: + if file not in pa and file not in pr: + pm.add(file) + for file in A: + pr.discard(file) + pm.discard(file) + pa.add(file) + for file in R: + pa.discard(file) + pm.discard(file) + pr.add(file)   flags = Qt.ItemIsSelectable | Qt.ItemIsUserCheckable | Qt.ItemIsEnabled - addfiles(u'M', M) - addfiles(u'A', A) - addfiles(u'R', R) + addfiles(u'M', pm) + addfiles(u'A', pa) + addfiles(u'R', pr)     def refreshSelectedGuards(self):   total = len(self.allguards)