Commit Graph

32547 Commits

Author SHA1 Message Date
Matt Harbison
9f35da932f wix: include zstd.pyd in the installation
When trying to create a zstd bundle, the MSI based install said:

  abort: compression engine zstd could not be loaded

The Inno installer is unaffected.  The name will need to be updated to include
'cext' when merging into default.
2017-05-25 23:03:56 -04:00
Matt Harbison
7dc2c0c995 clonebundles: fix missing newline character
Previously, the line displayed as '( )' instead of '(\n)'.
2017-05-24 22:59:59 -04:00
Gregory Szorc
3156c627f0 exchange: print full reason variable
This commit essentially reverts 62ad9c1dbce9.

urllib2.URLError receives a "reason" argument. It isn't always a
tuple. Mozilla has experienced at least IndexError failures due
to the reason[1] access.
https://bugzilla.mozilla.org/show_bug.cgi?id=1364687
2017-05-24 15:25:24 -07:00
FUJIWARA Katsunori
6e23c59850 dispatch: setup color before pager for correct console information on windows
Before this patch, "hg CMD --pager on" on Windows shows output
unintentionally decorated with ANSI color escape sequences, if color
mode is "auto". This issue occurs in steps below.

  1. dispatch() invokes ui.pager() at detection of "--pager on"
  2. stdout of hg process is redirected into stdin of pager process
  3. "ui.formatted" = True, because isatty(stdout) is so before (2)
  4. color module is loaded for colorization
  5. color.w32effects = None, because GetConsoleScreenBufferInfo()
     fails on stdout redirected at (2)
  6. "ansi" color mode is chosen, because of "not w32effects"
  7. output is colorized in "ansi" mode because of "ui.formatted" = True

Even if "ansi" color mode is chosen, ordinarily redirected stdout
makes ui.formatted() return False, and colorization is avoided. But in
this issue case, "ui.formatted" = True at (3) forces output to be
colorized.

For correct console information on win32, it is needed to ensure that
color module is loaded before redirection of stdout for pagination.

BTW, if any of enabled extensions has "colortable" attribute, this
issue is avoided even before this patch, because color module is
imported as a part of loading such extension, and extension loading
occurs before setting up pager. For example, mq and keyword have
"colortable".
2017-05-23 03:29:23 +09:00
Pierre-Yves David
8f0cd8c82a obsolete: invalidate "volatile" set cache after merging marker
Adding markers to the repository might affect the set of obsolete changesets. So we
most remove the "volatile" set who rely in that data. We add two missing
invalidations after merging markers. This was caught by code change in the evolve
extensions tests.

This issues highlight that the current way to do things is a bit fragile,
however we keep things simple for stable.
2017-05-17 15:39:37 +02:00
FUJIWARA Katsunori
231904c8ce win32mbcs: wrap underlying pycompat.bytestr to use checkwinfilename safely
win32mbcs wraps some functions, to prevent them from unintentionally
treating backslash (0x5c), which is used as the second or later byte
of multi bytes characters by problematic encodings, as a path
component delimiter on Windows platform.

This wrapping assumes that wrapped functions can safely accept unicode
string arguments.

Unfortunately, 440868900036 broke this assumption by introducing
pycompat.bytestr() into util.checkwinfilename() for py3 support. After
that, wrapped checkwinfilename() always fails for non-ASCII filename
at pycompat.bytestr() invocation.

This patch wraps underlying pycompat.bytestr() function to use
util.checkwinfilename() safely.

To avoid similar regression in the future, another patch series will
add smoke testing on default branch.
2017-05-12 21:46:14 +09:00
Pierre-Yves David
970619c327 hghave: prefill more version of Mercurial
The previous code was unable to go above version 4.0.
2017-05-09 15:08:47 +02:00
Mads Kiilerich
d682210796 graft: fix graft across merges of duplicates of grafted changes
Graft used findmissingrevs to find the candidates for graft duplicates in the
destination. That function operates with the constraint:

  1. N is an ancestor of some node in 'heads'
  2. N is not an ancestor of any node in 'common'

