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!
Commit
8347c4add17272170f557fd74ed0c2e8a28111c52814b3d49caba0a9e43e7034
Parent
af2f7d17493059d…
1 file changed
+2
-1
+2
-1
| --- src/fossil.diff.js | ||
| +++ src/fossil.diff.js | ||
| @@ -169,13 +169,14 @@ | ||
| 169 | 169 | } |
| 170 | 170 | let btnUp = false, btnDown = false; |
| 171 | 171 | /** |
| 172 | 172 | this.pos.next refers to the line numbers in the next TR's chunk. |
| 173 | 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. | |
| 174 | 175 | */ |
| 175 | 176 | if(this.pos.prev && this.pos.next |
| 176 | - && ((this.pos.next.startLhs - this.pos.prev.endLhs) | |
| 177 | + && ((this.pos.endLhs - this.pos.startLhs) | |
| 177 | 178 | <= Diff.config.chunkLoadLines)){ |
| 178 | 179 | /* Place a single button to load the whole block, rather |
| 179 | 180 | than separate up/down buttons. */ |
| 180 | 181 | btnDown = false; |
| 181 | 182 | btnUp = this.createButton(this.FetchType.FillGap); |
| 182 | 183 |
| --- 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 |