v0.8 Release – Fix for the Merge Changeset Problem

In my previous blog post I had outlined the problem with merge changesets for my patch (bug 459727). I’ve come up with a fix for the issue which seems to work. As I had mentioned previously I would move my code to a function so that I can employ recursion to access the merges within the merges. The following is the what the code looks like currently:

def getMergeData(ctx, mergeData):
  for cs in ctx.parents():
    mergeData.append(hex(cs.node()) + '|-|' + clean(person(cs.user())) + '|-|' + clean(cs.description()))
    if len(cs.parents()) > 1:
      getMergeData(cs, mergeData)
 
def pushes_worker(query, repo):
    """Given a PushlogQuery, return a data structure mapping push IDs
    to a map of data about the push."""
    pushes = {}
    for id, user, date, node in query.entries:
        mergeData = []
        ctx = repo.changectx(node)
        if len(ctx.parents()) > 1:
          getMergeData(ctx, mergeData)
        if id in pushes:
            # we get the pushes in reverse order
            pushes[id]['changesets'].insert(0, node)
            pushes[id]['mergeData'].insert(0, mergeData)
        else:
            pushes[id] = {'user': user,
                          'date': date,
                          'changesets': [node],
                          'formattedDate': util.datestr(localdate(date)),
                          'individualChangeset': hex(ctx.node()),
                          'author': clean(person(ctx.user())),
                          'desc': clean(ctx.description()),
                          'mergeData': mergeData,
                          'id': id
                          }
    return pushes

So getMergeData() is where all the functionality now resides. The problem of merges within merges is taken care of by the recursion functionality in getMergeData(). The function takes in ctx and mergeData after checking that there are parents available. Then a for loop is performed to add all the pushes to mergeData. Next a check is performed to see whether the current push is a merge as well and if it is then getMergeData() is called again to add data to the variable mergeData. This change now adds in the missing pushes from some of the larger merge changesets. Beforehand, with the previous code many of the pushes were missing but now with this new functionality they are being shown.

I’ll be putting up a new patch for hgpoller very soon. Unfortunately, ted can’t review my patch until the pushlog is fixed to work with hg 1.1, which will hopefully happen before the end of the semester (April 24th).

Posted in DPS911, Mercurial Project, Open Source | Tagged , , | Leave a comment

v0.8 Release – Problems with Displaying Merge Changesets

In my goals blog post I outlined that I wanted to fix this problem with displaying merge changesets. This is the only major problem remaining with my patch for bug 459727. I had talked to about in a previous post and at that time I thought that the problem was not with my code. However, it seems that I was mistaken. I had a little chat with ted and he seems to think that my problem is that I have merges within merges. This is why the right amount of pushes are not showing up.

I’ve been thinking how I can I solve this problem. I’m gonna have to alter my server side code. Currently it looks like the following:

def pushes_worker(query, repo):
    """Given a PushlogQuery, return a data structure mapping push IDs
    to a map of data about the push."""
    pushes = {}
    for id, user, date, node in query.entries:
        mergeData = []
        ctx = repo.changectx(node)
        if len(ctx.parents()) > 1:
          for cs in ctx.parents():
            mergeData.append(hex(cs.node()) + '|-|' + clean(person(cs.user())) + '|-|' + clean(cs.description()))
        if id in pushes:
            # we get the pushes in reverse order
            pushes[id]['changesets'].insert(0, node)
            pushes[id]['mergeData'].insert(0, mergeData)
        else:
            pushes[id] = {'user': user,
                          'date': date,
                          'changesets': [node],
                          'formattedDate': util.datestr(localdate(date)),
                          'individualChangeset': hex(ctx.node()),
                          'author': clean(person(ctx.user())),
                          'desc': clean(ctx.description()),
                          'mergeData': mergeData,
                          'id': id
                          }
    return pushes

I’ll probably be moving this functionality into a function and then hopefully use some recursion to access the merges within the merges. I don’t think I will need to change any of my server side code though, which is a relief.

