1023 creation (but not the relation definitions themselves, for which |
1023 creation (but not the relation definitions themselves, for which |
1024 committing depends on the `commit` argument value). |
1024 committing depends on the `commit` argument value). |
1025 |
1025 |
1026 """ |
1026 """ |
1027 reposchema = self.repo.schema |
1027 reposchema = self.repo.schema |
|
1028 rschema = self.fs_schema.rschema(rtype) |
|
1029 execute = self._cw.execute |
1028 if rtype in reposchema: |
1030 if rtype in reposchema: |
1029 print 'warning: relation type %s is already known, skip addition' % ( |
1031 print 'warning: relation type %s is already known, skip addition' % ( |
1030 rtype) |
1032 rtype) |
1031 return |
1033 else: |
1032 rschema = self.fs_schema.rschema(rtype) |
1034 # register the relation into CWRType and insert necessary relation |
1033 execute = self._cw.execute |
1035 # definitions |
1034 # register the relation into CWRType and insert necessary relation |
1036 ss.execschemarql(execute, rschema, ss.rschema2rql(rschema, addrdef=False)) |
1035 # definitions |
|
1036 ss.execschemarql(execute, rschema, ss.rschema2rql(rschema, addrdef=False)) |
|
1037 if addrdef: |
1037 if addrdef: |
1038 self.commit() |
1038 self.commit() |
1039 gmap = self.group_mapping() |
1039 gmap = self.group_mapping() |
1040 cmap = self.cstrtype_mapping() |
1040 cmap = self.cstrtype_mapping() |
1041 done = set() |
1041 done = set() |