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 status: drop self.filerowstart

I don't expect we'll support multiple files in the hunk selection pane anymore,
and the current multi-file logic has bugs.

Closes #1061

Changeset 97447b5e736a

Parent 22804f32bb99

by Steve Borho

Changes to one file · Browse files at 97447b5e736a Showing diff from parent 22804f32bb99 Diff from another changeset...

 
85
86
87
88
89
90
91
 
829
830
831
832
833
834
835
836
837
838
839
840
 
 
841
842
843
 
859
860
861
862
863
864
865
866
867
 
868
869
870
871
 
872
873
874
 
1147
1148
1149
1150
1151
1152
1153
 
1231
1232
1233
1234
1235
1236
1237
 
1265
1266
1267
1268
1269
1270
1271
1272
 
1273
1274
1275
1276
1277
1278
1279
 
1280
1281
1282
 
85
86
87
 
88
89
90
 
828
829
830
 
 
 
 
831
832
833
 
 
834
835
836
837
838
 
854
855
856
 
857
858
859
860
 
861
862
863
864
 
865
866
867
868
 
1141
1142
1143
 
1144
1145
1146
 
1224
1225
1226
 
1227
1228
1229
 
1257
1258
1259
 
1260
1261
1262
 
1263
1264
1265
1266
1267
1268
1269
 
1270
1271
1272
1273
@@ -85,7 +85,6 @@
  gdialog.GWindow.init(self)   self.mode = 'status'   self.ready = False - self.filerowstart = {}   self.filechunks = {}   self.status = (None,) * 7   self.status_error = None @@ -829,15 +828,11 @@
  chunks = self.filechunks[wfile]   for chunk in chunks:   chunk.active = selected - # this file's chunks may not be in diffmodel - if wfile not in self.filerowstart: - return - rowstart = self.filerowstart[wfile]   for n, chunk in enumerate(chunks):   if n == 0:   continue - self.diffmodel[rowstart+n][DM_REJECTED] = not selected - self.update_diff_hunk(self.diffmodel[rowstart+n]) + self.diffmodel[n][DM_REJECTED] = not selected + self.update_diff_hunk(self.diffmodel[n])   self.update_diff_header(self.diffmodel, wfile, selected)     def update_diff_hunk(self, row): @@ -859,16 +854,15 @@
    def update_diff_header(self, dmodel, wfile, selected):   try: - hc = self.filerowstart[wfile]   chunks = self.filechunks[wfile]   except IndexError:   return   lasthunk = len(chunks)-1 - sel = lambda x: x >= lasthunk or not dmodel[hc+x+1][DM_REJECTED] + sel = lambda x: x >= lasthunk or not dmodel[x+1][DM_REJECTED]   newtext = chunks[0].selpretty(sel)   if not selected:   newtext = "<span foreground='#888888'>" + newtext + "</span>" - dmodel[hc][DM_DISP_TEXT] = newtext + dmodel[0][DM_DISP_TEXT] = newtext     def updated_codes(self):   types = [('modified', 'M'), @@ -1147,7 +1141,6 @@
  def update_hunk_model(self, path, tree):   # Read this file's diffs into hunk selection model   wfile = self.filemodel[path][FM_PATH] - self.filerowstart = {}   self.diffmodel.clear()   if not self.is_merge():   self.append_diff_hunks(wfile) @@ -1231,7 +1224,6 @@
  elif nc.fromline > oc.fromline:   break   - self.filerowstart[wfile] = len(self.diffmodel)   self.filechunks[wfile] = chunks     # Set row status based on chunk state @@ -1265,18 +1257,17 @@
  row = dmodel[path]   wfile = row[DM_PATH]   try: - startrow = self.filerowstart[wfile]   chunks = self.filechunks[wfile]   except IndexError:   pass - chunkrows = xrange(startrow+1, startrow+len(chunks)) + chunkrows = xrange(1, len(chunks))   for fr in self.filemodel:   if fr[FM_PATH] == wfile:   break   if row[DM_IS_HEADER]:   for n, chunk in enumerate(chunks[1:]):   chunk.active = not fr[FM_CHECKED] - self.update_diff_hunk(dmodel[startrow+n+1]) + self.update_diff_hunk(dmodel[n+1])   newvalue = not fr[FM_CHECKED]   partial = False   else: