p4fastimport: fix resetting file flags
ClosedPublic

Authored by dsp on Oct 3 2017, 1:09 AM.

Details

Summary

When a file changed to include a flag and then the flag is removed we did not
correctly remove the flag. We now correctly set flags for all revisions.

Test Plan

python run-tests.py test-p4fastimport-import-modes.t

Diff Detail

Repository
rFBHGX Facebook Mercurial Extensions
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
dsp created this revision.Oct 3 2017, 1:09 AM
dsp edited the test plan for this revision. (Show Details)Oct 3 2017, 1:10 AM
dsp added reviewers: durham, quark.
quark accepted this revision.Oct 3 2017, 9:54 PM
This revision is now accepted and ready to land.Oct 3 2017, 9:54 PM
hollisb added a subscriber: hollisb.Oct 4 2017, 1:51 PM

Previously, flags were only stored in fileinfo when a file had some (either x or l). This patch now stores flags for all files; they're just almost always empty. In an import of 48K files, that's a lot of memory storage for nothing. There's also runtime overhead, because now we're always calling mf.setflag().

Alternative:

Instead of changing how we create fileinfo, change how we consume fileinfo. Call mf.setflags() only if mf.flags() != info['flags']. Missing flags are implicitly empty flags.

Less memory consumption, and I would hope faster too.

This revision was automatically updated to reflect the committed changes.