darcsforge.darcs – Darcs Wrapper

Platforms: Python

This is a simple Python-based wrapper around Darcs used in various ways by Darcsforge applications. It isn’t necessary to be used directly, but should provide insight into the functionality of Darcs applications.

DarcsRepository

class darcsforge.darcs.DarcsRepository(repodir, pristine_format=None)

DarcsRepository interacts with darcs

annotate_file(params)

Returns a dictionary representing the annotated version of a file.

Dictionary contents:

name
Current Filename
created_as
Original Filename
created_by
Originating Patch dictionary
lines
List of tuples with the line text and its Patch dictionary
annotate_patch(hash)
Returns the output of Darcs Annotate for a specific patch hash.
changes()

Returns a list of all changes in the darcs repo.

Returns:List of patch dictionaries
changes_last(last=15)

Returns a list of recent changes in the darcs repo.

Returns:List of patch dictionaries
changes_match(match='')

Returns a list of matching changes in the darcs repo.

Returns:List of patch dictionaries
clone(clone_path)
Clone this repository. Note that clone_path should be on the same file system due to the use of get.
clone_tag(clone_path, tag)
Clone this repository at a certain tag. Note that clone_path should be on the same file system due to the use of get.
get_motd()

Returns this repo’s Message of the Day

Returns:The repo’s prefs/motd
get_owner()

Returns this repo’s owner

Returns:The owner (this repo’s prefs/author)
parse_annotate_xml(xml)
Parses the xml output of file annotation.
parse_change_xml(log)
Parses the xml output of darcs changes.
show_contents(file_path)
Returns the current state of a specific file.