Commit Graph

42 Commits

Author SHA1 Message Date
Jun Wu
478e1fe524 commands: add debugrebuildchangelog
Summary:
Add a command to rebuild the changelog without recloning other parts of the
repo. This can be used as a way to recover from corrupted changelog. It
currently uses revlog because revlog is still the only supported format during
streamclone.

In the future this can be used for defragmentation.

Reviewed By: DurhamG

Differential Revision: D23720215

fbshipit-source-id: 6db0453d18dbf553660d55d528f990a4029d9da4
2020-09-18 13:28:33 -07:00
Jun Wu
1199790982 upgrade: remove the upgrade module
Summary: It is about legacy revlog formats that are no longer relevant.

Reviewed By: DurhamG

Differential Revision: D23390436

fbshipit-source-id: 58c2c432804181bcc6517d6c988777b843fc9ba4
2020-08-31 11:57:52 -07:00
Jun Wu
d586a40ada hgcommands: add debugfsync
Summary:
The `debugfsync` command calls fsync on newly modified files in svfs.
Right now it only includes locations that we know have constant number
of files.

The fsync logic is put in a separate crate to avoid slow compiles.

Reviewed By: DurhamG

Differential Revision: D23124169

fbshipit-source-id: 438296002eed14db599d6ec225183bf824096940
2020-08-27 18:26:03 -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
e12b6c81de debugbenchmark: add a command to benchmark revsets
Summary:
Provide a way to benchmark revsets, optionally on different backends.

Some example benchmarks:

On the linux.git repo:

  $ git clone https://github.com/torvalds/linux --filter=tree:0 -n
  # might need edit .git/config, set repositoryformat to 0
  $ hg debuginitgit --git-dir=linux/.git linux-hg
  $ hg debugbenchmarkrevsets --cwd linux-hg -x v2.6.26 -Y v5.8  -m
  # x:  bce7f793daec3e65ec5c5705d2457b81fe7b5725  (v2.6.26)
  # y:  bcf876870b95592b52519ed4aafcf9d95999bc9c  (v5.8)

  | revset \ backend | segments | revlog | revlog-cpy |
  |------------------|----------|--------|------------|
  | ancestor(x, x)   |    0.1ms |  0.1ms |      0.1ms |
  | ancestor(x, y)   |    0.1ms |   10ms |       11ms |
  | ancestors(x)     |    0.2ms |   10ms |      264ms |
  | ancestors(y)     |    0.2ms |  175ms |      3.0 s |
  | children(x)      |    0.2ms |   12ms |      955ms |
  | children(y)      |    0.2ms |  0.3ms |       54ms |
  | descendants(x)   |     75ms |  164ms |       69ms |
  | descendants(y)   |    1.6ms |  0.6ms |      0.7ms |
  | y % x            |    0.2ms |   18ms |      863ms |
  | x::y             |     75ms |  160ms |       68ms |
  | heads(_all())    |    0.1ms |  9.8ms |      843ms |
  | roots(_all())    |    0.5ms |   15ms |      1.6 s |

On the git.git repo with lots of merges but relatively short history:

  # x:  a3eb250f996bf5e12376ec88622c4ccaabf20ea8  (v0.99)
  # y:  4d4165b80d6b91a255e2847583bd4df98b5d54e1  (v2.9.5)

  | revset \ backend | segments | revlog | revlog-cpy |
  |------------------|----------|--------|------------|
  | ancestor(x, x)   |    0.1ms |  0.1ms |      0.1ms |
  | ancestor(x, y)   |    0.7ms |  0.6ms |      0.6ms |
  | ancestors(x)     |    0.2ms |  0.4ms |      1.7ms |
  | ancestors(y)     |    0.8ms |  4.4ms |      140ms |
  | children(x)      |    0.2ms |  1.1ms |       75ms |
  | children(y)      |    0.2ms |  0.4ms |       20ms |
  | descendants(x)   |     16ms |  8.2ms |      2.9ms |
  | descendants(y)   |    4.2ms |  1.8ms |      0.9ms |
  | y % x            |    0.8ms |  1.2ms |       42ms |
  | x::y             |     13ms |  5.8ms |      1.7ms |
  | heads(_all())    |    0.2ms |  0.6ms |       46ms |
  | roots(_all())    |    0.4ms |  1.0ms |      102ms |

