Commits

Andrew Godwin committed 03960fb

Correct hrefs in the output.

Comments (0)

Files changed (2)

         if self.parent is None:
             return ""
         else:
-            return self.parent.get_path + "/" + self.name
+            return self.parent.get_path() + "/" + self.name
     
     def parents(self):
         "Returns the list of parents, up to the root node, which comes first."
         up_rep = Element(SVN_NS+"update-report")
         up_rep.attrib['send-all'] = "true"
         
-        SubElement(up_rep, SVN_NS+"target-revision", rev="1")
+        rev = "1"
+        
+        SubElement(up_rep, SVN_NS+"target-revision", rev=rev)
         
         # The root directory is special.
         root_directory = self.repo.get_rev(1)
-        dir = SubElement(up_rep, SVN_NS+"open-directory", rev="1")
+        dir = SubElement(up_rep, SVN_NS+"open-directory", rev=rev)
         dir_ch_in = SubElement(dir, DAV_NS+"checked-in")
-        dir_ch_in.append(self._href("/!svn/ver/1/"))
+        dir_ch_in.append(self._href("/!svn/ver/%s/" % rev))
         
         print root_directory, root_directory.children
         
                 # Make the directory's entry
                 dir = SubElement(parent, SVN_NS+"add-directory", name=item.name, rev="1")
                 dir_ch_in = SubElement(dir, DAV_NS+"checked-in")
-                dir_ch_in.append(self._href("/!svn/ver/1/"))
+                dir_ch_in.append(self._href("/!svn/ver/%s%s" % (rev, item.get_path())))
                 # Add its children
                 for child in item.get_children():
                     queue.append((dir, child))
                 # Make the file object
                 file = SubElement(parent, SVN_NS+"add-file", name=item.name)
                 dir_ch_in = SubElement(file, DAV_NS+"checked-in")
-                dir_ch_in.append(self._href("/!svn/ver/1/hello.txt"))
-                rev = SubElement(file, SVN_NS+"set-prop", name="svn:entry:committed-rev")
-                rev.text = "1"
+                dir_ch_in.append(self._href("/!svn/ver/%s%s" % (rev, item.get_path())))
+                rev_elem = SubElement(file, SVN_NS+"set-prop", name="svn:entry:committed-rev")
+                rev_elem.text = str(rev)
                 txdelta = SubElement(file, SVN_NS+"txdelta")
                 txdelta.text = make_cheap_diff(item.contents).encode("base64")
         
+        print tostring(up_rep)
         return Response(tostring(up_rep))
     
     def _href(self, target):