I think I have it in mind how I want to implement this. I don’t forsee any problems at the moment. Watch out for another post detailing my fix for this issue.

Posted in DPS911, Mercurial Project, Open Source | Tagged , | Leave a comment

v0.8 Release – Implementing the Changeset Query UI

In my previous blog post I had discussed the changeset UI bug. I’ve thought about how I’m going to implement this and I’ve decided to use a little drop down menu. It’s going to have two choices, the date or the changeset. Then according to the choice the appropriate query will be called.

Lets have a look at the code. All of it can be found in the hg_templates/pushlog.tmpl file. First, we have some HTML markup to setup the text boxes and the the button. Then, I added a drop down menu that calls the function, changeQueryType() when the selected item in the drop down is changed. I’ve decided to put the drop down within the same div as the two text boxes and positioned it using the HTML space symbol. The following is the code:

<form action="{url}pushloghtml">
<div class="search">
<select id="querytype">
<option value="date">Date</option>
<option value="changeset">Changeset</option>
</select>
 
From:
<input id="from" name="startdate" type="text" value="#startdate|escape#" />
To:
<input id="to" name="enddate" type="text" value="#enddate|escape#" />
<input type="submit" value="Search" /></div>
</form>

Now, as I mentioned I have a JavaScript function called onchange() for the drop down menu. The following is the code:

function changeQueryType()
{
  var queryType = document.getElementById("querytype");
  var fromBox = document.getElementById("from");
  var toBox = document.getElementById("to");
  if(queryType.value == "changeset") {
    fromBox.name = "fromchange";
    fromBox.value="#fromchange|escape#";
    toBox.name = "tochange";
    toBox.value="#tochange|escape#";
  } else {
    fromBox.name = "startdate";
    fromBox.value="#startdate|escape#";
    toBox.name = "enddate";
    toBox.value="#enddate|escape#";
  }
}

So basically, I retrieve the drop down menu by a getElementById() and then check what the user has selected. If the user selects a changeset then I set the appropriate name and value of both the text boxes, otherwise I set the name and value for the date query.

The pushlog doesn’t look very different with this patch. No big changes, just a small dropdown menu shows up beside the 2 text boxes at the top right of the page. I’ll be posting this patch on the bug page very soon.

Posted in DPS911, Mercurial Project, Open Source | Tagged , | Leave a comment

v0.8 Release – Contemplating UI for the Changeset Query

For this release I needed to find a new feature to work on. I had a look at the various bugs available for the pushlog and decided to go with this changeset UI bug. Now, currently there is UI (2 text boxes at the top right) available to submit a date query but nothing for the changeset query.  Regretfully, I didn’t know that such a query even existed before I had a look at this bug. I’m sure other people are as ignorant about this as I was. This is why implementing some UI for this would be helpful.

Lets have a look at how this query works. It takes in two params, fromchange and tochange. Basically the query will retrieve all the changes pushed after the fromchange param and up to and including the tochange param. It works like any other query with the address bar looking something like this:

/pushloghtml?fromchange=df94feb90a4f&tochange=5428595e217c

Server Side Code

The server side functionality is already there, found in the hgpoller/pushlog-feed.py file. The following is what it looks like:

251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
    if 'startdate' in req.form:
        startdate = doParseDate(req.form['startdate'][0])
        query.querystart = QueryType.DATE
        query.querystart_value = startdate
    elif 'fromchange' in req.form:
        query.querystart = QueryType.CHANGESET
        query.querystart_value = req.form.get('fromchange', ['null'])[0]
    elif 'startID' in req.form:
        query.querystart = QueryType.PUSHID
        query.querystart_value = req.form.get('startID', ['0'])[0]
    else:
        # default is last 10 pushes
        query.querystart = QueryType.COUNT
        query.querystart_value = PUSHES_PER_PAGE
 
    if 'enddate' in req.form:
        enddate = doParseDate(req.form['enddate'][0])
        query.queryend = QueryType.DATE
        query.queryend_value = enddate
    elif 'tochange' in req.form:
        query.queryend = QueryType.CHANGESET
        query.queryend_value = req.form.get('tochange', ['default'])[0]
    elif 'endID' in req.form:
        query.queryend = QueryType.PUSHID
        query.queryend_value = req.form.get('endID', [None])[0]
 
    if 'user' in req.form:
        query.userquery = req.form.get('user', [])
 
    #TODO: use rev here, switch page to ?page=foo ?
    if 'changeset' in req.form:
        query.changesetquery = req.form.get('changeset', [])
 
    query.DoQuery()
    return query

