ported computeRelativeNamesAfterRenaming from hudson.model.Items.