mirror of
https://github.com/TECHNOFAB11/bumpver.git
synced 2025-12-12 06:20:08 +01:00
more vcs integration
This commit is contained in:
parent
fc937ddf8d
commit
181da8c930
3 changed files with 24 additions and 9 deletions
|
|
@ -240,4 +240,11 @@ def bump(
|
|||
if dry or not cfg.commit:
|
||||
return
|
||||
|
||||
# TODO (mb 2018-09-04): add files and commit
|
||||
for filepath in filepaths:
|
||||
_vcs.add(filepath)
|
||||
|
||||
_vcs.commit(f"bump version to {new_version}")
|
||||
|
||||
if cfg.tag:
|
||||
_vcs.tag(new_version)
|
||||
_vcs.push()
|
||||
|
|
|
|||
|
|
@ -119,6 +119,11 @@ def _parse_buffer(cfg_buffer: io.StringIO, config_filename: str = "<pycalver.cfg
|
|||
if file_patterns is None:
|
||||
return None
|
||||
|
||||
if tag and not commit:
|
||||
log.error(f"Invalid configuration in {config_filename}")
|
||||
log.error(" pycalver.commit = True required if pycalver.tag = True")
|
||||
return None
|
||||
|
||||
cfg = Config(current_version, tag, commit, file_patterns)
|
||||
|
||||
log.debug(cfg._debug_str())
|
||||
|
|
|
|||
|
|
@ -69,6 +69,9 @@ class VCS:
|
|||
return False
|
||||
raise
|
||||
|
||||
def fetch(self) -> None:
|
||||
self('fetch')
|
||||
|
||||
def status(self) -> typ.List[str]:
|
||||
status_output = self('status')
|
||||
return [
|
||||
|
|
@ -77,8 +80,12 @@ class VCS:
|
|||
if not line.strip().startswith(b"??")
|
||||
]
|
||||
|
||||
def fetch(self) -> None:
|
||||
self('fetch')
|
||||
def ls_tags(self) -> typ.List[str]:
|
||||
ls_tag_lines = self('ls_tags').splitlines()
|
||||
log.debug(f"ls_tags output {ls_tag_lines}")
|
||||
return [
|
||||
line.decode("utf-8").strip() for line in ls_tag_lines if line.strip().startswith(b"v")
|
||||
]
|
||||
|
||||
def add(self, path) -> None:
|
||||
log.info(f"{self.name} add {path}")
|
||||
|
|
@ -104,12 +111,8 @@ class VCS:
|
|||
def tag(self, name) -> None:
|
||||
self('tag', name=name)
|
||||
|
||||
def ls_tags(self) -> typ.List[str]:
|
||||
ls_tag_lines = self('ls_tags').splitlines()
|
||||
log.debug(f"ls_tags output {ls_tag_lines}")
|
||||
return [
|
||||
line.decode("utf-8").strip() for line in ls_tag_lines if line.strip().startswith(b"v")
|
||||
]
|
||||
def push(self) -> None:
|
||||
self('push')
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return f"VCS(name='{self.name}')"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue