Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

status: give diff hunks their file's checked status by default

This seems to be more robust refresh mechanism.

Changeset 2abc7e3e70f3

Parent 7e04b9b03c08

by Steve Borho

Changes to one file · Browse files at 2abc7e3e70f3 Showing diff from parent 7e04b9b03c08 Diff from another changeset...

Change 1 of 2 Show Entire File hggtk/​status.py Stacked
 
933
934
935
 
 
 
 
 
 
 
 
936
937
938
939
 
 
940
941
942
 
968
969
970
 
 
 
 
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
 
933
934
935
936
937
938
939
940
941
942
943
944
945
 
 
946
947
948
949
950
 
976
977
978
979
980
981
982
983
 
 
 
 
984
985
986
 
 
 
 
 
 
 
 
 
987
988
989
@@ -933,10 +933,18 @@
  if wfile in self.filechunks:   del self.filechunks[wfile]   return + + for fr in self.filemodel: + if fr[FM_PATH] == wfile: + break + else: + # should not be possible + return +   rows = []   for n, chunk in enumerate(chunks): - # append this attribute to the chunk - chunk.active = True + # chunks take file's selection state by default + chunk.active = fr[FM_CHECKED]   if isinstance(chunk, hgshelve.header):   rows.append([False, '', True, wfile, n, self.headerfont])   if chunk.special(): @@ -968,23 +976,14 @@
  rej, nonrej = False, False   for n, row in enumerate(rows):   row[DM_REJECTED] = not chunks[n].active + if chunks[n].active: + nonrej = True + else: + rej = True   if not row[DM_IS_HEADER]: - if chunks[n].active: - nonrej = True - else: - rej = True   self.update_diff_hunk(row)   self.diffmodel.append(row)   - for fr in self.filemodel: - if fr[FM_PATH] == wfile: - break - - # Do not modify file's selection state if no diff hunks - if len(chunks) == 1: - self.update_diff_header(self.diffmodel, wfile, fr[FM_CHECKED]) - return -   newvalue = nonrej   partial = rej and nonrej   if fr[FM_PARTIAL_SELECTED] != partial: