Gregory Szorc <gregory.szorc@gmail.com> [Fri, 25 Jan 2019 15:09:08 -0800] rev 41401
tests: add optional setsockopt() output on Python 3
Tests still don't pass. But this gets us a little closer.
Differential Revision: https://phab.mercurial-scm.org/D5699
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 25 Jan 2019 15:03:20 -0800] rev 41400
wireprotov2peer: rewrite character traversal to use slices
Otherwise on Python 3 we iterate over integers instead of a
bytes instance and the comparison fails.
Differential Revision: https://phab.mercurial-scm.org/D5698
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 25 Jan 2019 14:57:37 -0800] rev 41399
wireprotov2server: don't attempt to cast command name
I'm not sure why this was added. The command name should already
be bytes.
Differential Revision: https://phab.mercurial-scm.org/D5697
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 25 Jan 2019 14:38:49 -0800] rev 41398
wireprotov2server: use pycompat.strkwargs when calling cachekeyfn
Differential Revision: https://phab.mercurial-scm.org/D5696
Navaneeth Suresh <navaneeths1998@gmail.com> [Thu, 17 Jan 2019 18:05:54 +0530] rev 41397
diffstat: make --git work properly on renames (issue6025)
`$ hg diff --stat --git` shows only the new filename on renames.
I added the old filename also to the output to make it identical
with the output of `$ git diff --stat`.
Differential Revision: https://phab.mercurial-scm.org/D5628
Martin von Zweigbergk <martinvonz@google.com> [Fri, 25 Jan 2019 09:50:23 -0800] rev 41396
cmdutil: drop obsolete comment about updating to '.'
Obsolete since cf68e2649e0a (status: advertise --abort instead of
'update -C .' to abort a merge, 2018-08-09) and 5b04b6204931 (status:
advertise --abort instead of 'update -C .' to abort graft, 2018-08-09).
Differential Revision: https://phab.mercurial-scm.org/D5694
Martin von Zweigbergk <martinvonz@google.com> [Thu, 24 Jan 2019 16:30:30 -0800] rev 41395
mq: slightly simplify check for patched working copy
Differential Revision: https://phab.mercurial-scm.org/D5693
Martin von Zweigbergk <martinvonz@google.com> [Thu, 24 Jan 2019 16:25:19 -0800] rev 41394
localrepo: slightly simplify check for removed parents in _rollback()
Differential Revision: https://phab.mercurial-scm.org/D5692
Martin von Zweigbergk <martinvonz@google.com> [Thu, 24 Jan 2019 16:16:10 -0800] rev 41393
transplant: use bailifchanged() instead of reimplementing it
Differential Revision: https://phab.mercurial-scm.org/D5691
Martin von Zweigbergk <martinvonz@google.com> [Thu, 24 Jan 2019 12:47:54 -0800] rev 41392
revpair: clarify check for empty revset
Differential Revision: https://phab.mercurial-scm.org/D5688
Martin von Zweigbergk <martinvonz@google.com> [Thu, 24 Jan 2019 12:38:19 -0800] rev 41391
revpair: simplify revpair by always relying on smartset.first/last
I thinkt the code was written the way it was because it comes from
97b2f26dfc43 (revpair: smartset compatibility, 2014-03-20) and the
first/last methods came only later, in 228b0aafb1ce (smartset: add
first and last methods, 2014-10-06).
Differential Revision: https://phab.mercurial-scm.org/D5687
Martin von Zweigbergk <martinvonz@google.com> [Fri, 18 Jan 2019 11:10:30 -0800] rev 41390
grep: use set instead of dict with dummy value
Differential Revision: https://phab.mercurial-scm.org/D5633
Martin von Zweigbergk <martinvonz@google.com> [Thu, 06 Sep 2018 15:56:53 -0700] rev 41389
grep: don't look up copy info unless --follow is given
If no --follow was given, then the "copy" variable will become
None. In that case we would still look up the copy information from
the filelog and then ignore it. Let's avoid even looking it up.
Differential Revision: https://phab.mercurial-scm.org/D5620
Martin von Zweigbergk <martinvonz@google.com> [Thu, 17 Jan 2019 09:24:30 -0800] rev 41388
hghave: let OSError with ENOENT through like any other
Before this patch, if we get an OSError with ENOENT, we would not
re-raise it and would instead run into an undefined variable ("p")
soon thereafter.
Differential Revision: https://phab.mercurial-scm.org/D5631
Martin von Zweigbergk <martinvonz@google.com> [Thu, 17 Jan 2019 09:17:12 -0800] rev 41387
cleanup: delete lots of unused local variables
These were found by IntelliJ. There are many more, but these seemed
pretty safe.
Differential Revision: https://phab.mercurial-scm.org/D5629
Martin von Zweigbergk <martinvonz@google.com> [Mon, 24 Sep 2018 14:46:37 -0700] rev 41386
localrepo: use context manager for lock and transaction in commitctx()
Differential Revision: https://phab.mercurial-scm.org/D5624
Martin von Zweigbergk <martinvonz@google.com> [Wed, 16 Jan 2019 17:34:59 -0800] rev 41385
localrepo: use context manager for locks in commit()
Differential Revision: https://phab.mercurial-scm.org/D5623
Martin von Zweigbergk <martinvonz@google.com> [Wed, 16 Jan 2019 17:33:47 -0800] rev 41384
localrepo: use context manager for transaction in commit()
A side-effect is that the transaction is released a little earlier, so
the "commit message saved in ..." messages now comes after the
"rollback completed" message. That seems slightly better to me.
Differential Revision: https://phab.mercurial-scm.org/D5622
Martin von Zweigbergk <martinvonz@google.com> [Wed, 16 Jan 2019 17:46:39 -0800] rev 41383
commit: print "commit message saved in" message also if bookmark update fails
The bookmark update is done within the same transaction, so if fails,
the commit will also be rolled back.
I just happened to notice this while messing with this code; we have
not had reports of crashing bookmark updates from our users.
The same applies to the clearing of the merge state, although I don't
think that's currently tied into the transaction.
Differential Revision: https://phab.mercurial-scm.org/D5621
Martin von Zweigbergk <martinvonz@google.com> [Thu, 17 Jan 2019 22:07:58 -0800] rev 41382
remotefilelog: remove pointless return statement from constructor
Differential Revision: https://phab.mercurial-scm.org/D5630
Anton Shestakov <av6@dwimlabs.net> [Tue, 15 Jan 2019 22:57:09 +0800] rev 41381
revset: support ranges in #generations relation
Pulkit Goyal <pulkit@yandex-team.ru> [Thu, 24 Jan 2019 18:14:39 +0300] rev 41380
tests: fix module-import warnings in test-update-atomic.t
These were caught by test-check-module-imports.t on Python 3.
This should also make python3-buildbot green again.
Differential Revision: https://phab.mercurial-scm.org/D5674
Pulkit Goyal <pulkit@yandex-team.ru> [Fri, 18 Jan 2019 19:28:31 +0530] rev 41379
py3: use dict.items() instead of dict.iteritems() in tests/test-lfs-server.t
dict.iteritems() is not present on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D5673
Pulkit Goyal <pulkit@yandex-team.ru> [Fri, 18 Jan 2019 19:26:28 +0530] rev 41378
py3: add b'' prefixes in tests/test-lfs-serve.t
# skip-blame because just b'' prefixes
Differential Revision: https://phab.mercurial-scm.org/D5672
Pulkit Goyal <pulkit@yandex-team.ru> [Thu, 24 Jan 2019 18:09:34 +0300] rev 41377
py3: add b'' prefixes in doc/check-seclevel.py
# skip-blame because just b'' prefixes
Differential Revision: https://phab.mercurial-scm.org/D5670
Augie Fackler <augie@google.com> [Thu, 24 Jan 2019 15:52:59 -0500] rev 41376
tests: remove some over-globbing in test-dispatch.t
Hilariously, this was exposed by Python 3 work.
Differential Revision: https://phab.mercurial-scm.org/D5689
Augie Fackler <augie@google.com> [Thu, 24 Jan 2019 15:23:20 -0500] rev 41375
py3: port test-parseindex.t to Python 3
Differential Revision: https://phab.mercurial-scm.org/D5686
Augie Fackler <augie@google.com> [Thu, 24 Jan 2019 15:04:30 -0500] rev 41374
py3: almost fix test-trusted.py
The test now only fails due to output format changes on the repr of
mercurial.error.ParseError. I'm not really sure how to approach that
for now.
Differential Revision: https://phab.mercurial-scm.org/D5685
Yuya Nishihara <yuya@tcha.org> [Fri, 25 Jan 2019 18:55:23 +0900] rev 41373
merge with stable
Augie Fackler <augie@google.com> [Thu, 24 Jan 2019 15:03:00 -0500] rev 41372
py3: fix test-update-atomic.t
The .replace('o', '') hack on oct() return value is required because:
% python -c 'print(oct(10))'
012
% python3 -c 'print(oct(10))'
0o12
Differential Revision: https://phab.mercurial-scm.org/D5684
Augie Fackler <augie@google.com> [Thu, 24 Jan 2019 15:02:28 -0500] rev 41371
py3: fix test-newcgi.t
Differential Revision: https://phab.mercurial-scm.org/D5683
Augie Fackler <augie@google.com> [Thu, 24 Jan 2019 14:12:00 -0500] rev 41370
py3: fix up test-encoding-align.t for python3
I'm not super thrilled with how this reads, but the original didn't
thrill me either.
Differential Revision: https://phab.mercurial-scm.org/D5682
Augie Fackler <augie@google.com> [Thu, 24 Jan 2019 13:57:23 -0500] rev 41369
py3: these two casefolding tests pass for me on my Mac
I assume the buildbot didn't catch them because it's on a
case-sensitive filesystem.
Differential Revision: https://phab.mercurial-scm.org/D5681
Augie Fackler <augie@google.com> [Thu, 24 Jan 2019 13:54:45 -0500] rev 41368
py3: port test-bugzilla.t to Python 3
Some assorted fixes required in the extension itself, all around
bytes/str issues.
Differential Revision: https://phab.mercurial-scm.org/D5680
Martin von Zweigbergk <martinvonz@google.com> [Sun, 20 Jan 2019 21:49:58 -0800] rev 41367
uncommit: set dirstateparents from within _fixdirstate()
It's now done in the same way for uncommit and unamend, so we can
share the code.
Differential Revision: https://phab.mercurial-scm.org/D5662
Martin von Zweigbergk <martinvonz@google.com> [Sun, 20 Jan 2019 22:00:25 -0800] rev 41366
unamend: fix unamending of renamed rename
Before this patch, we were passing in the result of a status call for
a different set of commits than what we calculated copies for, which
seemed suspicous to me. The rewritten version gets status and copy
information from the same sets of commits.
Differential Revision: https://phab.mercurial-scm.org/D5661
Martin von Zweigbergk <martinvonz@google.com> [Sun, 20 Jan 2019 22:00:21 -0800] rev 41365
uncommit: mark old node obsolete after updating dirstate
The next patch will start doing more things with the context object
for the old node and that ran into problems without this
change. Regardless of that, I think it seems better to first update to
the new node and then mark the old node obsolete.
Differential Revision: https://phab.mercurial-scm.org/D5660
Martin von Zweigbergk <martinvonz@google.com> [Fri, 18 Jan 2019 17:09:42 -0800] rev 41364
unamend: import "copies" module as "copiesmod" to avoid shadowing
Differential Revision: https://phab.mercurial-scm.org/D5659
Martin von Zweigbergk <martinvonz@google.com> [Fri, 18 Jan 2019 17:08:02 -0800] rev 41363
tests: add more tests of uncommit/unamend with copies
The unamend tests show suboptimal behavior.
Differential Revision: https://phab.mercurial-scm.org/D5658
Martin von Zweigbergk <martinvonz@google.com> [Fri, 18 Jan 2019 16:49:18 -0800] rev 41362
tests: clean up after each test in test-unamend.t
Differential Revision: https://phab.mercurial-scm.org/D5657
Augie Fackler <augie@google.com> [Thu, 24 Jan 2019 10:21:59 -0500] rev 41361
cleanup: use clang-tidy to add missing {} around one-line statements
I find this easier to read. Cleanup performed like this:
hg files 'set:(**.c or **.cc or **.h) and not "listfile:contrib/clang-format-ignorelist"' | while read f ; do
clang-tidy -fix -checks=readability-braces-around-statements $f -- $(python-config --cflags) -Imercurial/cext -Imercurial
done
make format-c
I had to revert chg/chg.c as it's got a construct that seems to confuse
clang-tidy, so I'll work on that file later if this change is acceptable. I
only tackle files that are under clang-format's authority because otherwise
I'd have to do a bunch of manual formatting. A few files didn't get edited
because clang-tidy couldn't find some headers. Again, I'll figure that out
later assuming this change is accepted.
No check-code rule added for now because writing the regex sounds hard. In a
perfect world I guess we could write a test that uses clang-tidy on these
files, but I think clang-tidy is pretty rarely installed. :/
Differential Revision: https://phab.mercurial-scm.org/D5675
Augie Fackler <augie@google.com> [Thu, 24 Jan 2019 11:35:40 -0500] rev 41360
py3: port test-batching.py to python3
I used byteify-strings.py on this file, then manually added the
various pycompat and bprint bits as needed.
Differential Revision: https://phab.mercurial-scm.org/D5678
Augie Fackler <augie@google.com> [Thu, 24 Jan 2019 11:34:18 -0500] rev 41359
py3: fix missing b prefixes in test-arbitraryfilectx.t
Test passes on Python 3.
# skip-blame b prefixes
Differential Revision: https://phab.mercurial-scm.org/D5679
Augie Fackler <augie@google.com> [Thu, 24 Jan 2019 11:39:38 -0500] rev 41358
py3: add missing b prefixes in test-acl.t
There's one failure left in the test, which looks like a real problem
around executing hooks. I have not investigated further.
# skip-blame as just b'' prefixes
Differential Revision: https://phab.mercurial-scm.org/D5677
Augie Fackler <augie@google.com> [Thu, 24 Jan 2019 11:00:32 -0500] rev 41357
py3: buildbot found more passing tests, thanks to indygreg for most of them
Differential Revision: https://phab.mercurial-scm.org/D5676
Martin von Zweigbergk <martinvonz@google.com> [Wed, 16 Jan 2019 17:04:50 -0800] rev 41356
tests: drop a duplicate definition of a constant
Differential Revision: https://phab.mercurial-scm.org/D5663
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 23 Jan 2019 17:57:43 -0800] rev 41355
tests: support URL quoting on Python 3
We could use mercurial.urllibcompat, but meh. This makes things
easier to read.
The test still fails on Python 3 for some reason. But at least
we no longer have an exception.
Differential Revision: https://phab.mercurial-scm.org/D5669
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 23 Jan 2019 17:45:11 -0800] rev 41354
tests: write directly to stdout to avoid b'' prefixes
This enables the test to pass on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D5668
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 23 Jan 2019 17:41:46 -0800] rev 41353
tests: handle string escaping/encoding on Python 3
This code was failing on Python 3 for a few reasons:
1) sys.argv is str and str doesn't have a .decode()
2) the "string_escape" encoding was renamed to "unicode_escape"
It is wonky casting to bytes to str to bytes. But this is test
code, so meh. I don't believe we exercise any code paths in these
tests where the arguments aren't ascii.
Differential Revision: https://phab.mercurial-scm.org/D5667
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 23 Jan 2019 16:21:36 -0800] rev 41352
convert: use raw strings for XML strings
Due to the source transformer, we were passing bytes into the
XML APIs. This results in not finding elements and doing compares
against mismatched types.
Use raw string literals so we use str everywhere.
Differential Revision: https://phab.mercurial-scm.org/D5664
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 23 Jan 2019 16:22:54 -0800] rev 41351
tests: normalize XML values to bytes
This fixes some type mismatches. The encoding shouldn't matter
for what this script is used for. UTF-8 seems reasonable, especially
since I'm pretty sure SVN will emit UTF-8 encoded XML.
Differential Revision: https://phab.mercurial-scm.org/D5665
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 23 Jan 2019 17:26:00 -0800] rev 41350
hgweb: ensure template mapping keys are bytes
Before, str keys were being added in Python 3 because named
arguments to dict() use native str for keys. This caused the
templater to fail to find the keys since it was looking for
bytes versions.
This makes a handful of tests pass on Python 3.
We may want to consider having the templater validate that keys
in mapping dicts are bytes. But I'm unsure whether this is
appropriate and won't be doing this.
Differential Revision: https://phab.mercurial-scm.org/D5666
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 22 Jan 2019 18:25:34 -0800] rev 41349
remotefilelog: use %d to format an int
Differential Revision: https://phab.mercurial-scm.org/D5656
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 22 Jan 2019 18:24:52 -0800] rev 41348
tests: use bytes for file I/O
Otherwise we get various type mismatches.
Differential Revision: https://phab.mercurial-scm.org/D5655
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 22 Jan 2019 18:23:47 -0800] rev 41347
tests: make filenames bytes for Python 3
I also snuck a %s -> %d in there to appease Python 3.
Differential Revision: https://phab.mercurial-scm.org/D5654
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 22 Jan 2019 18:16:53 -0800] rev 41346
tests: use assertEqual()
This avoids a deprecation warning under at least Python 3.7.
Differential Revision: https://phab.mercurial-scm.org/D5653
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 22 Jan 2019 18:11:34 -0800] rev 41345
tests: add setsockopt() output on Python 3
Python 3 appears to call setsockopt() where Python 2 did not.
Differential Revision: https://phab.mercurial-scm.org/D5652
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 22 Jan 2019 18:07:51 -0800] rev 41344
hgweb: don't use raw string for session vars
This r'' is leaking into the templating layer and causing an
assertion failure.
The r'' was added in d1fccbd50fcd (October 2017). Similar code
in hgweb_mod.py was also changed in that changeset. hgweb_mod.py was
updated in ec46415ed826 (March 2018) to use webutil.sessionvars(),
which doesn't use raw strings.
Differential Revision: https://phab.mercurial-scm.org/D5651
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 22 Jan 2019 17:50:52 -0800] rev 41343
tests: normalize to bytes in test-install.t
directory() was returning str and hgdirectory() was returning
bytes. This made the set compare fail. Let's normalize the types
on Python 3 so the test passes.
Differential Revision: https://phab.mercurial-scm.org/D5650
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 22 Jan 2019 17:08:53 -0800] rev 41342
config: reject str sections and keys on Python 3
Otherwise we could end up with a dict having both the str
and bytes versions of a particular config item. This may cause
some tests to regress. I haven't checked. But it is better
behavior to fail fast.
We could just as easily change this to normalize the values. But
I like catching all non-compliant call sites first.
Differential Revision: https://phab.mercurial-scm.org/D5649
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 22 Jan 2019 17:02:40 -0800] rev 41341
tests: add size and hash for Python 3
test-archive.t now passes on Python 3.7.1.
Differential Revision: https://phab.mercurial-scm.org/D5648
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 22 Jan 2019 16:58:48 -0800] rev 41340
httppeer: use %s for formatting
This prevents a b'' from appearing in Python 3 output. We keep the
single quotes for backwards compatibility.
Differential Revision: https://phab.mercurial-scm.org/D5647
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 22 Jan 2019 16:54:56 -0800] rev 41339
tests: add b'' to notcapable
This fixes some exceptions in a few tests.
# skip-blame just b'' prefixes
Differential Revision: https://phab.mercurial-scm.org/D5646
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 22 Jan 2019 16:53:24 -0800] rev 41338
tests: add b'' to test-missing-capability.t
The test now passes on Python 3.
# skip-blame just b'' prefixes
Differential Revision: https://phab.mercurial-scm.org/D5645
Augie Fackler <raf@durin42.com> [Tue, 22 Jan 2019 11:41:22 -0500] rev 41337
fuzz: exercise more of the lazymanifest code
Differential Revision: https://phab.mercurial-scm.org/D5643
Augie Fackler <raf@durin42.com> [Tue, 22 Jan 2019 11:41:09 -0500] rev 41336
fuzz: restrict manifest input size
Again, let's keep the fuzzer from getting excited about huge inputs.
Differential Revision: https://phab.mercurial-scm.org/D5642
Augie Fackler <raf@durin42.com> [Tue, 22 Jan 2019 11:02:10 -0500] rev 41335
fuzz: exercise more of the revlog API
I noticed in the coverage report that we didn't have much coverage in
revlog.py. Let's try and get some of the more interesting bits tested
by the fuzzer. I ran this locally for a few minutes to verify that I
appear to be calling the various functions in reasonable ways.
Differential Revision: https://phab.mercurial-scm.org/D5641
Augie Fackler <raf@durin42.com> [Tue, 22 Jan 2019 11:18:05 -0500] rev 41334
fuzz: don't allow enormous revlog inputs either
I'm about to make the fuzzer do more, and without this it was getting
enthusiastic about large (and therefore slow) inputs that I don't
think buy us much.
Differential Revision: https://phab.mercurial-scm.org/D5640
Martin von Zweigbergk <martinvonz@google.com> [Tue, 22 Jan 2019 10:55:45 -0800] rev 41333
merge with stable
Augie Fackler <raf@durin42.com> [Tue, 19 Mar 2019 09:23:35 -0400] rev 41332
Added signature for changeset 4ea21df312ec
Augie Fackler <raf@durin42.com> [Tue, 19 Mar 2019 09:23:33 -0400] rev 41331
Added tag 4.9.1 for changeset 4ea21df312ec
Matt Harbison <matt_harbison@yahoo.com> [Sat, 16 Mar 2019 14:40:21 -0400] rev 41330
record: prevent commits that don't pick up dirty subrepo changes (issue6102)
This path covers interactive mode for commit, amend, and shelve, as well as the
deprecated record extension. Since shelf creation uses commit without -S in the
non-interactive case, aborting here should be OK. (I didn't check what happens
to non interactive shelve creation if `ui.commitsubrepos=True` is set.)
subrepoutil.precommit() will abort on a dirty subrepo if the config option isn't
set, but the hint recommends using --subrepos to commit. Since only the commit
command currently supports that option, the error has to be raised here to omit
the hint.
Doing the check before asking about all of the hunks in the MQ test seems like
an improvement on its own. There's probably an additional check on this path
that can be removed.
Yuya Nishihara <yuya@tcha.org> [Sun, 17 Mar 2019 12:43:45 +0900] rev 41329
test-https: add some more known failure messages of client certs (issue6030)
I don't think the exact error message is important here. On Debian sid,
ECONNRESET is raised, and "[SSL] tlsv13 alert certificate required" on NetBSD.
Yuya Nishihara <yuya@tcha.org> [Sun, 17 Mar 2019 12:37:57 +0900] rev 41328
test-https: turn off system OpenSSL configuration
This mostly fixes the test failure on Debian sid where TLS 1.0 and 1.1 are
disabled by default.
https://sources.debian.org/patches/openssl/1.1.1a-1/Set-systemwide-default-settings-for-libssl-users.patch/
$OPENSSL_CONF could be set by run-tests.py, but the other tests should work
without a "legacy" TLS, so I decided to not.
Manuel Jacob <me@manueljacob.de> [Sat, 23 Feb 2019 21:13:27 +0100] rev 41327
rebase: add missing dashes in help text
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 24 Feb 2019 19:56:46 +0100] rev 41326
test: stabilize bundle generation for test-sparse-revlog.t
To reduce the instability in the bundle binary content, we force it to contains
delta against p1 in all cases.
In the previous changeset, we already stabilized the processing of the bundle.
So we don't see any output change in the test itself.
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 24 Feb 2019 19:56:51 +0100] rev 41325
test: don't trust delta bases from the bundle in test-sparse-revlog.t
The point of the test is to check the strategy sparse-revlog uses to pick delta
base. If we trust the bases used in the bundle, we no longer fully test this
logic.
In order to force this computation we have to use the side effect of a legacy
format configuration `format.generaldelta`. The lack of a more official way to
do so will be fixed in a later changeset.
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 24 Feb 2019 19:56:57 +0100] rev 41324
test: update test-sparse-revlog.t output
This test is skipped unless a large artefact is pre-build. It seems like nobody
ran it in a while. Changeset 3764330f76a6 changed the expected output but
nobody noticed.
This changeset focus on the first and simpler step: putting the expected output
back to what one would get by running this test.
However this test changes highlight a couple of deeper issues:
1) Even if the revision content did not changed, a change in the delta
contained in the bundle affected the delta stored in the final revlog, changing
the test result. Since we are testing the delta computation strategy with
sparse, we should not blindly reuse the delta-base from the bundled delta.
2) A change in the format of the repository used to generate the bundle changed
the delta stored in the bundle. We should get a more stable output to avoid
future instabilities of this test.
3) The test is it not run by CI or developer.
We'll try to address all this issues in the coming changesets.
Matt Harbison <matt_harbison@yahoo.com> [Wed, 20 Feb 2019 20:57:58 -0500] rev 41323
tests: add a missing abort exit code on Windows in test-audit-subrepo.t
Yuya Nishihara <yuya@tcha.org> [Thu, 07 Feb 2019 20:50:41 +0900] rev 41322
subrepo: add test for Windows relative-ish path with drive letter
Matt Harbison pointed out that Windows had some weird path syntax.
Fortunately it's rejected appropriately by pathauditor, so we're safe.
Let's test the behavior as we have a special handling for Windows drive
letters.
This patch includes a basic example. Maybe we'll need to extend the test
case further, but writing such tests on Linux isn't easy.
Mathias De Mare <mathias.de_mare@nokia.com> [Thu, 07 Feb 2019 11:08:54 +0100] rev 41321
tests: fix regression tests failing on CentOS 7
Differential Revision: https://phab.mercurial-scm.org/D5877
Mathias De Mare <mathias.de_mare@nokia.com> [Thu, 07 Feb 2019 09:12:01 +0100] rev 41320
packaging: modify rc detection to work with X.Yrc instead of X.Y-rc
rc detection on CentOS failed without this change,
resulting in upgrades from 4.9rc to 4.9 not working
(4.9rc was considered more recent than 4.9).
Differential Revision: https://phab.mercurial-scm.org/D5876
Matt Harbison <matt_harbison@yahoo.com> [Tue, 05 Feb 2019 20:50:54 -0500] rev 41319
subrepo: avoid false unsafe path detection on Windows
Subrepo paths are not normalized for the OS, so what was happening in the
subsequent root path check was:
root -> $TESTTMP\issue1852a\sub/repo
util.expandpath(...) -> $TESTTMP\issue1852a\sub/repo
os.path.realpath(...) -> $TESTTMP\issue1852a\sub\repo
Augie Fackler <raf@durin42.com> [Fri, 01 Feb 2019 13:44:09 -0500] rev 41318
Added signature for changeset 83377b4b4ae0
Augie Fackler <raf@durin42.com> [Fri, 01 Feb 2019 13:44:07 -0500] rev 41317
Added tag 4.9 for changeset 83377b4b4ae0
Yuya Nishihara <yuya@tcha.org> [Tue, 08 Jan 2019 22:19:36 +0900] rev 41316
subrepo: reject potentially unsafe subrepo paths (BC) (SEC)
In addition to the previous patch, this prohibits '~', '$nonexistent', etc.
for any subrepo types. I think this is safer, and real-world subrepos wouldn't
use such (local) paths.
Yuya Nishihara <yuya@tcha.org> [Tue, 08 Jan 2019 22:07:45 +0900] rev 41315
subrepo: prohibit variable expansion on creation of hg subrepo (SEC)
It's probably wrong to expand path at localrepo.*repository() layer, but
fixing the layering issue would require careful inspection of call paths.
So, this patch adds add a validation to the subrepo constructor.
os.path.realpath(util.expandpath(root)) is what vfsmod.vfs() would do.
Yuya Nishihara <yuya@tcha.org> [Tue, 08 Jan 2019 21:51:54 +0900] rev 41314
subrepo: extend path auditing test to include more weird patterns (SEC)
While reviewing patches for the issue 5739, "$foo in repository path
expanded", I realized that subrepo paths can also be cheated. This patch
includes various subrepo paths which are potentially unsafe.
Since an expanded subrepo path isn't audited, this bug allows symlink check
bypass. As a result, a malicious subrepository could be checked out to a
sub tree of e.g. $HOME directory. The good news is that the destination
directory must be empty or nonexistent, so the existing ~/.bashrc wouldn't
be overwritten. See the last part of the tests for details.
Anton Shestakov <av6@dwimlabs.net> [Thu, 31 Jan 2019 13:32:21 +0800] rev 41313
copyright: update to 2019
Differential Revision: https://phab.mercurial-scm.org/D5779
Boris Feld <boris.feld@octobus.net> [Thu, 24 Jan 2019 18:22:47 -0500] rev 41312
revlog: make sure we never use sparserevlog without general delta (issue6056)
We are getting user report where the delta code tries to use `sparse-revlog`
logic on repository where `generaldelta` is disabled. This can't work so we
ensure the two booleans have a consistent value.
Creating this kind of repository is not expected to be possible the current bug
report point at a clonebundle related bug that is still to be properly isolated
(Yuya Nishihara seems to a have done it).
Corrupting a repository to reproduce the issue is possible. A test using this
method is included in this fix.
Boris Feld <boris.feld@octobus.net> [Wed, 30 Jan 2019 18:15:38 +0100] rev 41311
sparserevlog: document the config option
This was overlooked when this graduated from experimental.
Georges Racinet <georges.racinet@octobus.net> [Wed, 23 Jan 2019 07:49:36 -0500] rev 41310
rust-cpython: raising error.WdirUnsupported
The Graph implementation of hg-cpython returns the appropriate error
upon encounter with the working directory special revision number, and
this gives us in particular a code path to test from test-rust-ancestors.py
In the current implementation, the exception is actually raised from
the iterator instantiation; we are nonetheless consuming the iterator
in the test with `list()` in order not to depend on implementation details.
Georges Racinet <georges.racinet@octobus.net> [Wed, 23 Jan 2019 07:47:04 -0500] rev 41309
rust: error for WdirUnsupported with cpython conversion as exception
This introduces WorkingDirectoryUnsupported as an enum variant
of GraphError in the core and converts it to the expected
`mercurial.error.WdirUnsupported`.
Georges Racinet <georges.racinet@octobus.net> [Wed, 23 Jan 2019 07:39:27 -0500] rev 41308
rust: working directory revision number constant
This introduces the constant, but does not use it anywhere yet.
Yuya Nishihara <yuya@tcha.org> [Thu, 24 Jan 2019 21:38:02 +0900] rev 41307
ui: remove unreachable branches and function calls from write() (issue6059)
This is at least faster than ui.write() of 4.8.2.
$ HGRCPATH=/dev/null hg files -R mozilla-central --time >/dev/null
4.8.2: time: real 2.340 secs (user 2.310+0.000 sys 0.020+0.000)
4.9rc0: time: real 2.580 secs (user 2.550+0.000 sys 0.020+0.000)
this: time: real 2.230 secs (user 2.210+0.000 sys 0.020+0.000)
Maybe the formatter should own a resolved write() function because it will
just call dest.write(msg) most of the time, but that would be too much for
stable.
Yuya Nishihara <yuya@tcha.org> [Thu, 24 Jan 2019 21:35:55 +0900] rev 41306
ui: inline _writenobuf() into write() due to performance issue
I'll remove redundant conditions later in this series.
Yuya Nishihara <yuya@tcha.org> [Thu, 24 Jan 2019 21:34:48 +0900] rev 41305
ui: inline _write() into write() due to performance issue
I'll remove redundant conditions later in this series.
Yuya Nishihara <yuya@tcha.org> [Wed, 28 Nov 2018 22:36:24 +0900] rev 41304
ui: optimize buffered write with no label
This was spotted while making fastannotate faster again after ditching its
own formatter. Since I'm going to inline _write() into ui.write(), I decided
to include this patch in this series.
Here, the cost of '(self.label(a, label) for a in args)' was significant
in hot loops.
Boris Feld <boris.feld@octobus.net> [Wed, 23 Jan 2019 18:07:42 -0500] rev 41303
partialdiscovery: avoid `undecided` related computation sooner than necessary
Changeset 1d30be90c move the update of the `undecided` set within the
`partialdiscovery` object in order to clarify the API.
The update to the `undecided` set was unconditional in 1d30be90c and the first
access to the `self.undecided` property triggered the initial computation of
the set of undecided revisions. As a result, the set was computed much
earlier, at a time where less information is available, immediately followed
by an update of this set to remove common revisions.
To fix this regression, we ignore the `undecided` related logic in
`addcommons` when that `undecided` set has not been computed yet. Code that
actually needs to know the `undecided` set will trigger its computation later.
The change has no effects on semantic because the initial computation
`undecided` set takes all knowns `common` into account.
Example performance running `hg debugdiscovery` from a pypy repo missing 10
changesets:
870a89c6909d: 52.3ms (regression parent)
1d30be90c9dc: 72.0ms (regression)
5a5f504a7175: 64.8ms (this fix parent)
this fix: 52.6ms
Yuya Nishihara <yuya@tcha.org> [Mon, 21 Jan 2019 22:14:29 +0900] rev 41302
revlog: fix resolution of revlog version 0
This partially backs out cecf3f8bccd3, "revlog: always process opener options."
My understanding is that if there's no "revlog1" nor "revlog2" in .hg/requires,
the repository should stick to the v0 format. The reasoning is briefly
described in 31a5973fcf96, "revlog: get rid of defversion."
Maybe we can drop support for missing opener options, but I didn't do that
in this patch.
Yuya Nishihara <yuya@tcha.org> [Sun, 20 Jan 2019 11:57:36 +0900] rev 41301
rust: add comment about lack of wdirrev handling
If hg is compiled with rust support, 'only(wdir())' crashed as
"rustext.GraphError: ('ParentOutOfRange', 2147483647)", which should instead
say "abort: working directory revision cannot be specified."
Yuya Nishihara <yuya@tcha.org> [Sun, 20 Jan 2019 11:51:21 +0900] rev 41300
templatekw: fix crash on multiple latesttags resolution at wdir (issue6055)
It appears not easy to fix only() to support wdir(), so this patch works
around the issue by getlatesttags(). The "+1" after len(changes) doesn't
matter since ctx never changes while sorting. It's just for clarity.
Yuya Nishihara <yuya@tcha.org> [Sun, 20 Jan 2019 11:39:16 +0900] rev 41299
test-template-keywords: add test for {latesttag} of wdir() revision
It's probably broken since fb672eac2702, "templatekw: choose {latesttag}
by len(changes), not date (issue5659)". only() doesn't support wdir.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 18 Jan 2019 23:32:26 -0800] rev 41298
narrow: fix crash when restoring backup in legacy repo
Using --addremove when committing in an old repo (before we started
keeping .hg/narrowspec.dirstate) results in a crash. The test
case modified in this patch would crash like this:
abort: $ENOENT$
The issue is that when the dirstateguard is aborted, it tries to
restore the backup of .hg/narrowspec.dirstate. However, since we were
in an old repo, that file did not get created when the dirstateguard
was created. Note that the dirstateguard is not used unless
--addremove is passed.
This patch fixes the bug by making restorewcbackup() not fail if the
backup doesn't exist. I also made clearwcbackup() safe, just in case.
Differential Revision: https://phab.mercurial-scm.org/D5634
Boris Feld <boris.feld@octobus.net> [Fri, 18 Jan 2019 14:21:47 +0100] rev 41297
revset: introduce an internal `_rev` predicate for '%d' usage
In 24a1f67bb75a, we aligned "%d" behavior on "%ld" one, invalid revisions got
silently ignored. However, soon after in 8aca89a694d4 and 26b0a7514f01, a side
effect changed the behavior of "%ld" to no longer silently filter invalid
revisions.
After discussion on the mailing list, it was decided to align on the new %ld
behavior:
https://www.mercurial-scm.org/pipermail/mercurial-devel/2019-January/127291.html
This changeset introduce a '_rev()' predicated that keep the benefit from
24a1f67bb75a while enforcing a more strict checking on the inputs.
Boris Feld <boris.feld@octobus.net> [Fri, 18 Jan 2019 16:03:37 +0100] rev 41296
mmap: backed out changeset 875d2af8cb4e
There have been concrete and theoretical issues raised, this will need more
work during the next cycle.
Boris Feld <boris.feld@octobus.net> [Fri, 18 Jan 2019 16:02:26 +0100] rev 41295
mmap: backed out changeset 74a9f428227e
There have been concrete and theoretical issues raised, this will need more
work during the next cycle.
Matt Harbison <matt_harbison@yahoo.com> [Fri, 18 Jan 2019 23:22:56 -0500] rev 41294
help: document the minimumhgversion variable for extensions
Matt Harbison <matt_harbison@yahoo.com> [Fri, 18 Jan 2019 23:13:04 -0500] rev 41293
help: modernize the example for command registration
Augie Fackler <raf@durin42.com> [Fri, 18 Jan 2019 13:32:02 -0500] rev 41292
Added signature for changeset 593718ff5844
Augie Fackler <raf@durin42.com> [Fri, 18 Jan 2019 13:32:00 -0500] rev 41291
Added tag 4.9rc0 for changeset 593718ff5844
Augie Fackler <augie@google.com> [Fri, 18 Jan 2019 13:28:22 -0500] rev 41290
merge default into stable for 4.9 release
Boris Feld <boris.feld@octobus.net> [Thu, 10 Jan 2019 14:57:01 +0100] rev 41289
update: fix edge-case with update.atomic-file and read-only files
We used to create the tempfile with the original file mode. That means
creating a read-only tempfile when the original file is read-only, which crash
if we need to write on the tempfile.
The file in the working directory ends up being writable with and without the
atomic update config, so the behavior is the same.
Martin von Zweigbergk <martinvonz@google.com> [Wed, 16 Jan 2019 16:49:15 -0800] rev 41288
scmutil: drop unreachable except clause
socket.error is a subclass of IOError, which we catch higher up. It
seems to have been this way since 020a896a5292 (dispatch: sort
exception handlers, 2009-01-12), so let's celebrate the 10 year
anniversary (a few days late) of it being wrong by deleting it.
Differential Revision: https://phab.mercurial-scm.org/D5626
Martin von Zweigbergk <martinvonz@google.com> [Wed, 16 Jan 2019 21:32:15 -0800] rev 41287
tests: suppress "Checked out 1 paths of <hash>" from modern git
test-convert-git.t is failiing since git commit 0f086e6dca (checkout:
print something when checking out paths, 2018-11-13). Suppress the new
output by disambiguating the arguments with a "--" separator.
Differential Revision: https://phab.mercurial-scm.org/D5625
Yuya Nishihara <yuya@tcha.org> [Sun, 13 Jan 2019 14:56:26 +0900] rev 41286
revlog: document that mmap resources are released implicitly by GC
It's okay-ish, but currently the open fd and the mapping itself are leaked
until the indexdata is deallocated. If revlog had close(), the underlying
resources should be closed there as well, but AFAIK there's no such hook
point.
Yuya Nishihara <yuya@tcha.org> [Wed, 26 Sep 2018 21:41:52 +0900] rev 41285
ui: proxy protect/restorestdio() calls to update internal flag
It should be better to manage the redirection flag solely by the ui class.
Yuya Nishihara <yuya@tcha.org> [Wed, 26 Sep 2018 21:29:13 +0900] rev 41284
ui: move protectedstdio() context manager from procutil
This is a follow-up series for 23a00bc90a3c, "chgserver: do not send system()
back to client if stdio redirected." The function is renamed using ui terms.
Yuya Nishihara <yuya@tcha.org> [Thu, 10 Jan 2019 21:29:24 +0900] rev 41283
cext: clang-format new code coming from stable branch
Valentin Gatien-Baron <vgatien-baron@janestreet.com> [Thu, 03 Jan 2019 19:02:46 -0500] rev 41282
match: support rooted globs in hgignore
In a .hgignore, "glob:foo" always means "**/foo". This cannot be
avoided because there is no syntax like "^" in regexes to say you
don't want the implied "**/" (of course one can use regexes, but glob
syntax is nice).
When you have a long list of fairly specific globs like
path/to/some/thing, this has two consequences:
1. unintended files may be ignored (not too common though)
2. matching performance can suffer significantly
Here is vanilla hg status timing on a private repository:
Using syntax:glob everywhere
real 0m2.199s
user 0m1.545s
sys 0m0.619s
When rooting the appropriate globs
real 0m1.434s
user 0m0.847s
sys 0m0.565s
(tangentially, none of this shows up in --profile's output. It
seems that C code doesn't play well with profiling)
The code already supports this but there is no syntax to make use of
it, so it seems reasonable to create such syntax. I create a new
hgignore syntax "rootglob".
Differential Revision: https://phab.mercurial-scm.org/D5493