##// END OF EJS Templates
hgweb: only include graph-related data in jsdata variable on /graph pages (BC)...
hgweb: only include graph-related data in jsdata variable on /graph pages (BC) Historically, client-side graph code was not only rendering the graph itself, but it was also adding all of the changeset information to the page as well. It meant that JavaScript code needed to construct valid HTML as a string (although proper escaping was done server-side). It wasn't too clunky, even though it meant that a lot of server-side things were duplicated client-side for no good reason, but the worst thing about it was the data format it used. It was somewhat future-proof, but not human-friendly, because it was just a tuple: it was possible to append things to it (as was done in e.g. 270f57d35525), but you'd then have to remember the indices and reading the resulting JS code wasn't easy, because cur[8] is not descriptive at all. So what would need to happen for graph to have more features, such as more changeset information or a different vertex style (branch-closing, obsolete)? First you'd need to take some property, process it (e.g. escape and pass through templatefilters function, and mind the encoding too), append it to jsdata and remember its index, then go add nearly identical JavaScript code to 4 different hgweb themes that use jsdata to render HTML, and finally try and forget how brittle it all felt. Oh yeah, and the indices go to double digits if we add 2 more items, say phase and obsolescence, and there are more to come. Rendering vertex in a different style would need another property (say, character "o", "_", or "x"), except if you want to be backwards-compatible, it would need to go after tags and bookmarks, and that just doesn't feel right. So here I'm trying to fix both the duplication of code and the data format: - changesets will be rendered by hgweb templates the same way as changelog and other such pages, so jsdata won't need any information that's not needed for rendering the graph itself - jsdata will be a dict, or an Object in JS, which is a lot nicer to humans and is a lot more future-proof in the long run, because it doesn't use numeric indices What about hgweb themes? Obviously, this will break all hgweb themes that render graph in JavaScript, including 3rd-party custom ones. But this will also reduce the size of client-side code and make it more uniform, so that it can be shared across hgweb themes, further reducing its size. The next few patches demonstrate that it's not hard to adapt a theme to these changes. And in a later series, I'm planning to move duplicate JS code from */graph.tmpl to mercurial.js and leave only 4 lines of code embedded in those <script> elements, and even that would be just to allow redefining graph.vertex function. So adapting a custom 3rd-party theme to these changes would mean: - creating or copying graphnode.tmpl and adding it to the map file (if a theme doesn't already use __base__) - modifying one line in graph.tmpl and simply removing the bigger part of JavaScript code from there Making these changes in this patch and not updating every hgweb theme that uses jsdata at the same time is a bit of a cheat to make this series more manageable: /graph pages that use jsdata are broken by this patch, but since there are no tests that would detect this, bisect works fine; and themes are updated separately, in the next 4 patches of this series to ease reviewing.

File last commit:

r32652:9929af2b merge default
r35218:d61f2a3d default
Show More
control
54 lines | 1.6 KiB | text/plain | DebianControlLexer
Augie Fackler
debian: switch to using debhelper and dh_python2 to build debs...
r26148 Source: mercurial
Augie Fackler
builddeb: new script for building a deb package...
r24971 Section: vcs
Priority: optional
av6
debian: update mailing list address
r30873 Maintainer: Mercurial Developers <mercurial-devel@mercurial-scm.org>
Augie Fackler
debian: switch to using debhelper and dh_python2 to build debs...
r26148 Build-Depends:
Sean Farley
debian: fix lintian warning about debhelper...
r29047 debhelper (>= 9),
Augie Fackler
debian: switch to using debhelper and dh_python2 to build debs...
r26148 dh-python,
Rodrigo Damazio Bovendorp
debian: add less as a build dependency...
r32480 less,
Sean Farley
debian: add missing netbase dependency...
r28985 netbase,
Sean Farley
debian: add missing python-all-dev dependency
r28982 python-all,
Sean Farley
debian: add missing python-docutils dependency
r28983 python-all-dev,
Sean Farley
debian: add missing zip/unzip dependencies
r28984 python-docutils,
Sean Farley
debian: alphabetize build deps
r29048 unzip,
zip
Augie Fackler
debian: switch to using debhelper and dh_python2 to build debs...
r26148 Standards-Version: 3.9.4
Gregory Szorc
setup: drop support for Python 2.6 (BC)...
r32228 X-Python-Version: >= 2.7
Augie Fackler
debian: switch to using debhelper and dh_python2 to build debs...
r26148
Package: mercurial
Depends:
python,
${shlibs:Depends},
${misc:Depends},
${python:Depends},
mercurial-common (= ${source:Version})
Architecture: any
Description: fast, easy to use, distributed revision control tool.
Mercurial is a fast, lightweight Source Control Management system designed
for efficient handling of very large distributed projects.
.
Its features include:
* O(1) delta-compressed file storage and retrieval scheme
* Complete cross-indexing of files and changesets for efficient exploration
of project history
* Robust SHA1-based integrity checking and append-only storage model
* Decentralized development model with arbitrary merging between trees
* Easy-to-use command-line interface
* Integrated stand-alone web interface
* Small Python codebase
Package: mercurial-common
Augie Fackler
builddeb: new script for building a deb package...
r24971 Architecture: all
Augie Fackler
debian: switch to using debhelper and dh_python2 to build debs...
r26148 Depends:
${misc:Depends},
${python:Depends},
Recommends: mercurial (= ${source:Version}), ca-certificates
Sean Farley
debian: add wish to suggests...
r29091 Suggests: wish
Augie Fackler
debian: switch to using debhelper and dh_python2 to build debs...
r26148 Breaks: mercurial (<< ${source:Version})
Replaces: mercurial (<< 2.6.3)
Description: easy-to-use, scalable distributed version control system (common files)
Mercurial is a fast, lightweight Source Control Management system designed
for efficient handling of very large distributed projects.
.
This package contains the architecture independent components of Mercurial,
and is generally useless without the mercurial package.