321: def resolve_id(rev, id)
322:
323: if rev
324: possibles = find_revision(rev)
325:
326: if possibles.length > 1
327: UI.failure :constraint, "More than one revision matches that name:"
328: possibles.each do |rev, id|
329: puts "#{rev} -- #{id}"
330: end
331: elsif possibles.length == 1
332:
333: id = possibles[0][1]
334: else
335: UI.failure :search, "Could not find the requested revision #{rev}"
336: end
337: elsif id
338: if not find_meta_data(id)
339: UI.failure :input, "Given id #{id} is not in the repository"
340: id = nil
341: end
342: else
343: id = self['Path'].pop
344: end
345:
346: return id
347: end