If build.xml detects the presence of a V2 relying-party.xml but does not detect idp.properties, it determines that we're in a one-time upgrade-from-V2 scenario.
Note that after such an upgrade, this condition will no longer be true and things will look like a V3/V3 upgrade, which is reasonable.
One odd bit of behaviour is that in the V2 case it installs and then deletes the file conf/credentials.xml so that it is not present after a V2 upgrade. It will however reappear the next time that install is run, because that will not be a V2 upgrade.
This is confusing, or at least it was to me. I think the least surprising option is to remove the deletion of this file from the V2 upgrade process, so that it is always present even if unused. It has commentary to this effect already, so that should be fine.