Fossil SCM

Fix a gap positions vs. adjacent chunks positions mix-up in the diff context loader. The test case to reveal this bug is the 2nd gap of commit diff [d6ddd5bcfa]. Congrats again to Stephan for this smart code!

florian 2023-06-15 19:12 trunk
Commit 8347c4add17272170f557fd74ed0c2e8a28111c52814b3d49caba0a9e43e7034
1 file changed +2 -1
--- src/fossil.diff.js
+++ src/fossil.diff.js
@@ -169,13 +169,14 @@
169169
}
170170
let btnUp = false, btnDown = false;
171171
/**
172172
this.pos.next refers to the line numbers in the next TR's chunk.
173173
this.pos.prev refers to the line numbers in the previous TR's chunk.
174
+ this.pos corresponds to the line numbers of the gap.
174175
*/
175176
if(this.pos.prev && this.pos.next
176
- && ((this.pos.next.startLhs - this.pos.prev.endLhs)
177
+ && ((this.pos.endLhs - this.pos.startLhs)
177178
<= Diff.config.chunkLoadLines)){
178179
/* Place a single button to load the whole block, rather
179180
than separate up/down buttons. */
180181
btnDown = false;
181182
btnUp = this.createButton(this.FetchType.FillGap);
182183
--- src/fossil.diff.js
+++ src/fossil.diff.js
@@ -169,13 +169,14 @@
169 }
170 let btnUp = false, btnDown = false;
171 /**
172 this.pos.next refers to the line numbers in the next TR's chunk.
173 this.pos.prev refers to the line numbers in the previous TR's chunk.
 
174 */
175 if(this.pos.prev && this.pos.next
176 && ((this.pos.next.startLhs - this.pos.prev.endLhs)
177 <= Diff.config.chunkLoadLines)){
178 /* Place a single button to load the whole block, rather
179 than separate up/down buttons. */
180 btnDown = false;
181 btnUp = this.createButton(this.FetchType.FillGap);
182
--- src/fossil.diff.js
+++ src/fossil.diff.js
@@ -169,13 +169,14 @@
169 }
170 let btnUp = false, btnDown = false;
171 /**
172 this.pos.next refers to the line numbers in the next TR's chunk.
173 this.pos.prev refers to the line numbers in the previous TR's chunk.
174 this.pos corresponds to the line numbers of the gap.
175 */
176 if(this.pos.prev && this.pos.next
177 && ((this.pos.endLhs - this.pos.startLhs)
178 <= Diff.config.chunkLoadLines)){
179 /* Place a single button to load the whole block, rather
180 than separate up/down buttons. */
181 btnDown = false;
182 btnUp = this.createButton(this.FetchType.FillGap);
183

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button