You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2021/10/08 21:25:57 UTC
[allura] branch master updated: Fix typing import, var name, cleanup
This is an automated email from the ASF dual-hosted git repository.
brondsem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git
The following commit(s) were added to refs/heads/master by this push:
new eae1567 Fix typing import, var name, cleanup
eae1567 is described below
commit eae15670e167a0fc30261348c41a0ed4aa5f4997
Author: Dave Brondsema <db...@slashdotmedia.com>
AuthorDate: Fri Oct 8 17:18:03 2021 -0400
Fix typing import, var name, cleanup
---
Allura/allura/model/index.py | 5 +++++
Allura/allura/model/repo_refresh.py | 8 ++------
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/Allura/allura/model/index.py b/Allura/allura/model/index.py
index 27fc9dd..61a2393 100644
--- a/Allura/allura/model/index.py
+++ b/Allura/allura/model/index.py
@@ -20,6 +20,7 @@ from __future__ import absolute_import
import re
import logging
from itertools import groupby
+import typing
from ming.odm.property import FieldProperty
from six.moves.cPickle import dumps, loads
@@ -41,6 +42,10 @@ from .session import main_orm_session
from .project import Project
import six
+if typing.TYPE_CHECKING:
+ from ming.odm.mapper import Query
+
+
log = logging.getLogger(__name__)
diff --git a/Allura/allura/model/repo_refresh.py b/Allura/allura/model/repo_refresh.py
index 5b36379..0afbab5 100644
--- a/Allura/allura/model/repo_refresh.py
+++ b/Allura/allura/model/repo_refresh.py
@@ -135,10 +135,7 @@ def refresh_commit_repos(all_commit_ids, repo):
ci.repo_ids.append(repo._id)
index_id = 'allura.model.repository.Commit#' + oid
# TODO: use ArtifactReference.from_artifact?
- # print(f'ref {index_id}')
- # if '5c472' in index_id: 0/0
ref = ArtifactReference(
- # ref = ArtifactReferenceDoc(dict(
_id=index_id,
artifact_reference=dict(
cls=bson.Binary(dumps(Commit, protocol=2)),
@@ -146,7 +143,6 @@ def refresh_commit_repos(all_commit_ids, repo):
app_config_id=repo.app.config._id,
artifact_id=oid),
references=[])
- # )
# TODO: use Shortlink.from_artifact?
link0 = Shortlink(
_id=bson.ObjectId(),
@@ -171,8 +167,8 @@ def refresh_commit_repos(all_commit_ids, repo):
state(link0).status = ObjectState.dirty
session(link0).flush(link0)
session(link0).expunge(link0)
- state(link0).status = ObjectState.dirty
- session(link1).flush(link0)
+ state(link1).status = ObjectState.dirty
+ session(link1).flush(link1)
session(link1).expunge(link1)