For our purpose, we do however have to work correctly in cases where the graft
set has multiple roots or where merges between graft ranges are skipped. The
only changesets we can be sure doesn't have ancestors that are grafts of any
changeset in the graftset, are the ones that are common ancestors of *all*
changesets in the graftset. We thus need:

  2. N is not an ancestor of all nodes in 'common'

This change will graft more correctly, but it will also in some cases make
graft slower by making it search through a bigger and unnecessary large sets of
changes to find duplicates. In the general case of grafting individual or
linear sets, we do the same amount of work as before.
2017-05-11 17:18:40 +02:00
Mads Kiilerich
cfae38ec31 graft: test coverage of grafts and how merges can break duplicate detection
This demonstrates unfortunate behaviour: extending the graft range cause the
graft to behave differently. When the graft range includes a merge, we fail to
detect duplicates that are ancestors of the merge.
2017-05-09 00:11:30 +02:00
Matt Harbison
99eb2bf008 churn: use the non-deprecated template option in the examples 2017-05-08 23:05:01 -04:00
Gregory Szorc
3ffdc76e66 sslutil: reference fingerprints config option properly (issue5559)
The config option is "host:fingerprints" not "host.fingerprints".

This warning message is bad and misleads users.
2017-05-08 09:30:26 -07:00
Yuya Nishihara
6a634dc263 largefiles: make sure debugstate command is populated before wrapping
Copied the hack from 8fe57ad06da4, which seemed the simplest workaround.
Perhaps debugcommands.py should have its own commands table.
2017-05-04 15:23:51 +09:00
FUJIWARA Katsunori
b7a92ca8d3 help: describe about choice of :prompt as a fallback merge tool explicitly
"merge-tools" help topic has described that the merge of the file
fails if no tool is found to merge binary or symlink, since
9da9bced2226 (or Mercurial 1.7), which based on (already removed)
MergeProgram wiki page.

But even at that revision, and of course now, merge of the file
doesn't fail automatically for binary/symlink. ":prompt" (or
equivalent logic) is used, if there is no appropriate tool
configuration for binary/symlink.
2017-05-06 02:33:00 +09:00
Steve Borho
d7b9ecc0ba wix: only one KeyPath is allowed per Component 2017-05-06 10:18:34 -05:00
Matt Harbison
8f2d75af2f help: call out specific replacement configuration settings
As an aside, I'm having trouble parsing the help text meaning for HG when it is
unset or empty.  How can it be the frozen name or searched if it is empty?
2017-05-03 22:56:53 -04:00
Matt Harbison
44c7a911a4 help: spelling fixes 2017-05-03 22:07:47 -04:00
Matt Harbison
f50de2183a help: attempt to clarify that pager usage is not output length based
This may be too subtle of a change to get the point across, but when I first
read the original text, I thought maybe the pager would only be invoked if
writing more than a screenful.  The distinction between this and a pager that
simply exits after printing less than a screenful is important on Windows, given
the inability of `more` to color output.
2017-05-03 22:05:23 -04:00
Matt Harbison
ed8a9665e2 help: document color/pager pitfalls on Windows
Even though I figured this out a few weeks ago, I was initially puzzled where
the color went when I upgraded to 4.2 on a different Windows machine.  Let's
point users reading the help into the right direction.

I wonder if we should be even more explicit about cmd.exe/MSYS/pager/color
interplay, but at least all of the breadcrumbs are here (I think).
2017-05-03 21:58:11 -04:00
Matt Harbison
eef0589d4f test-diff-color: disable pager for expected output on Windows (issue5555)
Windows uses `more.com`, which unhelpfully adds an extra trailing line
consisting only of '\r'.  It also converts tab characters to spaces, which
throws off the last two tests.

