Gregory Szorc <gregory.szorc@gmail.com> [Sat, 13 May 2017 12:14:24 -0700] rev 32282
tests: remove regular expression matching for Python 2.6
This effectively reverts
52cca17ac523. Some lines still have (re)
due to variable length port numbers. There's not much we can do
about that. But at least this change removes most of the ugliness.
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 13 May 2017 11:58:08 -0700] rev 32281
branchmap: remove use of buffer() to support Python 2.6
The use of buffer() was added in
7359157b9e46 to support Python 2.6,
which we no longer support.
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 13 May 2017 11:55:39 -0700] rev 32280
py3: remove delayed import of importlib
All supported versions of Python now have importlib. This
effectively reverts
b85fa6bf298b.
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 13 May 2017 11:52:44 -0700] rev 32279
tests: use context manager form of assertRaises
Support for using unittest.TestCase.assertRaises as a context
manager was added in Python 2.7. This form is more readable,
especially for complex tests.
While I was here, I also restored the use of assertRaisesRegexp,
which was removed in
c6921568cd20 for Python 2.6 compatibility.
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 13 May 2017 11:42:42 -0700] rev 32278
obsolete: use 2 argument form of enumerate()
The 2 argument form of enumerate was added in Python 2.6. This
change effectively reverts
10880c8aad85.
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 13 May 2017 11:31:36 -0700] rev 32277
tests: remove special handling for undefined memoryview
'memoryview' was introduced in Python 2.7.
4adc090fa2fb added code
to filterpyflakes.py to ignore "undefined name 'memoryview'" pyflakes
warnings. Since we no longer support <Python 2.7, we can remove this
workaround.
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 13 May 2017 11:20:51 -0700] rev 32276
encoding: remove workaround for locale.getpreferredencoding()
locale.getpreferredencoding() was buggy in OS X for Python <2.7.
Since we no longer support Python <2.7, we no longer need this
workaround.
This essentially reverts
2be70ca17311.
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 13 May 2017 11:12:44 -0700] rev 32275
mail: remove code to support < Python 2.7
This code was added in
594b98846ce1. Since we no longer support
Python <2.7, it can be removed.
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 11 May 2017 00:02:32 -0700] rev 32274
help: clarify that colons are allowed in fingerprints values
This was suggested by Lars Rohwedder in
issue5559.
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 10 May 2017 23:49:37 -0700] rev 32273
sslutil: tweak the legacy [hostfingerprints] warning message
Lars Rohwedder noted in
issue5559 that the previous wording was
confusing. I agree.
Martin von Zweigbergk <martinvonz@google.com> [Thu, 11 May 2017 11:37:18 -0700] rev 32272
rebase: allow rebase even if some revisions need no rebase (BC) (
issue5422)
This allows you to do e.g. "hg rebase -d @ -r 'draft()'" even if some
drafts are already based off of @. You'd still need to exclude
obsolete and troubled revisions, though. We will deal with those cases
later.
Implemented by treating state[rev]==rev as "no need to rebase". I
considered adding another fake revision number like revdone=-6. That
would make the code clearer in a few places, but would add extra code
in other places.
I moved the existing test out of test-rebase-base.t and into a new
file and added more tests there, since not all are using --base.
Jun Wu <quark@fb.com> [Wed, 10 May 2017 11:55:22 -0700] rev 32271
chgserver: more explicit about sensitive environ variables
Environment variables like HGUSER, HGEDITOR, HGEDITFROM should not trigger
a new chgserver. This patch uses a whitelist for environ variables starting
with "HG" to reduce the number of servers.
I have went through `grep -o "[\"']HG[A-Z_0-9]*['\"]" -hR . | sort -u` so
the list should be up-to-date.
Kostia Balytskyi <ikostia@fb.com> [Thu, 11 May 2017 08:49:33 -0700] rev 32270
scmutil: make simplekeyvaluefile able to have a non-key-value first line
To ease migration from files with version numbers in their first lines,
we want simplekeyvaluefile to support a non-key-value first line. In this
way, old versions of Mercurial will read such files, discover a newer version
than the one they know how to handle and fail gracefully, rather than with
exception. Shelve's shelvestate file is an example.
Kostia Balytskyi <ikostia@fb.com> [Thu, 11 May 2017 08:39:44 -0700] rev 32269
scmutil: add simplekeyvaluefile reading test
Before this patch, mockvfs did not emulate readlines correctly
and there was no test for simplekeyvaluefile reading.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Tue, 02 May 2017 18:57:52 +0200] rev 32268
caches: stop warming the cache after changegroup application
Now that we garantee that branchmap cache is updated at the end of the
transaction we can drop this update. This removes a problematic case with
nested transaction where the new cache could be written on disk before the
transaction is finished (and even roll-backed)
Such premature cache write was visible in the following test:
* tests/test-acl.t
* tests/test-rebase-conflicts.t
In addition, running the cache update later means having more date about the
state of the repository (in particular: phases). So we can generate caches with
more information. This creates harmless changes to the following tests:
* tests/test-hardlinks-whitelisted.t
* tests/test-hardlinks.t
* tests/test-phases.t
* tests/test-tags.t
* tests/test-inherit-mode.t
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Tue, 02 May 2017 22:27:44 +0200] rev 32267
caches: move the 'updating the branch cache' message in 'updatecaches'
We are about to remove the branchmap cache update in changegroup application.
There is a debug message alongside this update that we do not want to loose. We
move the message beforehand to simplify the test update in the next changeset.
The message move is quite noisy and isolating that noise is useful.
Most tests update are just line reordering since the message is issued at a
later point during the transaction.
After this changes, the message is displayed in more case since local commit
creation also issue it.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Tue, 02 May 2017 18:56:07 +0200] rev 32266
caches: stop warming the cache after 'localrepo.commitctx'
Now that we garantee that branchmap cache are updated at the end of the
transaction we can drop that one. This removes a problematic case with nested
transaction where the new cache could be written on disk before the transaction
is finished.
The test change is harmless, since we update the cache at a later point, the
dirstate have been updated in between.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Tue, 02 May 2017 21:35:06 +0200] rev 32265
caches: introduce a 'debugupdatecaches' command
That command make sure caches are updated. This is based on
'localrepo.updatecaches' so when we move support for new cache in that function this
command will benefit from it.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Tue, 02 May 2017 19:05:58 +0200] rev 32264
caches: call 'repo.updatecache()' in 'repo.destroyed()'
Regenerating the cache after a 'strip' or a 'rollback' is useful. So we call the
generic cache warming function as other caches than just branchmap will be
updated there in the future.
To do so, we have to make 'repo.updatecache()' able to take no arguments. In
such cases, we reload all caches.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Tue, 02 May 2017 21:39:43 +0200] rev 32263
caches: introduce a function to warm cache
We have multiple caches that gain from being kept up to date. For example in a
server setup, we want to make sure the branchcache cache is hot for other
read-only clients.
Right now each cache tries to update themself in place where new data have been
added. However the approach is error prone (we might miss some spot) and
fragile. When nested transaction are involved, such cache updates might happen
before a top level transaction is committed. Writing caches for uncommitted
data on disk.
Having a single entry point, run at the end of each successful transaction,
helps to ensure the cache is up to date and refreshed at the right time.
We start with updating the branchmap cache but other will come.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Tue, 02 May 2017 18:45:51 +0200] rev 32262
transaction: track newly introduced revisions
Tracking revisions is not the data that will unlock the most new capability.
However, they are the simplest thing to track and still unlock some nice
improvements in regard with caching.
We plug ourself at the changelog level to make sure we do not miss any revision
additions.
The 'revs' set is configured at the repository level because the transaction
itself does not needs to know that much about the business logic.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Tue, 02 May 2017 18:31:18 +0200] rev 32261
transaction: introduce "changes" dictionary to precisely track updates
The transaction is already tracking some data intended for hooks (in
'hookargs'). However, that information is minimal as we optimise for
passing data to other processes through environment variables. There are
multiple places were we could use more complete and lower level
information locally (eg: cache update, better report of changes to
hooks, etc...).
For this purpose we introduces a 'changes' dictionary on the
transaction. It is intended to track every changes happening to the
repository (eg: new revs, bookmarks move, phases move, obs-markers,
etc).
For now we just adds the 'changes' dictionary. We'll adds more tracking
and usages over time.
Siddharth Agarwal <sid0@fb.com> [Thu, 11 May 2017 10:50:05 -0700] rev 32260
clone: add a server-side option to disable full getbundles (pull-based clones)
For large enough repositories, pull-based clones take too long, and an attempt
to use them indicates some sort of configuration or other issue or maybe an
outdated Mercurial. Add a config option to disable them.
Siddharth Agarwal <sid0@fb.com> [Mon, 08 May 2017 20:01:06 -0700] rev 32259
clone: warn when streaming was requested but couldn't be performed
This helps both users and the people who support them figure out why
a stream clone couldn't be performed.
In an upcoming patch we're going to add a way for servers to hard
abort on a full getbundle. In those cases servers might expect
clients to perform a stream clone, so it's important to communicate
why one couldn't be done.
Siddharth Agarwal <sid0@fb.com> [Mon, 08 May 2017 18:47:24 -0700] rev 32258
clone: test streaming disabled because client is missing requirement
Turns out we had no coverage for this important case.
Siddharth Agarwal <sid0@fb.com> [Mon, 08 May 2017 17:30:51 -0700] rev 32257
bundle2: don't check for whether we can do stream clones
At the moment this isn't used and all stream clones use the legacy protocol.
In an upcoming diff, canperformstreamclone will print out a message if a stream
clone was requested but couldn't happen for some reason. Removing this call
ensures the message isn't printed twice.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Sat, 13 May 2017 03:37:50 +0900] rev 32256
debugcommands: add debugpickmergetool to examine which merge tool is chosen
Before this patch, there is no convenient way to know which merge tool
is chosen for each managed files without actual merging.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Sat, 13 May 2017 03:31:42 +0900] rev 32255
filemerge: add internal merge tool to dump files forcibly
Internal merge tool :dump implies premerge. Therefore, files aren't
dumped, if premerge runs successfully.
This undocumented behavior might confuse users, if they want to always
dump files. But just making :dump omit premerge might cause backward
compatibility issue for existing automation.
This patch adds new internal merge tool :forcedump, which works as
same as :dump, but omits premerge always.
Internal tools annotated with "nomerge" should merge "change and
delete" correctly, but _forcedump() can't. Therefore, it is annotated
with "mergeonly" to always omit premerge, even though it doesn't merge
files actually.
This patch also adds explanation about premerge to :dump, to clarify
how :dump actually works.
BTW, this patch specifies internal tools with "internal:" prefix in
newly added test scenario in test-merge-tools.t, even though this
prefix is already deprecated. This is only for similarity to other
tests in test-merge-tools.t.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Sat, 13 May 2017 03:28:36 +0900] rev 32254
filemerge: make warning message more i18n friendly
Before this patch, " specified for " part of warning messages
(e.g. "couldn't find merge tool TOOL specified for PAT") isn't
translatable.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Sat, 13 May 2017 03:28:36 +0900] rev 32253
filemerge: show warning about choice of :prompt only at an actual fallback
Before this patch, internal merge tool :prompt shows "no tool found to
merge FILE" line, even if :prompt is explicitly specified as a tool to
be used.
This patch shows warning message about choice of :prompt only at an
actual fallback, in which case any tool is rejected by capability for
binary or symlink.
It is for backward compatibility to omit warning message in
"changedelete" case.