// ReversedChangeset returns changeset with all changes inversed
ReversedChangeset returns changeset with all changes inversed
// ReversedChangeset returns changeset with all changes inversed
func (u *PackageChangeset) ReversedChanges() []PackageUpdate {
	changes := make([]PackageUpdate, len(u.Changes))
	for i, c := range u.Changes {
		update := PackageUpdate{
			From:   c.To,
			To:     c.From,
			Labels: c.Labels,
		}
		if c.ConfigPackage != nil {
			update.ConfigPackage = &PackageUpdate{
				From:   c.ConfigPackage.To,
				To:     c.ConfigPackage.From,
				Labels: c.ConfigPackage.Labels,
			}
		}
		changes[i] = update
	}
	return changes
}
func ( u * PackageChangeset ) ReversedChanges ( ) [ ] PackageUpdate { changes := make ( [ ] PackageUpdate , len ( u . Changes ) ) for i , c := range u . Changes { update := PackageUpdate { From : c . To , To : c . From , Labels : c . Labels , } if c . ConfigPackage != nil { update . ConfigPackage = & PackageUpdate { From : c . ConfigPackage . To , To : c . ConfigPackage . From , Labels : c . ConfigPackage . Labels , } } changes [ i ] = update } return changes }
ReversedChangeset returns changeset with all changes inversed
ReversedChangeset returns changeset with all changes inversed