def get_repository_metadata_by_changeset_revision(app, id, changeset_revision):
 sa_session = app.model.context.current
 all_metadata_records = sa_session.query(app.model.RepositoryMetadata).filter(and_((app.model.RepositoryMetadata.table.c.repository_id == app.security.decode_id(id)), (app.model.RepositoryMetadata.table.c.changeset_revision == changeset_revision))).order_by(app.model.RepositoryMetadata.table.c.update_time.desc()).all()
 if (len(all_metadata_records) > 1):
  for repository_metadata in all_metadata_records[1:]:
   sa_session.delete(repository_metadata)
   sa_session.flush()
  return all_metadata_records[0]
 elif all_metadata_records:
  return all_metadata_records[0]
 return None

def get_repository_metadata_by_changeset_revision ( app , id , changeset_revision ) : sa_session = app . model . context . current all_metadata_records = sa_session . query ( app . model . RepositoryMetadata ) . filter ( and_ ( ( app . model . RepositoryMetadata . table . c . repository_id == app . security . decode_id ( id ) ) , ( app . model . RepositoryMetadata . table . c . changeset_revision == changeset_revision ) ) ) . order_by ( app . model . RepositoryMetadata . table . c . update_time . desc ( ) ) . all ( ) if ( len ( all_metadata_records ) > 1 ) : for repository_metadata in all_metadata_records [ 1 : ] : sa_session . delete ( repository_metadata ) sa_session . flush ( ) return all_metadata_records [ 0 ] elif all_metadata_records : return all_metadata_records [ 0 ] return None
get metadata for a specified repository change set from the database .