Commit Graph

22 Commits

Author SHA1 Message Date
John Reese
737849c9dd apply black 20.8b1 formatting update
Summary:
allow-large-files

black_any_style

Reviewed By: zertosh

Differential Revision: D24325133

fbshipit-source-id: b4afe80d1e8b2bc993f4b8e3822c02964df47462
2020-10-14 20:21:52 -07:00
Durham Goode
8f9c0899cc update: fix performance of updating to null commit
Summary:
When updating to the null commit, the logic that computes the update
distance was broken. The null commit is pre-resolved to -1, which when passed to
a revset raw gets resolved as the tip commit. In large repositories this can
take a long time and use a lot of memory, since it's computing the difference
between tip and null.

Let's fix it to not pass the raw rev number, and also to handle the case of a 0
distance update.

Reviewed By: quark-zju

Differential Revision: D23358402

fbshipit-source-id: 3b0a1fe1bbcb07effba4d0ab2c092e66bdc02e67
2020-08-26 22:14:59 -07:00
Durham Goode
9d2a577ac4 merge: backout checkunknownfiles fix
Summary:
This fix was originally meant to prevent doing checkunknown files when
it was clear there was no conflict. Unfortunatley, the data doesn't appear to
show it helped, and in some cases it definitely hurt it. Let's back it out for
now until we can do more investigation.

Reviewed By: StanislavGlebik

Differential Revision: D22574000

fbshipit-source-id: aeb644ecd6da046df17e6d10418a72363c1ee532
2020-07-16 10:45:14 -07:00
Durham Goode
f09839fdf9 merge: don't do checkunknown for files that we know are not untracked
Summary:
checkunknown is quite expensive since it has to read the contents of
every untracked file, which can be 10's of thousands of non-parallel stats and
reads. For files that don't exist in the working copy, it's just wasted work to
stat for the files at all. Status can efficiently tell us what files are
unknown, so let's use that to triage most "unknown" files to normal writes
before we even get to checkunknown.

The downside of this approach is that it makes an additional call to status,
which is not cached (only non-unknown+non-ignore+non-clean status calls are
cached). We could add more caching if this is a problem.

This doesn't help the case where a user might have 10k+ untracked files due to a
ctrl+c'd checkout, but we'll improve that in a future diff.

Reviewed By: quark-zju

Differential Revision: D22366758

fbshipit-source-id: b54fec113dc162f97a35e705ed083ddd14babe55
2020-07-06 22:10:56 -07:00
Durham Goode
c91dc5ac70 py3: fix merge._resolvetrivial
Summary: It depends on items() returning a list.

Reviewed By: quark-zju

Differential Revision: D22339205

fbshipit-source-id: 4691c981ba612ec9a00752cbcc57bf2272b59007
2020-07-02 09:05:13 -07:00
Xavier Deguillard
4d13ce1bcc remotefilelog: remove non Rust store code
Summary:
With the Rust stores being enabled by default in the code, time to actually
remove the code that wasn't using it. A lot of code still remains as the
treemanifest code still uses it. Migrating the treemanifest code to use the
Rust store would allow for even more code to be removed!

Reviewed By: DurhamG

Differential Revision: D21987918

fbshipit-source-id: 8e0becd4a1fb2ac81e26b8517d13e6d06ab06f65
2020-06-23 18:47:44 -07:00
Xavier Deguillard
c074611dee worker: remove the forkers
Summary:
Now that the workers are in Rust, we no longer need the forker version in
Python. For now, the Python LFS extension still uses the threaded worker so
keep this one for now, when that extension will be removed we can remove the
rest of the worker code.

In theory, not all repository would benefit from the Rust workers, but these
are not supported at FB due to not being remotefilelog based.

Reviewed By: DurhamG

Differential Revision: D21987295

fbshipit-source-id: d17b9730651671608cf13f7abe6a9bb32251e140
2020-06-23 18:47:44 -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
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
Mark Thomas
49166dbdfd format: apply latest Black formatting
Summary: Reformat using a newer version of Black.

Reviewed By: quark-zju

Differential Revision: D21426337

fbshipit-source-id: 1ac7f6e85a06feec0d41e9509eca09194f421a1d
2020-05-07 09:07:49 -07:00
Durham Goode
faced01356 tracing: add more trace values
Summary: This will help us debug slow commands

Reviewed By: xavierd

Differential Revision: D21075895

fbshipit-source-id: 3e7667bb0e4426d743841d8fda00fa4a315f0120
2020-04-22 15:35:17 -07:00
Xavier Deguillard
af1ab52527 merge: add a "rg" merge action
Summary:
When a file goes from being a symlink to a regular file, a regular update
action ("g") is used, and the Python code implicitely remove the symlink before
writing to it. In the Rust code, we don't and as a consequence write through
the symlink, not the intended behavior.

An alternative way of fixing this would be to perform an lstat(2) before
writing to a file, but the cost of doing that will be fairly high for a very
unlikely situation especially since the manifest diff can give us exactly this
information.

