Commit Graph

923 Commits

Author SHA1 Message Date
Stefan Filip
12fea6ed1b python3: remove line buffering from binary file open
Summary:
Python 3.8 gives a warning when asking for line buffering on a binary file:
```
line buffering (buffering=1) isn't supported in binary mode,
the default buffer size will be used
```

Reviewed By: xavierd

Differential Revision: D22120968

fbshipit-source-id: 9b1f98f5bfa8ac9ed4f0b4e62389051f665f5d4f
2020-06-18 14:21:20 -07:00
Mark Thomas
b0b6425f63 visibility: add hg debugvisibility status
Summary: Add a command to print out the current status of visibility tracking.

Reviewed By: quark-zju

Differential Revision: D22089413

fbshipit-source-id: 729e9f36fbc13ba90518dcd428a44c02ce358167
2020-06-18 12:15:00 -07:00
Mark Thomas
2eb20def5a commitcloud: require visibleheads for sync
Summary: Commit cloud sync works best when visibleheads are enabled.  Default to requiring it.

Reviewed By: quark-zju

Differential Revision: D22089414

fbshipit-source-id: b786103d5c5f65a7908eb97a973af9eca5990b22
2020-06-18 12:15:00 -07:00
Xavier Deguillard
67db664778 dynamicconfig: read file as bytes
Summary:
Somehow reading the file with `open("r")` will try to decode it as ascii, but
that file may contain utf-8 characters, so open it as bytes, and then decode
it.

Reviewed By: DurhamG

Differential Revision: D22105188

fbshipit-source-id: 0cfbd8c5417b637dd76391f86226e24ee663baf7
2020-06-18 10:44:57 -07:00
Mark Thomas
d9702a314a sampling: log repo root and repo shared root
Summary:
Add logging of the repo root and repo shared root to the sampling extension.

Reduce the number of different strings that are logged by replacing any path
component that equals the user's username (e.g. their home directory) with
`$USER`.

Reviewed By: farnz

Differential Revision: D22066053

fbshipit-source-id: 39221e5182b3d4df51afa386497003e637a50b13
2020-06-16 10:25:03 -07:00
Xavier Deguillard
adcd787f1b remotefilelog: do not import the builtins module
Summary:
From a simple `hg trace log -r .`, it appears that importing the module takes
16ms, which dominates the time it takes to load the treemanifest extension.
Since the module isn't necessary, don't import it.

Reviewed By: farnz

Differential Revision: D22048075

fbshipit-source-id: ccaf2d53eb006faa36d97df452b0db10f4983c23
2020-06-15 17:30:44 -07:00
Carolyn Busch
89f238b8dd Replace whitelist/blacklist term
Summary: Replaces usages of whitelist/blacklist with include/exclude/allow. These terms are more descriptive and less likely to contribute to racial stereotyping. More context: https://fb.workplace.com/groups/sourcecontrolteam/permalink/2926049127516414/

Reviewed By: farnz

Differential Revision: D22039299

fbshipit-source-id: d5b4cdeca681e1f4c992f7ef0b9f772b2ae1abd3
2020-06-15 15:01:19 -07:00
Mark Thomas
973d9806e7 commitcloud: use correct field in interactive smartlog history
Summary:
Interactive smartlog history attempts to access `sltimestamp` as a field of
`slinfo`.  The field is actually called `timestamp`.

Reviewed By: quark-zju

Differential Revision: D22042316

fbshipit-source-id: 7c1d53dfc1c8d661a248d8412f7d780c83723721
2020-06-15 14:06:30 -07:00
Carolyn Busch
990926cbc6 edenscm/mercurial: Replace whitelist/blacklist term
Summary: Replaces usages of whitelist/blacklist with include/exclude/allowed. These terms are more descriptive and less likely to contribute to racial stereotyping. More context: https://fb.workplace.com/groups/sourcecontrolteam/permalink/2926049127516414/

Reviewed By: kulshrax

Differential Revision: D22039297

fbshipit-source-id: ab6e55889e6cf42aed35c856475b2ff92f4cb802
2020-06-15 12:47:08 -07:00
Carolyn Busch
ca4bed9633 hgext: replace whitelist/blacklist term
Summary: Replaces usages of whitelist/blacklist with includelist/excludelist/incompatiblelist/. These terms are more descriptive and less likely to contribute to racial stereotyping. More context: https://fb.workplace.com/groups/sourcecontrolteam/permalink/2926049127516414/

