Welcome to jaraco.vcs documentation!

>>> repo().get_current_version()
'...'
>>> isinstance(repo(), Repo)
True
class jaraco.vcs.Git(location='.')

Bases: Subprocess, Git, Repo

A Repo implemented by calling into the ‘git’ command-line as a subprocess.

priority = 1
class jaraco.vcs.Mercurial(location='.')

Bases: Subprocess, Mercurial, Repo

A Repo implemented by calling into the ‘hg’ command-line as a subprocess.

priority = 1
class jaraco.vcs.Repo(location='.')

Bases: Versioned

An abstract class defining some interfaces for working with repositories.

age()

Return the age of the repo.

commit_tree(spec, msg='committed')

Apply the tree in spec and commit.

describe_version()

Return a string representing a version of the current state.

static detect(location='.')
static existing_only(instances: Iterable[Repo])

Return only those instances that refer to an existing repo

find_all_files()

Find files including those in subrepositories.

find_files()
find_root()
get_parent_revs(rev=None)

Get the parent revision for the specified revision (or the current revision if none is specified).

get_parent_tags(rev=None)
Return the tags for the parent revision (or None if no single

parent can be identified).

get_repo_tags()

Get all tags for the repository.

get_tags(rev=None)

Get the tags for the specified revision (or the current revision if none is specified).

get_timestamp(rev)
classmethod get_valid_managers(location)

Get the valid Repo implementations for this location.

is_modified()

Does the current working copy have modifications

is_valid()

Return True if this instance is a valid for this location.

setup()
sub_paths()
subrepos()
jaraco.vcs.repo(location='.')
class jaraco.vcs.subprocess.Git(location='.')

Bases: Subprocess, Git, Repo

A Repo implemented by calling into the ‘git’ command-line as a subprocess.

priority = 1
class jaraco.vcs.subprocess.Mercurial(location='.')

Bases: Subprocess, Mercurial, Repo

A Repo implemented by calling into the ‘hg’ command-line as a subprocess.

priority = 1
class jaraco.vcs.subprocess.Subprocess

Bases: object

env = None
class jaraco.vcs.cmd.Command

Bases: object

is_valid()
version()

Return the underlying version

class jaraco.vcs.cmd.Git

Bases: Command

age()
>>> repo = getfixture('git_repo')
>>> repo.age()
datetime.timedelta(...)
commit_tree(spec, message: str = 'committed')
describe_version()
>>> repo = getfixture('git_repo')
>>> _ = repo._invoke('tag', 'v1.0.0')
>>> desc = repo.describe_version()
>>> list(vars(desc))
['date', 'tag', 'distance', 'node', 'dirty']
>>> desc.tag
'v1.0.0'
>>> desc.node
'g...'
>>> desc.distance
0
>>> desc.dirty
False
>>> repo.commit_tree({'bar': {'baz': 'new content'}})
>>> desc = repo.describe_version()
>>> desc.distance
1
>>> desc.dirty
False
>>> jaraco.path.build({'bar': {'baz': 'pending'}})
>>> desc = repo.describe_version()
>>> desc.distance
1
>>> desc.dirty
True
exe = 'git'
find_files()
find_root()
get_ancestral_tags(rev=None)

Like get_repo_tags, but only get those tags ancestral to the current changeset.

get_repo_tags()
get_tags(rev=None)

Return the tags for the current revision as a set

head_date()
is_modified()

Is the current state modified? (currently stubbed assuming no)

is_valid()
sub_paths()
version_pattern = 'git version (\\d+\\.\\d+[^ ]*)'
class jaraco.vcs.cmd.Mercurial

Bases: Command

commit_tree(spec, message: str = 'committed')
exe = 'hg'
find_files()

Find versioned files in self.location

find_root()
get_ancestral_tags(rev='.')

Like get_repo_tags, but only get those tags ancestral to the current changeset.

get_parent_revs(rev=None)
get_repo_tags()
get_tags(rev=None)

Get the tags for the given revision specifier (or the current revision if not specified).

is_modified()
sub_paths()
version_pattern = 'Mercurial Distributed SCM \\((.*?)\\)'
class jaraco.vcs.cmd.TaggedRevision(tag, revision)

Bases: NamedTuple

revision: str

Alias for field number 1

tag: str

Alias for field number 0

Indices and tables