Returns revisions as a slice of ancestor revids, from the parent to the target ancestor.
(toAncestorRevID string)
| 159 | |
| 160 | // Returns revisions as a slice of ancestor revids, from the parent to the target ancestor. |
| 161 | func (revisions Revisions) parseAncestorRevisions(toAncestorRevID string) []string { |
| 162 | start, ids := splitRevisionList(revisions) |
| 163 | if ids == nil || len(ids) < 2 { |
| 164 | return nil |
| 165 | } |
| 166 | result := make([]string, 0) |
| 167 | |
| 168 | // Start at the parent, end at toAncestorRevID |
| 169 | start = start - 1 |
| 170 | for i := 1; i < len(ids); i++ { |
| 171 | revID := fmt.Sprintf("%d-%s", start, ids[i]) |
| 172 | result = append(result, revID) |
| 173 | if revID == toAncestorRevID { |
| 174 | break |
| 175 | } |
| 176 | start-- |
| 177 | } |
| 178 | return result |
| 179 | } |
| 180 | |
| 181 | func (attachments AttachmentsMeta) ShallowCopy() AttachmentsMeta { |
| 182 | if attachments == nil { |