Merge "Mark ALREADY_MERGED changes as merged in the DB and run hooks" into stable-2.7