zrb 0.28.0__py3-none-any.whl → 0.28.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- zrb/builtin/git/get_file_changes.py +13 -5
- zrb/helper/git/detect_changes.py +7 -2
- {zrb-0.28.0.dist-info → zrb-0.28.1.dist-info}/METADATA +1 -1
- {zrb-0.28.0.dist-info → zrb-0.28.1.dist-info}/RECORD +7 -7
- {zrb-0.28.0.dist-info → zrb-0.28.1.dist-info}/LICENSE +0 -0
- {zrb-0.28.0.dist-info → zrb-0.28.1.dist-info}/WHEEL +0 -0
- {zrb-0.28.0.dist-info → zrb-0.28.1.dist-info}/entry_points.txt +0 -0
@@ -16,12 +16,19 @@ from zrb.task_input.str_input import StrInput
|
|
16
16
|
description="Get modified files",
|
17
17
|
inputs=[
|
18
18
|
StrInput(
|
19
|
-
name="commit",
|
19
|
+
name="current-commit",
|
20
20
|
shortcut="c",
|
21
|
-
description="commit hash/tag",
|
22
|
-
prompt="
|
21
|
+
description="current commit hash/tag",
|
22
|
+
prompt="Current commit hash/Tag",
|
23
23
|
default="HEAD",
|
24
24
|
),
|
25
|
+
StrInput(
|
26
|
+
name="source-commit",
|
27
|
+
shortcut="s",
|
28
|
+
description="source commit hash/tag",
|
29
|
+
prompt="Source commit hash/Tag",
|
30
|
+
default="main",
|
31
|
+
),
|
25
32
|
BoolInput(
|
26
33
|
name="include-new",
|
27
34
|
description="include new files",
|
@@ -44,11 +51,12 @@ from zrb.task_input.str_input import StrInput
|
|
44
51
|
runner=runner,
|
45
52
|
)
|
46
53
|
async def get_git_file_changes(*args: Any, **kwargs: Any):
|
47
|
-
|
54
|
+
current_commit = kwargs.get("current_commit", "HEAD")
|
55
|
+
source_commit = kwargs.get("source_commit", "main")
|
48
56
|
include_new = kwargs.get("include_new", True)
|
49
57
|
include_removed = kwargs.get("include_removed", True)
|
50
58
|
include_updated = kwargs.get("include_updated", True)
|
51
|
-
modified_file_states = get_modified_file_states(
|
59
|
+
modified_file_states = get_modified_file_states(current_commit, source_commit)
|
52
60
|
modified_file_keys = []
|
53
61
|
output = []
|
54
62
|
for modified_file, state in modified_file_states.items():
|
zrb/helper/git/detect_changes.py
CHANGED
@@ -16,8 +16,13 @@ class ModificationState:
|
|
16
16
|
|
17
17
|
|
18
18
|
@typechecked
|
19
|
-
def get_modified_file_states(
|
20
|
-
|
19
|
+
def get_modified_file_states(
|
20
|
+
current_commit: str, source_commit: str = "main"
|
21
|
+
) -> Mapping[str, ModificationState]:
|
22
|
+
# git show b176b5a main
|
23
|
+
exit_status, output = subprocess.getstatusoutput(
|
24
|
+
f"git diff {source_commit} {current_commit}"
|
25
|
+
)
|
21
26
|
if exit_status != 0:
|
22
27
|
raise Exception(output)
|
23
28
|
lines = output.split("\n")
|
@@ -80,7 +80,7 @@ zrb/builtin/explain/task.py,sha256=HaWEwHn9lwXT1hrEgmQw-sW2qY62qaPsCEtY92F7yzA,3
|
|
80
80
|
zrb/builtin/git/__init__.py,sha256=1oIuwaOTyXomYGLjS65VLRXCLgTOqT79R2YGkVhcdGk,239
|
81
81
|
zrb/builtin/git/_group.py,sha256=yDZD0dIXDI8oG2DQpWsZhDS07HKAHrLj-luKTscI0ng,106
|
82
82
|
zrb/builtin/git/clear_branch.py,sha256=4eccEAlSoo1GcP7VZQTg-0d8gohuxlBZpBQohGIe3tg,479
|
83
|
-
zrb/builtin/git/get_file_changes.py,sha256=
|
83
|
+
zrb/builtin/git/get_file_changes.py,sha256=ejnRt4iL8T7yKKygHfvE1YweUMB7gJwXr0BzQdfu53s,2763
|
84
84
|
zrb/builtin/group.py,sha256=6k4TM49C93GZF63srUNkoVwdoIaoD5__dw66krPipGo,1292
|
85
85
|
zrb/builtin/md5/__init__.py,sha256=UQVSJdQTrLF8XDKNRhkFG05DHjfGQiarlwoatqRJwn0,196
|
86
86
|
zrb/builtin/md5/_group.py,sha256=dimqCmJItc7qx7yRm64tL608oMAjOVXRycP7NTSSFi0,100
|
@@ -1355,7 +1355,7 @@ zrb/helper/file/copy_tree.py,sha256=Tm1ImZWJ9tKB3sQd-4M0Kk1NSuBMLDlkYQfSKV_Grsc,
|
|
1355
1355
|
zrb/helper/file/match.py,sha256=wUan0dYRhzSW0_vU247SH3hEeZ_MWyDacoJdmnlS3cY,713
|
1356
1356
|
zrb/helper/file/text.py,sha256=7JqNbk8hC7Y4UopEmhiGYkxDAauepvI1tEkbfpzcI84,963
|
1357
1357
|
zrb/helper/git/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1358
|
-
zrb/helper/git/detect_changes.py,sha256=
|
1358
|
+
zrb/helper/git/detect_changes.py,sha256=jrfSe8po4f9ynTl05PBHAThaESw9ZeqfalR_rNR_VhQ,1420
|
1359
1359
|
zrb/helper/loader/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
1360
1360
|
zrb/helper/loader/load_module.py,sha256=OfF7rtiXjNqAjIycLveXcmrWz8bZ0R9uqKeae_xYc2c,570
|
1361
1361
|
zrb/helper/loader/load_script.py,sha256=LvIRB4-f3ft-wEp1amhws-L-mCKDQ1rFUzrdc16AwGE,1998
|
@@ -1432,8 +1432,8 @@ zrb/task_input/multiline_input.py,sha256=KNto5k5X1C6KE_A-vX0OjpQyjgCRJ6BR2PwHXNQ
|
|
1432
1432
|
zrb/task_input/password_input.py,sha256=95NlJ9xIq7z_evpAyR2XsBpeuWpBXd2Ezn3P7oDOttk,4360
|
1433
1433
|
zrb/task_input/str_input.py,sha256=0nje7vI9fs_xqQBbmKB8Yn7wevlWp9Qebv7f8-GmiXs,4350
|
1434
1434
|
zrb/task_input/task_input.py,sha256=WTj_qIQyRs-04-VotjNTcVyIuf6b2afInVoCQHoRmr0,2327
|
1435
|
-
zrb-0.28.
|
1436
|
-
zrb-0.28.
|
1437
|
-
zrb-0.28.
|
1438
|
-
zrb-0.28.
|
1439
|
-
zrb-0.28.
|
1435
|
+
zrb-0.28.1.dist-info/LICENSE,sha256=WfnGCl8G60EYOPAEkuc8C9m9pdXWDe08NsKj3TBbxsM,728
|
1436
|
+
zrb-0.28.1.dist-info/METADATA,sha256=G0gdU5pa1asXppGDzHH6NFIdDc7gXAstIsznDYCd53E,17094
|
1437
|
+
zrb-0.28.1.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
1438
|
+
zrb-0.28.1.dist-info/entry_points.txt,sha256=xTgXc1kBKYhJHEujdaSPHUcJT3-hbyP1mLgwkv-5sSk,40
|
1439
|
+
zrb-0.28.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|