def get_metadata_revisions(repository, repo, sort_revisions=True, reverse=False, downloadable=True):
 if downloadable:
  metadata_revisions = repository.downloadable_revisions
 else:
  metadata_revisions = repository.metadata_revisions
 changeset_tups = []
 for repository_metadata in metadata_revisions:
  ctx = hg_util.get_changectx_for_changeset(repo, repository_metadata.changeset_revision)
  if ctx:
   rev = ('%04d' % ctx.rev())
  else:
   rev = (-1)
  changeset_tups.append((rev, repository_metadata.changeset_revision))
 if sort_revisions:
  changeset_tups.sort(key=itemgetter(0), reverse=reverse)
 return changeset_tups

def get_metadata_revisions ( repository , repo , sort_revisions = True , reverse = False , downloadable = True ) : if downloadable : metadata_revisions = repository . downloadable_revisions else : metadata_revisions = repository . metadata_revisions changeset_tups = [ ] for repository_metadata in metadata_revisions : ctx = hg_util . get_changectx_for_changeset ( repo , repository_metadata . changeset_revision ) if ctx : rev = ( '%04d' % ctx . rev ( ) ) else : rev = ( - 1 ) changeset_tups . append ( ( rev , repository_metadata . changeset_revision ) ) if sort_revisions : changeset_tups . sort ( key = itemgetter ( 0 ) , reverse = reverse ) return changeset_tups
return a list of changesets for the provided repository .