def get_previous_repository_reviews(app, repository, changeset_revision):
 repo = hg_util.get_repo_for_repository(app, repository=repository, repo_path=None, create=False)
 reviewed_revision_hashes = [review.changeset_revision for review in repository.reviews]
 previous_reviews_dict = odict()
 for changeset in hg_util.reversed_upper_bounded_changelog(repo, changeset_revision):
  previous_changeset_revision = str(repo.changectx(changeset))
  if (previous_changeset_revision in reviewed_revision_hashes):
   (previous_rev, previous_changeset_revision_label) = hg_util.get_rev_label_from_changeset_revision(repo, previous_changeset_revision)
   revision_reviews = get_reviews_by_repository_id_changeset_revision(app, app.security.encode_id(repository.id), previous_changeset_revision)
   previous_reviews_dict[previous_changeset_revision] = dict(changeset_revision_label=previous_changeset_revision_label, reviews=revision_reviews)
 return previous_reviews_dict

def get_previous_repository_reviews ( app , repository , changeset_revision ) : repo = hg_util . get_repo_for_repository ( app , repository = repository , repo_path = None , create = False ) reviewed_revision_hashes = [ review . changeset_revision for review in repository . reviews ] previous_reviews_dict = odict ( ) for changeset in hg_util . reversed_upper_bounded_changelog ( repo , changeset_revision ) : previous_changeset_revision = str ( repo . changectx ( changeset ) ) if ( previous_changeset_revision in reviewed_revision_hashes ) : ( previous_rev , previous_changeset_revision_label ) = hg_util . get_rev_label_from_changeset_revision ( repo , previous_changeset_revision ) revision_reviews = get_reviews_by_repository_id_changeset_revision ( app , app . security . encode_id ( repository . id ) , previous_changeset_revision ) previous_reviews_dict [ previous_changeset_revision ] = dict ( changeset_revision_label = previous_changeset_revision_label , reviews = revision_reviews ) return previous_reviews_dict
return an ordered dictionary of repository reviews up to and including the received changeset revision .