[Pkg-bazaar-commits] ./bzr/unstable r215: Doc

mbp at sourcefrog.net mbp at sourcefrog.net
Fri Apr 10 07:51:27 UTC 2009


------------------------------------------------------------
revno: 215
committer: mbp at sourcefrog.net
timestamp: Sat 2005-04-09 15:24:56 +1000
message:
  Doc
modified:
  bzrlib/revfile.py
-------------- next part --------------
=== modified file 'bzrlib/revfile.py'
--- a/bzrlib/revfile.py	2005-04-09 05:20:54 +0000
+++ b/bzrlib/revfile.py	2005-04-09 05:24:56 +0000
@@ -215,10 +215,23 @@
 
 
     def add(self, text, base=_NO_RECORD):
+        """Add a new text to the revfile.
+
+        If the text is already present them its existing id is
+        returned and the file is not changed.
+
+        If a base index is specified, that text *may* be used for
+        delta compression of the new text.  Delta compression will
+        only be used if it would be a size win and if the existing
+        base is not at too long of a delta chain already.
+        """
+        
         text_sha = sha.new(text).digest()
 
         idx = self.find_sha(text_sha)
         if idx != _NO_RECORD:
+            # TODO: Optional paranoid mode where we read out that record and make sure
+            # it's the same, in case someone ever breaks SHA-1.
             return idx                  # already present
         
         if base == _NO_RECORD:



More information about the Pkg-bazaar-commits mailing list