Commit Graph

31920 Commits

Author SHA1 Message Date
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
Pulkit Goyal
fb9e5b4f21 py3: use %d instead of %s for integers
dispatch._runcatch() always returns an integer value.
2017-04-21 01:13:18 +05:30
Pulkit Goyal
cb5518387e py3: make posix.getuser return a bytes 2017-04-21 00:53:38 +05:30
Pulkit Goyal
ce6291f190 py3: replace str with bytes in isinstance() 2017-04-20 19:57:16 +05:30
Pulkit Goyal
c5fa590c26 py3: use pycompat.bytestr() instead of str()
This is because str() on python 3 return unicodes
2017-04-27 09:49:57 +05:30
Pulkit Goyal
ba8a84e565 py3: alias long to int on Python 3 2017-04-20 19:51:37 +05:30
Alex Gaynor
7152638545 setup: sys.version_info always exists
It is documented as existing since Python 2.0, and empirically from
other OSS projects I maintain, there is no problem relying on its
existance.
2017-05-03 09:41:55 -04:00
Jun Wu
3c7a9be1c9 filelog: fix parsemeta docstring
40c4e7d0117e changed the return type of filelog.parsemeta but forgot to
update its docstring.
2017-05-02 22:39:14 -07:00
Martin von Zweigbergk
eb6e7c0205 util: remove doc of long gone 'targetsize' argument
Gone since 89c808398d69 (chunkbuffer: removed unused method and arg,
2007-10-11).
2017-05-02 10:20:44 -07:00
Pierre-Yves David
95ea84f11b cleanup: drop the deprecated 'localrepo._link' method
This was deprecated in favor of 'localrepo.wvfs.islink'. We can now drop it for the
future 4.3.
2017-05-02 02:05:39 +02:00
Pierre-Yves David
258c50d8f2 cleanup: drop the deprecated 'localrepo.wfile' method
This was deprecated in favor of 'localrepo.wvfs.join'. We can now drop it for the
future 4.3.
2017-05-02 02:04:55 +02:00
Pierre-Yves David
511036e5cd cleanup: drop the deprecated 'localrepo.join' method
This was deprecated in favor of 'localrepo.vfs.join'. We can now drop it for the
future 4.3.
2017-05-02 02:03:56 +02:00
Pierre-Yves David
18be67b624 cleanup: drop the deprecated 'localrepo.tag' method
This was deprecated in favor of 'mercurial.tags.tag'. We can now drop it for the
future 4.3.
2017-05-02 02:03:04 +02:00
Pierre-Yves David
a1ea2991e5 cleanup: drop the deprecated 'localrepo.opener' method
This was deprecated in favor of 'localrepo.vfs'. We can now drop it for the
future 4.3.
2017-05-02 02:01:47 +02:00
Pierre-Yves David
aa3d41a9fe cleanup: drop the deprecated 'localrepo.wopener' method
This was deprecated in favor of 'localrepo.wvfs'. We can now drop it for the
future 4.3.
2017-05-02 02:01:15 +02:00
Pierre-Yves David
fd44cb6bd3 cleanup: drop vfs compatibility layer in scmutil
All these constructors are deprecated in 4.2. We can now drop them on the
default branch (future 4.3).
2017-05-02 01:59:33 +02:00
Jun Wu
7520d66fa5 test-worker: exercise more about "killworkers" situation
This patch adds some sleep and increases numcpus to exercise the
"killworkers" situation. So race conditions could be discovered more easily,
if someone changes worker.py incorrectly. Currently worker.py should be free
of such issues.
2017-04-22 17:13:05 -07:00
Jun Wu
81fa75bde6 test-worker: capture tracebacks more reliably
The traceback test may have traceback caused by SIGTERM. Instead of grepping
"Traceback", explicitly grep the exception we care about.

This makes the test less flaky.
2017-04-22 17:00:50 -07:00
Jun Wu
4c01cb2b48 worker: rewrite error handling so os._exit covers all cases
Previously the worker error handling is like:

    pid = os.fork()   --+
    if pid == 0:        |
        ....            | problematic
        ....          --+
        try:          --+
            ....        | worker error handling
                      --+

If a signal arrives when Python is executing the "problematic" lines, an
external error handling (dispatch.py) will take over the control flow and
it's no longer guaranteed "os._exit" is called (see 560cc0db7f01 for why it
is necessary).

This patch rewrites the error handling so it covers all possible code paths
for a worker even during fork.

Note: "os.getpid() == parentpid" is used to test if the process is parent or
not intentionally, instead of checking "pid", because "pid = os.fork()" may
be not atomic - it's possible that that a signal hits the worker before the
assignment completes [1].  The newly added test replaces "os.fork" to
exercise that extreme case.

[1]: CPython compiles "pid = os.fork()" to 2 byte codes: "CALL_FUNCTION" and
"STORE_FAST", so it's probably not atomic:

    def f():
        pid = os.fork()

    dis.dis(f)
      2           0 LOAD_GLOBAL              0 (os)
                  3 LOAD_ATTR                1 (fork)
                  6 CALL_FUNCTION            0
                  9 STORE_FAST               0 (pid)
                 12 LOAD_CONST               0 (None)
                 15 RETURN_VALUE
2017-04-22 16:50:08 -07:00
Jun Wu
1894115dcb dispatch: take over SignalInterrupt handling from scmutil
dispatch handles KeyboardInterrupt already. This makes the code more
consistent, and makes worker not print "killed!" if it receives SIGTERM in
most cases (in rare cases there is still "killed!" printed, which will be
fixed by the next patch).
2017-04-22 15:00:17 -07: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
Matt Harbison
0ec5f65b33 test-bookmarks: factor hooks out to a shell script for Windows
The previous incarnation of the hooks weren't being run on Windows, which
altered the DAG and hashes[1].

[1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-April/096987.html
2017-04-25 22:10:26 -04:00
Matt DeVore
212fc81929 help: explain how to access subtopics in internals 2017-04-19 17:04:22 -07:00
Matt DeVore
2eace305ec log: document the characters ---graph uses to draw
The meaning of : vs | was undocumented and non-obvious.
2017-04-18 14:51:32 -07:00
Gregory Szorc
c2a41903dd tests: demonstrate that pager.attend-<abbreviated> doesn't work
A pager.attend-* value that isn't a full command or alias name doesn't
work. We add explicit test coverage of this to demonstrate it.
2017-04-25 00:19:03 -07:00
Gregory Szorc
31e9dfacf0 tests: test that abbreviated command alias is also paged
Explicit test coverage is good.
2017-04-24 23:11:44 -07:00
Gregory Szorc
d76f93dd93 tests: drop unnecessary pager attend in test
`log` is attended by default. We don't need to specify pager.attend-log
in this test.
2017-04-24 23:10:43 -07:00
Denis Laxalde
82be200bb6 hgweb: change text of followlines links to "older / newer"
DAG directions "descending" / "ascending" arguably do not make much sense in
the web interface where changes are usually listed by "dates".
2017-04-24 10:48:07 +02:00
Denis Laxalde
d141711562 hgweb: do not show "descending" link in followlines UI for filelog heads
When on a filelog head, we are certain that there will be no descendant so the
target of the "descending" link will lead to an empty log result. Do not
display the link in this case.
2017-04-24 10:32:15 +02:00
Denis Laxalde
d7d47fec65 context: optimize linkrev adjustment in blockancestors() (issue5538)
We set parent._descendantrev = child.rev() when walking parents in
blockancestors() so that, when linkrev adjustment is perform for these, it
starts from a close descendant instead of possibly topmost introrev. (See
`self._adjustlinkrev(self._descendantrev)` in filectx._changeid().)

This is similar to changeset 8758896efb1c, which added a "f._changeid"
instruction in annotate() for the same purpose.
However, here, we set _descendantrev explicitly instead of relying on the
'_changeid' cached property being accessed (with effect to set _changeid
attribute) so that, in _parentfilectx() (called from parents()), we go through
`if '_changeid' in vars(self) [...]` branch in which instruction
`fctx._descendantrev = self.rev()` finally appears and does what we want.

With this, we can roughly get a 3x speedup (including in example of issue5538
from mozilla-central repository) on usage of followlines revset (and
equivalent hgweb request).
2017-04-24 18:33:23 +02:00