Rev 622: Move ancestry function to mapping code. in file:///data/jelmer/bzr-svn/revprops/

Jelmer Vernooij jelmer at samba.org
Fri Feb 1 19:07:49 GMT 2008


At file:///data/jelmer/bzr-svn/revprops/

------------------------------------------------------------
revno: 622
revision-id:jelmer at samba.org-20080201190748-4kvoeqydlo7myg59
parent: jelmer at samba.org-20080201185236-5bp8q23j0qyttcfd
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: revprops
timestamp: Fri 2008-02-01 20:07:48 +0100
message:
  Move ancestry function to mapping code.
modified:
  mapping.py                     mapping.py-20080128201303-6cp01phc0dmc0kiv-1
  repository.py                  repository.py-20060306123302-1f8c5069b3fe0265
=== modified file 'mapping.py'
--- a/mapping.py	2008-02-01 18:52:36 +0000
+++ b/mapping.py	2008-02-01 19:07:48 +0000
@@ -301,6 +301,13 @@
         raise NotImplementedError(self.get_rhs_parents)
 
     @staticmethod
+    def get_rhs_ancestors(revprops, get_branch_file_property, scheme):
+        """Obtain the right-hand side ancestors for a revision.
+
+        """
+        raise NotImplementedError(self.get_rhs_ancestors)
+
+    @staticmethod
     def get_fileid_map(revprops, get_branch_file_property):
         raise NotImplementedError(self.get_fileid_map)
 
@@ -422,6 +429,13 @@
 
         return []
 
+    @staticmethod
+    def get_rhs_ancestors(revprops, get_branch_file_property, scheme):
+        ancestry = []
+        for l in get_branch_file_property(SVN_PROP_BZR_ANCESTRY+str(scheme), "").splitlines():
+            ancestry.extend(l.split("\n"))
+        return ancestry
+
     @classmethod
     def get_fileid_map(cls, svn_revprops, get_branch_file_property):
         fileids = get_branch_file_property(SVN_PROP_BZR_FILEIDS, None)

=== modified file 'repository.py'
--- a/repository.py	2008-02-01 18:52:36 +0000
+++ b/repository.py	2008-02-01 19:07:48 +0000
@@ -40,7 +40,6 @@
 import logwalker
 from mapping import (default_mapping, SVN_PROP_BZR_REVISION_ID, 
                      SVN_PROP_BZR_BRANCHING_SCHEME,
-                     SVN_PROP_BZR_ANCESTRY, 
                      parse_revision_metadata, parse_revid_property, 
                      parse_merge_property)
 from revids import RevidMap
@@ -291,10 +290,9 @@
 
         ancestry = [revision_id]
 
-        for l in self.branchprop_list.get_property(path, revnum, 
-                                    SVN_PROP_BZR_ANCESTRY+str(scheme), "").splitlines():
-            ancestry.extend(l.split("\n"))
-
+        svn_revprops = self.transport.revprop_list(revnum)
+        get_branch_fileprop = lambda name, default: self.branchprop_list.get_property(path, revnum, name, default)
+        ancestry.extend(default_mapping.get_rhs_ancestors(svn_revprops, get_branch_fileprop))
         if revnum > 0:
             for (branch, rev) in self.follow_branch(path, revnum - 1, scheme):
                 ancestry.append(




More information about the bazaar-commits mailing list