Gregory Szorc <gregory.szorc@gmail.com> [Sat, 30 Sep 2017 09:01:36 +0100] rev 34391
hgweb: add HTML elements to control whitespace settings for annotate
Building on top of the new URL query string arguments to control
whitespace settings for annotate, this commit adds HTML checkboxes
reflecting the values of these arguments to the paper and gitweb
themes.
The actual diff settings are now exported to the templating layer.
The HTML templates add these as data-* attributes so they are
accessible to the DOM.
A new <form> with various <input> elements is added. The <form>
is initially hidden via CSS. A shared JavaScript function (which
runs after the <form> has been rendered but before the annotate
HTML (because annotate HTML could take a while to load and we want
the form to render quickly) takes care of setting the checked state
of each box from the data-* attributes. It also registers an event
handler to modify the URL and refresh the page whenever the checkbox
state is changed.
I'm using the URLSearchParams interface to perform URL manipulation.
https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams tells
me this may not be supported on older web browsers. Yes, apparently
the web API didn't have a standard API to parse and format query
strings until recently. Hence the check for the presence of this
feature in the JavaScript. If the browser doesn't support the
feature, the <form> will remain hidden and behavior will like it
currently is. We could polyfill this feature or implement our own
query string parsing. But I'm lazy and this could be done as a
follow-up if people miss it.
We could certainly expand this feature to support more diff options
(such as lines of context). That's why the potentially reusable code
is stored in a reusable place. It is also certainly possible to
add diff controls to other pages that display diffs. But since
Mozillians are making noise about controlling which revisions
annotate shows, I figured I'd start there.
.. feature::
Control whitespace settings for annotation on hgweb
/annotate URLs on hgweb now accept query string arguments to
influence how whitespace changes impact results.
The arguments "ignorews," "ignorewsamount," "ignorewseol," and
"ignoreblanklines" now have the same meaning as their [annotate]
config section counterparts. Any provided setting overrides the
server default.
HTML checkboxes have been added to the paper and gitweb themes
to expose current whitespace settings and to easily modify the
current view.
Differential Revision: https://phab.mercurial-scm.org/D850
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 30 Sep 2017 09:08:01 +0100] rev 34390
hgweb: query string arguments to control whitespace for annotate
This feature should hopefully be pretty straightforward. We simply
examine some query string arguments to feed into the diff options.
The function to obtain the diff options has been factored into its
own generic function to facilitate an upcoming change to the HTML
interface and to enable diff settings to be controlled via the same
query string arguments on other web commands.
The test output for "ignoreblanklines" didn't change. I'm not sure
why. Our test coverage for --ignore-blank-lines isn't great and I
can't figure out how to make this diff setting do anything meaningful.
On a very brief examination of the code, it is possible the setting
doesn't work because it is operating at the line level and blank lines
detection needs to examine multiple lines. But I'm not an expert in
this code, so I'm not sure.
Differential Revision: https://phab.mercurial-scm.org/D849
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 30 Sep 2017 09:07:00 +0100] rev 34389
tests: add tests for hgweb annotate output
In preparation for adding features to modify whitespace settings.
Differential Revision: https://phab.mercurial-scm.org/D848
Boris Feld <boris.feld@octobus.net> [Thu, 06 Jul 2017 14:46:07 +0200] rev 34388
obsolete: clean createmarkers part about operation
I will add another experiment in createmarkers, add a comment and some blank
lines for aesthetic sake.
Differential Revision: https://phab.mercurial-scm.org/D532
Augie Fackler <augie@google.com> [Sat, 30 Sep 2017 12:58:06 -0400] rev 34387
treediscovery: update test expectation
I'm not sure why this needs an update, but the test passes for me both
pure and non-pure.
Differential Revision: https://phab.mercurial-scm.org/D860
Augie Fackler <augie@google.com> [Sat, 30 Sep 2017 12:57:00 -0400] rev 34386
tests: update some clonebundles expectations to pass on both pure and non-pure
Specifically, zstd isn't available in --pure mode, and we need to glob
off the leading comma as well as the absent compression engine.
Differential Revision: https://phab.mercurial-scm.org/D859
Kevin Bullock <kbullock+mercurial@ringworld.org> [Sun, 01 Oct 2017 10:41:39 +0100] rev 34385
merge with stable
Augie Fackler <augie@google.com> [Fri, 29 Sep 2017 11:55:44 -0400] rev 34384
contrib: add a check to check-code to ban superfluous pass statements
These have annoyed me for a long time, and I'm tired of commenting on
them in reviews. I'm sorry for how complicated the regular expression
is, but I was too lazy to go crack open pylint's code and add the
check there.
Augie Fackler <augie@google.com> [Sat, 30 Sep 2017 07:45:18 -0400] rev 34383
posix: replace superfluous pass statement with explicit return
Augie Fackler <augie@google.com> [Sat, 30 Sep 2017 07:45:51 -0400] rev 34382
subrepo: remove superfluous pass statements
Augie Fackler <augie@google.com> [Sat, 30 Sep 2017 07:45:41 -0400] rev 34381
registrar: remove superfluous pass statements
Augie Fackler <augie@google.com> [Sat, 30 Sep 2017 07:45:07 -0400] rev 34380
patch: remove superfluous pass statements
Augie Fackler <augie@google.com> [Sat, 30 Sep 2017 07:44:55 -0400] rev 34379
obsolete: remove superfluous pass statements
Augie Fackler <augie@google.com> [Sat, 30 Sep 2017 07:44:45 -0400] rev 34378
match: remove superfluous pass statements
Augie Fackler <augie@google.com> [Sat, 30 Sep 2017 07:44:34 -0400] rev 34377
localrepo: remove superfluous pass statements
Augie Fackler <augie@google.com> [Sat, 30 Sep 2017 07:44:20 -0400] rev 34376
hgweb: remove superfluous pass statements
Augie Fackler <augie@google.com> [Sat, 30 Sep 2017 07:44:08 -0400] rev 34375
formatter: remove superfluous pass statements
Augie Fackler <augie@google.com> [Sat, 30 Sep 2017 07:43:53 -0400] rev 34374
exchange: remove superfluous pass statements
Augie Fackler <augie@google.com> [Sat, 30 Sep 2017 07:43:40 -0400] rev 34373
commandserver: remove superfluous pass statements
Augie Fackler <augie@google.com> [Sat, 30 Sep 2017 07:43:26 -0400] rev 34372
cmdutil: remove superfluous pass statements
Augie Fackler <augie@google.com> [Sat, 30 Sep 2017 07:43:11 -0400] rev 34371
byterange: remove superfluous pass statements
Augie Fackler <augie@google.com> [Sat, 30 Sep 2017 07:42:59 -0400] rev 34370
branchmap: remove superfluous pass statements
Augie Fackler <augie@google.com> [Sat, 30 Sep 2017 07:42:47 -0400] rev 34369
convert: remove superfluous pass statements
Augie Fackler <augie@google.com> [Fri, 29 Sep 2017 11:55:26 -0400] rev 34368
bugzilla: remove superfluous pass statements
Martin von Zweigbergk <martinvonz@google.com> [Sat, 30 Sep 2017 07:52:48 -0700] rev 34367
merge with stable
Yuya Nishihara <yuya@tcha.org> [Fri, 22 Sep 2017 22:45:02 +0900] rev 34366
copytrace: use ctx.mutable() instead of adhoc constant of non-public phases
Boris Feld <boris.feld@octobus.net> [Sat, 30 Sep 2017 10:09:29 +0100] rev 34365
exchange: fix test for remote support of binary phases
If the remote do not support phases, the "get" call will return None. We
change that default return to empty tuple to fix the membership testing.
This was a bug in the initial series. Thanks to yuja for catching this.
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 28 Sep 2017 15:24:54 +0100] rev 34364
exchange: perform stream clone with clone bundle with --uncompressed
Previously, `hg clone --uncompressed` would always clone from the
origin server, even if a streaming clone bundle were available.
With this change, we invoke the clone bundle mechanism before the
stream clone mechanism, giving clone bundles the opportunity to
handle --uncompressed (which is mapped to pullop.streamclonepreferred).
The clone bundle filtering code now filters out entries that aren't
stream clones when a stream clone is requested. If a stream clone
clone bundle entry is present, it will be used. Otherwise, the client
will fall back to a server-based streaming clone.
.. feature::
`hg clone --uncompressed` uses clone bundles when possible
Differential Revision: https://phab.mercurial-scm.org/D833
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 28 Sep 2017 12:17:30 +0200] rev 34363
tests: add tests for clone bundles with --uncompressed
Currently, --uncompressed will always clone from the origin server, even
if a stream clone bundle is present. Let's add tests demonstrating
this behavior.
Differential Revision: https://phab.mercurial-scm.org/D832
Yuya Nishihara <yuya@tcha.org> [Wed, 27 Sep 2017 19:27:41 +0900] rev 34362
py3: work around bytes/unicode divergence in parsedate()