Commit Graph

11 Commits

Author SHA1 Message Date
Arun Kulshreshtha
e26bc3ffa4 clidispatch: add --insecure global flag
Summary: Add the `--insecure` flag to the list of global hg flags. This flag is already supported by Python, and adding it here will make it available to Rust code as well. This is used later in the stack.

Reviewed By: quark-zju

Differential Revision: D27243029

fbshipit-source-id: 150d42ee96e1e3194ff1be6a33d9b36887d86f2c
2021-03-31 12:53:46 -07:00
Jun Wu
026bd9f950 tests: avoid some rev numbers in revsets
Summary: Done by the fix-revnum.py script.

Reviewed By: singhsrb

Differential Revision: D24173575

fbshipit-source-id: e4cf417be759f9898adfd4102984098474ab38a2
2020-10-08 11:08:37 -07:00
Jun Wu
ed78542610 dispatch: add --trace flag
Summary:
The `--trace` flag enables tracing Python modules.
For compatibility reasons, it also enables `--traceback`.

It can be used with debugshell to make `%trace` more useful.

Reviewed By: sfilipco

Differential Revision: D23278600

fbshipit-source-id: d6d0b34bd5c48111f8cd33d7df115f349b0e95b6
2020-08-27 18:14:28 -07:00
Jun Wu
0562c1220f tests: enable template-new-builtin
Summary: This makes tests depend less on revision numbers.

Reviewed By: DurhamG

Differential Revision: D22468669

fbshipit-source-id: 74a06930faa3e6ee9d246ecc718c2a3740f57a54
2020-07-20 17:27:53 -07:00
Jun Wu
39bd5d8634 context: remove "is a remote bookmark or commit, try to 'hg pull' it first" message
Summary:
We now have auto pull logic that covers most unknown rev use-cases. The hint
message is no longer necessary. It's also unclear how to use `hg pull`
correctly. For example, should it be `-r`, `-B remote/foo` or `-B foo`?

Reviewed By: DurhamG

Differential Revision: D21526667

fbshipit-source-id: 40583bfb094e52939130250dd71b96db4d725ad5
2020-05-13 19:27:41 -07:00
Mark Thomas
5168c29e12 encoding: use correct output encoding on windows
Summary:
On Windows, there are *two* 8-bit encodings for each process.

* The ANSI code page is used for all `...A` system calls, and this is what
  Mercurial uses internally.  It can be overridden using the `--encoding`
  command line option.

* The OEM code page is used when outputing to the console.  Mercurial has no
  concept of this, and instead renders to the console using the ANSI code page,
  which results in mojibake like "Θ" instead of "é".

Add the concept of an `outputencoding`.  If this differs from `encoding`, we
convert from the local encoding to the output encoding before writing to the
console.

On non-Windows platforms, this defaults to the same encoding as the local encoding,
so this is a no-op unless `--outputencoding` is manually specified.

On Windows, this defaults to the codepage given by `GetOEMCP`, causing output
to be converted to the OEM codepage before being printed.

For ordinary strings, the local encoded version is wrapped by `localstr` if the
encoding does not round-trip cleanly.  This means the output encoding works
even if the character is not represented in the local encoding.

Unfortunately, the templater is not localstr-clean, which means strings can get
flattened down to the local encoding and the original code points are lost.  In
this case we can only output characters which are in the intersection of the
encoding and the output encoding.

Most US English Windows systems use cp1252 for the ANSI code page and cp437 for
the OEM code page.  These both contain many accented characters, so users with
accented characters in their names will now see them correctly rendered.

All of this only applies to Python 2.7.  In Python 3, everything is Unicode,
the `--encoding` and `--outputencoding` options do nothing, and it just works.

Reviewed By: quark-zju, ikostia

Differential Revision: D19951381

fbshipit-source-id: d5cb8b5bfe2bc131b2e6c3b892137a48b2139ca9
2020-02-20 04:28:48 -08:00
Xavier Deguillard
db4849a0d6 tests: enable passing tests in python3
Summary: These are passing, let's enable them.

Reviewed By: quark-zju, singhsrb

Differential Revision: D19676094

fbshipit-source-id: bcb363382d48a93ac62dceab2dd6349b910bb51a
2020-01-31 18:12:14 -08:00
Zeyi (Rice) Fan
92f6f35e7a mark all tests requiring Python 2
Summary:
This diff marks **ALL** mercurial tests requiring Python 2 feature.

After you fixes some tests, simply remove the `py2` feature requirement and that tests will be continuously run after your diff is landed.

To bypass this feature requirement, run the tests command with `HGTEST_FORCE_PY2=1`. For example:

```
HGTEST_FORCE_PY2=1 buck test //eden/scm/tests:hg_run_tests
```

or

```
HGTEST_FORCE_PY2=1 python run-tests.py
```

----

Basically this diff are created with the following commands:

```
$ sed -i 's/import feature\(.*\)$/import feature\1\n\nfeature.require(["py2"])/' test-*-t.py
$ sed -i '1s/^/#require py2\n/' test-*.t
$ ls | grep -P "^test.*(?<\!-t)\.py$" > list && vim -p $(cat list)
# manually adding feature requires for these Python tests.
```

(Note: this ignores all push blocking failures!)

ignore-conflict-markers

Reviewed By: singhsrb

Differential Revision: D19655148

fbshipit-source-id: 985e3ccb4010cc559049f1d89f8909bc2d9b5e20
2020-01-30 18:49:21 -08:00
Durham Goode
218c83d574 tags: remove tip tag
Summary:
In a future diff we'll be removing tags. The most prevalent tag is
'tip', which shows up in a ton of test output. Let's drop that tag first, so we
can safely update the tests before we drop tags entirely.

Reviewed By: xavierd

Differential Revision: D18995058

fbshipit-source-id: 8c63710cd4ed567ea24e32724b8660f9006a61f1
2019-12-20 16:14:19 -08:00
Jun Wu
75a8173a10 tests: enable chg for 572 tests
Summary:
Add `#chg-compatible` to 572 tests that seem to pass with chg enabled.
This should make them run faster.

Reviewed By: xavierd

Differential Revision: D18870507

fbshipit-source-id: fe895e733efffc9286cd3d17c7a156c803124395
2019-12-09 15:26:29 -08:00
Adam Simpkins
ab3a7cb21f Move fb-mercurial sources into an eden/scm subdirectory.
Summary:
In preparation for merging fb-mercurial sources to the Eden repository,
move everything from the top-level directory into an `eden/scm`
subdirectory.
2019-11-13 16:04:48 -08:00