Full branching works!
authorJelmer Vernooij <jelmer@samba.org>
Tue, 16 May 2006 00:03:39 +0000 (02:03 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Tue, 16 May 2006 00:03:39 +0000 (02:03 +0200)
repository.py

index 64837c1de67d13747dd00cde3b7a6001fa51d67f..410b5eaff442dbd18602bf99ce6c8e7c1857c3e9 100644 (file)
@@ -185,6 +185,19 @@ class SvnRepository(Repository):
     def __del__(self):
         svn.core.svn_pool_destroy(self.pool)
 
+    def _get_last_change_revnum(self,path,revnum):
+        ret = []
+
+        def rcvr(paths,rev,author,date,message,pool):
+            ret.append(rev)
+
+        mutter("svn log -r %d:0 --limit 1 %s" % (revnum,path))
+        svn.ra.get_log(self.ra, [path.encode('utf8')], revnum, \
+            0, 1, False, False, rcvr)
+
+        return ret.pop(0)
+
+
     def get_inventory(self, revision_id):
         (path,revnum) = self.parse_revision_id(revision_id)
         mutter('getting inventory %r for branch %r' % (revnum, path))
@@ -204,7 +217,8 @@ class SvnRepository(Repository):
                 else:
                     child_path = child_name
 
-                (child_id,_) = self.path_to_file_id(revnum, child_path)
+                changed_revnum = self._get_last_change_revnum(child_path,revnum)
+                (child_id,revid) = self.path_to_file_id(changed_revnum, child_path)
 
                 if dirent.kind == svn.core.svn_node_dir:
                     inventry = InventoryDirectory(child_id,child_name,id)
@@ -215,8 +229,7 @@ class SvnRepository(Repository):
                 else:
                     raise BzrError("Unknown entry kind for '%s': %s" % (child_path, dirent.kind))
 
-                # FIXME: shouldn't this be last changed revision?
-                inventry.revision = revision_id
+                inventry.revision = revid
                 inv.add(inventry)
 
             for child_path in recurse: