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

status: header chunks must stay active

if header chunks become "rejected", they do not toggle appropriately.

Changeset 271bedf3ae91

Parent ba5af6808ce3

by Steve Borho

Changes to one file · Browse files at 271bedf3ae91 Showing diff from parent ba5af6808ce3 Diff from another changeset...

Change 1 of 2 Show Entire File hggtk/​status.py Stacked
 
943
944
945
946
947
948
 
 
949
950
951
952
953
 
 
954
955
956
957
958
959
960
961
962
963
 
975
976
977
978
979
980
981
982
983
 
 
 
 
 
984
985
986
987
988
989
990
991
992
993
 
 
 
 
 
 
 
 
 
 
994
995
996
 
943
944
945
 
 
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
 
962
963
964
 
976
977
978
 
 
 
 
 
979
980
981
982
983
984
985
986
987
 
 
 
 
 
 
 
988
989
990
991
992
993
994
995
996
997
998
999
1000
@@ -943,21 +943,22 @@
    rows = []   for n, chunk in enumerate(chunks): - # chunks take file's selection state by default - chunk.active = fr[FM_CHECKED]   if isinstance(chunk, hgshelve.header): + # header chunk is always active + chunk.active = True   rows.append([False, '', True, wfile, n, self.headerfont])   if chunk.special():   chunks = chunks[:1]   break   else: + # chunks take file's selection state by default + chunk.active = fr[FM_CHECKED]   rows.append([False, '', False, wfile, n, self.difffont])       # recover old chunk selection/rejection states, match fromline   if wfile in self.filechunks:   ochunks = self.filechunks[wfile] - chunks[0].active = ochunks[0].active   next = 1   for oc in ochunks[1:]:   for n in xrange(next, len(chunks)): @@ -975,22 +976,25 @@
  # Set row status based on chunk state   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 + row[DM_REJECTED] = not chunks[n].active   self.update_diff_hunk(row)   self.diffmodel.append(row)   - newvalue = nonrej - partial = rej and nonrej - if fr[FM_PARTIAL_SELECTED] != partial: - fr[FM_PARTIAL_SELECTED] = partial - if fr[FM_CHECKED] != newvalue: - fr[FM_CHECKED] = newvalue - self.update_check_count() + if len(rows) == 1: + newvalue = fr[FM_CHECKED] + else: + newvalue = nonrej + partial = rej and nonrej + if fr[FM_PARTIAL_SELECTED] != partial: + fr[FM_PARTIAL_SELECTED] = partial + if fr[FM_CHECKED] != newvalue: + fr[FM_CHECKED] = newvalue + self.update_check_count()   self.update_diff_header(self.diffmodel, wfile, newvalue)