The above code has the functionality for both the date and changeset queries. So basically, if the query is a changeset, then use QueryType.CHANGESET and set the values. Then query.DoQuery() retrieves the data from the db.

The UI

Now, the question remains what type of UI to implement. I could just dump in another two text boxes and a button for the changeset query. But, that just seems clumsy and it will clutter up the page. Right now I’m thinking of a drop down menu and two text boxes that can take in either dates or changesets. I’ll need to implement some JavaScript to get this functionality working. I hope to have this up and running soon.

Posted in DPS911, Mercurial Project, Open Source | Tagged , | Leave a comment

v0.8 Release – Improving the Coding Style for the OnScroll Patch

This post is concerning the patch for bug 459727. For this release I decided that I wanted to make some adjustments to my coding style to make it more consistent with the rest of the code. What do I mean by coding style? Well, things like variable names, indentation, new lines, commenting etc. The goal here is to improve code readability.

Braces

OK, first lets examine one of the small functions I’ve implemented in the hg_templates/pushlog.tmpl file:

function fillPage() {
  start = ($("div").attr("id")) - 10;
  var vHeight = 0;
  if (document.documentElement) {
      vHeight = document.documentElement.clientHeight;
  } else {
      vHeight = document.body.clientHeight
    }
 
  if (document.body.offsetHeight &lt; vHeight) {
    for(var count = 0, offSetHeight = document.body.offsetHeight;
        offSetHeight &lt; vHeight;
        count++, offSetHeight += 180);
 
    if(count &gt; 0)
      loadEntries(count);
  }
}

Now, lets look at one of the functions that was already present beforehand:

function localizeDates()
{
  var dates = document.getElementsByClassName("date");
  for (var i=0; i<dates.length; i++) {
    dates[i].textContent = new Date(dates[i].textContent).toLocaleString();
  }
  document.getElementById("localize").style.display = 'none';
  return false;
}

As you can see there’s a bit of a difference in the way the braces are handled. In my function I always keep the braces on the same line but in the other function the brace for the function name is on a new line while the rest of the braces are on the same line. A very peculiar coding style, if you ask me. Then again this may be some sort of coding convention but I haven’t really seen it implemented anywhere else before. I didn’t even notice this subtle difference until recently, which is why I didn’t make this change earlier. So, I’m going to be consistent and use the already implemented way of handling braces.

Variable Names

There doesn’t seem to be any type of convention being used, as far as I can tell, regarding variable names. The key is to just use short but logical variable names to increase readability. I’ve decided to change some of my variable names being used:

Old Name New Name Reasoning
trScroll row This is the actual row that gets added to the end of the table so it’s clearer to give it the name row. Nice and simple
pushCheckins req Since it is an xmlHttpRequest object I’ll give it the name req, pretty conventional
tdScrollUser userCol Since the variable is a column that will hold user information it will be appropriately called userCol
tdScrollChangeset revCol Since the variable is a column that will hold changeset information it will be appropriately called revCol
tdScrollAuthorDesc authDescCol This column will contain both the author name and the description and thus an appropriate name is chosen
trScrollMerge mergeRow Since it is a row that contains a merge push the new name seems more logical
tdScroll_MergeUser mergeUserCol Same reasoning as the userCol change above
tdScroll_MergeC mergeRevCol Same reasoning as the revCol change above
tdScroll_MergeAuthorDesc mergeAuthDescCol Same reasoning as the authDescCol change above
createRevLink(str) createRevTd(rev) This change was recommended by Justin Wood (Callek). The reasoning is that the attribute should indicate what to pass in, and the function name should indicate what it returns
mergeC mergeRev mergeC doesn’t make much sense. What does C stand for? Using mergeRev is definitely more logical


