func (b *Bundle) MergeImport(i interface{}) (bool, error) {
	existing := i.(*Bundle)
	if b.ID != existing.ID {
		return false, errors.New("IDs don't match")
	}
	if !b.Created.Equal(existing.Created) {
		return false, errors.New("Created timestamps don't match")
	}
	if b.Owner != existing.Owner {
		return false, errors.New("Cannot change bundle ownership")
	}
	if b.Imported.IsZero() || existing.Imported.IsZero() {
		return false, errors.New("not an import")
	}
	b.Rev = existing.Rev
	if b.Modified.After(existing.Modified) {
		// The new version is newer than the existing one, so update
		return true, nil
	}
	// The new version is older, so we need to use the version we just read
	b.Name = existing.Name
	b.Description = existing.Description
	b.Modified = existing.Modified
	b.Imported = existing.Imported
	return false, nil
}
// MergeImport attempts to merge i into b, returning true if a merge took place,
// or false if no merge was necessary.
MergeImport attempts to merge i into b, returning true if a merge took place,
or false if no merge was necessary.
// MergeImport attempts to merge i into b returning true if a merge took place // or false if no merge was necessary .
func (b *Bundle) MergeImport(i interface{}) (bool, error) {
	existing := i.(*Bundle)
	if b.ID != existing.ID {
		return false, errors.New("IDs don't match")
	}
	if !b.Created.Equal(existing.Created) {
		return false, errors.New("Created timestamps don't match")
	}
	if b.Owner != existing.Owner {
		return false, errors.New("Cannot change bundle ownership")
	}
	if b.Imported.IsZero() || existing.Imported.IsZero() {
		return false, errors.New("not an import")
	}
	b.Rev = existing.Rev
	if b.Modified.After(existing.Modified) {
		return true, nil
	}
	b.Name = existing.Name
	b.Description = existing.Description
	b.Modified = existing.Modified
	b.Imported = existing.Imported
	return false, nil
}
func ( b * Bundle ) MergeImport ( i interface { } ) ( bool , error ) { existing := i . ( * Bundle ) if b . ID != existing . ID { return false , errors . New ( " " ) } if ! b . Created . Equal ( existing . Created ) { return false , errors . New ( " " ) } if b . Owner != existing . Owner { return false , errors . New ( " " ) } if b . Imported . IsZero ( ) || existing . Imported . IsZero ( ) { return false , errors . New ( " " ) } b . Rev = existing . Rev if b . Modified . After ( existing . Modified ) { return true , nil } b . Name = existing . Name b . Description = existing . Description b . Modified = existing . Modified b . Imported = existing . Imported return false , nil }
MergeImport attempts to merge i into b, returning true if a merge took place,
or false if no merge was necessary.
MergeImport attempts to merge i into b returning true if a merge took place or false if no merge was necessary .
// The new version is newer than the existing one, so update // The new version is older, so we need to use the version we just read