equal
deleted
inserted
replaced
616 if syncprops: |
616 if syncprops: |
617 # properties |
617 # properties |
618 self.rqlexecall(ss.updaterdef2rql(rdef, repordef.eid), |
618 self.rqlexecall(ss.updaterdef2rql(rdef, repordef.eid), |
619 ask_confirm=confirm) |
619 ask_confirm=confirm) |
620 # constraints |
620 # constraints |
621 newconstraints = list(rdef.constraints) |
621 # 0. eliminate the set of unmodified constraints from the sets of |
|
622 # old/new constraints |
|
623 newconstraints = set(rdef.constraints) |
|
624 oldconstraints = set(repordef.constraints) |
|
625 unchanged_constraints = newconstraints & oldconstraints |
|
626 newconstraints -= unchanged_constraints |
|
627 oldconstraints -= unchanged_constraints |
622 # 1. remove old constraints and update constraints of the same type |
628 # 1. remove old constraints and update constraints of the same type |
623 # NOTE: don't use rschema.constraint_by_type because it may be |
629 # NOTE: don't use rschema.constraint_by_type because it may be |
624 # out of sync with newconstraints when multiple |
630 # out of sync with newconstraints when multiple |
625 # constraints of the same type are used |
631 # constraints of the same type are used |
626 for cstr in repordef.constraints: |
632 for cstr in oldconstraints: |
627 for newcstr in newconstraints: |
633 for newcstr in newconstraints: |
628 if newcstr.type() == cstr.type(): |
634 if newcstr.type() == cstr.type(): |
629 break |
635 break |
630 else: |
636 else: |
631 newcstr = None |
637 newcstr = None |