dirstate-map: factor out the change to _dirs and _alldirs on adding
This logic is complicated enough to deserves its own function. So it now does.
This will make it easier to reuse that logic in later changeset.
Differential Revision: https://phab.mercurial-scm.org/D11129
dirstate-item: introduce a `dm_otherparent` property
See inline documentation for details.
Differential Revision: https://phab.mercurial-scm.org/D11124