Spacing

One thing that I’ve always found a bit confusing is why or how to space out your code within a function or a method. Some people prefer to put in no spaces while others fall in love with them. Is there some sort of convention for this? Maybe there is but I’m not aware of any. Currently, with this patch’s code I’ve gone space-happy. There’s too much spacing in some places and it doesn’t look good. I’m going to be reducing the spacing wherever possible.

Variable Declarations

One thing I noticed was that I wasn’t putting all the variable declarations together, one after another. That made my code look very untidy. I’ve rectified that situation and now all the declarations at the very start of a code block.

Most of the changes have occurred with loadEntries(). The following is what my code now looks like:

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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
function loadEntries(iterations) 
{
  for(var t = 0; t < iterations; t++) {
    var loader = document.getElementById("loader");
    var end = start;
    var req = new XMLHttpRequest();
 
    loader.innerHTML = '<img src="{url}static/ajax-loader.gif" align="right" />';
    start = start - 20;
    req.open('GET', '/json-pushes?startID=' + start + '&endID=' + end, true);
    req.onreadystatechange = function() {
      if(req.readyState == 4) {
        if(req.status != 404) {
          var pushData = JSON.parse(req.responseText), counter = 0;
          //var counter = 0;
          for(var i = end; i > start; i--) {
            var row = document.createElement("tr");
            if(counter == 0) {
              row.className = "parity0"; 
              counter = 1;
            } else {
                row.className = "parity1";
                counter = 0;
            }  
            var userCol = document.createElement("td");
            var revCol = createRevTd(pushData[i].individualChangeset);
            var bugLink = createBuglink(pushData[i].desc);
            var authDescCol = document.createElement("td");
 
            userCol.width = "184px";
            userCol.innerHTML += pushData[i].user + '<br />' + pushData[i].formattedDate;
            authDescCol.innerHTML += '<strong>' + pushData[i].author + ' &mdash ' + bugLink + '</strong>';
            row.appendChild(userCol);
            row.appendChild(revCol);
            row.appendChild(authDescCol);
            loader.innerHTML = "";
            document.getElementById("titlePush").appendChild(row);
 
            //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++) {
                    if(pushData[i].mergeData[j] instanceof Array) {
                      var actualMergeStr = mergeStr[k].split('|-|');
                      var mergeRev = actualMergeStr[0];
                      var mergeUser = actualMergeStr[1];
                      var mergeDesc = actualMergeStr[2];
                    }
                    else {
                      var actualMergeStr = mergeStr.split('|-|');
                      var mergeRev = actualMergeStr[0];
                      var mergeUser = actualMergeStr[1];
                      var mergeDesc = actualMergeStr[2];
                      k = pushData[i].mergeData[j].length;
                    }
                    if(mergeDesc != pushData[i].desc) {
                      var mergeRow = document.createElement("tr");
                      var mergeUserCol = document.createElement("td");
                      var mergeRevCol = createRevTd(mergeRev);
                      var merge_bugLink = createBuglink(mergeDesc);
                      var mergeAuthDescCol = document.createElement("td");
 
                      mergeRow.className = row.className;
                      mergeUserCol.width = "184px";
                      mergeAuthDescCol.innerHTML += '<strong>' + mergeUser + ' &mdash ' + merge_bugLink + '</strong>';
                      mergeRow.appendChild(mergeUserCol);
                      mergeRow.appendChild(mergeRevCol);
                      mergeRow.appendChild(mergeAuthDescCol);
                      document.getElementById("titlePush").appendChild(mergeRow);
                    }
                  }
                }
              }
            }
          }    
        }  
      }
    }
    req.send(null);
  }
}
Posted in DPS911, Mercurial Project, Open Source | Tagged , | 4 Comments

