Commit Graph

5 Commits

Author SHA1 Message Date
Mark Thomas
9d6b58b5cd localrepo: add automigrate mechanism
Summary:
Generalise the `migrateonpull` mechanism of `treestate` into a generic
`automigrate` step that is invoked at the start of pulling.  This will be used
for other migrations in the future.

Reviewed By: liubov-dmitrieva

Differential Revision: D13608718

fbshipit-source-id: d558dc21176a6b8d786836d06414e3fc88a20d47
2019-01-15 07:05:46 -08:00
Mark Thomas
f47bd8c33d treestate: move treedirstate to core
Summary:
Parts of the treedirstate implementation were left in the extension.  Since
treestate is now in core, and the two are intertwined, treedirstate should be
in core, too.

In doing so:
- Change the garbage collection behaviour to match that of treestate.
- Use the treestate config options for configuring repacking and garbage
  collection.
- Make more of the code common.

Reviewed By: quark-zju

Differential Revision: D10258265

fbshipit-source-id: 89e82bc7662a3d1251fa9886751897cfc46cd66a
2018-10-10 03:53:20 -07:00
Jun Wu
ef31cb9a4b treestate: filter nonnormalset etc when downgrade
Summary:
Treestate tracks untracked files while treedirstate doesn't. The
treedirstate importmap logic changed by D7912557 will remove untracked files
from the tree. But it missed other places like nonnormalset, otherparentset
and copymap. This patch changes it to make sure paths in those sets are
tracked.

Reviewed By: DurhamG

Differential Revision: D8560022

fbshipit-source-id: 8ac39bfe634804ea94125fe42e11382acae35d94
2018-06-22 13:20:49 -07:00
Jun Wu
43abc77bfb fsmonitor: change state._usetreestate to a property
Summary:
Previously `state._usetreestate` is a value set in `state.__init__`. In the
treestate migration case, `state._usetreestate` needs to change accordingly.
Therefore let's use a property to always calculate that value from the
source of truth.

Reviewed By: DurhamG

Differential Revision: D8560019

fbshipit-source-id: a313f603275321b959502e7f2c528c4b54a11ce9
2018-06-22 13:20:49 -07:00
Jun Wu
2fad0cab8b treestate: add tests about problems in downgrade
Summary: Reveal 2 issues regarding on treestate downgrade.

Reviewed By: DurhamG

Differential Revision: D8560020

fbshipit-source-id: 950507a3811387203c0c4b1177dbb69a7393d72c
2018-06-22 13:20:49 -07:00