Update the merger recent dict when saving the repo state

This will have the effect of only saving or restoring the repo state
once in the merger.

The "recent" dictionary is consulted by the merger before it merges
each change to find upon which change the merge should be based.
If it contains an entry for a project-branch, that entry is used.
Otherwise, it resets the repo and finds the branch tip.

By populating it when we save the repo state, we can ensure that
a repo is reset only once during a merge, and since the repo_state
dict is only updated when there is no recent entry for a project-branch,
the repo state is only updated once per project as well.

The same applies to restoring the repo state -- the restore is
performed right before the save, so by fully populating recent
after the restore, we will only restore a repo state once.

Change-Id: I6fbdf4ec9be303bb6b90caa724ee2c813673a431
1 file changed