On large repo 1 with lots of drafts (and heads):

  # x:  94fccdcc90d52995bf47f1d9259372c290257420  (94fccdcc90 & public())
  # y:  afa87d815d528afadbe5622278e285346d5376f4  (afa87d81 & draft())

  | revset \ backend | segments | revlog | revlog-cpy |
  |------------------|----------|--------|------------|
  | ancestor(x, x)   |    0.1ms |  0.2ms |      0.1ms |
  | ancestor(x, y)   |    0.1ms |   40ms |       62ms |
  | ancestors(x)     |    0.2ms |  1.2 s |      6.8 s |
  | ancestors(y)     |    0.2ms |  2.7 s |       16 s |
  | children(x)      |    0.2ms |   52ms |      5.2 s |
  | children(y)      |    0.2ms |  5.4ms |      357ms |
  | descendants(x)   |    6.0ms |  616ms |      149ms |
  | descendants(y)   |    1.0ms |  0.9ms |      1.5ms |
  | y % x            |    0.2ms |   73ms |      4.2 s |
  | x::y             |    2.3ms |  557ms |      159ms |
  | heads(_all())    |    184ms |   87ms |       10 s |
  | roots(_all())    |     22ms |  110ms |       16 s |

On large repo 2 with mostly linear history:

  # x:  a5b69b059257f732c3b06e5af4ace9fd58ba87e4  (10000)
  # y:  e1e93ca550a89f7803e5a8fe5d388342c44bdd13  (e1e93ca5)

  | revset \ backend | segments | revlog | revlog-cpy |
  |------------------|----------|--------|------------|
  | ancestor(x, x)   |    0.1ms |  0.1ms |      0.1ms |
  | ancestor(x, y)   |    0.1ms |  354ms |      541ms |
  | ancestors(x)     |    0.1ms |  1.1ms |       13ms |
  | ancestors(y)     |    0.1ms |   16 s |       59 s |
  | children(x)      |    0.1ms |  371ms |       32 s |
  | children(y)      |    0.1ms |  0.1ms |      1.3 s |
  | descendants(x)   |    0.3ms |  5.7 s |      1.3 s |
  | descendants(y)   |    0.2ms |  0.2ms |      5.5ms |
  | y % x            |    0.1ms |  583ms |       30 s |
  | x::y             |    0.3ms |  5.7 s |      1.4 s |
  | heads(_all())    |    0.1ms |  317ms |       28 s |
  | roots(_all())    |    0.1ms |  493ms |       47 s |

Notes about the segments backend:
- Optimized for (common) ancestors calculation.
- x::y, or descendants are sensitive to the number of merges.
- descendants or heads are sensitive to the number of heads.
- Not optimized for too many heads. But with narrow-heads, `descendants(x)` is re-written to `x::visible_heads()` and it could be less of an issue if heads are "narrowed".
- More efficient IdDag implementation would improve performance by a constant time factor.
  Namely, having the Index pre-checksum the byte range would make it about 2x faster.

Reviewed By: DurhamG

Differential Revision: D23106173

fbshipit-source-id: b88770e2fc9f0f626bb65e214a83da1a0b927344
2020-08-26 15:32:25 -07:00
Jun Wu
0dc28f689f changelog2: initial support for segmented git changelog
Summary:
The immediate goal is to run benchmarks on a commit graph provided by a git
repo without converting a whole (large) repo from git to hg. Note git repos can
be cloned in a shallow way so it only contains the commit graph. For example:

  git clone https://github.com/torvalds/linux --filter=tree:0 -n

Note: The above command writes repositoryformat=1 in `.git/config`
which is not supported by libgit2. Manually editing it to repositoryformat=0
would enable libgit2 to read it for this crate's use-case.

In the longer term we might want to extend the support so refs/trees/files can
be read/written directly via the git repo based on this work. However that's
currently beyond scope.

Reviewed By: DurhamG

Differential Revision: D23095467

fbshipit-source-id: 868beb0c7de60453b47962639863eb8f7e3f5753
2020-08-21 13:00:45 -07:00
Jun Wu
af7142c7fe changelog2: add ways to migrate between formats
Summary: This allows migrating between a few changelog formats we have.

Reviewed By: DurhamG

Differential Revision: D22970571

fbshipit-source-id: d6b577ae5beb72a43fff999c26c35fcdc33e8f83
2020-08-21 13:00:45 -07:00
Jun Wu
9f8961a75c commands: add debugchangelog command
Summary: For now it just prints some details about the changelog backend.

Reviewed By: DurhamG, sfilipco

Differential Revision: D22970573

fbshipit-source-id: 719a5e5bb6f3856df3c9357e47daa9e7c8584952
2020-08-21 13:00:45 -07:00
Jeremy Sze Wei Teo
43425f1116 Revert D22992103: hgcommands: add debugfsync
Differential Revision:
D22992103 (f6d086d13b)

Original commit changeset: b5503e498d52

fbshipit-source-id: ad8f0d9c0bba1d07edb0aebca052da10c0f8e59c
2020-08-12 19:25:24 -07:00
Jun Wu
f6d086d13b hgcommands: add debugfsync
Summary:
The `debugfsync` command calls fsync on newly modified files in svfs.
Right now it only includes locations that we know have constant number
of files.

The fsync logic is put in a separate crate to avoid slow compiles.

Reviewed By: DurhamG

Differential Revision: D22992103

fbshipit-source-id: b5503e498d5216d4ba19701ecd5582387e4f45f5
2020-08-12 18:33:52 -07:00
Jun Wu
8ca7ab1c5a hgcommands: move debug commands to individual files
Summary:
This makes the main command table cleaner.

I dropped the `indexedlogrepair` command as it cannot rebuild indexes. `hg
doctor` is a better replacement. Some debug commands are renamed so they
no longer have `-` in the command name.

Reviewed By: DurhamG

Differential Revision: D22992107

fbshipit-source-id: f65d74e36fb971e592ad0cc8be9a94e245c39662
2020-08-12 18:33:52 -07:00
Xavier Deguillard
7f5439da0e eden: add a cat_tree command
Summary:
When running `edenfsctl prefetch **/BUCK` with an empty hgcache, EdenFS ends up
asking mercurial for every manifest one by one. Unfortunately, every manifest
fetched also causes the packfile to be flushed to disk, which then leads EdenFS
to rescan the filesystem for the new packfile. Once too many packfiles are
present on disk, Mercurial triggers a repack. Effectively, that means we have a
quadratic complexity both on Mercurial, and on EdenFS's side.

While this has been a long standing issue, we've so far avoided falling into
this complexity for a number of reason. The main one being that the hgcache is
very rarely empty, and thus the quadratic complexity is usually on low number
of files. Users also rarely run a prefetch of all the files for the entire
repo. However, on repositories with long standing branches, the hgcache is
effectively cold and thus any prefetch would trigger the pathological behavior.

To solve this, we take the same approach taken for files: sending the raw
manifest to EdenFS, which will then take care of deserializing it properly.

Reviewed By: DurhamG

Differential Revision: D23035335

fbshipit-source-id: 855e6fb4fabf81c427fad6c9f17d05f95c47e9ae
2020-08-12 01:48:03 -07:00
Jun Wu
e1851aaab7 treediscovery: remove treediscovery
Summary:
It has been long replaced by setdiscovery. This removes another dependency on
`dagutil.revlogdag`.

Reviewed By: DurhamG

Differential Revision: D22519585

fbshipit-source-id: ee261173ba584ffcb3371ec640b233609aafcf77
2020-07-30 20:32:30 -07:00
Meyer Jacobs
586ada8de6 taggederror: introduce bail macro replacement which allows tagging
Summary: This change introduces a bail macro that allows tagging errors using the syntax `bail!(fault=Fault::Request, "my normal {}", bail_args)` or `bail!(Fault::Request, "my normal {}", bail_args)`.

Reviewed By: DurhamG

Differential Revision: D22646428

fbshipit-source-id: a6ec2940001b26db8ddc3a6d3620a1e17406c867
2020-07-22 15:37:14 -07:00
Meyer Jacobs
f8b83f7880 debug: log exception metadata to scuba along with other exception information
Summary:
Extend `_log_exception` to inspect exceptions for metadata, and log any that is found to Scuba. Eventually I'd like to merge at least some of this information from the `perfpipe_hg_errors` table into the `perfpipe_dev_command_timers`.

Introduce `Tagged` mixin and `Fault` enum Python types for tagging Python exceptions.

Introduce `debugthrowexception` for testing Python error handling flow.

Reviewed By: DurhamG

Differential Revision: D22585764

fbshipit-source-id: f6300ae25db25d5e75fab9c2a03fb4f9beb06c1f
2020-07-20 11:46:13 -07:00
Meyer Jacobs
e3b86cf77d debug: introduce binding layer for propagating error metadata to Python
Summary:
Implements based Rust-Python binding layer for error metadata propagation.

We introduce a new type, `TaggedExceptionData`, which carries CommonMetadata and the original (without metadata) error message for a Rust Anyhow error. This class is passed to RustError and can be accessed in Python (somewhat awkwardly) via indexing:
```
except error.RustError as e:
    fault = e.args[0].fault()
    typename = e.args[0].typename()
    message = e.args[0].message()
```
As far as I can tell, due to limitations in cpython-rs, this can't be made more ergonomic without introducing a Python shim around the Rust binding layer, which could adapt the cpython-rs classes to use whatever API we'd like.

Currently, anyhow errors that are not otherwise special-cased will be converted into RustError, with both the original error message and any attached metadata printed as shown below
```
  abort: intentional error for debugging with message 'intentional_error'
  error has type name taggederror::IntentionalError and fault None
```
We can of course re-raise the error if desired to maintain the previous behavior for handling a RustError.

If we'd like other, specialized Rust Python Exception types to carry metadata (such as `IndexedLogError`), we'll need to modify them to accept a `TaggedExceptionData` like `RustError`.

Renamed the "cause an error in pure rust command" function to `debugcauserusterror`, and instead used the name `debugthrowrustexception` for a command which causes an error in rust which is converted to a Python exception across the binding layer.

Introduced a simple integration test which exercises `debugthrowrustexception`.

Added a basic handler for RustError to scmutil.py

Reviewed By: DurhamG

Differential Revision: D22517796

fbshipit-source-id: 0409489243fe739a26958aad48f608890eb93aa0
2020-07-16 19:30:00 -07:00
Meyer Jacobs
4ccbd119d7 debug: introduce error classification and metadata propagation
Summary:
Introduce new rust library, taggederror, which contains utilities for attaching metadata to errors. The library provides two main methods for attaching metadata to an error, the TaggedError wrapper type, and the AnyhowExt trait methods. Provides a struct, CommonMetadata, which contains all the metadata types introduced by taggederror (fault, transience, category, and typename), which can also be attached individually (and the same pattern can be used to attach other metadata).

Introduce a new native rust command, debugthrowrustexception, which causes the command to return an error, with some attached metadata.

Modify hg rust native command dispatch error handling to use debug formatter to print anyhow::Error errors. This will print out the source chain, contexts, and backtrace if available, which will cause the metadata we attach as a wrapper error or context to be printed.

Reviewed By: DurhamG

Differential Revision: D22420941

fbshipit-source-id: d38c5a10b686d86b69a2c0a19f5bcbf4ca24dff6
2020-07-15 10:03:10 -07:00
Durham Goode
28ddd1d1cc configs: add hg debugdynamicconfig --canary devvmXXX.prnY support
Summary:
Previously you could only canary locally on a devserver by setting an
environment variable. Let's add a --canary flag to debugdynamicconfig that
accepts a host.  Hg will ssh to that host and run the configerator cli to grab
the canaried config from that host.

Reviewed By: quark-zju

Differential Revision: D22535509

fbshipit-source-id: af1c21d8402c4e729769e50388d913bf52b66b89
2020-07-15 01:14:30 -07:00
Jun Wu
8e199e9a44 debugcomplete: show aliases with -v
Summary:
Make zsh_completion complete standard aliases like `checkout`.
This restores the behavior before D18463299 (54451585ce) stack.

Reviewed By: farnz

Differential Revision: D22396737

fbshipit-source-id: 745761041d6d1dec6adba2efb102e2021a01b36b
2020-07-07 16:47:45 -07:00
Jun Wu
b12980f84c commands: add debugmakepublic
Summary:
Many tests want to change commit phase to public. We don't want to leak this
feature to end-users. Therefore make a debug command.

Reviewed By: kulshrax

Differential Revision: D22052481

