diff roundup/backends/back_metakit.py @ 1496:e6ac4e074acb

relaxed CVS importing (feature [SF#693277])
author Richard Jones <richard@users.sourceforge.net>
date Thu, 06 Mar 2003 07:33:29 +0000
parents b3f2484babce
children 5c58ccad41ee
line wrap: on
line diff
--- a/roundup/backends/back_metakit.py	Thu Mar 06 07:02:18 2003 +0000
+++ b/roundup/backends/back_metakit.py	Thu Mar 06 07:33:29 2003 +0000
@@ -1106,11 +1106,18 @@
             value = eval(proplist[i])
             if not value:
                 continue
+
             propname = propnames[i]
-            prop = properties[propname]
             if propname == 'id':
                 newid = value = int(value)
-            elif isinstance(prop, hyperdb.Date):
+            elif propname == 'is retired':
+                # is the item retired?
+                if int(value):
+                    d['_isdel'] = 1
+                continue
+
+            prop = properties[propname]
+            if isinstance(prop, hyperdb.Date):
                 value = int(calendar.timegm(value))
             elif isinstance(prop, hyperdb.Interval):
                 value = str(date.Interval(value))
@@ -1124,16 +1131,23 @@
                 # we handle multilinks separately
                 continue
             d[propname] = value
-        # is the item retired?
-        if int(proplist[-1]):
-            d['_isdel'] = 1
+
+        # possibly make a new node
+        if not d.has_key('id'):
+            d['id'] = newid = self.maxid
+            self.maxid += 1
+
+        # save off the node
         view.append(d)
 
+        # fix up multilinks
         ndx = view.find(id=newid)
         row = view[ndx]
         for i in range(len(propnames)):
             value = eval(proplist[i])
             propname = propnames[i]
+            if propname == 'is retired':
+                continue
             prop = properties[propname]
             if not isinstance(prop, hyperdb.Multilink):
                 continue

Roundup Issue Tracker: http://roundup-tracker.org/