Skip to content

hg

Mercurial source control management.

Classes

Mercurial

Mercurial(config: SCMConfig)

Mercurial source control management.

Functions

add_path
add_path(path: str | Path) -> None

Add a path to the Source Control Management repository.

assert_nondirty
assert_nondirty() -> None

Assert that the working directory is clean.

commit_and_tag
commit_and_tag(
    files: list[Path | str],
    context: MutableMapping,
    dry_run: bool = False,
) -> None

Commit and tag files to the repository using the configuration.

is_available
is_available() -> bool

Is the VCS implementation usable?

latest_tag_info
latest_tag_info() -> LatestTagInfo

Return information about the latest tag.

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.

Parameters:

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:

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.

Parameters:

config

The source control configuration.

TYPE: SCMConfig

Returns:

dict

A dictionary containing information about the latest commit.

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.

Parameters:

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:

SignedTagsError

If sign is True