dirstatemap: move a multiple simple functions in the common class
These are small and simple, lets factor them out.
Differential Revision: https://phab.mercurial-scm.org/D11567
{
"conduit_uri": "https://phab.mercurial-scm.org/api",
"phabricator.uri": "https://phab.mercurial-scm.org/",
"repository.callsign": "HG",
"arc.land.onto.default": "@",
"base": "hg:.^"
}