Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Ley
synapse
Commits
a8594fd1
Commit
a8594fd1
authored
8 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Use better names
parent
e5d2df9c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/state.py
+7
-9
7 additions, 9 deletions
synapse/state.py
with
7 additions
and
9 deletions
synapse/state.py
+
7
−
9
View file @
a8594fd1
...
@@ -517,21 +517,19 @@ def _create_auth_events_from_maps(unconflicted_state, conflicted_state, state_ma
...
@@ -517,21 +517,19 @@ def _create_auth_events_from_maps(unconflicted_state, conflicted_state, state_ma
return
auth_events
return
auth_events
def
_resolve_with_state
(
unconflicted_state
,
conflicted_state
,
auth_events
,
def
_resolve_with_state
(
unconflicted_state
_ids
,
conflicted_state
_ds
,
auth_event
_id
s
,
state_map
):
state_map
):
new_
conflicted_state
=
{}
conflicted_state
=
{}
for
key
,
event_ids
in
conflicted_state
.
iteritems
():
for
key
,
event_ids
in
conflicted_state
_ds
.
iteritems
():
events
=
[
state_map
[
ev_id
]
for
ev_id
in
event_ids
if
ev_id
in
state_map
]
events
=
[
state_map
[
ev_id
]
for
ev_id
in
event_ids
if
ev_id
in
state_map
]
if
len
(
events
)
>
1
:
if
len
(
events
)
>
1
:
new_
conflicted_state
[
key
]
=
events
conflicted_state
[
key
]
=
events
elif
len
(
events
)
==
1
:
elif
len
(
events
)
==
1
:
unconflicted_state
[
key
]
=
events
[
0
].
event_id
unconflicted_state_ids
[
key
]
=
events
[
0
].
event_id
conflicted_state
=
new_conflicted_state
auth_events
=
{
auth_events
=
{
key
:
state_map
[
ev_id
]
key
:
state_map
[
ev_id
]
for
key
,
ev_id
in
auth_events
.
items
()
for
key
,
ev_id
in
auth_event
_id
s
.
items
()
if
ev_id
in
state_map
if
ev_id
in
state_map
}
}
...
@@ -543,7 +541,7 @@ def _resolve_with_state(unconflicted_state, conflicted_state, auth_events,
...
@@ -543,7 +541,7 @@ def _resolve_with_state(unconflicted_state, conflicted_state, auth_events,
logger
.
exception
(
"
Failed to resolve state
"
)
logger
.
exception
(
"
Failed to resolve state
"
)
raise
raise
new_state
=
unconflicted_state
new_state
=
unconflicted_state
_ids
for
key
,
event
in
resolved_state
.
iteritems
():
for
key
,
event
in
resolved_state
.
iteritems
():
new_state
[
key
]
=
event
.
event_id
new_state
[
key
]
=
event
.
event_id
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment