Page MenuHomePhabricator

p4fastimport: fix resetting file flags

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



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 test-p4fastimport-import-modes.t

Diff Detail

rFBHGX Facebook Mercurial Extensions
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

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().


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.