hal.cvs package¶
Submodules¶
hal.cvs.gits module¶
Handles main models in git repository
-
class
hal.cvs.gits.
Commit
(commit)[source]¶ Bases:
object
Git repository commit
Gets author
Returns: author of commit
-
class
hal.cvs.gits.
Diff
(diff)[source]¶ Bases:
object
Git diff result
-
ADD
= 'added'¶
-
DEL
= 'removed'¶
-
-
class
hal.cvs.gits.
Repository
(repo_path)[source]¶ Bases:
object
Git repository
-
get_diff
(commit, other_commit)[source]¶ Calculates total additions and deletions
Parameters: - commit – First commit
- other_commit – Second commit
Returns: dictionary: Dictionary with total additions and deletions
-
get_diff_amounts
()[source]¶ Gets list of total diff
Returns: List of total diff between 2 consecutive commits since start
-
get_new_version
(last_version, last_commit, diff_to_increase_ratio)[source]¶ Gets new version
Parameters: - last_version – last version known
- last_commit – hash of commit of last version
- diff_to_increase_ratio – Ratio to convert number of changes into
Returns: new version
-
hal.cvs.versioning module¶
Models to version stuff
-
class
hal.cvs.versioning.
Level
(max_inner, start=0)[source]¶ Bases:
hal.cvs.versioning.VersionNumber
Level of version number
-
increase
(amount=1)[source]¶ Increase version by this amount
Parameters: amount – Increase number by this amount Returns: True iff increase was successful
-
max
()[source]¶ Calculates max increases
Returns: Number of increases that can be done before reaching
-
-
class
hal.cvs.versioning.
Subsystem
(levels, separator='.')[source]¶ Bases:
hal.cvs.versioning.VersionNumber
List of levels of version system
-
increase
(amount=1)[source]¶ Increase version by this amount
Parameters: amount – Increase number by this amount Returns: True iff increase was successful
-
max
()[source]¶ Calculates max increases
Returns: Number of increases that can be done before reaching
-
-
class
hal.cvs.versioning.
Version
(start='0.0.0', max_number=9, separator='.')[source]¶ Bases:
hal.cvs.versioning.VersionNumber
-
static
from_str
(string, max_number=9, separator='.')[source]¶ Parses string
Parameters: - string – Version
- max_number – Max number reachable by sub
- separator – Version numbers are separated with this split
Returns: Parses string and returns object
-
increase_by_changes
(changes_amount, ratio)[source]¶ Increase version by amount of changes
Parameters: - changes_amount – Number of changes done
- ratio – Ratio changes
Returns: Increases version accordingly to changes
-
max
()[source]¶ Calculates max increases
Returns: Number of increases that can be done before reaching
-
static
-
class
hal.cvs.versioning.
VersionNumber
[source]¶ Bases:
object
Version
-
can_increase
(amount)[source]¶ Checks iff can increase by such amount
Parameters: amount – Amount to increase Returns: True iff this number can be increased by such amount
-
increase
(amount=1)[source]¶ Increase version by this amount
Parameters: amount – Increase number by this amount Returns: True iff increase was successful
-
max
()[source]¶ Calculates max increases
Returns: Number of increases that can be done before reaching
-