Posts Tagged changeset UI
v0.8 Release - Contemplating UI for the Changeset Query
Posted by Sid in DPS911, Mercurial Project, Open Source on March 28th, 2009
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.
v0.8 Release Goals
Posted by Sid in DPS911, Mercurial Project, Open Source on March 27th, 2009
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.