v0.8 Release Goals

Here we are, another release in the making. I’m going to change things up slightly this time around. I’m gonna work on a new bug just to mix things up. Admittedly the bug isn’t something very big but I just wanted to work on something new. Along with taking up a new feature I’m going to be improving my onScroll bug even further. I wanted to have it done and over with but there is still room for improvement. I’ve decided to look at this situation from another perspective. I mean this is what incremental development is all about, making small but significant changes and putting usable code out there. I think that is the goal of this entire course, releasing constantly and making improvements as you go. I want to stay true to that philosophy. Anyway, the following are my goals:

  • Implement an intuitive UI for the changeset query. Apparently many people don’t know that this query exists because currently there is no UI for it.
  • Fixing the repeating bug with merge changesets. I know I had said that it wasn’t a bug with my code but it seems I was wrong. I need to re-examine some of my server side code. Ted has given me some feed back to get me on the right track.
  • Coding style changes are needed with the onScroll patch to make it consistent with the rest of the code. I’ll be looking to change the variable names too. Currently the code isn’t very clean and readable it seems. Also, I’ll be looking to reduce even more code (and retain functionality), if possible.
Posted in DPS911, Mercurial Project, Open Source | Tagged , , | Leave a comment

v0.7 Release Complete

Well, I’m glad to say that another release is over and done with. I’m past the half way mark with only 3 more releases to go before the end of the semester comes around. This release I decided to focus entirely on bug 459727. I think I’ve made some significant improvements this time around. I outlined my goals for this release and was able to complete all of them, which is very pleasing. I also implemented a small fix that I didn’t outline in my goals. Hopefully, this patch is good enough to get approved. The most noticeable improvement was being able to load more entries onPageLoad according to the user’s screen size.

I also want to take the opportunity to announce that my patch for hg annotatet (0.5 release) has been added to hg_templates so hg.mozilla.org should be getting the speed boost pretty soon.

The following are the important links from this release:

Overall, I would say that this has been a satisfactory release. I’ve achieved my goals and improved my patch significantly. The most satisfactory part was fixing the onPageLoad problem that has been bothering me for a long long time. Just that fact fills me with great satisfaction.

Note: Please have a look at the project page for more details

Posted in DPS911, Mercurial Project, Open Source | Tagged , | Leave a comment

v0.7 Release – Repeating Bug with Merge Changesets

As a part of one of my goals for the current release I’m diving into an apparent (yes, another one) bug with with merge changesets. Now, let it be known that I’m not totally sure whether this is a bug or not. This might not be my fault at all. It could just be that the data from the database is as such that repetitions are occuring. This is what I have to investigate.

Take a look at the screenshot below:

As you can see above, the entry after a merge changset is the same as one of the entries in the merge changeset itself. I’ve had a look at the data being passed from the server side. I’m printing the exact same data that I am receiving from the server side. The repetition is definitely not due to my code. The order, the number of entries printed etc are all correct.

On the server side, ctx.parents() contains merge changeset data. So if ctx.parents() is greater than 1 than there is merge data present, which I then retrieve and pass on to the client side to display. The following is the code I use:

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
def pushes_worker(query, repo):
    """Given a PushlogQuery, return a data structure mapping push IDs
    to a map of data about the push."""
    pushes = {}
    for id, user, date, node in query.entries:
        mergeData = []
        ctx = repo.changectx(node)
        if len(ctx.parents()) > 1:
          for cs in ctx.parents():
            mergeData.append(hex(cs.node()) + '|-|' + clean(person(cs.user())) + '|-|' + clean(cs.description()))
        if id in pushes:
            # we get the pushes in reverse order
            pushes[id]['changesets'].insert(0, node)
            pushes[id]['mergeData'].insert(0, mergeData)
        else:
            pushes[id] = {'user': user,
                          'date': date,
                          'changesets': [node],
                          'formattedDate': util.datestr(localdate(date)),
                          'individualChangeset': hex(ctx.node()),
                          'author': clean(person(ctx.user())),
                          'desc': clean(ctx.description()),
                          'mergeData': mergeData,
                          'id': id
                          }
    return pushes

