dirstate: add a basic update_file function

15 jobs for topic/default/dirstate-refactor in 29 minutes and 13 seconds (queued for 3 seconds)