Martin von Zweigbergk <martinvonz@google.com> [Mon, 12 Jun 2017 16:35:57 -0700] rev 32822
pushkey: use False/True for return values from push functions
It was particularly unclear in phases.pushphase() whether the 0/1
returned were the 0/1 for public/draft phase or for False/True
Yuya Nishihara <yuya@tcha.org> [Fri, 10 Apr 2015 00:14:16 +0900] rev 32821
smartset: micro optimize spanset.slice() to narrow range accordingly
-1ms isn't significant, but seems not bad.
revset #0: limit(0:9999, 100, 9000)
6) 0.001145
7) 0.000214
revset #3: last(0:9999, 100)
6) 0.000197
7) 0.000171
Yuya Nishihara <yuya@tcha.org> [Thu, 09 Apr 2015 23:56:06 +0900] rev 32820
smartset: micro optimize baseset.slice() to use slice of list
-1ms isn't significant, but seems not bad.
revset #1: limit(0::9999, 100, 9000)
5) 0.001681
6) 0.000790
Yuya Nishihara <yuya@tcha.org> [Tue, 24 Mar 2015 00:14:53 +0900] rev 32819
smartset: extract method to slice abstractsmartset
Sub classes can provide optimized implementations.
Yuya Nishihara <yuya@tcha.org> [Sun, 24 May 2015 11:07:14 +0900] rev 32818
smartset: extract spanset factory to make it constructed without a repo
This renames the spanset class to _spanset, and moves its __init__ to new
spanset() function. spanset() is now a factory function.
This allows us to construct a spanset without keeping a repo instance.
Yuya Nishihara <yuya@tcha.org> [Sun, 11 Jun 2017 00:21:38 +0900] rev 32817
smartset: change repr of spanset to show revisions as half-open range
Before, an empty spanset was displayed as '<spanset+ 0:-1>', which seemed
confusing.
Siddharth Agarwal <sid0@fb.com> [Mon, 12 Jun 2017 15:34:31 -0700] rev 32816
fsmonitor: don't write out state if identity has changed (
issue5581)
Inspired by the dirstate fix in
dc7efa2826e4, this should fix any race
conditions with the fsmonitor state changing from underneath.
Since we now grab the wlock for any non-invalidate writes, the only situation
this appears to happen in is with a concurrent invalidation. Test that.
Siddharth Agarwal <sid0@fb.com> [Mon, 12 Jun 2017 15:34:31 -0700] rev 32815
fsmonitor: write state with wlock held and dirstate unchanged (
issue5581)
This means that the state will not be written if:
(1) either the wlock can't be obtained
(2) something else came along and changed the dirstate while we were in the
middle of a status run.
Siddharth Agarwal <sid0@fb.com> [Mon, 12 Jun 2017 13:56:50 -0700] rev 32814
workingctx: add a way for extensions to run code at status fixup time
Some extensions like fsmonitor need to run code after dirstate.status is
called, but while the wlock is held. The extensions could grab the wlock again,
but that has its own peculiar race issues. For example, fsmonitor would not
like its state to be written out if the dirstate has changed underneath (see
issue5581 for what can go wrong in that sort of case).
To protect against these sorts of issues, allow extensions to declare that they
would like to run some code to run at fixup time.
fsmonitor will switch to using this in the next patch in the series.
Siddharth Agarwal <sid0@fb.com> [Mon, 12 Jun 2017 13:56:43 -0700] rev 32813
workingctx: also pass status tuple into poststatusfixup
fsmonitor is going to need this to compute its set of notable files to persist.
Siddharth Agarwal <sid0@fb.com> [Mon, 12 Jun 2017 13:54:59 -0700] rev 32812
workingctx: factor out post-status dirstate fixup
We want to allow extensions to be able to add code to run inside the wlock.
Augie Fackler <augie@google.com> [Tue, 13 Jun 2017 10:02:34 -0400] rev 32811
merge with stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 12 Jun 2017 17:24:10 +0200] rev 32810
profile: properly propagate exception from the sub-context manager
Context manager has a mechanism to control extension propagation. It is not
used by profiling right now, but making the code correct will help prevent bug
in the future.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 12 Jun 2017 17:25:37 +0200] rev 32809
profile: close 'fp' in all cases
There are no way for this to happen today, but better be safe than sorry, no
one know how the code will evolve. We now make sure the file pointer is closed
even is profiler is None.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 12 Jun 2017 17:21:41 +0200] rev 32808
profile: close 'fp' on error within '__enter__'
Previously, error when initialying the profiler would forgot to explicitly
close the file. Thank goes to Yuya Nishihara for spotting this.