As far as I know ctx.parents() is the only way to retrieve merge changeset data and all I’m doing is displaying the data exactly as I’m getting it. This doesn’t seem to be a bug from my side of things but obviously something is wrong here. Fact is, entries shouldn’t be repeating like they are at the moment. Maybe a problem with ctx.parents()? It definitely seems to be something on the server side that is causing the issue. This is something I’ll have to discuss with ted or djc. I’ll look to fix this issue in my next release.

Posted in DPS911, Mercurial Project, Open Source | Tagged , | 1 Comment

v0.7 Release – Reducing Code Duplication

I’ve decided to make a small change for this release along with the other changes that I have already outlined. I want to avoid code duplication as much as possible and thus I have decided to put code to create a rev link into a function. Currently the code for creating a rev link looks like the following:

var tdScrollChangeset = document.createElement("td");
tdScrollChangeset.innerHTML += 
  '<a href="/rev/' + 
  pushData[i].individualChangeset.substring(0, 12) + 
  '">' + 
  pushData[i].individualChangeset.substring(0, 12) + 
  '</a>';

After my change the code looks like the following:

var tdScrollChangeset = createRevLink(pushData[i].individualChangeset);
function createRevLink(str) {
  var td = document.createElement("td");
 
  td.innerHTML +=
    '<a href="/rev/' +
    str.substring(0, 12) + 
    '">' + 
    str.substring(0, 12) +
    '</a>'; 
 
  return td;
}

This alteration reduces the number of lines of code but keeps the same functionality. A win win by all accounts.

Posted in DPS911, Mercurial Project, Open Source | Tagged , , | 2 Comments

v0.7 Release – Solving the Split Bug

In my previous blog post I outlined the Split bug which was targeting merge changesets. To fix this issue I re-examined what mergeData contains and was able to come up with a solution. Let me explain why this bug is occurring and how I fixed it:

The Why

There are two types of changesets that are shown by the pushlog, normal changesets and merge changsets. This particular bug applies to merge changesets. When passing merge changeset data from the server side to the client side it is stored in a list, called mergeData. What does this list contain?

1. It contains a another list that contains another list, which contains strings (confusing, isn’t it?)

OR

2. It contains strings

Now, I thought that only the first option was possible and thus I didn’t take the second option into account when writing my code. I still don’t understand how sometimes the list is made up of option 1 while other time, option 2 occurs. Regardless, it does happen and I needed to find a solution

The Fix

Let me show you the code right away. The following is the code that fixes the issue:

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
41
42
43
44
45
46
47
48
49
50
//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++) {
        if(pushData[i].mergeData[j] instanceof Array) {
          var actualMergeStr = mergeStr[k].split('|-|');
          var mergeC = actualMergeStr[0];
          var mergeUser = actualMergeStr[1];
          var mergeDesc = actualMergeStr[2];
        }
        else {
          var actualMergeStr = mergeStr.split('|-|');
          var mergeC = actualMergeStr[0];
          var mergeUser = actualMergeStr[1];
          var mergeDesc = actualMergeStr[2];
 
          k = pushData[i].mergeData[j].length;
        }
 
        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);
        }
      }
    }
  }
}

Basically, line 7 is the key here. The instanceof keyword allows me to find out whether the variable I am examining is a list or not. If it is a list, then mergeData contains option one and I perform the appropriate parsing. However, if it isn’t a list, then option 2 has occurred and I parse the data in a different way.

Adding the above functionality completely solved my problem. No more errors with Split() and all the merge changesets are appearing properly.

Posted in DPS911, Mercurial Project, Open Source | Tagged , | Leave a comment