Rev 1910: Use revmeta signature support. in file:///data/jelmer/bzr-svn/trunk/

Jelmer Vernooij jelmer at samba.org
Fri Sep 12 12:02:51 BST 2008


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

------------------------------------------------------------
revno: 1910
revision-id: jelmer at samba.org-20080912110224-v0tlqt9gmhb6fgzw
parent: jelmer at samba.org-20080912095923-a5m0alhph7uea1xe
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Fri 2008-09-12 13:02:24 +0200
message:
  Use revmeta signature support.
modified:
  repository.py                  repository.py-20060306123302-1f8c5069b3fe0265
  revmeta.py                     revmeta.py-20080901215045-n8a6arqybs9ez5hl-1
=== modified file 'repository.py'
--- a/repository.py	2008-09-11 17:56:37 +0000
+++ b/repository.py	2008-09-12 11:02:24 +0000
@@ -507,8 +507,7 @@
         :param revision_id: Revision for which to return the XML.
         :return: XML string
         """
-        return self._serializer.write_revision_to_string(
-            self.get_revision(revision_id))
+        return self._serializer.write_revision_to_string(self.get_revision(revision_id))
 
     def seen_bzr_revprops(self):
         """Check whether bzr-specific custom revision properties are present on this 
@@ -535,11 +534,10 @@
             at the moment.
         """
         try:
-            (path, revnum, mapping) = self.lookup_revision_id(revision_id)
+            revmeta = self._get_revmeta(revision_id)
         except NoSuchRevision:
             return False
-        revprops = self.transport.revprop_list(revnum)
-        return revprops.has_key(SVN_REVPROP_BZR_SIGNATURE)
+        return revmeta.get_signature() is not None
 
     def get_signature_text(self, revision_id):
         """Return the signature text for a particular revision.
@@ -548,12 +546,11 @@
                             signature.
         :raises NoSuchRevision: Always
         """
-        (path, revnum, mapping) = self.lookup_revision_id(revision_id)
-        revprops = self.transport.revprop_list(revnum)
-        try:
-            return revprops[SVN_REVPROP_BZR_SIGNATURE]
-        except KeyError:
+        revmeta = self._get_revmeta(revision_id)
+        signature = revmeta.get_signature()
+        if signature is None:
             raise NoSuchRevision(self, revision_id)
+        return signature
 
     def add_signature_text(self, revision_id, signature):
         (path, revnum, mapping) = self.lookup_revision_id(revision_id)

=== modified file 'revmeta.py'
--- a/revmeta.py	2008-09-12 09:59:23 +0000
+++ b/revmeta.py	2008-09-12 11:02:24 +0000
@@ -186,14 +186,16 @@
 
         """
         if not self.knows_fileprops() and not self.consider_bzr_fileprops():
-            # This revisions descendant doesn't have bzr fileprops set, so this one can't have them either.
+            # This revisions descendant doesn't have bzr fileprops set, so this one can't have 
+            # them either.
             return 0
         return estimate_bzr_ancestors(self.get_fileprops())
 
     def estimate_svk_fileprop_ancestors(self):
         """Estimate how many svk ancestors this revision has."""
         if not self.knows_fileprops() and not self.consider_svk_fileprops():
-            # This revisions descendant doesn't have svk fileprops set, so this one can't have them either.
+            # This revisions descendant doesn't have svk fileprops set, so this one can't have 
+            # them either.
             return 0
         return estimate_svk_ancestors(self.get_fileprops())
 




More information about the bazaar-commits mailing list