Trees Indices Help
Trac
Package trac :: Package versioncontrol :: Module cache :: Class CachedRepository

Class CachedRepository

source code

 object --+ 
 | 
api.Repository --+
 |
 CachedRepository
Known Subclasses:

Instance Methods
__init__(self, env, repos, log)
Initialize a repository. source code
close(self)
Close the connection to the repository. source code
db_rev(self, rev)
Convert a revision to its representation in the database. source code
get_base(self)
Return the name of the base repository for this repository. source code
get_changes(self, old_path, old_rev, new_path, new_rev, ignore_ancestry=1)
Generates changes corresponding to generalized diffs. source code
get_changeset(self, rev)
Retrieve a Changeset corresponding to the given revision rev. source code
get_changeset_uid(self, rev)
Return a globally unique identifier for the ''rev'' changeset. source code
get_changesets(self, start, stop)
Generate Changeset belonging to the given time period (start, stop). source code
get_node(self, path, rev=None)
Retrieve a Node from the repository at the given path. source code
get_oldest_rev(self)
Return the oldest revision stored in the repository. source code
get_path_history(self, path, rev=None, limit=None)
Retrieve all the revisions containing this path. source code
get_path_url(self, path, rev)
Return the repository URL for the given path and revision. source code
get_quickjump_entries(self, rev)
Generate a list of interesting places in the repository. source code
get_youngest_rev(self)
Return the youngest revision in the repository. source code
has_node(self, path, rev=None)
Tell if there's a node at the specified (path,rev) combination. source code
metadata(self, db)
Retrieve data for the cached metadata attribute. source code
next_rev(self, rev, path='')
Return the revision immediately following the specified revision. source code
normalize_path(self, path)
Return a canonical representation of path in the repos. source code
normalize_rev(self, rev)
Return a (unique) canonical representation of a revision. source code
previous_rev(self, rev, path='')
Return the revision immediately preceding the specified revision. source code
rev_db(self, rev)
Convert a revision from its representation in the database. source code
rev_older_than(self, rev1, rev2)
Provides a total order over revisions. source code
sync(self, feedback=None, clean=False)
Perform a sync of the repository cache, if relevant. source code
sync_changeset(self, rev)
Resync the repository cache for the given rev, if relevant. source code

Inherited from api.Repository : can_view , clear , display_rev , get_youngest_rev_in_cache , short_rev

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables
has_linear_changesets = False
Properties

Inherited from api.Repository : oldest_rev , youngest_rev

Inherited from object: __class__

Method Details

__init__(self, env, repos, log)
(Constructor)

source code
Initialize a repository.
Parameters:
  • name - a unique name identifying the repository, usually a type-specific prefix followed by the path to the repository.
  • params - a dict of parameters for the repository. Contains the name of the repository under the key "name" and the surrogate key that identifies the repository in the database under the key "id".
  • log - a logger instance.
Overrides: object.__init__
(inherited documentation)

close(self)

source code
Close the connection to the repository.
Overrides: api.Repository.close
(inherited documentation)

get_base(self)

source code

Return the name of the base repository for this repository.

This function returns the name of the base repository to which scoped repositories belong. For non-scoped repositories, it returns the repository name.

Overrides: api.Repository.get_base
(inherited documentation)

get_changes(self, old_path, old_rev, new_path, new_rev, ignore_ancestry=1)

source code

Generates changes corresponding to generalized diffs.

Generator that yields change tuples (old_node, new_node, kind, change) for each node change between the two arbitrary (path,rev) pairs.

The old_node is assumed to be None when the change is an ADD, the new_node is assumed to be None when the change is a DELETE.

Overrides: api.Repository.get_changes
(inherited documentation)

get_changeset(self, rev)

source code
Retrieve a Changeset corresponding to the given revision rev.
Overrides: api.Repository.get_changeset
(inherited documentation)

get_changeset_uid(self, rev)

source code

Return a globally unique identifier for the ''rev'' changeset.

