Commit Graph

32117 Commits

Author SHA1 Message Date
Pierre-Yves David
ba569a8325 pager: document the 'pager' config section
There as a 'hg help pager' section but the 'hg help config.pager' was missing.
2017-05-01 16:52:11 +02:00
Pierre-Yves David
06724edd2d pager: test the 'enable' config option
While poking at this option I realised it was not tested.
2017-05-01 16:36:30 +02:00
Pierre-Yves David
0600a78b19 config: drop pager from the recommended extension
The extension is deprecated, we should having exposing it to users.
2017-05-01 15:51:57 +02:00
Pierre-Yves David
c674366f10 config: use "churn" as an example extension
"Churn" is not the useful example we have, but this is the one used in
'hg help config.extensions'. As we need something to replace the deprecated
'pager' extension in the example config, we are adding 'churn'.
2017-05-01 15:51:47 +02:00
FUJIWARA Katsunori
dc9b825bd4 i18n-ja: synchronized with 878ab1a44c7e 2017-05-01 07:23:29 +09:00
Jun Wu
15584f0091 commandserver: move printbanner logic to bindsocket
bindsocket now handles listen automatically. "printbanner" seems to be just
a part of "bindsocket". This simplifies the interface a bit.
2017-04-30 11:21:05 -07:00
Jun Wu
d3cc1e50f4 commandserver: move "listen" responsibility from service to handler
This enables chg to replace a server socket in an atomic way:

  1. bind to a temp address
  2. listen
  3. rename

Currently 3 happens before 2 so a client may see the socket file but fails
to connect to it.
2017-04-30 11:08:27 -07:00
Gregory Szorc
23a56c76db hghave: remove py27+ capability
It is now unused. And we require Python 2.7+ now so this check is not
necessary.
2017-05-08 15:31:34 -07:00
Gregory Szorc
886ce31bbb tests: remove test targeting Python 2.6
We just removed support for Python 2.7. This test is dead since it only
ran on <2.7.
2017-05-08 15:30:15 -07:00
Gregory Szorc
c950654a68 setup: drop support for Python 2.6 (BC)
Per discussion on the mailing list and elsewhere, we've decided that
Python 2.6 is too old to continue supporting. We keep accumulating
hacks/fixes/workarounds for 2.6 and this is taking time away from
more important work.

So with this patch, we officially drop support for Python 2.6 and
require Python 2.7 to run Mercurial.
2017-05-02 16:19:04 -07:00
Gregory Szorc
f7646dc551 perf: move revlog construction and length calculation out of benchmark
We don't need to measure the time it takes to open the revlog or
calculate its length.

This is more consistent with what other perf* functions do.

While I was here, I also renamed the revlog variable from "r" to
"rl" - again in the name of consistency.
2017-05-06 11:16:59 -07:00
Gregory Szorc
86020b42fd perf: clear revlog caches on every iteration
cmdutil.openrevlog() may return a cached revlog instance. This /may/
be a recent "regression" due to refactoring of the manifest API. I'm
not sure.

Either way, this perf command was broken for at least manifests because
subsequent invocations of the perf function would get cache hits from
previous invocations, invalidating results. In the extreme case,
testing the last revision in the revlog resulted in near-instantanous
execution of subsequent runs (since the fulltext is cached). A time
of ~1us would be reported in this case.
2017-05-06 11:15:56 -07:00
Gregory Szorc
6d8d6e3d41 perf: don't convert rev to node before calling revlog.revision() 2017-05-06 11:12:23 -07:00
Gregory Szorc
5d6e940365 revlog: rename _chunkraw to _getsegmentforrevs()
This completes our rename of internal revlog methods to
distinguish between low-level raw revlog data "segments" and
higher-level, per-revision "chunks."

perf.py has been updated to consult both names so it will work
against older Mercurial versions.
2017-05-06 12:12:53 -07:00
Gregory Szorc
e83c5e1628 perf: store reference to revlog._chunkraw in a local variable
To prepare for renaming revlog._chunkraw, we stuff a reference to this
metho in a local variable. This does 2 things. First, it moves the
attribute lookup outside of a loop, which more accurately measures
the time of the code being invoked. Second, it allows us to alias
to different methods depending on their presence (perf.py needs to
support running against old Mercurial versions).

Removing an attribute lookup from a tigh loop appears to shift the
numbers slightly with mozilla-central:

$ hg perfrevlogchunks -c

! read
! wall 0.354789 comb 0.340000 user 0.330000 sys 0.010000 (best of 28)
! wall 0.335932 comb 0.330000 user 0.290000 sys 0.040000 (best of 30)
! read w/ reused fd
! wall 0.342326 comb 0.340000 user 0.320000 sys 0.020000 (best of 29)
! wall 0.332857 comb 0.340000 user 0.290000 sys 0.050000 (best of 30)
! read batch
! wall 0.023623 comb 0.020000 user 0.000000 sys 0.020000 (best of 124)
! wall 0.023666 comb 0.020000 user 0.000000 sys 0.020000 (best of 125)
! read batch w/ reused fd
! wall 0.023828 comb 0.020000 user 0.000000 sys 0.020000 (best of 124)
! wall 0.023556 comb 0.020000 user 0.000000 sys 0.020000 (best of 126)
2017-05-06 12:02:31 -07:00
Gregory Szorc
46413ff643 revlog: rename internal functions containing "chunk" to use "segment"
Currently, "chunk" is overloaded in revlog terminology to mean
multiple things. One of them refers to a segment of raw data from
the revlog. This commit renames various methods only used within
revlog.py to have "segment" in their name instead of "chunk."

While I was here, I also made the names more descriptive. e.g.
"_loadchunk()" becomes "_readsegment()" because it actually does
I/O.
2017-05-06 12:02:12 -07:00
Jun Wu
4229b98381 fsmonitor: do not nuke dirstate filecache
In the future, chg may prefill repo's dirstate filecache so it's valuable
and should be kept. Previously we drop both filecache and property cache for
dirstate during fsmonitor reposetup, this patch changes it to only drop
property cache but keep the filecache.
2017-05-06 16:36:24 -07:00
Gregory Szorc
d84946776c perf: move gettimer() call
This is more consistent with other perf* functions.
2017-05-06 11:01:02 -07:00
Gregory Szorc
c89bd8ad72 perf: don't clobber startrev variable
Previously, the "startrev" argument would be ignored due to
"startrev = 0" in the benchmark function. This meant that
`hg perfrevlog` always started at revision 0.

Rename the local variable to "beginrev" so the variable does the
right thing.
2017-05-06 10:59:38 -07:00
Pierre-Yves David
68b43a6db4 bundle: add optional 'tagsfnodecache' data to on disk bundle (issue5543)
This should help performance when unbundling.
2017-05-05 17:31:15 +02:00
Pierre-Yves David
a8c6292f9c bundle2: move tagsfnodecache generation in a generic function
This will help us reusing the logic for `hg bundle`.
2017-05-05 17:28:52 +02:00
Pierre-Yves David
6777304ca7 bundle: introduce an higher level function to write bundle on disk
The current function ('writebundle') is focussing on getting an existing
changegroup to disk. It is no easy ways to includes more part in the generated
bundle2. So we introduce a slightly higher level function that is fed the
'outgoing' object (that defines the bundled spec) and the bundlespec parameters
(to control the changegroup generation and inclusion of other parts).

This is creating the third logic dedicated to create a consistent bundle2 (the
other 2 are the push code and the getbundle code). We should probably reconcile
them at some points but they all takes different types of input. So we need to
introduce an intermediate "object" that each different input could be converted
to. Such unified "bundle2 specification" could be fed to some unified code.

