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

status: behavior fixes

* run auto_check() before selecting rows so file states are already set
when we're parsing the diff hunks.
* don't modify file's selection state when no diff hunks were found

Changeset e3f7faffa047

Parent c75c63056511

by Steve Borho

Changes to one file · Browse files at e3f7faffa047 Showing diff from parent c75c63056511 Diff from another changeset...

Change 1 of 4 Show Entire File hggtk/​status.py Stacked
 
607
608
609
 
 
610
611
612
 
634
635
636
637
638
639
640
 
944
945
946
 
947
948
949
 
975
976
977
978
979
980
 
 
981
982
983
984
985
986
987
988
989
990
991
992
993
 
 
 
 
 
 
 
 
994
995
996
 
607
608
609
610
611
612
613
614
 
636
637
638
 
639
640
641
 
945
946
947
948
949
950
951
 
977
978
979
 
 
 
980
981
982
983
984
985
 
986
987
988
 
 
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
@@ -607,6 +607,8 @@
  self.filemodel.append([wfile in recheck, char,   hglib.toutf(wfile), wfile, mst, False])   + self.auto_check() +   selected = False   for row in model:   if row[FM_PATH] in reselect: @@ -634,7 +636,6 @@
  if not self.ready: return False   self.last_file = None   res, outtext = self._hg_call_wrapper('Status', self.do_reload_status) - self.auto_check()   self.update_check_count()   return res   @@ -944,6 +945,7 @@
  return   rows = []   for n, chunk in enumerate(chunks): + # append this attribute to the chunk   chunk.active = True   if isinstance(chunk, hgshelve.header):   rows.append([False, '', True, wfile, n, self.headerfont]) @@ -975,22 +977,26 @@
  # Set row status based on chunk state   rej, nonrej = False, False   for n, row in enumerate(rows): - if row[DM_IS_HEADER]: - row[DM_REJECTED] = not chunks[n].active - else: + row[DM_REJECTED] = not chunks[n].active + 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   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:   fr[FM_PARTIAL_SELECTED] = partial   if fr[FM_CHECKED] != newvalue: