mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 16:57:49 +03:00
5ceeb5311d
Summary: Previously, dirsync wraps `repo.commit`, requires an on-disk working copy, and dirstate to work properly. This diff updates dirsync to wrap `repo.commitctx` instead, do commit edits purely in memory, then sync the commit back to disk. It makes dirsync compatible with absorb and in-memory rebase (and potentially other things like drawdag, if drawdag's context APIs are improved). To sync the changes made in-memory back to the filesystem, a dirstate callback is added to write back mirrored files from commit to disk. This works for both amend and absorb so the special wrapper about amend is dropped. It is also optimal for absorb, because it only writes the mirrored files once for the "final" commit, instead of writing the files for each commit in the stack. Some `O(N^2)`s (N: len(status)) complexities were avoided: - `applytomirrors` was called N times. - `allchanges = set(status.modified + status.removed + status.added)` in `applytomirrors` was O(N). - `sourcepath in status.removed` in `applytomirrors` was O(N). - `mirrorpath in status.removed` in `applytomirrors` was O(N). Note there is still a suboptimal complexity of `getmirrors` called per changed path, `O(N*M)` (N: len(status), M: len(dirsync_conig)). That will be addressed in a later diff. Reviewed By: DurhamG Differential Revision: D26726479 fbshipit-source-id: 482c6c830ab65cc0d9cd569a51ec610a1dac49cc |
||
---|---|---|
.. | ||
contrib | ||
distutils_rust | ||
doc | ||
edenscm | ||
edenscmnative | ||
exec | ||
hgcache_size_logger | ||
i18n | ||
lib | ||
newdoc | ||
pystubs | ||
slides | ||
tests | ||
.editorconfig | ||
.flake8 | ||
.gitignore | ||
COPYING | ||
gen_version.py | ||
hgeditor | ||
Makefile | ||
README.rst | ||
setup3.py | ||
setup.py |
Mercurial ========= Mercurial is a fast, easy to use, distributed revision control tool for software developers. Basic install:: $ make # see install targets $ make install # do a system-wide install $ hg debuginstall # sanity-check setup $ hg # see help Running without installing:: $ make local # build for inplace usage $ ./hg --version # should show the latest version See https://mercurial-scm.org/ for detailed installation instructions, platform-specific notes, and Mercurial user information.