Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 06 Jul 2020 23:14:52 +0200] rev 45239
commitctx: extract the function in a dedicated module
the function have few callers (< 15) is quite long a mostly independent from the
repository itself. It seems like a good candidate to reduce the bloatness of the
localrepository class. Extracting it will help us cleaning the code up and
splitting it into more reasonable-size function.
We don't use a copy trick because the amount of code extract is quite small
(<5%) and the de-indent means every single line change anyway. So this is not
deemed valuable to do so.
This is part of a larger refactoring/cleanup of the commitctx code to clarify
and augment the logic gathering metadata useful for copy tracing. The current
code is a tad too long and entangled to make such update easy.
Differential Revision: https://phab.mercurial-scm.org/D8709
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 06 Jul 2020 19:13:19 +0200] rev 45238
commitctx: document a fast path in _filecommit
This block cut off a lot of logic, documenting the why and how seems useful to
future reader.
This is part of a larger refactoring/cleanup of the commitctx code to clarify
and augment the logic gathering metadata useful for copy tracing. The current
code is a tad too long and entangled to make such update easy. We start with
easy and small cleanup.
Differential Revision: https://phab.mercurial-scm.org/D8700
Martin von Zweigbergk <martinvonz@google.com> [Tue, 21 Jul 2020 13:36:48 -0700] rev 45237
hgweb: simplify now that we always have a single path
Both `templatedir()` and `web.templatepath` are now always a single
path (or None).
Differential Revision: https://phab.mercurial-scm.org/D8788
Martin von Zweigbergk <martinvonz@google.com> [Tue, 21 Jul 2020 13:41:26 -0700] rev 45236
templater: simplify stylemap() now that templatedir() returns a single path
Differential Revision: https://phab.mercurial-scm.org/D8787
Martin von Zweigbergk <martinvonz@google.com> [Tue, 21 Jul 2020 13:11:49 -0700] rev 45235
templater: make templatepaths() return a single path, or None
The function returns either a singleton list or an empty list, so it
makes more sense to return a value or None. The plural in the name
also doesn't make sense, but `templatepath()` is already taken, so I
renamed it to `templatedir()` instead.
Differential Revision: https://phab.mercurial-scm.org/D8786
Martin von Zweigbergk <martinvonz@google.com> [Tue, 21 Jul 2020 13:05:37 -0700] rev 45234
templater: simplify templatepaths() to avoid iterating a singleton list
The function iterates over a hard-coded list of one element since
d844e220792a (templater: don't search randomly for templates - trust
util.datapath, 2014-09-28).
Differential Revision: https://phab.mercurial-scm.org/D8785
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 06 Jul 2020 22:46:49 +0200] rev 45233
commitctx: move a tiny else clause above the very long one
This is simple to have all the simple case unfold before the 100+ line one. Otherwise it is hard to relate the `else` to the initial conditionnal.
This is part of a larger refactoring/cleanup of the commitctx code to clarify
and augment the logic gathering metadata useful for copy tracing. The current
code is a tad too long and entangled to make such update easy. We start with
easy and small cleanup.
Differential Revision: https://phab.mercurial-scm.org/D8708
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 06 Jul 2020 22:37:53 +0200] rev 45232
commitctx: consider removed as touched
This achieve the same result with clearer code.
This is part of a larger refactoring/cleanup of the commitctx code to clarify
and augment the logic gathering metadata useful for copy tracing. The current
code is a tad too long and entangled to make such update easy. We start with
easy and small cleanup.
Differential Revision: https://phab.mercurial-scm.org/D8707
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 06 Jul 2020 22:35:34 +0200] rev 45231
commitctx: rename "changed" to touched
The variable contains content that are both added and modified. "changed" could
be confused with "modified" only, so we pick a less ambiguous naming that will
help with more unification.
For example, it would make sense to shove the "removed" item in there since
this is how the variable is used.
This is part of a larger refactoring/cleanup of the commitctx code to clarify
and augment the logic gathering metadata useful for copy tracing. The current
code is a tad too long and entangled to make such update easy. We start with
easy and small cleanup.
Differential Revision: https://phab.mercurial-scm.org/D8706
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 07 Jul 2020 11:16:28 +0200] rev 45230
commitctx: more filesremoved assignment closer to removed computation
A small change that makes the code flow clearer.
This is part of a larger refactoring/cleanup of the commitctx code to clarify
and augment the logic gathering metadata useful for copy tracing. The current
code is a tad too long and entangled to make such update easy. We start with
easy and small cleanup.
Differential Revision: https://phab.mercurial-scm.org/D8704
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 06 Jul 2020 20:03:30 +0200] rev 45229
commitctx: compute files added from _filecommit returns
When possible, lets avoid recomputing the same information again.
This is part of a larger refactoring/cleanup of the commitctx code to clarify
and augment the logic gathering metadata useful for copy tracing. The current
code is a tad too long and entangled to make such update easy. We start with
easy and small cleanup.
Differential Revision: https://phab.mercurial-scm.org/D8703
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 06 Jul 2020 19:35:53 +0200] rev 45228
commitctx: return "touched" status from _filecommit
Instead of mutating a list passed in argument, we simply return the information
from the `_filecommit` function. This make for a cleaner API and allow for
richer information to be returned. That richer information will be used in the
next commit to avoid duplicated computation.
This is part of a larger refactoring/cleanup of the commitctx code to clarify
and augment the logic gathering metadata useful for copy tracing. The current
code is a tad too long and entangled to make such update easy. We start with
easy and small cleanup.
Differential Revision: https://phab.mercurial-scm.org/D8702
Martin von Zweigbergk <martinvonz@google.com> [Thu, 08 Oct 2020 13:45:56 -0700] rev 45227
tests: fix test-check-module-imports.t broken by D9150
Differential Revision: https://phab.mercurial-scm.org/D9177
Martin von Zweigbergk <martinvonz@google.com> [Thu, 08 Oct 2020 13:16:14 -0700] rev 45226
tests: make test-convert-git.t work across changed default branch name
Recent git versions default to "main" instead of "master", which
breaks our test.
Differential Revision: https://phab.mercurial-scm.org/D9174
Joerg Sonnenberger <joerg@bec.de> [Mon, 05 Oct 2020 15:08:15 +0200] rev 45225
tests: skip doctests if not running from a hg repo
Differential Revision: https://phab.mercurial-scm.org/D9150
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 02 Oct 2020 19:19:01 +0530] rev 45224
Added signature for changeset 07731064ac41
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 02 Oct 2020 19:18:54 +0530] rev 45223
Added tag 5.5.2 for changeset 07731064ac41
Ludovic Chabant <ludovic@chabant.com> [Tue, 29 Sep 2020 14:38:46 -0700] rev 45222
hgdemandimport: exclude more sqlalchemy modules
We could potentially exclude the entire sqlalchemy library.
Martin von Zweigbergk <martinvonz@google.com> [Wed, 23 Sep 2020 15:36:15 -0700] rev 45221
repoview: don't crash if mergestate points to non-existent node
Differential Revision: https://phab.mercurial-scm.org/D9078
Martin von Zweigbergk <martinvonz@google.com> [Wed, 23 Sep 2020 16:07:14 -0700] rev 45220
tests: demonstrate crash caused by pinning of non-existent mergestate node
If the mergestate somehow contains a reference to a non-existent node,
it causes most commands to crash since aaeccdb6e654 (repoview: pin
revisions for `local` and `other` when a merge is active,
2020-09-04). This patch adds a test showing that.
Differential Revision: https://phab.mercurial-scm.org/D9077
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 18 Sep 2020 12:20:28 +0200] rev 45219
strip: with --keep, consider all revs "removed" from the wcp (issue6270)
The current code was blink to change from other branches when stripping merges
that are ancestors of the working copy parents.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 18 Sep 2020 12:10:12 +0200] rev 45218
test-strip: display more information highlight buggy behavior
When using `hg strip --keep` on a set of changeset that contains a merge, the
set of file considered when rebuilding the dirstate is missing files updated by
changeset that are not directly inside the `new-parent::old-parent` range.
We start with updating the test with new output highlighting the issue.
This issue was spotted because that dirstate inconsistency made the test flaky.
The new command make the test less flaky (but still wrong).
Yuya Nishihara <yuya@tcha.org> [Sun, 13 Sep 2020 15:59:23 +0900] rev 45217
py3: fix formatting of LookupError for workingctx
Spotted while writing broken tests for "hg grep -fr'wdir()'".
basectx._fileinfo() raises ManifestLookupError(self._node, ..), but _node
of the workingctx is None for historical reasons.
Yuya Nishihara <yuya@tcha.org> [Fri, 11 Sep 2020 14:41:05 +0900] rev 45216
log: fix crash and bad filematcher lookup by -fr'wdir()' PATH
"-fr'wdir()' ADDED-PATH" is still wrong, which will be fixed in default
branch.
Augie Fackler <augie@google.com> [Wed, 09 Sep 2020 14:48:55 -0400] rev 45215
hgdemandimport: bypass demandimport for _ast module (issue6407)
This is broken on Python 3.9rc1, and while it sounds like there may be
a fix in Python, we probably also should have this workaround in place
in hg. See the bug for more details (including on bugs at redhat and
b.p.o).
Differential Revision: https://phab.mercurial-scm.org/D9004
Matt Harbison <matt_harbison@yahoo.com> [Fri, 04 Sep 2020 15:21:02 -0400] rev 45214
repoview: pin revisions for `local` and `other` when a merge is active
I've hit this a couple of times, where pulling with a dirty `wdir` obsoletes
`p1` and updating to the successor results in merge conflicts. The problem was
resolving them failed immediately, complaining that the old checkout was
filtered.
The change in `test-rebase-obsolete.t` is because there's an outstanding merge
conflict in a rebase operation. The summary prompt to merge seems incorrect for
this scenario, but that's an existing issue.
Differential Revision: https://phab.mercurial-scm.org/D8980
Harald Klimach <harald@klimachs.de> [Wed, 02 Sep 2020 12:31:37 +0200] rev 45213
hgweb: compatibility of hgweb.cgi template with Python 3
When running Mercurial on Python 3 hgweb expects the config variable to be a
bytestring.
The solution proposed by Anton Shestakov is to use a byteprefix to the literal
string defined cgi script as provided in this patch for hgweb.cgi,
contrib/hgweb.fcgi and contrib/hgweb.wsgi.
I am not sure whether this covers all relevant templates, but I couldn't find
others.
Differential Revision: https://phab.mercurial-scm.org/D8978
Augie Fackler <augie@google.com> [Tue, 01 Sep 2020 10:33:10 -0400] rev 45212
genosxversion: don't give up if we can't find a path to hg libraries
This doesn't work if you have a PyOxidized hg on $PATH, but everything
is fine if you just ignore that problem.
Differential Revision: https://phab.mercurial-scm.org/D8975
Manuel Jacob <me@manueljacob.de> [Wed, 02 Sep 2020 01:30:56 +0200] rev 45211
tests: fix test-demandimport.py on Python 3.9
Starting with Python 3.9, importing importlib.resources (indirectly) imports
the zipfile module. Therefore, the module is not suitable for the test.
Instead, we can use the ftplib module, which is very unlikely to be imported
during the test run.
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 01 Sep 2020 16:27:25 +0530] rev 45210
Added signature for changeset f62bb5d07848