MCPcopy
hub / github.com/borgbackup/borg / format_version

Function format_version

src/borg/version.py:36–49  ·  view source on GitHub ↗

A reverse for parse_version (obviously without the dropped information).

(version)

Source from the content-addressed store, hash-verified

34
35
36def format_version(version):
37 """A reverse for parse_version (obviously without the dropped information)."""
38 f = []
39 it = iter(version)
40 while True:
41 part = next(it)
42 if part >= 0:
43 f.append(str(part))
44 elif part == -1:
45 break
46 else:
47 f[-1] = f[-1] + {-2: "rc", -3: "b", -4: "a"}[part] + str(next(it))
48 break
49 return ".".join(f)

Callers 4

do_versionMethod · 0.90
do_rpcFunction · 0.70
do_rpcFunction · 0.70
test_format_versionFunction · 0.50

Calls

no outgoing calls

Tested by 1

test_format_versionFunction · 0.40