Page MenuHomePhabricator

p4fastimport: allow sync commits only when imported repository is up-to-date

Authored by dsp on Dec 21 2017, 8:18 PM.



Previously we allowed a sync commit to happen at any time, but imported the
full repository to bring it into sync. This is slow for very large repositories
and might be accidentally triggered. We change this behavior to only do a sync
commit if only the imported client changed but nothing else.

Test Plan
cd tests
python ../../hg-crew/tests/ test-p4fastimport-*.t test-check*.t

Diff Detail

Lint Skipped
Unit Tests Skipped

Event Timeline

dsp created this revision.Dec 21 2017, 8:18 PM
kaleyh requested changes to this revision.Dec 22 2017, 5:37 PM
kaleyh added a subscriber: kaleyh.
kaleyh added inline comments.

What client will it use if we fall back to fast import ? Since CL 5 touches files that are not in the current client spec, will fast import be able to update the repo to CL5?

This revision now requires changes to proceed.Dec 22 2017, 5:37 PM
dsp added inline comments.Jan 2 2018, 2:37 PM

Yes, using the old clientspec it will be able to update it.

dsp requested review of this revision.Jan 2 2018, 2:38 PM
dsp added inline comments.Jan 2 2018, 2:42 PM

In case p4fastimport uses the new client-spec, it behaves like before: if a file changes it will happily included it. So what we want to do is: use the new-spec only after p4syncimport changed. Maybe in an upcoming change we can save information about the clientspec in Mercurial to automatically detect a change in the p4fastimport case

kaleyh accepted this revision.Jan 3 2018, 4:56 PM
kaleyh added inline comments.

that can be a good idea

This revision is now accepted and ready to land.Jan 3 2018, 4:56 PM