vcs 0.4.0 documentation
Base for all available scm backends
created_on: | Apr 8, 2010 |
---|---|
copyright: |
|
Each backend should implement it’s changeset representation.
Attributes
- repository
- repository object within which changeset exists
- id
- may be raw_id or i.e. for mercurial’s tip just tip
- raw_id
- raw changeset representation (i.e. full 40 length sha for git backend)
- short_id
- shortened (if apply) version of raw_id; it would be simple shortcut for raw_id[:12] for git/mercurial backends or same as raw_id for subversion
- revision
- revision number as integer
- files
- list of FileNode (Node with NodeKind.FILE) objects
- dirs
- list of DirNode (Node with NodeKind.DIR) objects
- nodes
- combined list of Node objects
- author
- author of the changeset, as unicode
- message
- message of the changeset, as unicode
- parents
- list of parent changesets
- last
- True if this is last changeset in repository, False otherwise; trying to access this attribute while there is no changesets would raise EmptyRepositoryError
Returns list of added FileNode objects.
Returns dictionary with changeset’s attributes and their values.
Returns Author for given commit
Returns Author email address for given commit
Returns Author name for given commit
Returns list of modified FileNode objects.
Returns list of children changesets.
Returns Committer for given commit
Returns Author email address for given commit
Returns Author name for given commit
Fills up given stream.
Parameters: |
|
---|
Returns iterable archive. Tiny wrapper around fill_archive method.
Parameters: | chunk_size – extra parameter which controls size of returned chunks. Default:8k. |
---|
Returns last commit of the file at the given path.
Returns content of the file at the given path.
Returns history of file as reversed list of Changeset objects for which file at given path has been modified.
Returns stat mode of the file at the given path.
Returns size of the file at the given path.
Returns generator that yields all file nodes.
Returns Node object from the given path.
Raises NodeDoesNotExistError: | |
---|---|
if there is no node at the given path |
Returns combined DirNode and FileNode objects list representing state of changeset at the given path.
Raises ChangesetError: | |
---|---|
if node at the given path is not instance of DirNode |
Returns string identifying this changeset.
Returns next changeset from current, if branch is gives it will return next changeset belonging to this branch
Parameters: | branch – show changesets within the given named branch |
---|
Returns list of parents changesets.
Returns previous changeset from current, if branch is gives it will return previous changeset belonging to this branch
Parameters: | branch – show changesets within the given named branch |
---|
Returns raw string identifying this changeset.
Returns list of removed FileNode objects.
Returns integer identifying this changeset.
Returns RootNode object for this changeset.
Returns shortened version of raw_id attribute, as string, identifying this changeset, useful for web representation.
Returns total number of bytes from contents of all filenodes.
Similar to os.walk method. Insted of filesystem it walks through changeset starting at given topurl. Returns generator of tuples (topnode, dirnodes, filenodes).
Represents differences between repository’s state (most recent head) and changes made in place.
Attributes
- repository
- repository object for this in-memory-changeset
- added
- list of FileNode objects marked as added
- changed
- list of FileNode objects marked as changed
- removed
- list of FileNode or RemovedFileNode objects marked to be removed
- parents
- list of Changeset representing parents of in-memory changeset. Should always be 2-element sequence.
Marks given FileNode objects as to be committed.
Raises: |
|
---|
Marks given FileNode objects to be changed in next commit.
Raises: |
|
---|
Checks in-memory changeset’s integrity. Also, sets parents if not already set.
Raises CommitError: | |
---|---|
if any error occurs (i.e. NodeDoesNotExistError). |
Performs in-memory commit (doesn’t check workdir in any way) and returns newly created Changeset. Updates repository’s revisions.
Note
While overriding this method each backend’s should call self.check_integrity(parents) in the first place.
Parameters: |
|
---|---|
Raises CommitError: | |
if any error occurs while committing |
Returns generator of paths from nodes marked as added, changed or removed.
Returns list of paths from nodes marked as added, changed or removed.
Marks given FileNode (or RemovedFileNode) objects to be removed in next commit.
Raises: |
|
---|
Resets this instance to initial state (cleans added, changed and removed lists).
Base Repository for final backends
Attributes
- DEFAULT_BRANCH_NAME
- name of default branch (i.e. “trunk” for svn, “master” for git etc.
- scm
- alias of scm, i.e. git or hg
- repo
- object from external api
- revisions
- list of all available revisions’ ids, in ascending order
- changesets
- storage dict caching returned changesets
- path
- absolute path to the repository
- branches
- branches as list of changesets
- tags
- tags as list of changesets
Initializes repository. Raises RepositoryError if repository could not be find at the given repo_path or directory at repo_path exists and create is set to True.
Parameters: |
|
---|
Commit api function that will add given FileNode into this repository.
Raises: |
|
---|
Persists current changes made on this repository and returns newly created changeset.
Raises NothingChangedError: | |
---|---|
if no changes has been made |
Returns instance of Changeset class. If revision is None, most recent changeset is returned.
Raises EmptyRepositoryError: | |
---|---|
if there are no revisions |
Returns iterator of MercurialChangeset objects from start to end not inclusive This should behave just like a list, ie. end is not inclusive
Parameters: |
|
---|
Returns configuration value for a given [section] and name.
Parameters: |
|
---|
Returns (git like) diff, as plain text. Shows changes introduced by rev2 since rev1.
Parameters: |
|
---|
Returns dictionary with added, changed and removed lists containing FileNode objects.
Returns user’s email from global configuration file.
Parameters: | config_file – A path to file which should be used to retrieve configuration from (might also be a list of file paths) |
---|
Returns user’s name from global configuration file.
Parameters: | config_file – A path to file which should be used to retrieve configuration from (might also be a list of file paths) |
---|
Returns InMemoryChangeset object for this repository.
Validates repository.
Commit api function that will remove given FileNode into this repository.
Raises: |
|
---|
Removes tag with the given name.
Parameters: |
|
---|---|
Raises TagDoesNotExistError: | |
if tag with given name does not exists |
Returns combined size in bytes for all repository files
Creates and returns a tag for the given revision.
Parameters: |
|
---|---|
Raises TagAlreadyExistError: | |
if tag with same name already exists |
Returns Workdir instance for this repository.
Working directory representation of single repository.
Attribute : | repository: repository object of working directory |
---|
Checks out branch or the backend’s default branch.
Raises BranchDoesNotExistError if the branch does not exist.
Commits local (from working directory) changes and returns newly created Changeset. Updates repository’s revisions list.
Raises CommitError: | |
---|---|
if any error occurs while committing |
Returns list of FileNode objects marked as new in working directory.
Returns name of current branch.
Returns list of FileNode objects changed in working directory.
Returns current changeset.
Returns list of RemovedFileNode objects marked as removed in working directory.
Returns dict with added, changed, removed and untracked lists.
Returns list of FileNode objects which are present within working directory however are not tracked by repository.
Fetches content of the given revision and populates it within working directory.
An dummy empty changeset. It’s possible to pass hash when creating an EmptyChangeset
Returns raw string identifying this changeset, useful for web representation.