l.c.i.r.IRevisionSet(Interface) : interface documentation

Part of lp.code.interfaces.revision View In Hierarchy

The set of all revisions.
Method getByRevisionId Find a revision by revision_id.
Method onlyPresent Return the revision ids from revids that are present.
Method new Create a new Revision with the given revision ID.
Method newFromBazaarRevisions Create new Revisions from the given Bazaar Revisions.
Method acquireRevisionAuthors Return a dict of RevisionAuthors with the specified names.
Method getTipRevisionsForBranches Get the tip branch revisions for the specified branches.
Method getRecentRevisionsForProduct Get the revisions for product created within so many days.
Method getRevisionsNeedingKarmaAllocated Get the revisions needing karma allocated.
Method getPublicRevisionsForPerson Get the public revisions for the person or team specified.
Method getPublicRevisionsForProduct Get the public revisions for the product specified.
Method getPublicRevisionsForProjectGroup Get the public revisions for the project group specified.
Method updateRevisionCacheForBranch Update the RevisionCache table with the revisions from the branch.
Method pruneRevisionCache Remove old rows from the RevisionCache.
def getByRevisionId(revision_id):
Find a revision by revision_id.

None if the revision is not known.

def onlyPresent(revids):
Return the revision ids from revids that are present.
def new(revision_id, log_body, revision_date, revision_author, parent_ids, properties):
Create a new Revision with the given revision ID.
def newFromBazaarRevisions(revision_batch):
Create new Revisions from the given Bazaar Revisions.

This method allows us to insert Revisions in bulk, which is important for larger branches.

def acquireRevisionAuthors(names):
Return a dict of RevisionAuthors with the specified names.

If a RevisionAuthor is not present in the database, it is created first.

def getTipRevisionsForBranches(branches):
Get the tip branch revisions for the specified branches.

The revision_authors are prejoined in to reduce the number of database queries issued.

ReturnsResultSet containing Revision or None if no matching revisions found.
def getRecentRevisionsForProduct(product, days):
Get the revisions for product created within so many days.

In order to get the time the revision was actually created, the time extracted from the revision properties is used. While this may not be 100% accurate, it is much more accurate than using date created.

ReturnsResultSet containing tuples of (Revision, RevisionAuthor)
def getRevisionsNeedingKarmaAllocated(limit=None):

Get the revisions needing karma allocated.

Under normal circumstances karma is allocated for revisions by the branch scanner as it is scanning the revisions.

There are a number of circumstances where this doesn't happen though:
  • The revision author is not linked to a Launchpad person
  • The branch is +junk
ReturnsA ResultSet containing revisions where: * karma not allocated * revision author linked to a Launchpad person * revision in a branch associated with a product
def getPublicRevisionsForPerson(person, day_limit=30):
Get the public revisions for the person or team specified.
ParameterspersonA person or team.
day_limitDefines a time boundary for the revision_date, where (now - day_limit) < revision_date <= now.
ReturnsResultSet containing all revisions that are in a public branch somewhere where the person is the revision author, or the revision author is in the team, where the revision_date is within day_limit number of days of now. The results are ordered with the most recent revision_date first.
def getPublicRevisionsForProduct(product, day_limit=30):
Get the public revisions for the product specified.
ParametersproductA valid Product.
day_limitDefines a time boundary for the revision_date, where (now - day_limit) < revision_date <= now.
ReturnsResultSet containing all revisions that are in a public branch associated with the product, where the revision_date is within day_limit number of days of now. The results are ordered with the most recent revision_date first.
def getPublicRevisionsForProjectGroup(projectgroup, day_limit=30):
Get the public revisions for the project group specified.
ParametersprojectgroupA valid ProjectGroup.
day_limitDefines a time boundary for the revision_date, where (now - day_limit) < revision_date <= now.
ReturnsResultSet containing all revisions that are in a public branch associated with a product that is associated with the project, where the revision_date is within day_limit number of days of now. The results are ordered with the most recent revision_date first.
def updateRevisionCacheForBranch(branch):
Update the RevisionCache table with the revisions from the branch.

Make sure that there is a reference in the RevisionCache table for all revisions that are less than 30 days old that match the product or source package for the branch.

def pruneRevisionCache(limit):
Remove old rows from the RevisionCache.

All rows where the revision date is older than 30 days from now are removed.

ParameterslimitRemove at most limit rows at once.
API Documentation for Launchpad, generated by pydoctor at 2019-07-19 00:00:17.