Changeset View
Changeset View
Standalone View
Standalone View
swh/model/hypothesis_strategies.py
Show First 20 Lines • Show All 194 Lines • ▼ Show 20 Lines | if not only_objects: | ||||
if (target | if (target | ||||
and target.target_type == 'alias' | and target.target_type == 'alias' | ||||
and target.target not in branches) | and target.target not in branches) | ||||
} | } | ||||
for alias in unresolved_aliases: | for alias in unresolved_aliases: | ||||
branches[alias] = draw(branch_targets(only_objects=True)) | branches[alias] = draw(branch_targets(only_objects=True)) | ||||
# Ensure no cycles between aliases | |||||
while True: | while True: | ||||
try: | try: | ||||
id_ = snapshot_identifier({ | id_ = snapshot_identifier({ | ||||
'branches': { | 'branches': { | ||||
name: branch.to_dict() if branch else None | name: branch.to_dict() if branch else None | ||||
for (name, branch) in branches.items()}}) | for (name, branch) in branches.items()}}) | ||||
except ValueError as e: | except ValueError as e: | ||||
for (source, target) in e.args[1]: | for (source, target) in e.args[1]: | ||||
Show All 22 Lines |