fbshipit-source-id: 4ce6a61120da0d74374465e97ac0ec0ff9638088
2020-06-29 11:29:04 -07:00
Durham Goode
7f1588131b py3: set LANG="en_US.UTF-8" for most tests
Summary:
We support unicode file paths, and in python 3 those get passed to
python libraries as unicode strings. The tests set LANG=C which mean the python
library tries to convert the path to ascii, but fails for any non-ascii
characters. Let's switch to LANG="en_US.UTF-8" to match our production
behavior and make tests about unicode paths work.

Reviewed By: xavierd

Differential Revision: D22098359

fbshipit-source-id: c3057edc66e6e32f7b8b49374e622d02bd05711f
2020-06-19 13:40:17 -07:00
Meyer Jacobs
96ef9dda5d debug: Add commit metadata storage and templating for marking stable commits
Summary:
Introduced a new local commit metadata storage system, smallcommitmetadata, which stores a simple local JSON file for a mapping of (node, category) -> value.

This data can be manipulated with the debugsmallcommitmetadata command, and can be consumed in the smartlog using the smallcommitmeta template func.

Total number of entries can be limited with smallcommitmetadata.entrylimit configuration option, which defaults to 100.

Reviewed By: DurhamG

Differential Revision: D21673611

fbshipit-source-id: 2239a47867118dd86b15944058505ddf67548549
2020-06-10 19:29:39 -07:00
Meyer Jacobs
341fbdc1aa debugging: Implement "debugdetectissues" command for detecting signs of repository issues
Summary:
Implements a "debugdetectissues" command, which runs a series of checks on the repository meant to detect potential issues, logging the data to Scuba so that we can determine how common certain issues are, and under what conditions they appear.

Future extensions of this change may involve merging the functionality into hg doctor, and setting the command to run automatically in the background on some interval.

Reviewed By: DurhamG

Differential Revision: D21558170

fbshipit-source-id: a878ae1804d5f11c83a574e0dc3c802b564d2ced
2020-05-19 18:11:29 -07:00
Kostia Balytskyi
b1d4f6d2a5 debugsendunbundle: add cmd to send unbunble from stdin
Summary:
This is helpful, when we have raw unbundle bytes and a server path and just
want to send these bytes server's way.

Very similar to `sendunbundlereplay`, but does not do anything additional,
and reads from stdin.

Reviewed By: markbt

Differential Revision: D21527243

fbshipit-source-id: 97726cb40a32c7e44f47e0f56d8c8eabc4faf209
2020-05-13 15:34:39 -07:00
Jun Wu
76643816b3 remotefilelog: move "--shallow" command-line flag to core
Summary: It will be used in the next change.

Reviewed By: DurhamG

Differential Revision: D21011399

fbshipit-source-id: 6bdffc79af0474e42562686109417882a8cb2cd6
2020-05-12 10:23:20 -07:00
Durham Goode
bfe0c8d7ab configs: add dynamic config generator
Summary:
We want Mercurial to become more responsible for it's own
configuration, instead of relying on chef and other means. To do so, let's
introduce a new `hg debugdynamicconfig` that can generate dynamic configs for
a given repository based on various states, like what tier it's in or what shard
that machine is in.  By default it generates to '.hg/hgrc.dynamic' for the given
repository.

Currently it just sets the hostgroup config.

Future diffs will make Mercurial consume this config, and possibly have Mercurial
call this command asynchronously when it notices the file is out-of-date.

Reviewed By: quark-zju

Differential Revision: D20828132

fbshipit-source-id: 6f5bf749f5b04e0a5989d6dc19ee788c2e47f88f
2020-04-14 21:22:26 -07:00
Xavier Deguillard
a800e3e4ce tests: enable bunch of tests
Summary: These appear to pass now.

Reviewed By: quark-zju

Differential Revision: D20954747

fbshipit-source-id: ffd4dd4dc4832ed7cf84815ff1af9dad4361b26a
2020-04-13 08:53:48 -07:00
Jun Wu
5a69be9e70 commands: add debugvisibleheads
Summary:
Add a command to print visibleheads. This was part of my attempt to check if
visibleheads can accidentally include public commits and if there are a way
to remove it. I ended up thinking D20808884 might actualy solve the only case
that visibleheads include public heads.

I also tried to add strong verification so that the visibility layer never
writes public nodes. That's for non-narrow-heads use-cases. However, the
phasescache + repoview layer is kind of messy in a way that inside a
transaction there is only one "repo" that has the right in-memory, dirty
"phasescache" and other repos will load the (stale, wrong) phasescache from
disk. That means if we test phases in visibility before transaction flushes,
we won't be able to access the latest phases information correctly. So I
gave up this approach too.