Setting the 'ui.formatted' option is what allowed the pager to be used by these
tests in the first place.
2017-05-02 22:26:09 -04:00
Kevin Bullock
053ec75639 Added signature for changeset 2e4bacde4889 2017-05-02 17:09:00 -05:00
Kevin Bullock
05a45e3f47 merge with i18n 2017-05-02 16:35:12 -05:00
Pierre-Yves David
a5a7702af1 pager: drop the support for 'pager.enable=<bool>'
This option was never released except for a release candidate. Dropping
compatibility with this option will free the 'pager.enable' config option for
other usage in the future.
2017-05-02 17:18:13 +02:00
Pierre-Yves David
bf9fa9e05b pager: rename 'pager.enable' to 'ui.paginate'
This aligns with what we do for color (see cea7a760c58d). Pager is a central
enough notion that having the master config in the [ui] section makes senses. It
will helps with consistency, discoverability. It will also help having a simple
and clear example hgrc mentioning pager.

The previous form of the option had never been released in a non-rc version but
we keep it around for convenience. If both are set, 'ui.pager' take priority.
2017-05-01 16:36:50 +02:00
Pierre-Yves David
f6556e7dce color: special case 'always' in 'ui.color'
This lift the confusing case, where 'ui.color=always' would actually not always
use color.
2017-05-02 20:19:09 +02:00
Pierre-Yves David
9b05154b04 color: turn 'ui.color' into a boolean (auto or off)
Previously, 'ui.color=yes' meant "always show color", While
"ui.color=auto" meant "use color automatically when it appears
sensible".

This feels problematic to some people because if an administrator has
disabled color with "ui.color=off", and a user turn it back  on using
"color=on", it will get surprised (because it breaks their output when
redirected to a file.) This patch changes ui.color=true to only move the
default value of --color from "never" to "auto".

I'm not really in favor of this changes as I suspect the above case will
be pretty rare and I would rather keep the logic simpler. However, I'm
providing this patch to help the 4.2 release in the case were others
decide to make this changes.

Users that want to force colors without specifying --color on the
command line can use the 'ui.formatted' config knob, which had to be
enabled in a handful of tests for this patch.

Nice summary table (credit: Augie Fackler)

That is, before this patch:

+--------------------+--------------------+--------------------+
|                    | not a tty          | a tty              |
|                    | --color not set    | --color not set    |
|                    |                    |                    |
+--------------------+--------------------+--------------------+
| [ui]               |                    |                    |
| color (not set)    | no color           | no color           |
|                    |                    |                    |
+--------------------+--------------------+--------------------+
| [ui]               |                    |                    |
| color = auto       | no color           | color              |
|                    |                    |                    |
+--------------------+--------------------+--------------------+
| [ui]               |                    |                    |
| color = yes        | *color*            | color              |
|                    |                    |                    |
+--------------------+--------------------+--------------------+
| [ui]               |                    |                    |
| color = no         | no color           | no color           |
|                    |                    |                    |
+--------------------+--------------------+--------------------+
(if --color is specified, it always clobbers the setting in [ui])

and after this patch:

+--------------------+--------------------+--------------------+
|                    | not a tty          | a tty              |
|                    | --color not set    | --color not set    |
|                    |                    |                    |
+--------------------+--------------------+--------------------+
| [ui]               |                    |                    |
| color (not set)    | no color           | no color           |
|                    |                    |                    |
+--------------------+--------------------+--------------------+
| [ui]               |                    |                    |
| color = auto       | no color           | color              |
|                    |                    |                    |
+--------------------+--------------------+--------------------+
| [ui]               |                    |                    |
| color = yes        | *no color*         | color              |
|                    |                    |                    |
+--------------------+--------------------+--------------------+
| [ui]               |                    |                    |
| color = no         | no color           | no color           |
|                    |                    |                    |
+--------------------+--------------------+--------------------+
(if --color is specified, it always clobbers the setting in [ui])
2017-05-02 20:01:54 +02:00
Pierre-Yves David
28b8d7eb26 pager: document the 'pager.enable' option
The 'config' helps was missing help about pager enabling/disabling.
2017-05-01 16:43:43 +02:00
Pierre-Yves David
50e449e083 pager: advertise the config option in the default hgrc
Same as for 'ui.color', this is a critical part of the UI and we want user to
find this config knob easily.
2017-05-01 18:07:23 +02:00
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
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