We start by having the `hg bundle` related code on its own to helps defines its
specific needs first. Once the common and specific parts of each logic will be
known we can start unification.
2017-05-05 17:09:47 +02:00
Pierre-Yves David
e9ce49e179 bundle: handle compression earlier
We can also handle that part before starting any generation.
2017-05-04 21:47:03 +02:00
Pierre-Yves David
f76028d798 bundle: check changegroup version earlier
We can check if we know how to bundle this changegroup version before actually
starting to generate the changegroup.
2017-05-04 21:46:02 +02:00
Pierre-Yves David
f734e61f99 bundle: check lack of revs to bundle before generating the changegroup
We already have the information so we can check it earlier.
2017-05-04 21:44:36 +02:00
Matt Harbison
36f740cc43 extdiff: copy back files to the working directory if the size changed
In theory, it should be enough to pay attention only to the modification time
when detecting if a snapshotted working directory file changed.  In practice,
BeyondCompare preserves all file attributes when syncing files at the directory
level.  (If you open the file and sync individual hunks, then mtime does change,
and everything was being copied back as desired.)  I'm not sure how many other
synchronization tools would trigger this issue, but it's annoyingly inconsistent
(if a single file is diffed, it isn't snapshotted, so the same BeyondCompare
file sync operation _is_ visible, because wdir() is updated in place.

I filed a bug with them, and they stated it is on their wish list, but won't be
fixed in the near term.  This isn't a complete fix (there is still the case of
the size not changing), but this seems like a trivial enough change to fix most
of the problem.  I suppose we could fool around with making files in the other
snapshot readonly, and copy back if we see the readonly bit copied.  That seems
pretty hacky though, and only works if the external tool copies all attributes.
2017-05-06 23:00:57 -04:00
Matt Harbison
76f6c3e6b8 test-extdiff: enable a previously failing test on Windows 2017-05-06 22:48:06 -04:00
Matt Harbison
a8aad83714 test-extdiff: narrow the range of an '#if execbit' block
Now that output can be conditionalized, the few `chmod +x` specific outputs can
be conditionalized, and the rest of the tests run as normal.  Disable one test
that is failing on Windows for now.
2017-05-06 19:11:59 -04:00
Matt Harbison
73a6095bf9 test-extdiff: deduplicate tests 2017-05-06 14:36:26 -04:00
Matt Harbison
d12266faed test-extdiff: fill in a missing Windows test 2017-05-06 13:37:00 -04:00
Yuya Nishihara
aad5689a75 test-worker: disable tests of forked workers on Windows
The number of the "Traceback" lines differs on Windows because the main
process does not raise SystemExit.
2017-04-20 22:51:28 +09:00
Yuya Nishihara
5f9b0dd4d2 test-profile: allow negative time in JSON output (issue5542)
I don't know why it can be a negative number, but that shouldn't be important
here.
2017-04-20 22:45:45 +09:00
Yuya Nishihara
532f16e237 discovery: prevent crash caused by prune marker having no parent data
If a marker has no parent information, parents field is set to None, which
caused TypeError. I think this shouldn't normally happen, but somehow
I have such marker in my repo.
2017-04-19 23:10:05 +09:00
Pierre-Yves David
39d62892b4 color: point to the global help in the example hgrc
This is probably the best way to have users learn more is they need too.
2017-05-01 15:40:41 +02:00
Pierre-Yves David
d8acfa70c4 color: reflect the new default in the example hgrc
Color is enabled by default so un-commenting the line would not have any effect.
We'll point to the help in the next changeset.
2017-05-01 15:39:50 +02:00
Pierre-Yves David
6a7374c4a8 color: point to the config help in global help topic
We point out at the help of the config option for user who wants to learn more
about the possible config value.

The suggested command returns some other extra (color related) results, but this
is bug to fix outside of the freeze.
2017-05-01 15:38:57 +02:00
Pierre-Yves David
d12d7fe72c color: reflect the new default in global help topic
We point out that color is enabled by default.
2017-05-01 15:38:07 +02:00
Martin von Zweigbergk
7f6a3bb427 docs: describe ui.color consistently with --color
The --color option is described to accept "boolean, always, auto,
never, or debug". Let's use a similar description for ui.color. Also
fix the formatting to use double quotes as we seem to use for about
half the values in config.txt (the other half uses double
backticks). Also use uppercase Boolean for consistency within the
file.
2017-05-01 11:04:10 -07:00
Pierre-Yves David
736dfc321a test: glob out variation from 'HGPORT' length
On system where HGTEST_PORT is configured to a value an order a magnitude lower
or higher than the default. The number of digit in the HGPORT changes and this
test breaks.
2017-05-01 16:09:35 +02:00
FUJIWARA Katsunori
8f34219d1a lock: avoid unintentional lock acquisition at failure of readlock
Acquiring lock by vfs.makelock() and getting lock holder (aka
"locker") information by vfs.readlock() aren't atomic action.
Therefore, failure of the former doesn't ensure success of the latter.

Before this patch, lock is unintentionally acquired, if ENOENT
causes failure of vfs.readlock() while 5 times retrying, because
lock._trylock() returns to caller silently after retrying, and
lock.lock() assumes that lock._trylock() returns successfully only if
lock is acquired.

In this case, lock symlink (or file) isn't created, even though lock
is treated as acquired in memory.

To avoid this issue, this patch makes lock._trylock() raise
LockHeld(EAGAIN) at the end of it, if lock isn't acquired while
retrying.

An empty "locker" meaning "busy for frequent lock/unlock by many
processes" might appear in an abortion message, if lock acquisition
fails. Therefore, this patch also does:

  - use '%r' to increase visibility of "locker", even if it is empty
  - show hint message to explain what empty "locker" means
