diff --git a/_modules/bumpversion/aliases.html b/_modules/bumpversion/aliases.html index 2213deae..df2865da 100644 --- a/_modules/bumpversion/aliases.html +++ b/_modules/bumpversion/aliases.html @@ -178,28 +178,28 @@
  • bumpversion
  • diff --git a/_modules/bumpversion/autocast.html b/_modules/bumpversion/autocast.html index 86cb3197..a486c309 100644 --- a/_modules/bumpversion/autocast.html +++ b/_modules/bumpversion/autocast.html @@ -178,28 +178,28 @@
  • bumpversion
  • diff --git a/_modules/bumpversion/bump.html b/_modules/bumpversion/bump.html index 111b5930..8a94ba0b 100644 --- a/_modules/bumpversion/bump.html +++ b/_modules/bumpversion/bump.html @@ -178,28 +178,28 @@
  • bumpversion
  • diff --git a/_modules/bumpversion/config.html b/_modules/bumpversion/config.html index 52300d35..10ff53bc 100644 --- a/_modules/bumpversion/config.html +++ b/_modules/bumpversion/config.html @@ -178,28 +178,28 @@
  • bumpversion
  • diff --git a/_modules/bumpversion/config/files.html b/_modules/bumpversion/config/files.html index adaf7114..dc9929c1 100644 --- a/_modules/bumpversion/config/files.html +++ b/_modules/bumpversion/config/files.html @@ -178,28 +178,28 @@
  • bumpversion
  • diff --git a/_modules/bumpversion/config/files_legacy.html b/_modules/bumpversion/config/files_legacy.html index 668b36ff..fe473697 100644 --- a/_modules/bumpversion/config/files_legacy.html +++ b/_modules/bumpversion/config/files_legacy.html @@ -178,28 +178,28 @@
  • bumpversion
  • diff --git a/_modules/bumpversion/config/models.html b/_modules/bumpversion/config/models.html index 3afeb586..c8755d77 100644 --- a/_modules/bumpversion/config/models.html +++ b/_modules/bumpversion/config/models.html @@ -178,28 +178,28 @@
  • bumpversion
  • diff --git a/_modules/bumpversion/config/utils.html b/_modules/bumpversion/config/utils.html index 978227c4..46e738e6 100644 --- a/_modules/bumpversion/config/utils.html +++ b/_modules/bumpversion/config/utils.html @@ -178,28 +178,28 @@
  • bumpversion
  • diff --git a/_modules/bumpversion/exceptions.html b/_modules/bumpversion/exceptions.html index 141bce91..31f2c6d1 100644 --- a/_modules/bumpversion/exceptions.html +++ b/_modules/bumpversion/exceptions.html @@ -178,28 +178,28 @@
  • bumpversion
  • diff --git a/_modules/bumpversion/files.html b/_modules/bumpversion/files.html index 1eaa61d9..5d423af4 100644 --- a/_modules/bumpversion/files.html +++ b/_modules/bumpversion/files.html @@ -178,28 +178,28 @@
  • bumpversion
  • diff --git a/_modules/bumpversion/functions.html b/_modules/bumpversion/functions.html index 75862e75..9126a9ab 100644 --- a/_modules/bumpversion/functions.html +++ b/_modules/bumpversion/functions.html @@ -178,28 +178,28 @@
  • bumpversion
  • diff --git a/_modules/bumpversion/indented_logger.html b/_modules/bumpversion/indented_logger.html index 5d093ce1..a62c83a2 100644 --- a/_modules/bumpversion/indented_logger.html +++ b/_modules/bumpversion/indented_logger.html @@ -178,28 +178,28 @@
  • bumpversion
  • diff --git a/_modules/bumpversion/scm.html b/_modules/bumpversion/scm.html index 98925c4a..f62c9314 100644 --- a/_modules/bumpversion/scm.html +++ b/_modules/bumpversion/scm.html @@ -178,28 +178,28 @@
  • bumpversion
  • @@ -257,7 +257,7 @@

    Source code for bumpversion.scm

     if TYPE_CHECKING:  # pragma: no-coverage
         from bumpversion.config import Config
     
    -from bumpversion.exceptions import DirtyWorkingDirectoryError, SignedTagsError
    +from bumpversion.exceptions import BumpVersionError, DirtyWorkingDirectoryError, SignedTagsError
     
     logger = get_indented_logger(__name__)
     
    @@ -310,6 +310,12 @@ 

    Source code for bumpversion.scm

         def commit(cls, message: str, current_version: str, new_version: str, extra_args: Optional[list] = None) -> None:
             """Commit the changes."""
             extra_args = extra_args or []
    +        if not current_version:
    +            logger.warning("No current version given, using an empty string.")
    +            current_version = ""
    +        if not new_version:
    +            logger.warning("No new version given, using an empty string.")
    +            new_version = ""
     
             with NamedTemporaryFile("wb", delete=False) as f:
                 f.write(message.encode("utf-8"))
    @@ -322,10 +328,13 @@ 

    Source code for bumpversion.scm

             try:
                 cmd = [*cls._COMMIT_COMMAND, f.name, *extra_args]
                 subprocess.run(cmd, env=env, capture_output=True, check=True)  # noqa: S603
    -        except subprocess.CalledProcessError as exc:  # pragma: no-coverage
    -            err_msg = f"Failed to run {exc.cmd}: return code {exc.returncode}, output: {exc.output}"
    +        except (subprocess.CalledProcessError, TypeError) as exc:  # pragma: no-coverage
    +            if isinstance(exc, TypeError):
    +                err_msg = f"Failed to run {cls._COMMIT_COMMAND}: {exc}"
    +            else:
    +                err_msg = f"Failed to run {exc.cmd}: return code {exc.returncode}, output: {exc.output}"
                 logger.exception(err_msg)
    -            raise exc
    +            raise BumpVersionError(err_msg) from exc
             finally:
                 os.unlink(f.name)
    diff --git a/_modules/bumpversion/show.html b/_modules/bumpversion/show.html index 66701f01..298f3993 100644 --- a/_modules/bumpversion/show.html +++ b/_modules/bumpversion/show.html @@ -178,28 +178,28 @@
  • bumpversion
  • diff --git a/_modules/bumpversion/ui.html b/_modules/bumpversion/ui.html index b58fa4a8..ec336cab 100644 --- a/_modules/bumpversion/ui.html +++ b/_modules/bumpversion/ui.html @@ -178,28 +178,28 @@
  • bumpversion
  • diff --git a/_modules/bumpversion/utils.html b/_modules/bumpversion/utils.html index 5aacb14a..95dfd016 100644 --- a/_modules/bumpversion/utils.html +++ b/_modules/bumpversion/utils.html @@ -178,28 +178,28 @@
  • bumpversion
  • @@ -338,7 +338,7 @@

    Source code for bumpversion.utils

     ) -> ChainMap:
         """Return the context for rendering messages and tags."""
         ctx = base_context(config.scm_info)
    -    ctx.new_child({"current_version": config.current_version})
    +    ctx = ctx.new_child({"current_version": config.current_version})
         if current_version:
             ctx = ctx.new_child({f"current_{part}": current_version[part].value for part in current_version})
         if new_version:
    diff --git a/_modules/bumpversion/version_part.html b/_modules/bumpversion/version_part.html
    index 7a1c8848..42ba043c 100644
    --- a/_modules/bumpversion/version_part.html
    +++ b/_modules/bumpversion/version_part.html
    @@ -178,28 +178,28 @@
     
  • bumpversion
  • diff --git a/_modules/bumpversion/visualize.html b/_modules/bumpversion/visualize.html index e53b5ed8..bb75694b 100644 --- a/_modules/bumpversion/visualize.html +++ b/_modules/bumpversion/visualize.html @@ -178,28 +178,28 @@
  • bumpversion
  • diff --git a/_modules/bumpversion/yaml_dump.html b/_modules/bumpversion/yaml_dump.html index 6cb9de76..a01c7212 100644 --- a/_modules/bumpversion/yaml_dump.html +++ b/_modules/bumpversion/yaml_dump.html @@ -178,28 +178,28 @@
  • bumpversion
  • diff --git a/_modules/index.html b/_modules/index.html index 71c5e3c4..c261d981 100644 --- a/_modules/index.html +++ b/_modules/index.html @@ -178,28 +178,28 @@
  • bumpversion
  • diff --git a/_sources/reference/bumpversion/bumpversion.config.md.txt b/_sources/reference/bumpversion/bumpversion.config.md.txt index 1585e296..b5f6f707 100644 --- a/_sources/reference/bumpversion/bumpversion.config.md.txt +++ b/_sources/reference/bumpversion/bumpversion.config.md.txt @@ -14,10 +14,10 @@ :maxdepth: 1 bumpversion.config.create -bumpversion.config.files_legacy -bumpversion.config.files bumpversion.config.utils +bumpversion.config.files bumpversion.config.models +bumpversion.config.files_legacy ``` ## Package Contents diff --git a/_sources/reference/bumpversion/bumpversion.md.txt b/_sources/reference/bumpversion/bumpversion.md.txt index fd5af42d..0cf6a34d 100644 --- a/_sources/reference/bumpversion/bumpversion.md.txt +++ b/_sources/reference/bumpversion/bumpversion.md.txt @@ -22,22 +22,22 @@ bumpversion.config :titlesonly: :maxdepth: 1 -bumpversion.exceptions -bumpversion.files +bumpversion.yaml_dump +bumpversion.show bumpversion.ui bumpversion.utils -bumpversion.bump -bumpversion.autocast -bumpversion.yaml_dump -bumpversion.aliases -bumpversion.cli +bumpversion.version_part bumpversion.scm -bumpversion.show +bumpversion.autocast +bumpversion.files +bumpversion.bump bumpversion.indented_logger -bumpversion.visualize -bumpversion.version_part bumpversion.functions +bumpversion.exceptions bumpversion.__main__ +bumpversion.cli +bumpversion.visualize +bumpversion.aliases ``` ## Package Contents diff --git a/changelog.html b/changelog.html index ef177264..b8852e1e 100644 --- a/changelog.html +++ b/changelog.html @@ -179,28 +179,28 @@
  • bumpversion
  • diff --git a/contributing.html b/contributing.html index 29ca20ef..0e7f9875 100644 --- a/contributing.html +++ b/contributing.html @@ -179,28 +179,28 @@
  • bumpversion
  • diff --git a/explanation/index.html b/explanation/index.html index fab61816..49b7a9ac 100644 --- a/explanation/index.html +++ b/explanation/index.html @@ -3,7 +3,7 @@ - + Explanation - Bump My Version 0.17.0 @@ -179,28 +179,28 @@
  • bumpversion
  • @@ -254,14 +254,14 @@

    Explanation - +
    Previous
    -
    bumpversion.__main__
    +
    bumpversion.aliases
    diff --git a/genindex.html b/genindex.html index 06bfea31..705d7632 100644 --- a/genindex.html +++ b/genindex.html @@ -177,28 +177,28 @@
  • bumpversion
  • diff --git a/howtos/avoid-incorrect-replacements.html b/howtos/avoid-incorrect-replacements.html index bce0f168..1b8a3a7e 100644 --- a/howtos/avoid-incorrect-replacements.html +++ b/howtos/avoid-incorrect-replacements.html @@ -179,28 +179,28 @@
  • bumpversion
  • diff --git a/howtos/custom-version-formats-by-file.html b/howtos/custom-version-formats-by-file.html index ed8a0d8f..f2ead908 100644 --- a/howtos/custom-version-formats-by-file.html +++ b/howtos/custom-version-formats-by-file.html @@ -179,28 +179,28 @@
  • bumpversion
  • diff --git a/howtos/index.html b/howtos/index.html index 42536008..50ee4cf3 100644 --- a/howtos/index.html +++ b/howtos/index.html @@ -179,28 +179,28 @@
  • bumpversion
  • diff --git a/howtos/multiple-replacements.html b/howtos/multiple-replacements.html index 3336b713..c89eab0f 100644 --- a/howtos/multiple-replacements.html +++ b/howtos/multiple-replacements.html @@ -179,28 +179,28 @@
  • bumpversion
  • diff --git a/index.html b/index.html index 921c626e..91618416 100644 --- a/index.html +++ b/index.html @@ -179,28 +179,28 @@
  • bumpversion
  • diff --git a/py-modindex.html b/py-modindex.html index 12500752..7b405720 100644 --- a/py-modindex.html +++ b/py-modindex.html @@ -177,28 +177,28 @@
  • bumpversion
  • diff --git a/readme.html b/readme.html index a574a4c9..d5753d8a 100644 --- a/readme.html +++ b/readme.html @@ -179,28 +179,28 @@
  • bumpversion
  • diff --git a/reference/bumpversion/bumpversion.__main__.html b/reference/bumpversion/bumpversion.__main__.html index 2a67ce3f..abe7253b 100644 --- a/reference/bumpversion/bumpversion.__main__.html +++ b/reference/bumpversion/bumpversion.__main__.html @@ -3,7 +3,7 @@ - + bumpversion.__main__ - Bump My Version 0.17.0 @@ -179,28 +179,28 @@
  • bumpversion
  • @@ -252,23 +252,23 @@