Martin von Zweigbergk <martinvonz@google.com> [Thu, 05 Dec 2019 08:59:23 -0800] rev 43795
exchange: replace a "not x in ys" by more Pythonic "x not in ys"
Found by one of our (Google-)internal tools.
Differential Revision: https://phab.mercurial-scm.org/D7546
Kyle Lippincott <spectral@google.com> [Thu, 05 Dec 2019 20:05:08 -0800] rev 43794
packaging: include defaultrc/*.rc instead of default.d/*.rc
Differential Revision: https://phab.mercurial-scm.org/D7555
Augie Fackler <augie@google.com> [Thu, 05 Dec 2019 11:15:19 -0500] rev 43793
merge with stable
Augie Fackler <raf@durin42.com> [Thu, 05 Dec 2019 09:17:38 -0500] rev 43792
Added signature for changeset
a50fecefa691
Augie Fackler <raf@durin42.com> [Thu, 05 Dec 2019 09:17:37 -0500] rev 43791
Added tag 5.2.1 for changeset
a50fecefa691
Kyle Lippincott <spectral@google.com> [Tue, 03 Dec 2019 17:17:57 -0800] rev 43790
py3: make a pycompat.osdevnull, use it in extdiff
Differential Revision: https://phab.mercurial-scm.org/D7545
Kyle Lippincott <spectral@google.com> [Tue, 03 Dec 2019 17:10:10 -0800] rev 43789
subrepo: use pycompat.open directly instead of importing open from pycompat
Differential Revision: https://phab.mercurial-scm.org/D7544
Raphaël Gomès <rgomes@octobus.net> [Fri, 22 Nov 2019 10:39:05 +0100] rev 43788
rust-dirs: address failing tests for `dirs` impl with a temporary fix
https://phab.mercurial-scm.org/D7252 (
5d40317d42b7083b49467502549e25f144888cb3)
introduced a regression in Rust tests.
This is a temporary fix that replicates the behavior of the C and Python impl,
pending the resolution of the discussion (in the phabricator link) about how
we actually want to solve this problem.
Differential Revision: https://phab.mercurial-scm.org/D7503
Matt Harbison <matt_harbison@yahoo.com> [Sun, 01 Dec 2019 18:46:10 -0500] rev 43787
cleanup: fix docstring formatting
This is just removing the b'' prefix (except demandimportpy2), and making sure
it is triple quoted. I skipped the mapping.py module in zope because that's 3rd
party code.
Differential Revision: https://phab.mercurial-scm.org/D7539
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 13 Nov 2019 20:42:13 +0100] rev 43786
copies: split the combination of the copies mapping in its own function
In some case, this part take up to 95% of the copy tracing that take about a
hundred second. This poor performance comes from the fact we keep duplciating
and merging dictionary that are mostly similar.
I want to experiment with smarter native code to do this, so I need to isolate
the function first.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 13 Nov 2019 09:39:44 +0100] rev 43785
copies: do not initialize the dictionary with root in changeset copies
We don't strictly need the dict to be prefiled with `{}`. Not doing so will make
the next changeset simpler. This part of a preparation to use native code for
this part of copy tracing.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 13 Nov 2019 20:42:08 +0100] rev 43784
copies: expand `_chain` variable name to make the function easier to read
This came up while explaining what the function is about. I find the function
easier to follow that way.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 13 Nov 2019 20:45:34 +0100] rev 43783
copies: show we can read data from the "first" mapping
In practice this make no difference since `t` is a copy of `a`. Having this
change before hand will make the next cleanup changeset clearer.
This is work on the road to using some native code for some performance critical
part of copy tracing.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 13 Nov 2019 20:33:22 +0100] rev 43782
copies: return consistent type from revinfo
The return is expected to be a list, so we should return a list. This make the
use of this function from type-checked language (eg: rust) much simpler.
Jun Wu <quark@fb.com> [Mon, 25 Nov 2019 12:44:04 -0800] rev 43781
dateutil: correct default for Ymd in parsedate
The code uses `0` for the default value of Ymd (year, month, and day), which
seems suboptimal. For example, these will fail to parse:
dateutil.parsedate('2000', formats=dateutil.extendeddateformats)
dateutil.parsedate('Jan 2000', formats=dateutil.extendeddateformats)
Fix it by providing sane defaults (1 instead of 0) for year, month, and day.
The suboptimal behavior was introduced by
91bc001a592 (2010-12-29,
"date: fix matching of underspecified date ranges"), which does not seem to
justify the current behavior.
Note end-users should not notice the subtle issue, because there are no formats
in `defaultdateformats` that allow an explicit year with omitted month, or an
explicit month with omitted day.
Differential Revision: https://phab.mercurial-scm.org/D7520
Jun Wu <quark@fb.com> [Mon, 25 Nov 2019 12:33:06 -0800] rev 43780
test-doctest: include dateutil
`mercurial.utils.dateutil` has dostrings that contain doctests. Include them.
Differential Revision: https://phab.mercurial-scm.org/D7519
Jun Wu <quark@fb.com> [Mon, 25 Nov 2019 11:53:50 -0800] rev 43779
revlog: fix revset in reachableroots docstring
`reachableroots` will only return a subset of `roots` when `includepath` is
False. For example, given the following linear DAG:
2
|
1
|
0
Using roots=0+2, heads=1, the definition in the docstring does not match what
`reachableroots` actually does:
ipdb> repo.changelog.reachableroots(0, roots=[0,2],heads=[1])
[0]
ipdb> repo.revs('heads(::(0+2) & (0+2)::1)')
<baseset+ [1]>
The fix is to do `heads & ::roots` (or `heads & heads::roots`) first, then
select their ancestors:
ipdb> repo.revs('heads(::((0+2) & (0+2)::1))')
<baseset+ [0]>
The docstring was introduced by
fd92bfbbe02d9 (2015-06-19 "revset: rename
revsbetween to reachableroots and add an argument"), which introduced the
`includepath=False` behavior for graphlog grandparents use-case. I believe
the docstring instead of the code should be changed because changing the
code to match the docstring can result in suboptimal graphlog like:
o
:\
: o
: :
:/
o
As opposite to the current "linearized" graphlog:
o
|
o
:
o
Differential Revision: https://phab.mercurial-scm.org/D7518
Kyle Lippincott <spectral@google.com> [Tue, 19 Nov 2019 18:38:17 -0800] rev 43778
lock: pass "success" boolean to _afterlock callbacks
This lets the callback decide if it should actually run or not. I suspect that
most callbacks (and hooks) *should not* run in this scenario, but I'm trying
to not break any existing behavior. `persistmanifestcache`, however, seems
actively dangerous to run: we just encountered an exception and the repo is in
an unknown state (hopefully a consistent one due to transactions, but this is
not 100% guaranteed), and the data we cache may be based on this unknown
state.
This was observed by our users since we wrap some of the functions that
persistmanifestcache calls and it expects that the repo object is in a certain
state that we'd set up earlier. If the user hits ctrl-c before we establish
that state, we end up crashing there. I'm going to make that extension
resilient to this issue, but figured it might be a common issue and should be
handled here as well instead of just working around the issue.
Differential Revision: https://phab.mercurial-scm.org/D7459
Martin von Zweigbergk <martinvonz@google.com> [Fri, 22 Nov 2019 11:08:59 -0800] rev 43777
relnotes: add note about changes to match.{explicit,reverse}dir
Differential Revision: https://phab.mercurial-scm.org/D7508
Yuya Nishihara <yuya@tcha.org> [Thu, 21 Nov 2019 22:43:01 +0900] rev 43776
graphlog: change state dict to attr struct
This should help static analysis.
Yuya Nishihara <yuya@tcha.org> [Thu, 21 Nov 2019 22:52:23 +0900] rev 43775
status: fix default value of status struct
The default argument isn't overloaded. Before, the default constructor would
create a struct having 7 list type objects.
Yuya Nishihara <yuya@tcha.org> [Tue, 19 Nov 2019 23:53:12 +0900] rev 43774
typing: fix return type of logcmdutil.getrevs()
Fixes the following errors:
Invalid type annotation "'Tuple[smartset.BaseSet, changesetdiffer]'"
[invalid-annotation]
No attribute 'BaseSet' on module 'mercurial.smartset'
getrevs: bad option in return type [bad-return-type]
Expected: Tuple[mercurial.smartset.abstractsmartset, changesetdiffer]
Actually returned: Tuple[mercurial.smartset.baseset, None]
Yuya Nishihara <yuya@tcha.org> [Tue, 19 Nov 2019 23:49:05 +0900] rev 43773
typing: consolidate "if not globals():" trick
Removes redundant inline comments. I think pycompat is good place to host
this kind of constants.
Yuya Nishihara <yuya@tcha.org> [Tue, 19 Nov 2019 23:19:57 +0900] rev 43772
rust-cpython: do not convert warning pattern to utf-8 bytes
On Unix, both Rust Path and Mercurial expect a locale-dependent bytes,
and we don't support Windows yet.
Yuya Nishihara <yuya@tcha.org> [Tue, 19 Nov 2019 23:16:16 +0900] rev 43771
rust-cpython: import utils::files::* function at module level
IIRC, it's common in Rust to call functions with the module prefix.
Matt Harbison <matt_harbison@yahoo.com> [Sat, 23 Nov 2019 00:03:18 -0500] rev 43770
exchange: guard against method invocation on `b2caps=None` args
I couldn't figure out how these are called, but the value is pretty obviously
set at least for the cases that have tests.
Differential Revision: https://phab.mercurial-scm.org/D7512
Matt Harbison <matt_harbison@yahoo.com> [Fri, 22 Nov 2019 23:58:25 -0500] rev 43769
exchange: eliminate some bytes.format() calls
Differential Revision: https://phab.mercurial-scm.org/D7511
Matt Harbison <matt_harbison@yahoo.com> [Fri, 22 Nov 2019 23:55:57 -0500] rev 43768
windows: suppress pytype warnings for Windows imports and functions
This should allow the modules to not be excluded, and not generate complaints on
non Windows platforms.
Differential Revision: https://phab.mercurial-scm.org/D7510
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 23 Nov 2019 16:54:59 -0800] rev 43767
changectx: mark the parents of the working copy as non filtered
If we successfully accessed the working copy, its parents are not filtered.
Differential Revision: https://phab.mercurial-scm.org/D7491
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 21 Nov 2019 19:56:47 +0100] rev 43766
repoview: add an explicit set of all filter that show the wc parents
The `visible` set will always show the working copy parents. We record this in a
specific set. This will allow to fast path some access.
Differential Revision: https://phab.mercurial-scm.org/D7490
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 23 Nov 2019 16:52:44 -0800] rev 43765
localrepo: introduce a `_quick_access_changeid` property
Having faster access to `null` is cuteā¦ but limited. We want to speedup access
to more useful revision, like `.`. We start with turning the fast path for
`null` into something more generic.
Differential Revision: https://phab.mercurial-scm.org/D7488
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 17 Nov 2019 08:50:21 +0100] rev 43764
changectx: use unfiltered changelog to access parents of unfiltered revs
If a revision is not filtered, we know that its parents are not either. So we
can take a shortcut. This shortcut avoid the computation of all filtered revs in
some cases.
Differential Revision: https://phab.mercurial-scm.org/D7487
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 23 Nov 2019 16:49:34 -0800] rev 43763
locarepo: also fastpath `nullid` lookup in __getitem__
We already use that fastpath for `"null"` and `nullrev`, using it for `nullid`
is similar.
Differential Revision: https://phab.mercurial-scm.org/D7486
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 23 Nov 2019 13:59:17 +0100] rev 43762
repoview: add more tests to track operation not supposed to trigger filtering
This test is useful to confirm we removed filtering trigger and to prevent
it to come back without us noticing.
The commands tested in the test were initially introduced one by one. However,
on Martin von Zweigbergk request, we are adding them all at once.
Differential Revision: https://phab.mercurial-scm.org/D7514
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 23 Nov 2019 16:46:20 -0800] rev 43761
localrepo: mark nullrev has never filtered
All repository have a null, and it cannot be filtered.
Differential Revision: https://phab.mercurial-scm.org/D7484
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 17 Nov 2019 06:06:38 +0100] rev 43760
changectx: add a "maybe filtered" filtered attribute
There are changeset that we know not to be filtered (eg: `null`). In this case,
we could access some information without triggering changelog filtering. We add
an attribute to changectx that track this property.
Differential Revision: https://phab.mercurial-scm.org/D7483
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 17 Nov 2019 07:25:25 +0100] rev 43759
repoview: add a test that access actual changeset data of `null`
Ideally, we would not trigger filtering here. However some work needs to happens
first.
Differential Revision: https://phab.mercurial-scm.org/D7482
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 17 Nov 2019 07:25:14 +0100] rev 43758
localrepo: recognize trivial "null" queries in `anyrev`
Bypassing the revset logic for trivial "null" queries means we can avoid to
trigger the filtering logic in some cases.
Differential Revision: https://phab.mercurial-scm.org/D7481
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 17 Nov 2019 06:36:50 +0100] rev 43757
localrepo: also fastpath `nullrev` in __getitem__
As explained earlier, nullrev will exist in all repository, we do not need any
special checking.
Differential Revision: https://phab.mercurial-scm.org/D7480
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 17 Nov 2019 07:11:06 +0100] rev 43756
repoview: add a test to track operation not supposed to trigger filtering
This test will be useful to confirm we removed filtering trigger and to prevent
it to come back without us noticing.
Differential Revision: https://phab.mercurial-scm.org/D7479
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 17 Nov 2019 06:27:00 +0100] rev 43755
repoview: display stack trace along side the debug message
When a filter computation is triggered, If --traceback is provided, we will
display a traceback in addition to the debug message.
Differential Revision: https://phab.mercurial-scm.org/D7478
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 17 Nov 2019 06:26:41 +0100] rev 43754
util: add an optional `prefix` argument to debugstacktrace
This is useful when using it in a specific context.
Differential Revision: https://phab.mercurial-scm.org/D7477
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 17 Nov 2019 05:32:38 +0100] rev 43753
repoview: add a 'devel.debug.repo-filter' option
If set, there will be debug message when a filter computation is triggered.
This is going to be useful to remove various filtering trigger and to test they
do not get reintroduced.
Differential Revision: https://phab.mercurial-scm.org/D7476
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 21 Nov 2019 17:54:25 +0100] rev 43752
localrepo: extract handling of some special value in __getitem__
The value "tip" should always be accessible, otherwise there is some problematic
bug in the lower level. So we can access this outside of the general try/catch.
If it fails some wider and actual big is in play.
Differential Revision: https://phab.mercurial-scm.org/D7475
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 21 Nov 2019 17:53:08 +0100] rev 43751
localrepo: extract handling of some special value in __getitem__
The value "null" will always be present in a repository. So this lookup should
always succeed and do not need to be in the general try/catch.
Differential Revision: https://phab.mercurial-scm.org/D7474
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 17 Nov 2019 03:27:51 +0100] rev 43750
localrepo: add some basic comment for block in __getitem__
There are different early processing before getting to the core of the function.
We highlight that fact.
Differential Revision: https://phab.mercurial-scm.org/D7473
Augie Fackler <augie@google.com> [Fri, 22 Nov 2019 18:02:12 -0500] rev 43749
windows: further build fixes for the WiX installer
With these fixes in place, the .msi actually builds for me again.
Differential Revision: https://phab.mercurial-scm.org/D7509
Matt Harbison <matt_harbison@yahoo.com> [Sat, 30 Nov 2019 02:13:56 -0500] rev 43748
windows: fix an issue causing registry config paths to be ignored on py3
`util.lookupreg()` returns bytes.
Differential Revision: https://phab.mercurial-scm.org/D7532
Denis Laxalde <denis@laxalde.org> [Mon, 02 Dec 2019 10:18:18 +0100] rev 43747
tests: cover revision conversion logic in githelp tests
There was no test involving actual conversion of option values when they
contain a git revision name (to be converted as a hg one by
hgext.githelp.convert()). Adding one. This test would fail on Python 3
without https://phab.mercurial-scm.org/D7537.
Differential Revision: https://phab.mercurial-scm.org/D7540
Matt Harbison <matt_harbison@yahoo.com> [Sat, 30 Nov 2019 03:15:17 -0500] rev 43746
pvec: fix a `str` type conditional for py3
Differential Revision: https://phab.mercurial-scm.org/D7538
Matt Harbison <matt_harbison@yahoo.com> [Sat, 30 Nov 2019 03:02:53 -0500] rev 43745
githelp: fix a `str` type conditional for py3
Differential Revision: https://phab.mercurial-scm.org/D7537
Matt Harbison <matt_harbison@yahoo.com> [Sat, 30 Nov 2019 03:01:44 -0500] rev 43744
histedit: fix an `isinstance(nodelist, str)` check for py3
Differential Revision: https://phab.mercurial-scm.org/D7536
Matt Harbison <matt_harbison@yahoo.com> [Sat, 30 Nov 2019 02:59:04 -0500] rev 43743
win32mbcs: fix a `str` type conditional for py3
Differential Revision: https://phab.mercurial-scm.org/D7535
Matt Harbison <matt_harbison@yahoo.com> [Sat, 30 Nov 2019 02:53:39 -0500] rev 43742
hgweb: fix a few `str` type conditional for py3
Differential Revision: https://phab.mercurial-scm.org/D7534
Matt Harbison <matt_harbison@yahoo.com> [Sat, 30 Nov 2019 02:38:42 -0500] rev 43741
repair: fix an `isinstance(nodelist, str)` check for py3
All of the callers appear to pass a list, so this doesn't fix anything in core
hg. But maybe out of tree extensions use this shortcut.
Differential Revision: https://phab.mercurial-scm.org/D7533
Denis Laxalde <denis@laxalde.org> [Fri, 29 Nov 2019 21:43:13 +0100] rev 43740
log: map None rev to wdirrev when filtering revisions with --line-range
When 'hg log -f --line-range <file>,<range>' is invoked with <range>
containing uncommitted changes, the command crashes on Python 3 as
follows:
[...]
File "/usr/lib/python3/dist-packages/mercurial/commands.py", line 4725, in log
revs, differ = logcmdutil.getlinerangerevs(repo, revs, opts)
File "/usr/lib/python3/dist-packages/mercurial/logcmdutil.py", line 933, in getlinerangerevs
if rev not in userrevs:
File "/usr/lib/python3/dist-packages/mercurial/smartset.py", line 969, in __contains__
if l < x:
TypeError: '<' not supported between instances of 'int' and 'NoneType'
The None value is because requested line range has uncommitted changes,
so 'rev' is the working directory revision. This only occurs in Python 3
as Python 2 allows comparing None with int.
As suggested by Yuya Nishihara, mapping None to node.wdirrev resolves
the issue and also make the '--line-range' option properly work with -r
'wdir()'. We add extra tests for non-regression and to illustrate
handling of 'wdir()'.
Denis Laxalde <denis@laxalde.org> [Fri, 29 Nov 2019 21:34:54 +0100] rev 43739
tests: check that 'log --line-range' follows uncommitted changes
The reason we start walking revisions from the working directory (None
revision) in logcmdutil.getlinerangerevs() is because we can follow
uncommitted changes. Adding a test to illustrate this based on an
uncommitted rename as there was none before. This helps understand the
fix in next changeset.
Julien Cristau <jcristau@debian.org> [Fri, 29 Nov 2019 18:49:59 +0100] rev 43738
test: don't put $BINDIR in $PATH for test-merge-tools.t
We call $BINDIR/hg explicitly anyway, so don't need it in $PATH. This
fixes failures when running the test --with-hg=/usr/bin/hg, where we
pick up /usr/bin/false as merge tool when we expected not to find it.
Matt Harbison <matt_harbison@yahoo.com> [Sat, 23 Nov 2019 23:02:26 -0500] rev 43737
webutil: add missing argument to join()
Differential Revision: https://phab.mercurial-scm.org/D7516
Augie Fackler <augie@google.com> [Thu, 21 Nov 2019 23:35:29 -0500] rev 43736
cleanup: update references to /help/ that should now be /helptext/
I noticed this only because the WiX build was broken after
2e017696181f. I haven't tested this change with WiX, but it seems
pretty obvious by inspection this should fix it.
Differential Revision: https://phab.mercurial-scm.org/D7472