2017-05-01 19:59:13 +09:00
FUJIWARA Katsunori
cb1cfe7f12 lock: avoid unintentional lock acquisition at failure of readlock
Acquiring lock by vfs.makelock() and getting lock holder (aka
"locker") information by vfs.readlock() aren't atomic action.
Therefore, failure of the former doesn't ensure success of the latter.

Before this patch, lock is unintentionally acquired, if
self.parentlock is None (this is default value), and lock._readlock()
returns None for ENOENT at vfs.readlock(), because these None are
recognized as equal to each other.

In this case, lock symlink (or file) isn't created, even though lock
is treated as acquired in memory.

To avoid this issue, this patch retries lock acquisition immediately,
if lock._readlock() returns None "locker".

This issue will be covered by a test added in subsequent patch,
because simple emulation of ENOENT at vfs.readlock() easily causes
another issue.  "raising ENOENT only at the first vfs.readlock()
invocation" is too complicated for unit test, IMHO.
2017-05-01 19:58:52 +09:00
FUJIWARA Katsunori
60903a6565 httppeer: unify hint message for PeerTransportError
Another raising PeerTransportError for "incomplete response" in
httppeer.py uses this (changed) hint message. This unification reduces
cost of translation.
2017-05-01 05:52:36 +09:00
FUJIWARA Katsunori
1ff2143781 revset: add i18n comments to error messages for followlines predicate
This patch also includes un-quoting "descend" keyword for similarity
to other error messages (this seems too trivial as a separated patch).
2017-05-01 05:52:36 +09:00
FUJIWARA Katsunori
6eec3cc46a help: apply bulk fixes for indentation and literal blocking issues
There are some paragraphs, which aren't rendered in online help as
expected because of indentation and literal blocking issues.

- hgext/rebase.py

  - paragraph before example code ends with ":", which treats
    subsequent indented paragraphs as normal block

    => replace ":" with "::" to treat subsequent paragraphs as literal block

- help/pager.txt

  - paragraph before a list of --pager option values ends with "::",
    which treats subsequent indented paragraphs as literal block

    => replace "::" with ":" to treat subsequent paragraphs as normal block

  - the second line of explanation for no/off --pager option value is
    indented incorrectly (this also causes failure of "make" in doc)

    => indent correctly

- help/revisions.txt

  - explanation following example code of "[revsetalias]" section
    isn't suitable for literal block

    => un-indent explanation paragraph to treat it as normal block

  - indentation of "For example" before example of tag() revset
    predicate matching is meaningless

  - descriptive text for tag() revset predicate matching isn't
    suitable for literal block

    => un-indent concatenated two paragraphs to treat them as normal block
2017-05-01 05:52:32 +09:00
FUJIWARA Katsunori
262750cefb rebase: fix incorrect configuration example
This configuration example doesn't make rebase require a destination,
even though help document wants to show such example.
2017-05-01 05:38:52 +09:00
FUJIWARA Katsunori
625808858d help: use hg role of mini reST to make hyper link in HTML page 2017-05-01 05:38:52 +09:00
FUJIWARA Katsunori
3c93d9ace7 help: use mercurial as a subject of colorization and pagination
Now, colorization and pagination are in Mercurial core.
2017-05-01 05:35:57 +09:00
Boris Feld
e2b921724b packaging: add make target for linux wheels
Having linux wheels is going to helps system without compiler or python-dev
plus speed up the installation for everyone.

I followed the manylinux example repository
https://github.com/pypa/python-manylinux-demo
to add a make target (build-linux-wheels) using
official docker image to build python 2 linux wheels
for mercurial. It generates Python 2.6 and Python 2.7 for both
32 and 64 bits architectures.

I had to blacklist several test cases for various reasons:
* test-convert-git.t and test-subrepo-git.t because of the git version
* test-patchbomb-tls.t because of warning using tls 1.0
  It's likely because the docker image is based on centos 5.0 and
  openssl is outdated.
2017-04-25 16:50:01 +02:00
Boris Feld
6fe24d97d9 tests: fix two http tests to also pass inside manylinux1 docker
This will let us build Linux wheels.
2017-04-25 16:50:01 +02:00
Yuya Nishihara
c11e91f8ff pager: use less as a fallback on Unix
This seems reasonable choice per discussion, and the default-default of Git.
See also the inline-comment for why.

https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-April/097042.html
2017-04-28 20:51:14 +09:00