Two changesets from different repositories can sometimes refer to the ''very same'' changeset (e.g. the repositories are clones).

Overrides: api.Repository.get_changeset_uid
(inherited documentation)

get_changesets(self, start, stop)

source code
Generate Changeset belonging to the given time period (start, stop).
Overrides: api.Repository.get_changesets
(inherited documentation)

get_node(self, path, rev=None)

source code

Retrieve a Node from the repository at the given path.

A Node represents a directory or a file at a given revision in the repository. If the rev parameter is specified, the Node corresponding to that revision is returned, otherwise the Node corresponding to the youngest revision is returned.

Overrides: api.Repository.get_node
(inherited documentation)

get_oldest_rev(self)

source code
Return the oldest revision stored in the repository.
Overrides: api.Repository.get_oldest_rev
(inherited documentation)

get_path_history(self, path, rev=None, limit=None)

source code

Retrieve all the revisions containing this path.

If given, rev is used as a starting point (i.e. no revision ''newer'' than rev should be returned). The result format should be the same as the one of Node.get_history()

Overrides: api.Repository.get_path_history
(inherited documentation)

get_path_url(self, path, rev)

source code

Return the repository URL for the given path and revision.

The returned URL can be None, meaning that no URL has been specified for the repository, an absolute URL, or a scheme-relative URL starting with //, in which case the scheme of the request should be prepended.

Overrides: api.Repository.get_path_url
(inherited documentation)

get_quickjump_entries(self, rev)

source code

Generate a list of interesting places in the repository.

rev might be used to restrict the list of available locations, but in general it's best to produce all known locations.

The generated results must be of the form (category, name, path, rev).

Overrides: api.Repository.get_quickjump_entries
(inherited documentation)

get_youngest_rev(self)

source code
Return the youngest revision in the repository.
Overrides: api.Repository.get_youngest_rev
(inherited documentation)

has_node(self, path, rev=None)

source code

Tell if there's a node at the specified (path,rev) combination.

When rev is None, the latest revision is implied.

Overrides: api.Repository.has_node
(inherited documentation)

metadata(self, db)

source code
Retrieve data for the cached metadata attribute.
Decorators:
  • @cached('_metadata_id')

next_rev(self, rev, path='')

source code
Return the revision immediately following the specified revision.
Overrides: api.Repository.next_rev
(inherited documentation)

normalize_path(self, path)

source code
Return a canonical representation of path in the repos.
Overrides: api.Repository.normalize_path
(inherited documentation)

normalize_rev(self, rev)

source code

Return a (unique) canonical representation of a revision.

It's up to the backend to decide which string values of rev (usually provided by the user) should be accepted, and how they should be normalized. Some backends may for instance want to match against known tags or branch names.

In addition, if rev is None or '', the youngest revision should be returned.

Overrides: api.Repository.normalize_rev
(inherited documentation)

previous_rev(self, rev, path='')

source code
Return the revision immediately preceding the specified revision.
Overrides: api.Repository.previous_rev
(inherited documentation)

rev_older_than(self, rev1, rev2)

source code

Provides a total order over revisions.

Return True if rev1 is older than rev2, i.e. if rev1 comes before rev2 in the revision sequence.

Overrides: api.Repository.rev_older_than
(inherited documentation)

sync(self, feedback=None, clean=False)

source code

Perform a sync of the repository cache, if relevant.

If given, rev_callback must be a callable taking a rev parameter. The backend will call this function for each rev it decided to synchronize, once the synchronization changes are committed to the cache. When clean is True, the cache is cleaned first.

Overrides: api.Repository.sync
(inherited documentation)

sync_changeset(self, rev)

source code

Resync the repository cache for the given rev, if relevant.

Returns a "metadata-only" changeset containing the metadata prior to the resync, or None if the old values cannot be retrieved (typically when the repository is not cached).

Overrides: api.Repository.sync_changeset
(inherited documentation)

Property Details

scope

Get Method:
unreachable(self)

Trees Indices Help
Trac

AltStyle によって変換されたページ (->オリジナル) /