Anyway, I wasn't able to add a new interesting test, but the utility built for
the test seems useful. Therefore this change.

Reviewed By: sfilipco

Differential Revision: D20829136

fbshipit-source-id: 5ebafefac820ebb4044db63b7892ffaa341c0573
2020-04-07 19:10:45 -07:00
Jun Wu
707b7dea42 localrepo: add a tech-debt-free repo.pull API
Summary:
The new `repo.pull` API aims to be tech-debt free. It does:
- Pull nothing instead of everything if nothing is specified.
- Update remote names that are explicitly specified, not everything the server
  has.
- Do not update local bookmarks.

The direct motivation is to implement autopull `remote/foo` behavior while not relying on the pull command.

Reviewed By: DurhamG

Differential Revision: D20531119

fbshipit-source-id: 80c3bdd5556126d81af099a74f1345ecc94904b7
2020-04-01 19:40:55 -07:00
Jun Wu
d7fd7c15d6 metalog: add debugmetalogroots
Summary: The command lists all metalog roots. It's useful for debugging purpose.

Reviewed By: sfilipco

Differential Revision: D20449408

fbshipit-source-id: 206573b20c7740b6e536bf5d97276175c684959a
2020-03-16 10:21:47 -07:00
Jun Wu
9bff661020 commands: add debugdifftree
Summary:
This command can be used to diff two trees and only print changed paths,
without changed file contents.

With a customized template it can also print changed flags, which can be useful
for watchman use-cases.

Reviewed By: sfilipco

Differential Revision: D20377436

fbshipit-source-id: dad79f1b891182fa612c446114f9daceb4ec5881
2020-03-11 10:42:21 -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
Mark Thomas
3690e8ab44 debugmutation: add time range limiting
Summary:
Make it possible to limit the time range of mutation info being displayed by hg
debugmutation.

Reviewed By: DurhamG

Differential Revision: D19904000

fbshipit-source-id: 365f54fdd861661961bba1a0ea96fce772623a23
2020-02-17 06:41:03 -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
Saurabh Singh
17ad617625 purge: move extension to core
Reviewed By: quark-zju

Differential Revision: D19506964

fbshipit-source-id: 173918346e90fadbaa52155786aa30fbd4951c8c
2020-01-21 20:49:08 -08:00
Mark Thomas
b654a9aae5 tests: use disable treemanifest in place of setconfig
Summary: Use `disable treemanifest` in place of `setconfig extensions.treemanifest=!`

Reviewed By: quark-zju

Differential Revision: D19457678

fbshipit-source-id: 47c8b3c4f4ed5cfc97275ca67afab4a86ffe7f0d
2020-01-20 02:45:15 -08:00
Jun Wu
aa64745a35 debugmetalog: add a command to show repo history
Summary:
The command shows how visibility, bookmarks, remotenames change in the repo
over time, using metalog data.

Also add this command to hg rage report.

Reviewed By: markbt

Differential Revision: D19358668

fbshipit-source-id: 9bddc039143b45c29c0c937ee60906ab93a2defe
2020-01-13 14:29:07 -08:00
Jun Wu
5da0c6903d util: switch to Rust time parsing
Summary:
The Rust bindings now provide a subset of time parsing features.  Replace the
old Python implementation. This has multiple benefits:
- Strong gurarnatee that Rust and Python behave the same.
- Parse relative time (ex. `5 minutes ago`)
- Parse date beyound i32 range (ex. >= year 2038)

Reviewed By: DurhamG

Differential Revision: D18946332

fbshipit-source-id: 721f47bc5b2835d7ca0a05ab34ea4faa1a411a4e
2020-01-09 11:51:31 -08:00
Durham Goode
9778811573 tags: remove tags feature
Summary:
We no longer user tags in any of our repositories, so let's delete all
the code and remove some tech debt.

Previously drawdag was our last remaining use of tags, but in a previous diff I
switched that to use bookmarks.

Reviewed By: quark-zju

Differential Revision: D19042226

fbshipit-source-id: d7871c71c1026599aa70fdd806418347ea214a8a
2020-01-07 12:31:10 -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