Reviewed By: kulshrax

Differential Revision: D22039296

fbshipit-source-id: d4c1fd09e40d5ebeaab99515ed19aa5df6c2ecc4
2020-06-15 11:47:28 -07:00
Thomas Orozco
cb64897c70 infinitepush: only warn about mutation server support if entries are to be sent
Summary:
In the Mononoke integration tests (which are .t tests), we've started seeing
this waring show up.

We probably shouldn't have mutation enabled for most of those tests anyway
(save for the tests that actually exercise mutation), so I'm turning that off.
That said, we'd still see the warning. So, this diff refactors mutation a
little bit to only warn if we do have something to send to the server.

Reviewed By: ikostia

Differential Revision: D22016685

fbshipit-source-id: e9e8dbcc44a0fa048dca3ca7ce0961631058a2d6
2020-06-12 04:17:17 -07:00
Jun Wu
7728e73e01 mutation: do not auto migrate if proxy-obsstore is enabled
Summary:
There is no need to migrate if the obsstore is a proxy to the mutation store.
This avoids a crash reading the attribute `_all`.

Reviewed By: DurhamG

Differential Revision: D21999245

fbshipit-source-id: bfa6439982834c6835412fc175132526525af548
2020-06-11 10:00:42 -07:00
Durham Goode
17eb13e7b5 configs: fix config generation when executed from outside the repo
Summary:
When kicking off the background process, we were depending on the
current working directory being inside the repo. This is not always true, like
when the current command was invoked like `hg -R xxx log -r .`. Let's invoke the
debugdynamicconfig command with the explicit path.

Reviewed By: quark-zju

Differential Revision: D21983297

fbshipit-source-id: 72981ea596e62dced3918f2fc6272953ab3d84cd
2020-06-10 22:16:39 -07:00
Xavier Deguillard
16777c3d81 merge: remove the rustworkers option
Summary: It's now the default.

Reviewed By: DurhamG

Differential Revision: D21981563

fbshipit-source-id: 9e27e65ea8e47019f1542a505f5b7726c2cbeba2
2020-06-10 20:10:29 -07:00
Jun Wu
5344951764 tests: turn on mutation, disable obsstore for tests
Summary:
Incompatible tests are blacklisted.

The affects non-tests environment: `proxy-obsstore` is turned on.
That is in theory not very different from having an empty obsstore.
If it becomes an issue we can easily turn it off.

Reviewed By: sfilipco

Differential Revision: D21899139

fbshipit-source-id: e4a87ecced0542e7852b48b1a807775e523b3cc9
2020-06-10 19:30:01 -07:00
Jun Wu
5140e6950b cleanobsstore: remove the extension
Summary: We're getting rid of obsstore. The extension is no longer needed.

Reviewed By: sfilipco

Differential Revision: D21899142

fbshipit-source-id: 6e4dd2b2ddfa9325c19d6d1d9951099748260904
2020-06-10 19:29:58 -07:00
Jun Wu
cb68b3c6a0 commitcloud: remove pullcreatemarkers feature
Summary:
The feature is off in production.

It calls the "scan changelog" code path in pullcreatemarkers.py, which
is also unused in production.

This allows us to remove a test that no longer passes with the mutation config.

Remove it.

Reviewed By: sfilipco

Differential Revision: D21913600

fbshipit-source-id: 23850fca2d1dc3d135d25954f00a08dc6d13972e
2020-06-10 19:29:58 -07:00
Jun Wu
530723b653 arcdiff: use core autopull API
Summary: This unblocks turning mutation on for test-commitcloud-lazypull-phab.t.

Reviewed By: sfilipco

Differential Revision: D21913590

fbshipit-source-id: 2580f2c054a3db753d40ea5aacdb8d2860e8cd3b
2020-06-10 19:29:56 -07:00
Jun Wu
f231cd0db3 unamend: use core autopull API
Summary: This unblocks turning on mutation for test-commitcloud-lazypull.t

Reviewed By: sfilipco

Differential Revision: D21913604

fbshipit-source-id: 5f52b179cea526f7260bf036323926b779da46f8
2020-06-10 19:29:56 -07:00
Jun Wu
842416e189 pullcreatemarkers: skip creating mutation entries less aggressively
Summary:
The old code only compares successors without checking predecessors, and skips
creating markers even if predecessors do not match.  Update it to also check
predecessors. This is needed to maintain the `x` commits in
test-fb-hgext-pull-createmarkers-hide-later.t when switched to use mutation.

