Jun Wu <quark@fb.com> [Mon, 18 Sep 2017 16:01:03 -0700] rev 34276
blackbox: set lastui even if ui.log is not called (
issue5518)
`lastui` decides where (where is the `.hg`) to use if the current `ui`
object does not have a `_bbrepo` associated. Previously it only gets set in
`ui.log`, which means unless a `ui` with repo associated calls `log` with
tracked event, blackbox does not know where to write its log. This patch
makes `reposetup` set `lastui` so it so we could log some more events (see
test changes).
Differential Revision: https://phab.mercurial-scm.org/D655
Jun Wu <quark@fb.com> [Wed, 06 Sep 2017 21:23:38 -0700] rev 34275
blackbox: unindent a try block
The try block is no longer necessary.
Differential Revision: https://phab.mercurial-scm.org/D654
Jun Wu <quark@fb.com> [Mon, 18 Sep 2017 15:56:08 -0700] rev 34274
blackbox: simplify ui states
It seems cleaner to just remove `_partialinit`, `copy`, `__init__`. This
patch makes it so by using `getattr` in `log` so those fields do not need to
be existed.
Differential Revision: https://phab.mercurial-scm.org/D652
Jun Wu <quark@fb.com> [Fri, 01 Sep 2017 19:42:09 -0700] rev 34273
revset: move weight information to predicate
Previously revset weight is hardcoded and cannot be modified. This patch
moves it to predicate so newly registered revsets could define their weight
to properly give static optimization some hint.
Differential Revision: https://phab.mercurial-scm.org/D657
Jun Wu <quark@fb.com> [Fri, 01 Sep 2017 19:30:40 -0700] rev 34272
revset: remove "small" argument from "_optimize"
`_optimize` calculates weights of subtrees. "small" affects some weight
calculation (either 1 or 0.5). The weights are now only useful in `and`
optimization where we might swap two arguments and use `andsmally`.
In the real world, it seems unlikely that revsets with weight of 0.5 or 1
matters the `and` order optimization. I think the important thing is to get
weights of expensive revsets right (ex. `contains`).
This patch removes the `small` argument to simplify the interface.
As for choosing between 0.5 vs 1, things returning a single revision
(`ancestor`, `string`) has a weight of 0.5. Things returning multiple
revisions returns 1. This could be sometimes useful in the `andsmally`
optimization, ex.
(((:)-2) & expensive()) & ((1-2) & expensive())
^^^ ^
^^^^^^^ ^^^^^
^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^
weight=1 weight=0.5
would have an `andsmally` optimization so `1-2` gets executed first, which
seems to be desirable.
Differential Revision: https://phab.mercurial-scm.org/D656
Augie Fackler <augie@google.com> [Mon, 18 Sep 2017 13:37:00 -0400] rev 34271
ui: fix progress debug log format strings to work on Python 3
Augie Fackler <augie@google.com> [Mon, 18 Sep 2017 13:37:32 -0400] rev 34270
tests: update `f` helper script to work on Python 3
Augie Fackler <augie@google.com> [Tue, 19 Sep 2017 00:09:37 -0400] rev 34269
tests: fix run-tests XML reporting on Python 3
cdatasafe wants to work in terms of bytes, but of course we have a
unicode. Easy to work around, especially since we know we'll get utf-8
at the end.
Augie Fackler <augie@google.com> [Tue, 19 Sep 2017 00:08:52 -0400] rev 34268
tests: convert bisect support regex to binary
The bisection feature of run-tests still fails tests with this because
bisect itself doesn't work yet. We'll get there.
Augie Fackler <augie@google.com> [Tue, 19 Sep 2017 00:08:12 -0400] rev 34267
tests: decode bytes path to hg command before hitting with shellquote
Augie Fackler <augie@google.com> [Tue, 19 Sep 2017 00:07:51 -0400] rev 34266
tests: fix test-is-whitelisted check in run-tests
Again, look for bytes in a set of bytes objects.
Augie Fackler <augie@google.com> [Tue, 19 Sep 2017 00:07:23 -0400] rev 34265
tests: fix run-tests "slow test" check
Look for bytes in a set of bytes objects.
Augie Fackler <augie@google.com> [Tue, 19 Sep 2017 00:06:57 -0400] rev 34264
tests: fix run-tests default values in Test constructor
As far as I can tell, default values are evaluated far earlier on
Python 3.6 than 2.7, meaning we've got to be more careful about when
we read the defaults dictionary for the kwarg defaults. Sigh.
With this change, test-run-tests.t is significantly less of a mess
under 3.6.
Augie Fackler <augie@google.com> [Mon, 18 Sep 2017 17:11:32 -0400] rev 34263
tests: add support for listing tests to run in a file
This will make it easier for us to run the tests in the python3
whitelist in buildbot.
Augie Fackler <augie@google.com> [Mon, 18 Sep 2017 15:34:50 -0400] rev 34262
python3: remove test-update-dest.t from the whitelist
I've poked at this on and off several times, and I can't figure out
what regressed. Let's kick this out of the whitelist for now so that
we can get the *rest* of our progress covered by the buildbots.
Durham Goode <durham@fb.com> [Thu, 14 Sep 2017 10:20:05 -0700] rev 34261
bundle2: move part processing to a separate function
Now that the part processing loop is tiny, let's move it to a separate function.
This will allow extensions to completely replace the part processing logic,
without having to replace the overall bundle processing logic or the stream
maintenance logic.
This will be useful for the infinitepush extension, so it can completely take
over receiving a bundle and rerouting it to a side store. This will also make it
easier to upstream the infinitepush functionality later.
Differential Revision: https://phab.mercurial-scm.org/D709
Durham Goode <durham@fb.com> [Thu, 14 Sep 2017 10:20:05 -0700] rev 34260
bundle2: remove unnecessary try finally
This is no longer needed.
Differential Revision: https://phab.mercurial-scm.org/D708
Durham Goode <durham@fb.com> [Thu, 14 Sep 2017 10:20:05 -0700] rev 34259
bundle2: move handler validation out of processpart
As part of refactoring bundle part processing let's move handler validation to
its own function.
Differential Revision: https://phab.mercurial-scm.org/D707
Durham Goode <durham@fb.com> [Thu, 14 Sep 2017 10:20:05 -0700] rev 34258
bundle2: move processpart stream maintenance into part iterator
The processpart function also did some stream maintenance, so let's move it to
the part iterator as well, as part of moving all part iteration logic into the
class.
There is one place processpart is called outside of the normal loop, so we
manually handle the seek there.
The now-empty try/finally will be removed in a later patch, for ease of review.
Differential Revision: https://phab.mercurial-scm.org/D706
Kevin Bullock <kbullock+mercurial@ringworld.org> [Mon, 18 Sep 2017 14:12:20 -0500] rev 34257
merge with stable
Yuya Nishihara <yuya@tcha.org> [Sun, 17 Sep 2017 12:39:53 +0900] rev 34256
py3: convert system strings to bytes in doctest of formatter.py
Yuya Nishihara <yuya@tcha.org> [Sun, 17 Sep 2017 12:39:14 +0900] rev 34255
py3: rewrite stdout hack of doctest by using ui.pushbuffer()
We can't use pycompat.stdout here because the doctest runner replaces
sys.stdout with a string buffer.
Yuya Nishihara <yuya@tcha.org> [Sun, 17 Sep 2017 12:26:42 +0900] rev 34254
py3: use bytes os.sep in doctest of pathutil.py
Yuya Nishihara <yuya@tcha.org> [Sun, 17 Sep 2017 12:23:16 +0900] rev 34253
py3: fix doctests in patch.py to be compatible with Python 3
We were lucky that parsepatch() could concatenate a character slice as if
it were a list of chunks.