translate.storage.versioncontrol

Package translate :: Package storage :: Package versioncontrol |
[hide private]
[frames] | no frames]

# Package versioncontrol

source code

This module manages interaction with version control systems.

To implement support for a new version control system, inherit the class GenericRevisionControlSystem.

TODO:

- add authentication handling
- 'commitdirectory' should do a single commit instead of one for each file
- maybe implement some caching for 'get_versioned_object' - check profiler

Submodules | [hide private]
translate.storage.versioncontrol.bzr translate.storage.versioncontrol.cvs translate.storage.versioncontrol.darcs translate.storage.versioncontrol.git translate.storage.versioncontrol.hg translate.storage.versioncontrol.svn

Classes | [hide private]
| GenericRevisionControlSystem The super class for all version control classes.

Functions | [hide private]
__get_rcs_class(name) | source code
run_command(command, cwd=None) Runs a command (array of program name and arguments) and returns the exitcode, the output and the error as a tuple. | source code
__shellescape(path) Shell-escape any non-alphanumeric characters. | source code
get_versioned_objects_recursive(location, versioning_systems=None, follow_symlinks=True) return a list of objects, each pointing to a file below this directory | source code
get_versioned_object(location, versioning_systems=None, follow_symlinks=True) return a versioned object for the given file | source code
get_available_version_control_systems() return the class objects of all locally available version control systems | source code
updatefile(filename) | source code
getcleanfile(filename, revision=None) | source code
commitfile(filename, message=None, author=None) | source code
commitdirectory(directory, message=None, author=None) commit all files below the given directory | source code
updatedirectory(directory) update all files below the given directory | source code
hasversioning(item) | source code

Variables | [hide private]
| DEFAULT_RCS = ``[``'``svn``'``,` `'``cvs``'``,` `'``darcs``'``,` `'``git``'``,` `'``bzr``'``,` `'``hg``'``]`` the names of all supported revision control systems
| __CACHED_RCS_CLASSES = ``{``}`` The dynamically loaded revision control system implementations (python modules) are cached here for faster access.
| __package__ = ``'``translate.storage.versioncontrol``'``

Imports: os, re, subprocess, popen2

Function Details | [hide private]

### run_command(command, cwd=None) | source code
Runs a command (array of program name and arguments) and returns the exitcode, the output and the error as a tuple. Parameters: `command` (list) - list of arguments to be joined for a program call `cwd` (str) - optional directory where the command should be executed

### commitdirectory(directory, message=None, author=None) | source code
commit all files below the given directory files that are just symlinked into the directory are supported, too

### updatedirectory(directory) | source code
update all files below the given directory files that are just symlinked into the directory are supported, too

Variables Details | [hide private]

  ### DEFAULT_RCS the names of all supported revision control systems modules of the same name containing a class with the same name are expected to be defined below 'translate.storage.versioncontrol' Value:
      ['svn', 'cvs', 'darcs', 'git', 'bzr', 'hg']