[CalendarServer-changes] [12762] twext/trunk/twext/enterprise/dal/model.py

source_changes at macosforge.org source_changes at macosforge.org
Thu Feb 27 10:11:35 PST 2014


Revision: 12762
          http://trac.calendarserver.org//changeset/12762
Author:   cdaboo at apple.com
Date:     2014-02-27 10:11:35 -0800 (Thu, 27 Feb 2014)
Log Message:
-----------
Schema comparison prints out the full names of mismatched objects.

Modified Paths:
--------------
    twext/trunk/twext/enterprise/dal/model.py

Modified: twext/trunk/twext/enterprise/dal/model.py
===================================================================
--- twext/trunk/twext/enterprise/dal/model.py	2014-02-27 02:34:52 UTC (rev 12761)
+++ twext/trunk/twext/enterprise/dal/model.py	2014-02-27 18:11:35 UTC (rev 12762)
@@ -320,10 +320,14 @@
         otherColumns = dict([
             (item.name.lower(), item) for item in other.columns
         ])
-        for item in set(myColumns.keys()) ^ set(otherColumns.keys()):
+        for item in set(myColumns.keys()) - set(otherColumns.keys()):
             results.append(
-                "Table: %s, missing column: %s" % (self.name, item,)
+                "Table: %s, extra column: %s" % (self.name, myColumns[item].name,)
             )
+        for item in set(otherColumns.keys()) - set(myColumns.keys()):
+            results.append(
+                "Table: %s, missing column: %s" % (self.name, otherColumns[item].name,)
+            )
 
         for name in set(myColumns.keys()) & set(otherColumns.keys()):
             results.extend(myColumns[name].compare(otherColumns[name]))
@@ -561,13 +565,13 @@
             ])
             for item in set(myItems.keys()) - set(otherItems.keys()):
                 results.append(
-                    "Schema: %s, missing %s: %s"
-                    % (other.filename, descriptor, item)
+                    "Schema: %s, extra %s: %s"
+                    % (other.filename, descriptor, myItems[item].name)
                 )
             for item in set(otherItems.keys()) - set(myItems.keys()):
                 results.append(
                     "Schema: %s, missing %s: %s"
-                    % (self.filename, descriptor, item)
+                    % (self.filename, descriptor, otherItems[item].name)
                 )
 
             for name in set(myItems.keys()) & set(otherItems.keys()):
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140227/04d0d17a/attachment-0001.html>


More information about the calendarserver-changes mailing list