Posts Tagged djc
v0.3 Release - Understanding djc’s Graph View
Posted by Sid in Mercurial Project, Open Source on November 25th, 2008
I’m starting work on a graph view for the pushlog. Frankly, I didn’t know where to begin since I have never really done anything like this before, then again I could say the same thing about the whole project. After having a discussion with jorendorff I was pointed towards djc’s (Dirkjan Ochtman) Graph view for Mercurial. He already has it working and my job is to now understand what he has done and get it working for the pushlog now.
The Source
I downloaded the source from http://hg.intevation.org/mercurial/crew/ using hg clone.
Getting it Running
Getting it running on my browser was pretty simple. Almost identical to what I had to do for the pushlog. Just open up a command prompt and navigate to the directory where you saved the source and call the hg serve command. Then fire up a browser and type in http://localhost:8000 and you should be able to see the graph view.
Understanding the Code
Mercurial crew comes with Mercurial and hgweb. Some of the functionality is implemented in crew/templates/static/graph.js which is what runs on the client side. Also the tmpl file used to render the page is crew/templates/coal/graph.tmpl which imports graph.js to utilize its methods. The template also takes in a parameter, jsdata which contains the graph data. jsdata is populated on the server side by the graph method of the crew/mercurial/hgweb/webcommands.py file. It contains graphmod.graph() which is apparently what does the actual graph layout.
I don’t fully understand this code at the moment. There are many questions going through my mind. For example it seems that the server side code (mercurial.hgweb.webcommands.graph) returns a tmpl so I don’t know whether I should be working from a new tmpl file or can I put my client side code in hg_templates/gitweb_mozilla/pushlog.tmpl like I have been doing all along?
The client side code receives the data from the server side through {jsdata|json} which is all the changeset data. But right now with the pushlog all this is processed through pushlog-feed.py which gives the data to hg_templates\gitweb_mozilla\map that renders the page. So should I be messing with this map file? If not then how can I pass the data to the client side so that I can draw the graph and render it on the page?
The above 2 examples are only some of the questions going through my mind right now. I have told you about them because they are ones that must be answered urgently. It is important that I understand the basic functionality of djc’s Graph view so that I can deduce a way to apply it to my problem.
It is still early days for this feature and I’m still trying to feel my way through it. Hopefully things will pick up as my understanding of this feature increases.
Looking Forward to v0.3 Release
Posted by Sid in Mercurial Project, Open Source on November 24th, 2008
The end of the semester is approaching fast and so the due of my v0.3 release. I’ve had a talk with jorendorff about what I should do for my next release. We discussed working on the ability to filter by file/directory or a graph view for the pushlog. In the end we decided that working on a graph view for the pushlog would be a pretty amazing thing to work on.
Dirkjan Ochtman (djc) has already done some work on this graph view feature which you can see here. So now my job is to adapt and adjust the work done by djc for the pushlog. At this point I can’t really say how hard or easy this is going to be. All I know is that this feature would be quite awesome to have as far as the users are concerned.
I also will be looking to make fixes to the patches I submitted for my v0.2 release as the reviews come in.
With all the other assignments I have due the time to work on my v0.3 release isn’t too much so I need to be efficient with my work. Here’s hoping things go well…