dirstate update file API

Closed Pulkit Goyal requested to merge topic/default/dirstate-update-file-API into branch/default

Also introduces another function so should be split.

Merge request reports