mirror of
https://github.com/TECHNOFAB11/bumpver.git
synced 2025-12-12 06:20:08 +01:00
more obvious handling of tag and push
This commit is contained in:
parent
d46d8f075a
commit
fe4b381b5b
3 changed files with 9 additions and 6 deletions
|
|
@ -214,8 +214,10 @@ def _bump(cfg: config.Config, new_version: str, allow_dirty: bool = False) -> No
|
|||
|
||||
_vcs.commit(f"bump version to {new_version}")
|
||||
|
||||
if cfg.tag:
|
||||
if cfg.commit and cfg.tag:
|
||||
_vcs.tag(new_version)
|
||||
|
||||
if cfg.commit and cfg.tag and cfg.push:
|
||||
_vcs.push(new_version)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -79,8 +79,8 @@ class Config(typ.NamedTuple):
|
|||
current_version: str
|
||||
pep440_version : str
|
||||
|
||||
tag : bool
|
||||
commit: bool
|
||||
tag : bool
|
||||
push : bool
|
||||
|
||||
file_patterns: PatternsByFilePath
|
||||
|
|
@ -91,8 +91,8 @@ def _debug_str(cfg: Config) -> str:
|
|||
f"Config Parsed: Config(",
|
||||
f"current_version='{cfg.current_version}'",
|
||||
f"pep440_version='{cfg.pep440_version}'",
|
||||
f"tag={cfg.tag}",
|
||||
f"commit={cfg.commit}",
|
||||
f"tag={cfg.tag}",
|
||||
f"push={cfg.push}",
|
||||
"file_patterns={",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -64,7 +64,10 @@ class VCS:
|
|||
"""Invoke subcommand and return output."""
|
||||
cmd_tmpl = self.subcommands[cmd_name]
|
||||
cmd_str = cmd_tmpl.format(**kwargs)
|
||||
log.debug(cmd_str)
|
||||
if cmd_name in ("commit", "tag", "push_tag"):
|
||||
log.info(cmd_str)
|
||||
else:
|
||||
log.debug(cmd_str)
|
||||
output_data = sp.check_output(cmd_str.split(), env=env, stderr=sp.STDOUT)
|
||||
|
||||
# TODO (mb 2018-11-15): Detect encoding of output?
|
||||
|
|
@ -122,7 +125,6 @@ class VCS:
|
|||
|
||||
def add(self, path: str) -> None:
|
||||
"""Add updates to be included in next commit."""
|
||||
log.info(f"{self.name} add {path}")
|
||||
try:
|
||||
self('add_path', path=path)
|
||||
except sp.CalledProcessError as ex:
|
||||
|
|
@ -134,7 +136,6 @@ class VCS:
|
|||
|
||||
def commit(self, message: str) -> None:
|
||||
"""Commit added files."""
|
||||
log.info(f"{self.name} commit -m '{message}'")
|
||||
message_data = message.encode("utf-8")
|
||||
|
||||
tmp_file = tempfile.NamedTemporaryFile("wb", delete=False)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue