v0.7 Release – Explaining the Split Bug

As a part of one of my goals for this release I want to find a solution for a problem I have appropriately named the “split bug”. Let me explain what it is all about:

Sometimes merge changsets are showing up while others times they aren’t. It has me pretty confused. I wasn’t getting this error beforehand. Basically sometimes I’m getting an error with the Split() function which I’m using to get the rev, user and description for each entry. The error only occurs with some merge changsets, which means they don’t get shown.

Basically, the following is the code I’m using to parse merge changesets right now:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//Check whether it is a merge changeset or not
if(pushData[i].MergeData != []) {
  for(var j = 0; j < pushData[i].mergeData.length; j++) {
    if(pushData[i].mergeData[j] != "") {
      var mergeStr = pushData[i].mergeData[j];
      for(var k = 0; k < pushData[i].mergeData[j].length; k++) {
        var actualMergeStr = mergeStr[k].split('|-|');
        var mergeC = actualMergeStr[0];
        var mergeUser = actualMergeStr[1];
        var mergeDesc = actualMergeStr[2];
 
        if(mergeDesc != pushData[i].desc) {
          var trScrollMerge = document.createElement("tr");
          trScrollMerge.className = trScroll.className;
          var tdScroll_MergeUser = document.createElement("td");
          tdScroll_MergeUser.width = "184px";
 
          //Create changset link 
          var tdScroll_MergeC = document.createElement("td");
            tdScroll_MergeC.innerHTML +=
            '<a href="/rev/' +
            mergeC.substring(0, 12) + 
            '">' + 
            mergeC.substring(0, 12) +
            '</a>'; 
 
          //Create bugLink  
          var merge_bugLink = createBuglink(mergeDesc);
 
          var tdScroll_MergeAuthorDesc = document.createElement("td");
          tdScroll_MergeAuthorDesc.innerHTML += '<strong>' + mergeUser + ' &mdash ' + merge_bugLink + '</strong>';
          trScrollMerge.appendChild(tdScroll_MergeUser);
          trScrollMerge.appendChild(tdScroll_MergeC);
          trScrollMerge.appendChild(tdScroll_MergeAuthorDesc);
          document.getElementById("titlePush").appendChild(trScrollMerge);
        }
      }
    }
  }
}

This is a very surprising development. Why is this bug popping up now? Was this bug always there or did I make some change to cause it to occur? All things I will have to explore. I think I will start by re-exploring what the JSON data contains. In particular, I need to look at what mergeData contains, in order to find a solution to this bug.

This entry was posted in DPS911, Mercurial Project, Open Source and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>