Martin von Zweigbergk <martinvonz@google.com> [Mon, 20 May 2019 16:12:27 -0700] rev 42352
help: document new "bookmarksinstore" requirement in internals.requirements
Differential Revision: https://phab.mercurial-scm.org/D6413
Augie Fackler <augie@google.com> [Mon, 20 May 2019 14:00:12 -0400] rev 42351
absorb: fix interactive mode I didn't know existed
While investigating a bug in `hg absorb -e` I unintentionally
discovered `hg absorb --interactive` and its brokenness. This adds a
test and restores the functionality.
Note that this interface is still marked experimental, so we can
change this to be more sophisticated in the future.
Differential Revision: https://phab.mercurial-scm.org/D6411
Augie Fackler <augie@google.com> [Fri, 17 May 2019 11:13:12 -0400] rev 42350
tests: work around libressl being different about error strings (
issue6122)
As far as I can tell, this is the right behavior. Thanks to Alex
Gaynor for checking what the string means by looking at libressl
sources for me.
Differential Revision: https://phab.mercurial-scm.org/D6410
Augie Fackler <augie@google.com> [Mon, 20 May 2019 11:40:47 -0400] rev 42349
merge with stable
Yuya Nishihara <yuya@tcha.org> [Mon, 20 May 2019 08:40:54 +0900] rev 42348
templatekw: change default value of 'requires' to ()
Since we dropped support for the old-style template keywords, we no longer
have to distinguish None (old-style) and an empty requirement (new-style).
Martin von Zweigbergk <martinvonz@google.com> [Tue, 14 May 2019 16:30:38 -0700] rev 42347
commit: move sorting of added and removed files list to lower level
localrepo.commitctx() has lists of all changed files, as well as lists
of added and removed files. The list of all files is unsorted and
changelog.add() will sort it. Let's also sort the lists of added and
removed files at a lower level (manifestrevlog.add()) for
consistency. It also seems safer to do it there, just before we write
them to the store. That way other callers won't be able to create
invalid commits (or whatever the consequence is) by passing in
unsorted lists. Also, alternative storages may not care that the lists
are sorted. I don't think this will be a performance problem (someone
should have fixed the sorting in changelog.add() if it were).
Differential Revision: https://phab.mercurial-scm.org/D6390
Martin von Zweigbergk <martinvonz@google.com> [Wed, 24 Apr 2019 09:39:40 -0700] rev 42346
match: drop unnecessary adding of '' to set of dirs
This breaks some tests for "rootfilesin:" in a pattern matcher even
more, but that just shows how broken that case is.
Differential Revision: https://phab.mercurial-scm.org/D6406
Martin von Zweigbergk <martinvonz@google.com> [Mon, 22 Apr 2019 22:43:00 -0700] rev 42345
narrowcommands: drop unnecessary adding of '' for root directory
It's now included by util.dirs().
Differential Revision: https://phab.mercurial-scm.org/D6405
Martin von Zweigbergk <martinvonz@google.com> [Wed, 17 Apr 2019 21:39:18 -0700] rev 42344
copies: remove hack for adding root dir to util.dirs object
Differential Revision: https://phab.mercurial-scm.org/D6404
Martin von Zweigbergk <martinvonz@google.com> [Tue, 16 May 2017 11:00:38 -0700] rev 42343
util: make util.dirs() and util.finddirs() include root directory (API)
This changes the behavior of test-origbackup-conflict.t so it no
longer errors out when the backup path points to an existing
file. Instead, it replaces the file by a directory. That seems
reasonable to me.
Differential Revision: https://phab.mercurial-scm.org/D6403
Martin von Zweigbergk <martinvonz@google.com> [Thu, 13 Jul 2017 23:43:16 -0700] rev 42342
dirstate: drop workaround for '.' matching root directory
The check was added in
31abcae33b4f (dirstate: do not ignore current
directory '.' (issue 1078), 2008-04-05) to fix
issue1078. Funnily
enough, comment #2 on that issue mentions using '' instead of '.' to
represent the root directory, just like my previous patch did.
test-hgignore.t fails with this patch without the previous patch.
Differential Revision: https://phab.mercurial-scm.org/D6402
Martin von Zweigbergk <martinvonz@google.com> [Mon, 15 May 2017 00:12:19 -0700] rev 42341
match: use '' instead of '.' for root directory (API)
I think '' is generally a better value for the root directory than '.'
is. For example, os.path.join('', 'foo') => 'foo', while
os.path.join('.', 'foo') => './foo'.
This patch mostly makes it so we use '' internally in
match.py. However, it also affects the API in visitdir(),
visitchildrenset() and files(). The two former now also accept '' as
input. I've updated the callers of these methods. I've also added a
deprecation warning for passing '.' (for external callers). The only
caller I could find that was affected by files() returning '' instead
of '.' was in dirstate.walk(). I've updated that.
The next few patches show some workarounds we can remove by using ''
instead of '.'.
Differential Revision: https://phab.mercurial-scm.org/D6401
Martin von Zweigbergk <martinvonz@google.com> [Wed, 24 Apr 2019 09:32:29 -0700] rev 42340
dirstate: move special handling of files==['.'] together
I think it makes it a little clearer to have the two conditions for
files==['.'] near each other.
Differential Revision: https://phab.mercurial-scm.org/D6400
Martin von Zweigbergk <martinvonz@google.com> [Fri, 17 May 2019 00:57:57 -0700] rev 42339
convert: don't include file in "files" list if it's added in p2
If the file is from p2, we should clearly compare the flags to what
they were in p2.
Also note that manifest.flags('non-existent') unfortunately returns ''
instead of erroring out.
Differential Revision: https://phab.mercurial-scm.org/D6409
Martin von Zweigbergk <martinvonz@google.com> [Fri, 17 May 2019 11:32:48 -0700] rev 42338
convert: demonstrate broken {files} list in merge commits with file flags
When there is a merge in which the flags for a file from p2 is
non-empty, `hg convert` will incorrectly include that in the
changeset's files list.
Differential Revision: https://phab.mercurial-scm.org/D6408
Matt Harbison <matt_harbison@yahoo.com> [Sat, 18 May 2019 19:56:06 -0400] rev 42337
templater: drop support for old style keywords (API)
These changes originated from several commits over a period of time, so I'm
slightly unsure if this is correct. But the tests pass.
Matt Harbison <matt_harbison@yahoo.com> [Sat, 18 May 2019 19:38:47 -0400] rev 42336
commands: drop support for legacy ^cmd registration (API)
Matt Harbison <matt_harbison@yahoo.com> [Sat, 18 May 2019 19:33:48 -0400] rev 42335
extensions: drop support for extsetup() without `ui` argument (API)
Martin von Zweigbergk <martinvonz@google.com> [Fri, 17 May 2019 11:11:40 -0700] rev 42334
relnotes: mention removed support for mixed log graph lines
This adds release notes for
264a2cbb25d0 (graphmod: remove support for
graph lines mixing parent/grandparent styles (BC), 2018-10-16).
Differential Revision: https://phab.mercurial-scm.org/D6407
Augie Fackler <augie@google.com> [Fri, 17 May 2019 11:03:47 -0400] rev 42333
tests: fix test-clonebundles on recent openbsd
I guess openbsd feels like it needs to stringify this errno in
lowercase and omit the "host" part of "hostname. Okay.
Reported in a big test diff talking about libressl, see 6122. I'm not
flagging this because most of that issue is about a libressl string
change, so this doesn't really make a big difference there.
Differential Revision: https://phab.mercurial-scm.org/D6399
Georges Racinet <georges.racinet@octobus.net> [Thu, 16 May 2019 21:17:14 +0200] rev 42332
rust-python3: compatibility fix for integer conversion
On python3, `to_py_object()` on the usize gives us a PyLong,
whereas it is the generic `PyObject` already on python2, which fits
the `py.None()` default value.
Upcasting to `PyObject` explicitely in all cases solves the issue.
Differential Revision: https://phab.mercurial-scm.org/D6396
Augie Fackler <augie@google.com> [Fri, 17 May 2019 09:42:02 -0400] rev 42331
rust: sort dependencies entries in Cargo.toml
I should probably write a test to enforce this...
Differential Revision: https://phab.mercurial-scm.org/D6398
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 17 May 2019 00:04:29 +0530] rev 42330
py3: make contrib/testparseutil.py to work on str(unicodes)
contrib/check-code work on unicodes and call functions from testparseutil.py
which before this patch used to work on bytes.
This path removes that inconsistency and make testparseutil.py work on unicodes.
This makes test-check-code.t and test-contrib-check-code.t work on Python 3
again.
Differential Revision: https://phab.mercurial-scm.org/D6391
Raphaël Gomès <rgomes@octobus.net> [Fri, 17 May 2019 09:36:29 -0400] rev 42329
rust-filepatterns: call new Rust implementations from Python
This change adds the import to the `rust-cpython` bindings and uses
them when appropriate.
A wrapper function has been defined in the case of `_regex` to
keep this patch simple.
Differential Revision: https://phab.mercurial-scm.org/D6273
Raphaël Gomès <rgomes@octobus.net> [Fri, 17 May 2019 09:36:29 -0400] rev 42328
rust-filepatterns: add `rust-cpython` bindings for `filepatterns`
This change adds the `rust-cpython` interface for top-level functions and
exceptions in the filepatterns module.
Contrary to the Python implementation, this tries to have finer-grained
exceptions to allow for better readability and flow control down the line.
Differential Revision: https://phab.mercurial-scm.org/D6272
Raphaël Gomès <rgomes@octobus.net> [Wed, 24 Apr 2019 11:34:09 +0200] rev 42327
rust-filepatterns: add a Rust implementation of pattern-related utils
This change introduces Rust implementations of two functions related to
pattern handling, all located in `match.py`:
- `_regex`
- `readpatternfile`
These utils are useful in the long-term effort to improve `hg status`'s
performance using Rust. Experimental work done by Valentin Gatien-Baron
shows very promising improvements, but is too different from the current
Mercurial core code structure to be used "as-is".
This is the first - albeit very small - step towards the code revamp
needed down the line.
Two dependencies were added: `regex` and `lazy_static`. Both of them
will be useful for a majority of the Rust code that will be written,
are well known and maintained either by the Rust core team, or by
very frequent contributors.
Differential Revision: https://phab.mercurial-scm.org/D6271
Martin von Zweigbergk <martinvonz@google.com> [Wed, 15 May 2019 22:11:41 -0700] rev 42326
exchange: don't take wlock if bookmarks are stored in .hg/store/
If bookmarks are stored in .hg/store/, there is no need for the
wlock().
Differential Revision: https://phab.mercurial-scm.org/D6388
Martin von Zweigbergk <martinvonz@google.com> [Wed, 15 May 2019 22:09:02 -0700] rev 42325
bookmarks: keep bookmarks in .hg/store if new config set
Bookmarks storage consists of two parts: (1) the set of bookmarks and
their positions, and (2) the current bookmark. The former can get
updated by exchange, while the latter cannot. However, they are both
stored in directly .hg/ and protected by repo.wlock(). As a result,
ugly workarounds were needed. This patch introduces a new config
option to store the set of bookmarks and their positions in .hg/store/
but still storing the current bookmark directory in .hg/. The config
option only takes effect at repo creation time. It results in a new
requirement being set.
Differential Revision: https://phab.mercurial-scm.org/D6387
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 May 2019 10:08:28 +0200] rev 42324
bookmark: also make bookmark cache depends of the changelog
Since the changelog is also used during the parsing of bookmark data, it should
be listed as a file cache dependency. This fix the race condition we just
introduced a test for.
This is a simple fix that might lead bookmark data to be invalidated more often
than necessary. We could have more complicated code to deal with this race in a
more "optimal" way. I feel it would be unsuitable for stable.
In addition, the performance impact of this is probably minimal and I don't
foresee the more advanced fix to actually be necessary.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 May 2019 10:08:17 +0200] rev 42323
localrepo: grab mixedrepostorecache class from
526750cdd02d
On default, Martin von Zweigbergk <martinvonz@google.com> introduced a more
advance filecache decorator. I need this decorator to fix a bug on stable. So I
am grafting the relevant part of
526750cdd02d.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 May 2019 10:06:53 +0200] rev 42322
bookmark: add a test for a race condition on push
Bookmark pointing to unknown nodes are ignored. Later these ignored bookmarks
are dropped when writing the file back on disk. On paper, this behavior should
be fine, but with the current implementation, it can lead to unexpected
bookmark deletions.
In theory, to make sure writer as a consistent view, taking the lock also
invalidate bookmark data we already loaded into memory. However this
invalidation is incomplete. The data are stored in a `filecache` that preserve
them if the bookmark related file are untouched. In practice, the bookmark data
in memory also depends of the changelog content, because of the step checking
if the bookmarks refers to a node known to the changelog. So if the bookmark
data were loaded from an up to date bookmark file but filtered with an outdated
changelog file this go undetected.
This condition is fairly specific, but can occurs very often in practice. We
introduce a test recreating the situation. The test comes in an independant
changeset to show it actually reproduce the situation. The fix will come soon
after.
A large share of the initial investigation of this race condition was made by
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 May 2019 07:11:16 +0200] rev 42321
test: properly gate a zstd section
This part of the test can't run if zstd is not available. This was caught by
--pure test (who don't support zstd).
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 May 2019 07:11:06 +0200] rev 42320
test: update test for expected test output
In
1fac9b931d46 as new test session was introduced. It did not take in account
some part that only ran for pure.
The test is now fixed.
Yuya Nishihara <yuya@tcha.org> [Thu, 16 May 2019 08:15:20 +0900] rev 42319
log: flag topo-sorted set as such
This isn't required right now, but revs.istopo() should return True.
Martin von Zweigbergk <martinvonz@google.com> [Wed, 09 Jan 2019 15:54:45 -0800] rev 42318
copies: fix duplicatecopies() with overlay context
The reasoning for this check is in
78d760aa3607 (duplicatecopies: do
not mark items not in the dirstate as copies, 2013-03-28). The check
was then moved to workingfilectx in
754b5117622f (context: add
workingfilectx.markcopied, 2017-10-15) and no corresponding check was
added later when overlayworkingfilectx was added. Rather than adding
the check there, this patch adds a more generic check on the callers
side and removes the check in workingfilectx.markcopied().
Differential Revision: https://phab.mercurial-scm.org/D6380
Martin von Zweigbergk <martinvonz@google.com> [Wed, 15 May 2019 16:10:52 -0700] rev 42317
tests: demonstrate crash when rebasing across copy with --collapse
As reported by timeless.
Differential Revision: https://phab.mercurial-scm.org/D6379
Augie Fackler <augie@google.com> [Wed, 15 May 2019 17:18:57 -0400] rev 42316
exthelper: add some semi-useful trace logs
It'd be nice to make the trace functions a little better-named in the output,
but I'm not sure how much better we can do without overhead. This at least
lets you see if a single reposetup function is eating all the time or if it's
spread over all of them. I needed this because Google's uber-extension has a
long load time and I wasn't sure where the problem was.
Differential Revision: https://phab.mercurial-scm.org/D6381
Martin von Zweigbergk <martinvonz@google.com> [Wed, 15 May 2019 23:26:05 -0700] rev 42315
help: add missing blank line, making "revlog-compression" show up
Differential Revision: https://phab.mercurial-scm.org/D6386
Martin von Zweigbergk <martinvonz@google.com> [Wed, 15 May 2019 11:53:22 -0700] rev 42314
tests: fix share test to actually share the repo
"repo2" is clearly meant to be a share from "repo1" but without
sharing bookmarks. However, `hg unshare` was called in the repo, so it
had become completely unrelated and thus not testing what it was
supposed to test.
Differential Revision: https://phab.mercurial-scm.org/D6385
Martin von Zweigbergk <martinvonz@google.com> [Wed, 15 May 2019 11:38:45 -0700] rev 42313
tests: separate out bookmarks tests from test-share.t
Differential Revision: https://phab.mercurial-scm.org/D6384
Martin von Zweigbergk <martinvonz@google.com> [Wed, 15 May 2019 10:19:36 -0700] rev 42312
bookmarks: use vfs.tryread() instead of reimplementing it
Differential Revision: https://phab.mercurial-scm.org/D6383
Martin von Zweigbergk <martinvonz@google.com> [Wed, 15 May 2019 10:13:29 -0700] rev 42311
bookmarks: use context manager when writing files
Differential Revision: https://phab.mercurial-scm.org/D6382
timeless <timeless@mozdev.org> [Wed, 15 May 2019 10:54:36 -0400] rev 42310
bisect: do not crash with rewritten commits
Martin von Zweigbergk <martinvonz@google.com> [Wed, 01 May 2019 09:34:47 -0700] rev 42309
log: add config for making `hg log -G` always topo-sorted
I (and everyone else at Google) have an log alias that adds graph mode
and templating. I have another one that builds on the first and also
restricts the set of revisions to only show those I'm most likely to
care about. This second alias also adds topological sorting. I still
sometimes use the first one. When I do, it very often bothers me that
it's not topologically sorted (branches are interleaved). This patch
adds a config option for always using topological sorting with graph
log.
The revision set is sorted eagerly, which seems like a bad idea, but
it doesn't seem to make a big difference in the hg repo (150ms). I
initially tried to instead wrap the user's revset in sort(...,topo),
but that seemed much harder.
Differential Revision: https://phab.mercurial-scm.org/D6331
Martin von Zweigbergk <martinvonz@google.com> [Tue, 14 May 2019 09:13:39 -0700] rev 42308
log: remove an unnecessary "and opts.get('rev')" condition
As Yuya pointed out, the condition is unnecessary since
revs.isdescending() would be true if --follow without --rev.
Differential Revision: https://phab.mercurial-scm.org/D6372
Kyle Lippincott <spectral@google.com> [Tue, 16 Oct 2018 04:59:36 -0700] rev 42307
graphmod: remove support for graph lines mixing parent/grandparent styles (BC)
Currently, if the configuration for a graph edge draw style has multiple bytes
(at least on python2), it is interpreted as "this is a request to draw the line
partially in the style of the parent, partially in the style of the
grandparent". This precludes the configuration handling unicode characters
(which trigger the `len > 1` check, at least on python2), and I believe was part
of the reason that beautifygraph was written the way it was.
Talking with the person who implemented this, it appears to have been to achieve
feature parity with the rendering of the smartlog extension. I suspect that this
isn't actually used outside of that situation, so I think that we can remove it
without much issue.
This will make it so that multi-character edges are possible, and render any
existing configuration that uses this feature with these multiple characters.
This is *not* going to adjust the width of everything to make it line up
correctly, please see the test that's being modified in this changeset for an
example of how the previous configuration now renders.
Note also that the previous configuration seems to have been broken, or at least
it was behaving in a really non-obvious way - it was avoiding the grandparent
character(s) when it should have been displaying them! This is why so many "!"
characters changed to "3."; I don't know if this was intentional.
Differential Revision: https://phab.mercurial-scm.org/D5112
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 15 May 2019 21:02:32 +0300] rev 42306
py3: add 5 new passing tests
Differential Revision: https://phab.mercurial-scm.org/D6378
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 15 May 2019 20:37:39 +0300] rev 42305
py3: add a r'' to prevent transformer adding b''
# skip-blame because just r'' prefix
Differential Revision: https://phab.mercurial-scm.org/D6377