Reviewed By: markbt

Differential Revision: D21913610

fbshipit-source-id: 1fec2f96544236dd675ceb8c1a399bcef6cd0ede
2020-06-10 19:29:56 -07:00
Jun Wu
72881bf471 smartlog: remove obsolete templates
Summary:
They are no-op with mutation, which is enabled in production. Therefore remove
the template keywords and tests.

Reviewed By: sfilipco

Differential Revision: D21913602

fbshipit-source-id: 40ef3a915d591d6bcae2ca7931e388b5d5e00c25
2020-06-10 19:29:55 -07:00
Jun Wu
3c841e26c5 obsolete: ignore prune markers if visibility is on
Summary:
Pruned commits are handled by visibility. Ignore them when calculating
`obsolete()`.

This change makes transition to mutation smoother. The latter does not allow
obsoleting commits without successors.

Practically, this means some `x` commits will show as `o`s.

Reviewed By: sfilipco

Differential Revision: D21913596

fbshipit-source-id: 8a6495d040595ead1f6f08cf81e095e25cd8ff1f
2020-06-10 19:29:55 -07:00
Jun Wu
49c75cfa9d debugobsolete: stop printing obsmarkers
Summary: This makes transition to mutation smoother.

Reviewed By: sfilipco

Differential Revision: D21913599

fbshipit-source-id: 74cc0b7f0608a952eded4a40291b56b291a221e5
2020-06-10 19:29:54 -07:00
Jun Wu
ff888f03a6 repair: remove "saved backup bundle to" message
Summary:
The code path printing that message is rarely used in production setup.  This
makes transition to mutation easier.

Reviewed By: sfilipco

Differential Revision: D21913595

fbshipit-source-id: 3aa22575c11e38dbb7d4c4cbc7aad8dde2e755ed
2020-06-10 19:29:54 -07:00
Jun Wu
9044ccc3da bundle2: remove 'n new obsolescence markers' message
Summary: This makes transition to mutation smoother.

Reviewed By: sfilipco

Differential Revision: D21913608

fbshipit-source-id: b9ba470572ed68dff75104bba9dbb5c8622dcfb0
2020-06-10 19:29:54 -07:00
Jun Wu
9cd4491c02 transaction: remove summary callback
Summary:
The summary callback is only used to display "obsoleted n changesets".
Remove it to make transition to mutation smoother.

Reviewed By: sfilipco

Differential Revision: D21913597

fbshipit-source-id: e47fa9df0033d1302ffc8dfa3b9885eb75861f4b
2020-06-10 19:29:53 -07:00
Jun Wu
45c6e5635e pushrebase: wrap mutationobsstore to get commit mapping
Summary: This is needed to enable mutation and disable the old obsstore in more places.

Reviewed By: sfilipco

Differential Revision: D21913607

fbshipit-source-id: 2e1ef1e7df58fb134d541f550b6fb90508b9289a
2020-06-10 19:29:53 -07:00
Jun Wu
2323f845c7 mutation: add a proxy obsstore implementation that writes to mutation
Summary:
This makes code relying on `repo.obsstore` work with the new mutation backend.
Namely, commands like `debugobsolete` will work in tests.

Reviewed By: sfilipco

Differential Revision: D21899149

fbshipit-source-id: b4906ededdc32cfd9c9b7efbf2c85600a0c4a8f4
2020-06-10 19:29:52 -07:00
Jun Wu
33b497c035 remotefilelog: fix type of missingids
Summary: `getpack` requires list and will crash on set.

Reviewed By: xavierd

Differential Revision: D21968128

fbshipit-source-id: 75956f5adfcdb8082608e65f041007e58fc36c5c
2020-06-10 19:29:50 -07:00
Durham Goode
9473b487b5 tests: enable treemanifest for ~100 more tests
Summary:
Enables treemanifest for about 100 more tests. To make them pass I had
to expose the gettreepack capability from peers, which just works, and enable
treeonly and sendtrees by default in the tests, which I probably should've done
before anyway.

Reviewed By: quark-zju

Differential Revision: D21894955

fbshipit-source-id: 7a6a4d453824fb8c81a797a5487bf2ecc2b67761
2020-06-10 19:29:48 -07:00
Xavier Deguillard
edd44536ae transaction: copy files before truncation
Summary:
On Windows, if a file is memory mapped it cannot be truncated, unfortunately,
with the 00changelog.i being almost 500MB, this means that every time Mercurial
starts, the file needs to be read entirely. With the code being moved to Rust,
this read is done twice, resulting in a memory consumption of over 900MB.

Instead of always trying truncate the file in place, let's just try to truncate
it first, and then copy it, truncate it and then move it back in place. This
will allow us to memory map the 00changelog.i on Windows, which should
significantly reduce the memory consumption of Mercurial.

Reviewed By: DurhamG

Differential Revision: D21953553

fbshipit-source-id: e0f447fea017a34c8da8cdbbc6914cee7b5b2bee
2020-06-10 19:29:45 -07:00
Durham Goode
6f7b096d91 treemanifest: override root node during normal hg push
Summary:
We need to support pushing legacy flat manifets commits without push
rebase. Currently we rebuild the tree on the server and recompute it's hash,
which can result in a tree hash instead of a flat hash for the pushed commit.
Since we're provided with the correct hash via the push, we should just use that
directly.

Since the hash isn't validated, it opens some opportunities for receiving
incorrect data from the server, but we can disable this functionality at some
point, once all legacy repos have been merged in.  Then we can get rid of the
need for flat manifest hashes entirely once we switch to a new hash scheme.

Reviewed By: quark-zju

Differential Revision: D21962513

fbshipit-source-id: 8cdaf3a4e2aba73d5fc97fcb78821d2c88f5284f
2020-06-10 19:29:45 -07:00
Chad Austin
7e4835f677 rename eden.thrift Python module to eden.thrift.legacy
Summary:
The Python 2-and-3 Thrift API is sort of deprecated and does not
handle binary data in `binary` fields. In advance of migrating to the
modern Python 3 API, remane eden.thrift to eden.thrift.legacy.

Reviewed By: fanzeyi

Differential Revision: D21889697

fbshipit-source-id: a745ee8977999acbfb383a4edebe81d8deb1734e
2020-06-10 19:29:42 -07:00
Kostia Balytskyi
dc91c602d1 infinitepush: support setting a reason for disabling writes
Reviewed By: StanislavGlebik

Differential Revision: D21929217

fbshipit-source-id: 5924a29945da4b4bb4bbf6f8e93f427d66665900
2020-06-10 19:29:41 -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
Durham Goode
bc9087841c deprecate: log the caller of the deprecated logic
Summary:
Let's record the caller of the hg command that's using deprecated
logic. In most cases the caller will be the unix username, but we'd like to get
services to set an environment variable with their oncall so we could associate
hg usage with specific oncalls and eventually automatically file tasks for using
deprecated functionality.

Reviewed By: markbt

Differential Revision: D21891753

fbshipit-source-id: a4de0d348c583777cc3eeb9be26510e6af8b3a27
2020-06-10 19:29:39 -07:00
Durham Goode
b0aba2856f deprecate: deprecate a number of commands
Summary:
Marks a number of commands as deprecated. The default ui.deprecate()
behavior is to just log the usage to scuba, so this diff doesn't actually change
any behavior.

Reviewed By: markbt

Differential Revision: D21891192

fbshipit-source-id: 4611e31cf630eee4f07443fe242c759c3cb3fe31
2020-06-10 19:29:38 -07:00
Durham Goode
1d65457032 deprecate: introduce ui.deprecate
Summary:
Adds a simple ui.deprecate() function for deprecating code paths. It
has several levels of deprecation and can optionally automatically escalate
through those levels across a specified time frame.

The levels are:
- Log - just logs the usage to scuba
- Warn - same as Log but also prints a warning to the user
- Slow - same as Warn but also sleeps for 2 seconds
- OptIn - throws an exception, but hints that the exception can be bypassed by
  setting 'deprecated.bypass-XXXX=True'
- Block - throws an exception that cannot be bypassed

I also call it from a few locations that are expected to be deprecated already.

Reviewed By: markbt

Differential Revision: D21890496

fbshipit-source-id: faddb301888ef75cc71d46ffb7374f3fe3d044bd
2020-06-10 19:29:38 -07:00
Kostia Balytskyi
8cda84ca26 infinitepush: add an ability to disable writes on servers
Summary: This will be very useful when we migrate to Mononoke.

Reviewed By: StanislavGlebik

Differential Revision: D21912115

fbshipit-source-id: 1ed2204f17f90152a67fd4e10b0ae61aacfc41d7
2020-06-10 19:29:30 -07:00
Mark Thomas
860594a0e6 streampager: fix progress rendering
Summary:
With the internal streampager, progress bars must be sent on a separate stream so that
streampager can render them correctly.

Reviewed By: quark-zju

Differential Revision: D21906173

fbshipit-source-id: eb41b0bf22807d9cae518b3f676996ab1c642c6e
2020-06-10 19:29:28 -07:00
Jun Wu
a2d3da5114 bundlerepo: only enable index2 for changelog revlog
Summary:
`index2` is the Rust revlog index implementation that has extra requirements,
namely, the revlog cannot be inlined. We have code to make sure changelog is
not inlined, but manifest or filelog can still be inlined.

`index2` is only needed for changelog for phase and visibility calculations.
Therefore, disable it for manifest and filelog.

Reviewed By: singhsrb

Differential Revision: D21917447

fbshipit-source-id: c45f955175c623092e6f728042dbfd3b942fe911
2020-06-10 19:29:26 -07:00
Jun Wu
92e7b5feb2 visibility: turn on visibility by default
Summary:
It was turned on in production (facebook.rc) except for hg servers.
This mainly affects tests.

Reviewed By: markbt

Differential Revision: D21894313

fbshipit-source-id: 5f12620cfc11bb243e96fba12a07cbf0241c738b
2020-06-10 19:29:24 -07:00
Mateusz Kwapich
41b87a449b hgsql: check if paths are not too long before inserting to DB
Summary:
This is a followup from s195788 - this little check should be enough to prevent
us from having the paths in our DB being truncated on insert.

Reviewed By: markbt

Differential Revision: D21904281

fbshipit-source-id: c9306e0cca4a2e009bb50bc287190d8f7ad12be4
2020-06-10 19:29:23 -07:00
Jun Wu
476afcb2f6 visibility: stop logging "repo visibility is tracked through visible heads"
Summary:
Visibleheads (and even narrow-heads) are enabled by default except for hg
servers. No need to log them specially.

Reviewed By: markbt

Differential Revision: D21894308

fbshipit-source-id: 7ffe0977e51c17e743b62da0e2bfbe7618c64610
2020-06-10 19:29:22 -07:00
Jun Wu
1586c31ebb visibility: skip unknown nodes in some places
Summary: This is required to make some tests pass.

Reviewed By: markbt

Differential Revision: D21894312

fbshipit-source-id: 481bcc42f8f7fbb5c1707e66da31aee29932484c
2020-06-10 19:29:22 -07:00
Jun Wu
d6ed467b66 convert: use unfiltered repo
Summary: This avoids some issues.

Reviewed By: markbt

Differential Revision: D21894316

fbshipit-source-id: 98c75704bb3ace9fc9ac912711a8cd2d77dfeaf0
2020-06-10 19:29:22 -07:00
Jun Wu
64585a5895 hgsql: disable conflicting features explicitly
Summary:
If hgsql is enabled, disable visibility and narrow-heads explicitly to avoid
surprises.

Reviewed By: markbt

Differential Revision: D21894320

fbshipit-source-id: 335cf92dc1c62e2801e7407b706f6fc5dd59d5b4
2020-06-10 19:29:21 -07:00
Jun Wu
ae58e90f07 prune: update visibility
Summary: Make `prune` remove visible heads. This affects tests.

Reviewed By: markbt

Differential Revision: D21894322

fbshipit-source-id: 7cfa102b1be72c83a2ccdbc2d396a74ec1de2cfe
2020-06-10 19:29:21 -07:00
Jun Wu
20ea1b6543 debugobsolete: update visibility
Summary: Make `debugobsolete` also update visibility. This affects many tests.

Reviewed By: markbt

Differential Revision: D21894310

fbshipit-source-id: eba6ecb07fdd8f5a13085434b303581ec5acf463
2020-06-10 19:29:21 -07:00
Durham Goode
823a1ca4a1 configs: prevent infinite loops in dynamicconfig generation
Summary:
There's an issue where hg foo could spawn hg dynamicconfig which could
spawn hg version (via the telemetry wrapper) which could spawn hg dynamicconfig.
If the config generation fails then this could enter an infiniteloop, since the
mtime of the file would not be updated appropriately, so we will always think we
need to regenerate.

Let's prevent this by setting an environment variable when spawning the
background process.

Reviewed By: quark-zju

Differential Revision: D21885363

fbshipit-source-id: ba4938c926d1219985813a521fec412097df4b4a
2020-06-10 19:29:15 -07:00