uEdition-Editor 2.0.0b6__py3-none-any.whl → 2.0.0b7__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.
Potentially problematic release.
This version of uEdition-Editor might be problematic. Click here for more details.
- uedition_editor/__about__.py +1 -1
- uedition_editor/api/branches.py +3 -0
- uedition_editor/cron.py +41 -35
- {uedition_editor-2.0.0b6.dist-info → uedition_editor-2.0.0b7.dist-info}/METADATA +2 -2
- {uedition_editor-2.0.0b6.dist-info → uedition_editor-2.0.0b7.dist-info}/RECORD +8 -8
- {uedition_editor-2.0.0b6.dist-info → uedition_editor-2.0.0b7.dist-info}/WHEEL +0 -0
- {uedition_editor-2.0.0b6.dist-info → uedition_editor-2.0.0b7.dist-info}/entry_points.txt +0 -0
- {uedition_editor-2.0.0b6.dist-info → uedition_editor-2.0.0b7.dist-info}/licenses/LICENSE.txt +0 -0
uedition_editor/__about__.py
CHANGED
uedition_editor/api/branches.py
CHANGED
|
@@ -97,6 +97,7 @@ async def create_branch(
|
|
|
97
97
|
repo.branches.local.create(branch_id, commit)
|
|
98
98
|
repo.checkout(repo.branches[branch_id])
|
|
99
99
|
repo.branches[branch_id].upstream = repo.branches[f"{init_settings.git.remote_name}/{branch_id}"]
|
|
100
|
+
await cron.insecure_track_branches()
|
|
100
101
|
return {"id": branch_id, "title": de_slugify(data.title)}
|
|
101
102
|
else:
|
|
102
103
|
for remote_branch_id in repo.branches.remote:
|
|
@@ -115,6 +116,7 @@ async def create_branch(
|
|
|
115
116
|
)
|
|
116
117
|
fetch_repo(repo, init_settings.git.remote_name)
|
|
117
118
|
repo.branches[branch_id].upstream = repo.branches[f"{init_settings.git.remote_name}/{branch_id}"]
|
|
119
|
+
await cron.insecure_track_branches()
|
|
118
120
|
return {"id": branch_id, "title": data.title}
|
|
119
121
|
except GitError as ge:
|
|
120
122
|
logger.error(ge)
|
|
@@ -165,3 +167,4 @@ async def delete_branch(
|
|
|
165
167
|
)
|
|
166
168
|
if branch_id in repo.branches:
|
|
167
169
|
repo.branches.delete(branch_id)
|
|
170
|
+
await cron.insecure_track_branches()
|
uedition_editor/cron.py
CHANGED
|
@@ -16,42 +16,48 @@ from uedition_editor.state import local_branches, remote_branches
|
|
|
16
16
|
logger = logging.getLogger(__name__)
|
|
17
17
|
|
|
18
18
|
|
|
19
|
+
async def insecure_track_branches():
|
|
20
|
+
"""
|
|
21
|
+
Track the status of all git branches.
|
|
22
|
+
|
|
23
|
+
Use only when the uedition_lock is already completed.
|
|
24
|
+
"""
|
|
25
|
+
remote_branches.clear()
|
|
26
|
+
local_branches.clear()
|
|
27
|
+
try:
|
|
28
|
+
repo = Repository(init_settings.base_path, flags=RepositoryOpenFlag.NO_SEARCH)
|
|
29
|
+
logger.debug("Tracking branches")
|
|
30
|
+
repo.checkout(repo.branches[init_settings.git.default_branch])
|
|
31
|
+
if init_settings.git.remote_name in list(repo.remotes.names()):
|
|
32
|
+
logger.debug("Synchronising with remote")
|
|
33
|
+
fetch_repo(repo, init_settings.git.remote_name)
|
|
34
|
+
logger.debug("Updating branch status")
|
|
35
|
+
for branch_name in repo.branches.local:
|
|
36
|
+
repo.checkout(repo.branches[branch_name])
|
|
37
|
+
if init_settings.git.remote_name in list(repo.remotes.names()):
|
|
38
|
+
if repo.branches[branch_name].upstream is not None:
|
|
39
|
+
pull_branch(repo, branch_name)
|
|
40
|
+
diff = repo.diff(
|
|
41
|
+
repo.revparse_single(init_settings.git.default_branch),
|
|
42
|
+
)
|
|
43
|
+
local_branches.append(
|
|
44
|
+
{
|
|
45
|
+
"id": branch_name,
|
|
46
|
+
"title": de_slugify(branch_name),
|
|
47
|
+
"update_from_default": diff.stats.files_changed > 0,
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
for branch_name in repo.branches.remote:
|
|
51
|
+
if repo.branches[branch_name].remote_name == init_settings.git.remote_name and "HEAD" not in branch_name:
|
|
52
|
+
remote_branches.append({"id": branch_name, "title": de_slugify(branch_name)})
|
|
53
|
+
logger.debug("Tracking complete")
|
|
54
|
+
except GitError as ge:
|
|
55
|
+
logger.error(ge)
|
|
56
|
+
local_branches.append({"id": "-", "title": "Direct Access", "nogit": True})
|
|
57
|
+
|
|
58
|
+
|
|
19
59
|
@aiocron.crontab("*/5 * * * *")
|
|
20
60
|
async def track_branches() -> None:
|
|
21
61
|
"""Track the status of all git branches."""
|
|
22
62
|
async with uedition_lock:
|
|
23
|
-
|
|
24
|
-
local_branches.clear()
|
|
25
|
-
try:
|
|
26
|
-
repo = Repository(init_settings.base_path, flags=RepositoryOpenFlag.NO_SEARCH)
|
|
27
|
-
logger.debug("Tracking branches")
|
|
28
|
-
repo.checkout(repo.branches[init_settings.git.default_branch])
|
|
29
|
-
if init_settings.git.remote_name in list(repo.remotes.names()):
|
|
30
|
-
logger.debug("Synchronising with remote")
|
|
31
|
-
fetch_repo(repo, init_settings.git.remote_name)
|
|
32
|
-
logger.debug("Updating branch status")
|
|
33
|
-
for branch_name in repo.branches.local:
|
|
34
|
-
repo.checkout(repo.branches[branch_name])
|
|
35
|
-
if init_settings.git.remote_name in list(repo.remotes.names()):
|
|
36
|
-
if repo.branches[branch_name].upstream is not None:
|
|
37
|
-
pull_branch(repo, branch_name)
|
|
38
|
-
diff = repo.diff(
|
|
39
|
-
repo.revparse_single(init_settings.git.default_branch),
|
|
40
|
-
)
|
|
41
|
-
local_branches.append(
|
|
42
|
-
{
|
|
43
|
-
"id": branch_name,
|
|
44
|
-
"title": de_slugify(branch_name),
|
|
45
|
-
"update_from_default": diff.stats.files_changed > 0,
|
|
46
|
-
}
|
|
47
|
-
)
|
|
48
|
-
for branch_name in repo.branches.remote:
|
|
49
|
-
if (
|
|
50
|
-
repo.branches[branch_name].remote_name == init_settings.git.remote_name
|
|
51
|
-
and "HEAD" not in branch_name
|
|
52
|
-
):
|
|
53
|
-
remote_branches.append({"id": branch_name, "title": de_slugify(branch_name)})
|
|
54
|
-
logger.debug("Tracking complete")
|
|
55
|
-
except GitError as ge:
|
|
56
|
-
logger.error(ge)
|
|
57
|
-
local_branches.append({"id": "-", "title": "Direct Access", "nogit": True})
|
|
63
|
+
await insecure_track_branches()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: uEdition-Editor
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.0b7
|
|
4
4
|
Project-URL: Documentation, https://github.com/uEdition/uEditor#readme
|
|
5
5
|
Project-URL: Issues, https://github.com/uEdition/uEditor/issues
|
|
6
6
|
Project-URL: Source, https://github.com/uEdition/uEditor
|
|
@@ -19,7 +19,7 @@ Requires-Dist: aiocron<3,>=2.1
|
|
|
19
19
|
Requires-Dist: fastapi<1
|
|
20
20
|
Requires-Dist: httptools<1
|
|
21
21
|
Requires-Dist: httpx<1,>=0.28.1
|
|
22
|
-
Requires-Dist: lxml<
|
|
22
|
+
Requires-Dist: lxml<7,>=5
|
|
23
23
|
Requires-Dist: pydantic-settings<3,>=2
|
|
24
24
|
Requires-Dist: pydantic[email]<3,>=2
|
|
25
25
|
Requires-Dist: pygit2<2,>=1.17.0
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
uedition_editor/__about__.py,sha256=
|
|
1
|
+
uedition_editor/__about__.py,sha256=aW-WgftsaGBz6zItvh5iguKin-FT7NQBnp7KmFbnaYk,160
|
|
2
2
|
uedition_editor/__init__.py,sha256=0cx1VWwBkmHTA9kTR7dF22kM-K2I4b8q5bRrEiVJ3Pc,1496
|
|
3
3
|
uedition_editor/__main__.py,sha256=b4COmnuVMw6l_M_HFxKWvPYWwegDk0382NAL_l7w8Do,222
|
|
4
|
-
uedition_editor/cron.py,sha256=
|
|
4
|
+
uedition_editor/cron.py,sha256=3nQp90yvyH7AUkL3lFw2_MEWWHdAxkFraMupJaisn5g,2470
|
|
5
5
|
uedition_editor/settings.py,sha256=NNxu-W3S4lhcROvDXrvWMKJwrT4oZCJJwnDl0sM9mfM,14401
|
|
6
6
|
uedition_editor/state.py,sha256=P9T4bLq5cm-spQMRt63Nin8-a4FDxSfeLy4d4bMl9A4,187
|
|
7
7
|
uedition_editor/api/__init__.py,sha256=zXhBEHFh2UWl9KDgF9bFlVMhUhkES6jmKh1QoBnHtDI,1911
|
|
8
8
|
uedition_editor/api/auth.py,sha256=yZG3K3QglRziJtEod4wFNVrCTyYZC89Hwhx33wGcYgw,7255
|
|
9
|
-
uedition_editor/api/branches.py,sha256=
|
|
9
|
+
uedition_editor/api/branches.py,sha256=uGqJfe2mGdZ_ufnuem3BqMAGwwrpuvWaUHTq7s7pXVc,6993
|
|
10
10
|
uedition_editor/api/configs.py,sha256=lXRpbdxaKQ4OMTVL0nrTHdGE4SBcSMWaWgYhSBXoOh4,2919
|
|
11
11
|
uedition_editor/api/files.py,sha256=ed2lYGwUXMT27dl8ud0n4TR7dJED4hYBhC9hffejVdY,32978
|
|
12
12
|
uedition_editor/api/tests.py,sha256=f9BF3oBAY1o8TA7EhouXmeIDOp4elA4SQaDDtlG1Nh8,1162
|
|
@@ -22,8 +22,8 @@ uedition_editor/frontend/dist/assets/TeiEditor-CjT57X2c.js,sha256=NYzvN2qDd2mEBS
|
|
|
22
22
|
uedition_editor/frontend/dist/assets/index-D6QIwXwq.js,sha256=yz1ijev4Ww2ePUyFSGDZRwRJORkSbbUO_eJTgAq74WU,324108
|
|
23
23
|
uedition_editor/frontend/dist/assets/index-HmBQiVS_.css,sha256=I-O-hMFBmkNau7U6v3iX3AMfMu6stKgFtrNVoGRh1Pk,19716
|
|
24
24
|
uedition_editor/frontend/dist/assets/index-Vcq4gwWv.js,sha256=7NTN0-UTH-BpoJQqdC43Ec4Cdwj4Wv8viGg4W3EBqx8,1494
|
|
25
|
-
uedition_editor-2.0.
|
|
26
|
-
uedition_editor-2.0.
|
|
27
|
-
uedition_editor-2.0.
|
|
28
|
-
uedition_editor-2.0.
|
|
29
|
-
uedition_editor-2.0.
|
|
25
|
+
uedition_editor-2.0.0b7.dist-info/METADATA,sha256=b7zXCYpyodcP6puO-A4s2twma2w_pmm6ax92_lTOyVE,2753
|
|
26
|
+
uedition_editor-2.0.0b7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
27
|
+
uedition_editor-2.0.0b7.dist-info/entry_points.txt,sha256=v2HE8dFcsAPreD-LjMrjsB31iyTTqKjQ-Uj2_ztaqpg,52
|
|
28
|
+
uedition_editor-2.0.0b7.dist-info/licenses/LICENSE.txt,sha256=pL_y3ondEzJrX26zSglvj0GOT0p2SjFnDm7dRpMgk64,1101
|
|
29
|
+
uedition_editor-2.0.0b7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
{uedition_editor-2.0.0b6.dist-info → uedition_editor-2.0.0b7.dist-info}/licenses/LICENSE.txt
RENAMED
|
File without changes
|