This whole merge code feels extremely fragile, so I'm definitively not sure if
I got all the places that needs updating :(.

Reviewed By: DurhamG

Differential Revision: D21082733

fbshipit-source-id: 4f36a67363915c9b67d5a0b290a226075a9f1d31
2020-04-19 22:48:19 -07:00
Xavier Deguillard
5184a72b56 merge: only enable rustworkers when remotefilelog is enabled too
Summary:
The Rust worker code will only work with remotefilelog, and when the Rust
ContentStore is enabled, make sure to not enable it if these 2 conditions
aren't met.

Reviewed By: quark-zju

Differential Revision: D21033428

fbshipit-source-id: c34c1b39ddb81be399463712216fa2cd68771f41
2020-04-15 16:16:30 -07:00
Xavier Deguillard
16f09d25a3 pyworker: add a retry backchannel to Python
Summary:
While failures in the Rust updater aren't expected, at least one valid case
requires requires retrying the operation in Python: old-style LFS pointers.
When these are stored in packfiles/indexedlog, only the Python code knows how
to deal with them, and thus the operation needs to be retried there.

Reviewed By: DurhamG

Differential Revision: D20603709

fbshipit-source-id: 7d24ba573f0ff540906d909f1b4440fd4d3469a6
2020-03-25 12:29:26 -07:00
Xavier Deguillard
20029d1bdc merge: disable Rust workers if in-memory merge is in progress
Summary: We don't really need the Rust workers for this, as we do not expect thousands of files to be changed during an in-memory merge.

Reviewed By: DurhamG

Differential Revision: D20495141

fbshipit-source-id: e72f8c4b01deee46ee72364dcd6716692c4103ab
2020-03-17 16:01:49 -07:00
Xavier Deguillard
d15b04d438 pyworker: handle symlinks and executable
Summary:
Symlinks are treated a bit differently from plain files, what is stored in the
ContentStore is the destination of the symlink, not it's content (well, the
content of a symlink really is it's destination).

For now, only unix platforms support symlinks, in reality this should be a
filesystem property as writing to ntfs-3g should have the same behavior as on
Windows.

For executable, we just need to mark the file as executable after writing to
it.

Reviewed By: quark-zju

Differential Revision: D20250943

fbshipit-source-id: 022dabc750125df32953a151df7da60db69b2cec
2020-03-11 01:13:55 -07:00
Xavier Deguillard
40bbe7b4da merge: add a Rust threaded file updater
Summary:
During `hg update`, Mercurial forks multiple processes to write files on disk
concurrently, this is done as fetching blobs from the content store, and
writing them to disk is CPU bound. Usually, threads would be the preferred way
of speeding up such process, but unfortunately, Python has GIL that severely
limit the available concurrency. So, multiple processes were chosen.

Unfortunately, the multi-process solution also brings a lot of other issues,
more recently, we've had cases where the connections to the server and memcache
had to be dropped after the fork. In some other cases, this caused deadlocks.
And the solution is not effective on Windows.

Now that Mercurial is getting more and more Rust, we could instead go back to
the threads solution by using them in Rust, and have Python just push work to
them, this is exactly what this change does.

Things that are left to be done, but I wanted to get a diff out first:
 - no file path audit
 - no file backup
 - no symlink creation
 - probably other things I'm missing

Reviewed By: quark-zju

Differential Revision: D20102888

fbshipit-source-id: d47829fd7818b97710586b9851880f178048e27b
2020-03-11 01:13:54 -07:00
Jun Wu
bfa9485f90 py3: merge: fix some encoding issues
Summary: This affects mergestate and updatestate.

Reviewed By: farnz

Differential Revision: D19615836

fbshipit-source-id: bc549c71a5ba5ba9d2069deb1e77cb580f210ba2
2020-01-29 07:45:18 -08:00
Mark Thomas
82715fd2ea py3: iter{keys,values,items} -> pycompat.iter{keys,values,items}
Reviewed By: quark-zju

Differential Revision: D19608323

fbshipit-source-id: dd186ef16d6422a56af41fcaa850d9838ae9a240
2020-01-28 16:27:28 -08:00
Mateusz Kwapich
7e0e170db9 rename fbconduit extension to fbscmquery
Summary:
This is mostly result of:
```
  find . -type f -exec sed -i "s/fbconduit/fbscmquery/g" {} \;

```
`fbconduit` extension doesn't use conduit anymore so the name is just misleading.

Reviewed By: ikostia

Differential Revision: D18748843

fbshipit-source-id: 0d59e61ba7a96d86d9d1333d81255108cc3141bc
2019-12-13 03:23:25 -08:00
Jessie Liu
a219882211 Log manual merged files to dev command timers
Summary: Log files that required manual merge during a rebase to dev command timers so we have an idea of how often they happen and on which files

Reviewed By: simpkins

Differential Revision: D18648175

fbshipit-source-id: 83ffe6d9177ca00b8fd1095745c585186bc2c8e9
2019-12-03 20:12:16 -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