Simon Farnsworth <simonfar@fb.com> [Wed, 15 Feb 2017 13:17:39 -0800] rev 30975
mercurial: switch to util.timer for all interval timings
util.timer is now the best available interval timer, at the expense of not
having a known epoch. Let's use it whenever the epoch is irrelevant.
Simon Farnsworth <simonfar@fb.com> [Wed, 15 Feb 2017 11:53:59 -0800] rev 30974
util: introduce timer()
As documented for timeit.default_timer, there are better timers available for
performance measures on some platforms. These timers don't have a set epoch,
and thus are only useful for interval measurements, but have higher
resolution, and thus get you a better measurement overall.
Use the same selection logic as Python's timeit.default_timer. This is a
platform clock on Python 2 and early Python 3, and time.perf_counter on Python
3.3 and later (where time.perf_counter is introduced as the best timer to use).
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Thu, 22 Dec 2016 02:38:53 +0100] rev 30973
color: move the '_render_effects' function to the core module
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Thu, 22 Dec 2016 02:37:18 +0100] rev 30972
color: move '_effect_str' function into the core module
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Thu, 22 Dec 2016 02:34:22 +0100] rev 30971
color: move configstyles into the core module
The extension is getting thinner as we speak!
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Thu, 22 Dec 2016 02:30:03 +0100] rev 30970
color: rework conditional 'valideffect'
Not very important, but the full conditional is not that hard to follow and
having it unified make the function role a bit clearer in my opinion.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Thu, 22 Dec 2016 02:26:50 +0100] rev 30969
color: move 'valideffect' function into the core module
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Thu, 22 Dec 2016 02:23:23 +0100] rev 30968
color: move '_terminfo_params' into the core 'color' module
On step closer to have color in core.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Fri, 18 Nov 2016 18:48:38 +0100] rev 30967
color: move '_effect' mapping into core
This is the second things we can move into core safely.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Fri, 18 Nov 2016 18:43:39 +0100] rev 30966
color: spread '_effect' values for readability
We move to our "usual" one value per line style.
Augie Fackler <augie@google.com> [Wed, 15 Feb 2017 11:22:01 -0500] rev 30965
merge with stable
Martin von Zweigbergk <martinvonz@google.com> [Mon, 13 Feb 2017 15:04:46 -0800] rev 30964
update: clarify that -C and -c are mutually exclusive
This makes it clear in both the synopsis and in the verbose output
that -C and -c are mutually exclusive. It also restructures the
verbose output a little so it's better prepared for a third option
(--merge).
This patch also reorders the options to match the flag table.
Martin von Zweigbergk <martinvonz@google.com> [Mon, 13 Feb 2017 11:58:02 -0800] rev 30963
update: move check for dirty wdir into hg.updatetotally()
The function has a "check" parameter that's currently unused, and it
makes sense to me to have it honor it. That way other callers than
commands.update() could set it if they needed.
Martin von Zweigbergk <martinvonz@google.com> [Mon, 13 Feb 2017 11:32:09 -0800] rev 30962
destutil: drop now-unused "check" parameter from destupdate()
Martin von Zweigbergk <martinvonz@google.com> [Thu, 09 Feb 2017 09:52:32 -0800] rev 30961
destutil: remove duplicate check and leave it to merge.update()
The check is done in merge.update() already and the next few patches
will add more checks there. Some of the additional checks will need
information about the merge that will not be available in destutil.
Since commands.postincoming() catches UpdateAbort(), we need to change
merge.update() to raise that more specific exception.
This goes directly again
45b86dbabbda (destupdate: move the check
related to the "clean" logic in the function, 2015-10-05), but it will
simplify the next few patches, and we can always move it out again
(preferably move, not copy) after if we still think it's better that
way.
Anton Shestakov <av6@dwimlabs.net> [Wed, 15 Feb 2017 14:49:33 +0800] rev 30960
make: update .PHONY targets
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Thu, 02 Feb 2017 10:07:53 +0100] rev 30959
debugcommands: move 'debugwireargs' in the new module
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Thu, 02 Feb 2017 10:07:28 +0100] rev 30958
debugcommands: move 'debugwalk' in the new module
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Thu, 02 Feb 2017 10:06:01 +0100] rev 30957
debugcommands: move 'debugtemplate' in the new module
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Thu, 02 Feb 2017 10:05:22 +0100] rev 30956
debugcommands: move 'debugsuccessorssets' in the new module
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Thu, 02 Feb 2017 10:04:55 +0100] rev 30955
debugcommands: move 'debugsub' in the new module
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Thu, 02 Feb 2017 10:04:34 +0100] rev 30954
debugcommands: move 'debugstate' in the new module
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Thu, 02 Feb 2017 10:04:02 +0100] rev 30953
debugcommands: move 'debugsetparents' in the new module
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Thu, 02 Feb 2017 10:03:31 +0100] rev 30952
debugcommands: move 'debugrevspec' in the new module
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Thu, 02 Feb 2017 10:02:40 +0100] rev 30951
debugcommands: move 'debugrevlog' in the new module
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Thu, 02 Feb 2017 10:01:54 +0100] rev 30950
debugcommands: move 'debugrename' in the new module
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Thu, 02 Feb 2017 10:01:00 +0100] rev 30949
debugcommands: move 'debugrebuildfncache' in the new module
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Thu, 02 Feb 2017 10:00:26 +0100] rev 30948
debugcommands: move 'debugrebuilddirstate' in the new module
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Thu, 02 Feb 2017 09:59:47 +0100] rev 30947
debugcommands: move 'debugpvec' in the new module
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 01 Feb 2017 17:48:30 +0100] rev 30946
debugcommands: move 'debugpushkey' in the new module
Kyle Lippincott <spectral@google.com> [Sun, 12 Feb 2017 03:06:38 -0800] rev 30945
ui: remove urllib2 from being imported early
Before this change, urllib2 was brought in when constructing the ui object, and
that added ~5ms on my Linux workstation to the hg startup time for every
command, bringing the time for 'HGRCPATH=/dev/null hg root' from 46ms to 40ms.
Now, we construct a single proxy object per initial ui creation (so that if the
ui is copied they share the object), but defer the actual instantiation of it
and the import of urllib2 until it's needed.
# no-check-commit
Augie Fackler <augie@google.com> [Mon, 06 Feb 2017 23:57:32 -0500] rev 30944
tests: switch "this command isn't paged" example to id
I'm about to enable pager support in summary.
Augie Fackler <augie@google.com> [Tue, 07 Feb 2017 17:08:41 -0500] rev 30943
tests: update test-i18n.t to not depend on the pager extension
I'm about to mark that extension as deprecated, and that broke this
test.
Augie Fackler <augie@google.com> [Mon, 06 Feb 2017 21:15:35 -0500] rev 30942
pager: add a test of --pager=no functionality
I'm about to upend the pager universe, but I would like to not regress
anything.
David Demelier <demelier.david@gmail.com> [Tue, 07 Feb 2017 17:33:35 +0100] rev 30941
hg: allow usage of XDG_CONFIG_HOME/hg/hgrc
Modern applications must use the following paths to store configuration files:
- $XDG_CONFIG_HOME/hg/hgrc,
- $HOME/.config/hg/hgrc (if XDG_CONFIG_HOME is unset or not absolute).
For backward compatibility, ~/.hgrc is still created if no hgrc exist using hg
config --edit.
See https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 01 Feb 2017 17:47:35 +0100] rev 30940
debugcommands: move 'debugpathcomplete' in the new module
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 01 Feb 2017 17:46:21 +0100] rev 30939
debugcommands: move 'debugobsolete' in the new module
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 01 Feb 2017 17:42:49 +0100] rev 30938
debugcommands: move 'debuglocks' in the new module
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 01 Feb 2017 17:41:12 +0100] rev 30937
debugcommands: move 'debugnamecomplete' in the new module
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 01 Feb 2017 17:40:20 +0100] rev 30936
debugcommands: move 'debugmergestate' in the new module
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 01 Feb 2017 17:39:31 +0100] rev 30935
debugcommands: move 'debuglabelcomplete' in the new module
Bryan O'Sullivan <bryano@fb.com> [Mon, 13 Feb 2017 20:47:41 -0800] rev 30934
dispatch: start profiling earlier
This makes it possible to profile extension loading and setup, which
takes a substantial fraction of overall execution time for fast
commands.
(99% of this commit is simply changes of indentation to reflect the
hoisting of the two calls to maybeprofile to a single one that
happens earlier.)
# no-check-commit
Bryan O'Sullivan <bryano@fb.com> [Mon, 13 Feb 2017 20:44:20 -0800] rev 30933
dispatch: move detection of profiling earlier during startup
Jun Wu <quark@fb.com> [Mon, 13 Feb 2017 21:00:50 -0800] rev 30932
ui: fix configwith doctest
4.2 cannot be expressed with IEEE floating point losslessly, and could
cause test failure on some platform:
File ".../mercurial/ui.py", line 414, in mercurial.ui.ui.configwith
Failed example:
u.configwith(float, s, 'float2')
Expected:
-4.2
Got:
-4.
2000000000000002
This patch fixes that by changing the number to 4.25, which can be expressed
by the binary number 100.01.
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 14 Feb 2017 01:52:16 +0530] rev 30931
test-bdiff: move import inside the function to avoid test failure
test-check-module-imports.t fails on some systems where the path of home
directories is different than sys.prefix and sys.exec_prefix.
Importing silenttestrunner will help avoiding that failure.
Bryan O'Sullivan <bryano@fb.com> [Sun, 12 Feb 2017 22:28:09 -0800] rev 30930
profiling: add statprof support for Chrome trace viewer rendering
We synthesize function call begin/end events from snapshots, and
try (configurably) to eliminate "noisy" stack frames.
Example invocation:
hg --config profiling.output=$HOME/Desktop/clone.json \
--config profiling.statformat=chrome \
--profile clone https://www.mercurial-scm.org/repo/hg
Bryan O'Sullivan <bryano@fb.com> [Sun, 12 Feb 2017 22:20:20 -0800] rev 30929
statprof: allow rendering in the Chrome trace viewer format
Bryan O'Sullivan <bryano@fb.com> [Sun, 12 Feb 2017 22:16:58 -0800] rev 30928
statprof: add a path simplification function
Bryan O'Sullivan <bryano@fb.com> [Sun, 12 Feb 2017 21:44:55 -0800] rev 30927
ui: rewrite configint in terms of configwith
Bryan O'Sullivan <bryano@fb.com> [Sun, 12 Feb 2017 21:40:46 -0800] rev 30926
ui: add a configwith method
This is a long-overdue generalization of the pattern in configint
and configbool.
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 13 Feb 2017 22:15:28 +0530] rev 30925
py3: convert the mode argument of os.fdopen to unicodes (2 of 2)
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 13 Feb 2017 20:06:38 +0530] rev 30924
py3: convert the mode argument of os.fdopen to unicodes (1 of 2)
os.fdopen() does not accepts bytes as its second argument which represent the
mode in which the file is to be opened. This patch makes sure unicodes are
passed in py3 by using pycompat.sysstr().
John Mulligan <phlogistonjohn@asynchrono.us> [Thu, 09 Feb 2017 15:20:41 -0500] rev 30923
bugzilla: add a rest api backend (usable with bugzilla 5.0+)
Add support for the bugzilla rest api documented at
https://wiki.mozilla.org/Bugzilla:REST_API
and at
https://bugzilla.readthedocs.io/en/latest/
This backend has the following benefits:
* It supports the bugzilla api keys so hgrc does not need to contain
a user's bugzilla password
* Works with Mercurial's "hostfingerprints" support making handling
bugzilla instances with self-signed certs easier
* Does not use xmlrpc ;-)
Adds configuration item 'apikey' in [bugzilla] section.
My major concern with these patches is if the approach to HTTP access
is the right way for an extension and if hooking into request object
and the overriding the get_method to perform PUT requests was a
sensible approach.
# no-check-commit
John Mulligan <phlogistonjohn@asynchrono.us> [Mon, 13 Feb 2017 15:12:17 -0500] rev 30922
keepalive: honor urllib2 style get_method overrides
In urllib2 docs and discussions it can be found that in order
to make a request other than GET or POST the get_method of a
Request object can be overriden. Make Mercurial's internal
version of this honor the return value of get_method.
Please see the followup patch to the bugzilla extension for
the reason for this change. Marking RFC because I'm not entirely
sure this is the right way make the HTTP requests.
Jun Wu <quark@fb.com> [Fri, 10 Feb 2017 13:56:31 -0800] rev 30921
lock: include Linux pid namespace identifier in prefix
Previously, the lock only contains a hostname as an attempt to detect pid
namespace difference. However, that's not enough on modern Linux - a single
hostname could have different pid namespaces.
That means if people run hg inside different PID namespaces with a same UTS
namespae, the lock would be broken - an hg proccess in pid namespace A will
think the lock having a "random" pid in pid namespace B is "dead" and remove
it.
This patch solves the above issue by appending an PID namespace identifier of
the current process to the lock prefix ("hostname"). It depends on /proc
being mounted properly. But I don't think there is a better way to get pid
namespace identifier reliably.
Jun Wu <quark@fb.com> [Fri, 10 Feb 2017 13:35:21 -0800] rev 30920
lock: move lock._host calculation to a function
This allows customization per platform. See the next patch for why.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 01 Feb 2017 17:33:46 +0100] rev 30919
debugcommands: move 'debugknown' in the new module
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 01 Feb 2017 17:31:05 +0100] rev 30918
debugcommands: extract debuginstall in the debugcommands module
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Mon, 13 Feb 2017 16:35:49 +0100] rev 30917
dispatch: load debugcommand before extension
Multiple extension will manipulate commands on load, we need the debug command
to be loaded before that point.
Martin von Zweigbergk <martinvonz@google.com> [Mon, 13 Feb 2017 09:44:16 -0800] rev 30916
merge with stable
Siddharth Agarwal <sid0@fb.com> [Mon, 13 Feb 2017 11:43:12 -0800] rev 30915
bundle2: fix assertion that 'compression' hasn't been set
`n.lower()` will return `compression`, not `Compression`.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Fri, 10 Feb 2017 18:20:58 +0100] rev 30914
wireproto: properly report server Abort during 'getbundle'
Previously Abort raised during 'getbundle' call poorly reported (HTTP-500 for
http, some scary messages for ssh). Abort error have been properly reported for
"push" for a long time, there is not reason to be different for 'getbundle'. We
properly catch such error and report them back the best way available. For
bundle, we issue a valid bundle2 reply (as expected by the client) with an
'error:abort' part. With bundle1 we do as best as we can depending of http or
ssh.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Fri, 10 Feb 2017 18:17:20 +0100] rev 30913
getbundle: cleanly handle remote abort during getbundle
bundle2 allow the server to report error explicitly. This was initially
implemented for push but there is not reason to not use it for pull too. This
changeset add logic similar to the one in 'unbundle' to the
client side of 'getbundle'. That logic make sure the error is properly reported
as "remote". This will allow the server side of getbundle to send clean "Abort"
message in the next changeset.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Fri, 10 Feb 2017 18:06:08 +0100] rev 30912
bundle1: fix bundle1-denied reporting for pull over ssh
Changeset
b288fb2724bf introduced a config option to have the server deny pull
using bundle1. The original protocol has not really been design to allow that
kind of error reporting so some hack was used. It turned the hack only works on
HTTP and that ssh server hangs forever when this is used. After further
digging, there is no way to report the error in a unified way. Using `ooberror`
freeze ssh and raising 'Abort' makes HTTP return a HTTP-500 without further
details. So with sadness we implement a version that dispatch according to the
protocol used.
Now the error is properly reported, but we still have ungraceful abort after
that. The protocol do not allow anything better to happen using bundle1.