sapling/mercurial/hgweb
Denis Laxalde 0ed26e5739 hgweb: use patch.diffhunks in webutil.diffs to simplify the algorithm
Function patch.diffhunks yields items for a "block" (i.e. a file) as a whole
so take advantage of this to simplify the algorithm and avoid parsing diff
lines to determine whether we're starting a new "block" or not. Thus we drop
to external block counter and rely on diffhunks iterations instead.
We also take advantage of the fact that patch.diffhunks() yields *lines* of
hunks (instead of a string) to avoid building a list that is ''.join-ed into a
string that is then split.

As lines in 'header' returned by patch.diffhunks() have no trailing new line,
we need to insert it ourselves to match template expectations.
2017-03-06 09:28:33 +01:00
..
__init__.py server: move service factory from hgweb 2016-10-15 14:09:36 +09:00
common.py hgweb: support Content Security Policy 2017-01-10 23:37:08 -08:00
hgweb_mod.py hgweb: support Content Security Policy 2017-01-10 23:37:08 -08:00
hgwebdir_mod.py hgweb: support Content Security Policy 2017-01-10 23:37:08 -08:00
protocol.py protocol: send application/mercurial-0.2 responses to capable clients 2016-12-24 15:29:32 -07:00
request.py hgweb: use absolute_import 2015-10-31 22:07:40 +09:00
server.py py3: replace os.name with pycompat.osname (part 1 of 2) 2016-12-19 00:16:52 +05:30
webcommands.py hgweb: explictly pass basectx in webutil.diffs 2017-01-17 17:25:48 +01:00
webutil.py hgweb: use patch.diffhunks in webutil.diffs to simplify the algorithm 2017-03-06 09:28:33 +01:00
wsgicgi.py py3: replace os.environ with encoding.environ (part 3 of 5) 2016-12-18 01:54:36 +05:30