Package trac :: Package versioncontrol :: Module api :: Class RepositoryManager

Class RepositoryManager

source code

    object --+    
             |    
core.Component --+
                 |
                RepositoryManager

Version control system manager.
Nested Classes

Inherited from core.Component: __metaclass__

Instance Methods
 
repositories_section(...)
One of the alternatives for registering new repositories is to populate the [repositories] section of the trac.ini.
source code
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
pre_process_request(self, req, handler) source code
 
post_process_request(self, req, template, data, content_type) source code
 
get_resource_realms(self) source code
 
get_resource_description(self, resource, format=None, **kwargs) source code
 
get_resource_url(self, resource, href, **kwargs) source code
 
resource_exists(self, resource) source code
 
get_repositories(self)
Retrieve repositories specified in TracIni.
source code
 
get_htdocs_dirs(self) source code
 
get_templates_dirs(self) source code
 
get_supported_types(self)
Return the list of supported repository types.
source code
 
get_repositories_by_dir(self, directory)
Retrieve the repositories based on the given directory.
source code
 
get_repository_id(self, reponame)
Return a unique id for the given repository name.
source code
 
get_repository(self, reponame)
Retrieve the appropriate Repository for the given repository name.
source code
 
get_repository_by_path(self, path)
Retrieve a matching Repository for the given path.
source code
 
get_default_repository(self, context)
Recover the appropriate repository from the current context.
source code
 
get_all_repositories(self)
Return a dictionary of repository information, indexed by name.
source code
 
get_real_repositories(self)
Return a set of all real repositories (i.e.
source code
 
reload_repositories(self)
Reload the repositories from the providers.
source code
 
notify(self, event, reponame, revs)
Notify repositories and change listeners about repository events.
source code
 
shutdown(self, tid=None)
Free Repository instances bound to a given thread identifier
source code
 
read_file_by_path(self, path)
Read the file specified by path
source code

Inherited from core.Component: __repr__

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

Static Methods

Inherited from core.Component: implements

Class Variables
  changeset_realm = 'changeset'
  source_realm = 'source'
  repository_realm = 'repository'
  default_repository_type = <Option [versioncontrol] 'default_re...
Properties
  connectors
List of components that implement ~trac.versioncontrol.api.IRepositoryConnector
  providers
List of components that implement ~trac.versioncontrol.api.IRepositoryProvider
  change_listeners
List of components that implement ~trac.versioncontrol.api.IRepositoryChangeListener

Inherited from object: __class__

Method Details

repositories_section(...)

source code 

One of the alternatives for registering new repositories is to populate the [repositories] section of the trac.ini.

This is especially suited for setting up convenience aliases, short-lived repositories, or during the initial phases of an installation.

See [TracRepositoryAdmin#ReposTracIni TracRepositoryAdmin] for details about the format adopted for this section and the rest of that page for the other alternatives.

(''since 0.12'')

__init__(self)
(Constructor)

source code 
x.__init__(...) initializes x; see help(type(x)) for signature
Overrides: object.__init__
(inherited documentation)

get_repositories(self)

source code 

Retrieve repositories specified in TracIni.

The [repositories] section can be used to specify a list of repositories.

get_repositories_by_dir(self, directory)

source code 
Retrieve the repositories based on the given directory.
Parameters:
  • directory - the key for identifying the repositories.
Returns:
list of Repository instances.

get_repository_id(self, reponame)

source code 

Return a unique id for the given repository name.

This will create and save a new id if none is found.

Note: this should probably be renamed as we're dealing
exclusively with db repository ids here.

get_repository(self, reponame)

source code 
Retrieve the appropriate Repository for the given repository name.
Parameters:
  • reponame - the key for specifying the repository. If no name is given, take the default repository.
Returns:
if no corresponding repository was defined, simply return None.
Raises:

get_repository_by_path(self, path)

source code 
Retrieve a matching Repository for the given path.
Parameters:
  • path - the eventually scoped repository-scoped path
Returns:
a (reponame, repos, path) triple, where path is the remaining part of path once the reponame has been truncated, if needed.

get_default_repository(self, context)

source code 

Recover the appropriate repository from the current context.

Lookup the closest source or changeset resource in the context hierarchy and return the name of its associated repository.

get_real_repositories(self)

source code 
Return a set of all real repositories (i.e. excluding aliases).

notify(self, event, reponame, revs)

source code 

Notify repositories and change listeners about repository events.

The supported events are the names of the methods defined in the IRepositoryChangeListener interface.

read_file_by_path(self, path)

source code 
Read the file specified by path
Parameters:
  • path - the repository-scoped path. The repository revision may specified by appending @ followed by the revision, otherwise the HEAD revision is assumed.
Returns:
the file content as a unicode string. None is returned if the file is not found.

Since: 1.2.2


Class Variable Details

default_repository_type

Value:
<Option [versioncontrol] 'default_repository_type'>

Property Details

connectors

List of components that implement ~trac.versioncontrol.api.IRepositoryConnector
Get Method:
unreachable.extensions(component) - Return a list of components that declare to implement the extension point interface.

providers

List of components that implement ~trac.versioncontrol.api.IRepositoryProvider
Get Method:
unreachable.extensions(component) - Return a list of components that declare to implement the extension point interface.

change_listeners

List of components that implement ~trac.versioncontrol.api.IRepositoryChangeListener
Get Method:
unreachable.extensions(component) - Return a list of components that declare to implement the extension point interface.