Commit Graph

23 Commits

Author SHA1 Message Date
Jun Wu
9dc21f8d0b codemod: import from the edenscm package
Summary:
D13853115 adds `edenscm/` to `sys.path` and code still uses `import mercurial`.
That has nasty problems if both `import mercurial` and
`import edenscm.mercurial` are used, because Python would think `mercurial.foo`
and `edenscm.mercurial.foo` are different modules so code like
`try: ... except mercurial.error.Foo: ...`, or `isinstance(x, mercurial.foo.Bar)`
would fail to handle the `edenscm.mercurial` version. There are also some
module-level states (ex. `extensions._extensions`) that would cause trouble if
they have multiple versions in a single process.

Change imports to use the `edenscm` so ideally the `mercurial` is no longer
imported at all. Add checks in extensions.py to catch unexpected extensions
importing modules from the old (wrong) locations when running tests.

Reviewed By: phillco

Differential Revision: D13868981

fbshipit-source-id: f4e2513766957fd81d85407994f7521a08e4de48
2019-01-29 17:25:32 -08:00
Marla Azriel
02d41c83e8 commands: help text for update / checkout
Summary: Updated help text for hg update / hg checkout and removed --date option

Reviewed By: ikostia

Differential Revision: D13071724

fbshipit-source-id: 31b51b26f5d199e356f2148353d6714cecc1f632
2018-12-17 14:33:04 -08:00
Marla Azriel
96cb1050bc commands: update help summary text
Summary: Updated the global help summaries that are displayed for each command when you run 'hg help' and fixed corresponding tests

Reviewed By: markbt, kulshrax

Differential Revision: D12832280

fbshipit-source-id: 950dad1c805feab573d7d0182da523ae12299d3b
2018-11-07 19:59:47 -08:00
Phil Cohen
6a8a7d7ba7 test-i18n: fix the build
Summary: I think D10446929 might've broken this by changing the pull string such that there was no German translation for it.

Reviewed By: quark-zju

Differential Revision: D10520682

fbshipit-source-id: a39b5911295ee0d1f5eee3b307930cffa87c3562
2018-10-23 17:42:58 -07:00
Jun Wu
e92a601d9b hghave: add normal-layout feature
Summary:
With `buck build`, the single hg binary won't be guarnateed to have
access to i18n messages because directories like `mercurial/locale`
do not exist on filesystem. It could also mess up with `PYTHONPATH`
somehow because the python binary wrapper sometimes ignores
`PYTHONPATH`.

So let's add a hghave feature for it. And gate troublesome tests
with `#if normal-layout`.

Reviewed By: DurhamG, phillco

Differential Revision: D6879876

fbshipit-source-id: 3d63605b55c8f7096093b89be824add2ec491f81
2018-04-13 21:51:02 -07:00
Yuya Nishihara
74b6f75047 test-i18n: guard gettext test appropriately 2017-10-14 13:37:14 +09:00
Yuya Nishihara
1b540c162d i18n: cache translated messages per encoding
This is a simpler workaround alternative to D958, "i18n: clean msgcache when
encoding changes." The cache won't be bloated unless you run tons of commands
with different --encoding options on command server, or serve many repositories
of different web.encoding options on hgweb.

The test was originally written by Jun Wu.

Differential Revision: https://phab.mercurial-scm.org/D1053
2017-10-13 21:36:10 +09:00
Augie Fackler
e5d7bd82c5 cleanup: use $PYTHON to run python in many more tests
Spotted one of these, then wrote a check-code rule that caught them
all. It will be the next change.
2017-06-20 09:45:02 -04:00
Augie Fackler
8305222dc8 tests: update test-i18n.t to not depend on the pager extension
I'm about to mark that extension as deprecated, and that broke this
test.
2017-02-07 17:08:41 -05:00
timeless@mozdev.org
076fde20cc test-i18n: always run non gettext tests 2015-09-17 07:31:07 -04:00
Matt Mackall
11be5cc27c tests: replace exit 80 with #require 2014-08-06 11:43:59 -05:00
Mads Kiilerich
0e8795ccd6 spelling: fixes from spell checker 2014-04-13 19:01:00 +02:00
Simon Heimberg
0663ca30c6 i18n-de: update many fuzzy entries and translate some simple ones
I mainly did the simple cases, like removing ".. note::", changing single
quotes to double quotes and adapting underlining.
Unhelpful msgstr in fuzzy entries are removed. (They were suggestions by the
program msgmerge.)
2014-01-30 23:34:18 +01:00
FUJIWARA Katsunori
3535aee6e1 i18n: add the tool to check Mercurial specific translation problems in *.po
Existing tool like "msgfmt --check" can check typical translation
problems (missing "%s" in msgstr, for example), but can't check
Mercurial specific ones.

For example, "msgfmt --check" can't check whether the translated
string given to "ui.promptchoice()" is correct or not, even though
problems like below cause run-time error or unexpected behavior:

  - less or more choices than msgid,
  - choices without '&', or
  - choices with '&' followed by none

This patch adds the tool to check Mercurial specific translation
problems in *.po files.
2013-11-27 22:47:32 +09:00
Mads Kiilerich
ccfffc07ba tests: add missing no-outer-repo requirements
Outer repos (if any) will now never be touched by the tests. But it is better
to run without any repos around the tmp directory.
2012-06-20 23:41:21 +02:00
Mads Kiilerich
64b75078bf tests: fix test-i18n.t after translation update 2012-06-18 23:28:56 +02:00
Olav Reinert
919979c82d help: test keyword search in translated text.
Tests that help keyword search is able to search the translated help text when
using a non-English language.
2012-06-08 23:37:11 +02:00
Wagner Bruna
92a9350b35 test-i18n, i18n-pt_BR: updated test message changed in 73e761bdb384 2011-07-22 20:31:15 -03:00
David Golub
11baa243a9 dispatch: avoid double backslashes in error message
The use of %r in the format string caused Python to display Windows paths with
double backslashes.
2011-07-21 16:02:34 -04:00
Wagner Bruna
5a0aba06bc test-i18n, i18n-pt_BR: update test message
This changes both a test and a translation, so I'm sending
a patch; please let me know if I should push this directly
to i18n instead.
2011-06-17 12:23:12 -03:00
Matt Mackall
a33ce77f33 dispatch: improve repository not found message
This should help clarify what the problem is in various problematic
cases like ssh.
2011-04-20 14:28:40 -05:00
Martin Geisler
722ee510d8 test-i18n: make test conditional on msgfmt availability 2011-02-20 13:35:30 +01:00
Martin Geisler
0af898a976 test-i18n: test translations 2011-02-16 10:02:24 +01:00