Skip to content

hg

Mercurial source control management.

Attributes

Classes

Mercurial

Mercurial(config: SCMConfig)

Mercurial source control management.

Methods:

__repr__
__repr__() -> str

Return a string representation of the SCMTool.

__str__
__str__() -> str

A string representation of the object.

add_path
add_path(path: Pathlike) -> None

Add a path to the Source Control Management repository.

assert_nondirty staticmethod
assert_nondirty() -> None

Assert that the working directory is clean.

commit
commit(context: MutableMapping) -> None

Commit the changes.

commit_and_tag
commit_and_tag(files: List[Pathlike], context: MutableMapping, dry_run: bool = False) -> None

Commit and tag files to the repository using the configuration.

get_all_tags
get_all_tags() -> List[str]

Return all tags in a mercurial repository.

is_available
is_available() -> bool

Is the VCS implementation usable?

latest_tag_info
latest_tag_info() -> LatestTagInfo

Return information about the latest tag.

tag staticmethod
tag(name: str, sign: bool = False, message: Optional[str] = None) -> None

Create a tag of the new_version in VCS.

If only name is given, bumpversion uses a lightweight tag. Otherwise, it uses an annotated tag.

PARAMETER DESCRIPTION
name

The name of the tag

TYPE: str

sign

True to sign the tag

TYPE: bool DEFAULT: False

message

A optional message to annotate the tag.

TYPE: Optional[str] DEFAULT: None

RAISES DESCRIPTION
SignedTagsError

If sign is True

Functions:

assert_nondirty

assert_nondirty() -> None

Assert that the working directory is clean.

commit_info

commit_info(config: SCMConfig) -> dict

Get the commit info for the repo.

PARAMETER DESCRIPTION
config

The source control configuration.

TYPE: SCMConfig

RETURNS DESCRIPTION
dict

A dictionary containing information about the latest commit.

parse_commit_log

parse_commit_log(log_string: str, config: SCMConfig) -> dict

Parse the commit log string.

tag

tag(name: str, sign: bool = False, message: Optional[str] = None) -> None

Create a tag of the new_version in VCS.

If only name is given, bumpversion uses a lightweight tag. Otherwise, it uses an annotated tag.

PARAMETER DESCRIPTION
name

The name of the tag

TYPE: str

sign

True to sign the tag

TYPE: bool DEFAULT: False

message

A optional message to annotate the tag.

TYPE: Optional[str] DEFAULT: None

RAISES DESCRIPTION
SignedTagsError

If sign is True