mirror of
https://github.com/TECHNOFAB11/bumpver.git
synced 2025-12-12 14:30:09 +01:00
expose fetch via logging
This commit is contained in:
parent
cdbf5c6627
commit
65446440f7
1 changed files with 6 additions and 6 deletions
|
|
@ -47,10 +47,10 @@ def _init_logging(verbose: int = 0) -> None:
|
||||||
log_level = logging.DEBUG
|
log_level = logging.DEBUG
|
||||||
elif verbose == 1:
|
elif verbose == 1:
|
||||||
log_format = "%(levelname)-7s - %(message)s"
|
log_format = "%(levelname)-7s - %(message)s"
|
||||||
log_level = logging.INFO
|
log_level = logging.DEBUG
|
||||||
else:
|
else:
|
||||||
log_format = "%(message)s"
|
log_format = "%(levelname)-7s - %(message)s"
|
||||||
log_level = logging.WARNING
|
log_level = logging.INFO
|
||||||
|
|
||||||
logging.basicConfig(level=log_level, format=log_format, datefmt="%Y-%m-%dT%H:%M:%S")
|
logging.basicConfig(level=log_level, format=log_format, datefmt="%Y-%m-%dT%H:%M:%S")
|
||||||
log.debug("Logging initialized.")
|
log.debug("Logging initialized.")
|
||||||
|
|
@ -93,7 +93,7 @@ def _update_cfg_from_vcs(cfg: config.Config, fetch: bool) -> config.Config:
|
||||||
_vcs = vcs.get_vcs()
|
_vcs = vcs.get_vcs()
|
||||||
log.debug(f"vcs found: {_vcs.name}")
|
log.debug(f"vcs found: {_vcs.name}")
|
||||||
if fetch:
|
if fetch:
|
||||||
log.info(f"fetching tags from remote")
|
log.info(f"fetching tags from remote (to turn off use: -n / --no-fetch)")
|
||||||
_vcs.fetch()
|
_vcs.fetch()
|
||||||
|
|
||||||
version_tags = [tag for tag in _vcs.ls_tags() if version.PYCALVER_RE.match(tag)]
|
version_tags = [tag for tag in _vcs.ls_tags() if version.PYCALVER_RE.match(tag)]
|
||||||
|
|
@ -116,7 +116,7 @@ def _update_cfg_from_vcs(cfg: config.Config, fetch: bool) -> config.Config:
|
||||||
@cli.command()
|
@cli.command()
|
||||||
@click.option('-v', '--verbose', count=True, help="Control log level. -vv for debug level.")
|
@click.option('-v', '--verbose', count=True, help="Control log level. -vv for debug level.")
|
||||||
@click.option(
|
@click.option(
|
||||||
'-f', "--fetch/--no-fetch", is_flag=True, default=True, help="Sync tags from remote origin."
|
'-f/-n', "--fetch/--no-fetch", is_flag=True, default=True, help="Sync tags from remote origin."
|
||||||
)
|
)
|
||||||
def show(verbose: int = 0, fetch: bool = True) -> None:
|
def show(verbose: int = 0, fetch: bool = True) -> None:
|
||||||
"""Show current version."""
|
"""Show current version."""
|
||||||
|
|
@ -211,7 +211,7 @@ def _bump(cfg: config.Config, new_version: str, allow_dirty: bool = False) -> No
|
||||||
|
|
||||||
@cli.command()
|
@cli.command()
|
||||||
@click.option("-v", "--verbose" , count=True , help="Control log level. -vv for debug level.")
|
@click.option("-v", "--verbose" , count=True , help="Control log level. -vv for debug level.")
|
||||||
@click.option('-f', "--fetch/--no-fetch", is_flag=True, default=True)
|
@click.option('-f/-n', "--fetch/--no-fetch", is_flag=True, default=True, help="Sync tags from remote origin.")
|
||||||
@click.option(
|
@click.option(
|
||||||
"--dry", default=False, is_flag=True, help="Display diff of changes, don't rewrite files."
|
"--dry", default=False, is_flag=True, help="Display diff of changes, don't rewrite files."
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue