Rev 2769: Merge more bzr.dev goodness. in http://people.ubuntu.com/~robertc/baz2.0/repository

Robert Collins robertc at robertcollins.net
Fri Sep 21 02:37:01 BST 2007


At http://people.ubuntu.com/~robertc/baz2.0/repository

------------------------------------------------------------
revno: 2769
revision-id: robertc at robertcollins.net-20070921013648-i9w180g6ea73w9mf
parent: robertc at robertcollins.net-20070921002704-ci0zcbhvcis4hhoy
parent: pqm at pqm.ubuntu.com-20070921005024-anlkzk5nrdtujta4
committer: Robert Collins <robertc at robertcollins.net>
branch nick: repository
timestamp: Fri 2007-09-21 11:36:48 +1000
message:
  Merge more bzr.dev goodness.
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/knit.py                 knit.py-20051212171256-f056ac8f0fbe1bd9
  bzrlib/versionedfile.py        versionedfile.py-20060222045106-5039c71ee3b65490
    ------------------------------------------------------------
    revno: 2592.1.25.2.7.1.28.1.6.1.3.1.9.2.1.3.74.1.31.3.18.1.9.1.2.1.12.1.8.1.16
    revision-id: pqm at pqm.ubuntu.com-20070921005024-anlkzk5nrdtujta4
    parent: pqm at pqm.ubuntu.com-20070920235505-6w61gqyajy9i0ioj
    parent: ian.clatworthy at internode.on.net-20070920224415-92hsfa28iflycxvz
    committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
    branch nick: +trunk
    timestamp: Fri 2007-09-21 01:50:24 +0100
    message:
      tuned_gzip.bytes_to_gzip() for faster commits (Robert Collins)
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/knit.py                 knit.py-20051212171256-f056ac8f0fbe1bd9
      bzrlib/tuned_gzip.py           tuned_gzip.py-20060407014720-5aadc518e928e8d2
        ------------------------------------------------------------
        revno: 2592.1.25.2.7.1.28.1.6.1.3.1.9.2.1.3.74.1.31.3.18.1.9.1.2.1.12.1.8.1.14.1.1
        revision-id: ian.clatworthy at internode.on.net-20070920224415-92hsfa28iflycxvz
        parent: pqm at pqm.ubuntu.com-20070920125023-upjqmzln7mjtvj1h
        parent: robertc at robertcollins.net-20070913031607-fit1cj291o8yu1z2
        committer: Ian Clatworthy <ian.clatworthy at internode.on.net>
        branch nick: ianc-integration2
        timestamp: Fri 2007-09-21 08:44:15 +1000
        message:
          tuned_gzip.bytes_to_gzip() for faster commits (Robert Collins)
        modified:
          NEWS                           NEWS-20050323055033-4e00b5db738777ff
          bzrlib/knit.py                 knit.py-20051212171256-f056ac8f0fbe1bd9
          bzrlib/tuned_gzip.py           tuned_gzip.py-20060407014720-5aadc518e928e8d2
        ------------------------------------------------------------
        revno: 2592.1.25.2.7.1.28.1.6.1.3.1.9.2.1.3.74.1.31.3.18.1.9.1.2.1.12.3.1
        revision-id: robertc at robertcollins.net-20070913031607-fit1cj291o8yu1z2
        parent: pqm at pqm.ubuntu.com-20070912222627-zvqit350mf6gvrbh
        committer: Robert Collins <robertc at robertcollins.net>
        branch nick: knits
        timestamp: Thu 2007-09-13 13:16:07 +1000
        message:
          * New helper ``bzrlib.tuned_gzip.bytes_to_gzip`` which takes a byte string
            and returns a gzipped version of the same. This is used to avoid a bunch
            of api friction during adding of knit hunks. (Robert Collins)
        modified:
          NEWS                           NEWS-20050323055033-4e00b5db738777ff
          bzrlib/knit.py                 knit.py-20051212171256-f056ac8f0fbe1bd9
          bzrlib/tuned_gzip.py           tuned_gzip.py-20060407014720-5aadc518e928e8d2
    ------------------------------------------------------------
    revno: 2592.1.25.2.7.1.28.1.6.1.3.1.9.2.1.3.74.1.31.3.18.1.9.1.2.1.12.1.8.1.15
    revision-id: pqm at pqm.ubuntu.com-20070920235505-6w61gqyajy9i0ioj
    parent: pqm at pqm.ubuntu.com-20070920125023-upjqmzln7mjtvj1h
    parent: ian.clatworthy at internode.on.net-20070920061251-hmtw92x5y19nhwa1
    committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
    branch nick: +trunk
    timestamp: Fri 2007-09-21 00:55:05 +0100
    message:
      versionedfile.py code cleanups (Ian Clatworthy)
    modified:
      bzrlib/knit.py                 knit.py-20051212171256-f056ac8f0fbe1bd9
      bzrlib/versionedfile.py        versionedfile.py-20060222045106-5039c71ee3b65490
    ------------------------------------------------------------
    revno: 2592.1.25.2.7.1.28.1.6.1.3.1.9.2.1.3.74.1.31.3.18.1.9.1.2.1.12.1.8.1.11.1.1
    revision-id: ian.clatworthy at internode.on.net-20070920061251-hmtw92x5y19nhwa1
    parent: pqm at pqm.ubuntu.com-20070920024052-y2l7r5o00zrpnr73
    parent: ian.clatworthy at internode.on.net-20070920011247-0me000hq8e69yi6l
    committer: Ian Clatworthy <ian.clatworthy at internode.on.net>
    branch nick: ianc-integration
    timestamp: Thu 2007-09-20 16:12:51 +1000
    message:
      versionedfile.py code cleanups (Ian Clatworthy)
    modified:
      bzrlib/knit.py                 knit.py-20051212171256-f056ac8f0fbe1bd9
      bzrlib/versionedfile.py        versionedfile.py-20060222045106-5039c71ee3b65490
    ------------------------------------------------------------
    revno: 2592.1.25.2.7.1.28.1.6.1.3.1.9.2.1.3.74.1.31.3.18.1.9.1.2.1.12.1.8.1.6.7.2
    revision-id: ian.clatworthy at internode.on.net-20070920011247-0me000hq8e69yi6l
    parent: ian.clatworthy at internode.on.net-20070919233838-b0da8j380rleae9f
    committer: Ian Clatworthy <ian.clatworthy at internode.on.net>
    branch nick: bzr.versionedfile
    timestamp: Thu 2007-09-20 11:12:47 +1000
    message:
      incorporate feedback from lifeless & abentley on _apply_delta
    modified:
      bzrlib/knit.py                 knit.py-20051212171256-f056ac8f0fbe1bd9
      bzrlib/versionedfile.py        versionedfile.py-20060222045106-5039c71ee3b65490
    ------------------------------------------------------------
    revno: 2592.1.25.2.7.1.28.1.6.1.3.1.9.2.1.3.74.1.31.3.18.1.9.1.2.1.12.1.8.1.6.7.1
    revision-id: ian.clatworthy at internode.on.net-20070919233838-b0da8j380rleae9f
    parent: pqm at pqm.ubuntu.com-20070918045733-es6jch43pxvogvhj
    committer: Ian Clatworthy <ian.clatworthy at internode.on.net>
    branch nick: bzr.versionedfile
    timestamp: Thu 2007-09-20 09:38:38 +1000
    message:
      versionedfile.py code cleanups
    modified:
      bzrlib/versionedfile.py        versionedfile.py-20060222045106-5039c71ee3b65490
=== modified file 'NEWS'
--- a/NEWS	2007-09-21 00:27:04 +0000
+++ b/NEWS	2007-09-21 01:36:48 +0000
@@ -98,6 +98,10 @@
    * New method on xml serialisers, write_inventory_to_lines, which matches the
      API used by knits for adding content. (Robert Collins)
 
+   * New helper ``bzrlib.tuned_gzip.bytes_to_gzip`` which takes a byte string
+     and returns a gzipped version of the same. This is used to avoid a bunch
+     of api friction during adding of knit hunks. (Robert Collins)
+
   TESTING:
 
 

=== modified file 'bzrlib/knit.py'
--- a/bzrlib/knit.py	2007-09-21 00:27:04 +0000
+++ b/bzrlib/knit.py	2007-09-21 01:36:48 +0000
@@ -1014,6 +1014,16 @@
             text_map[version_id] = text
         return text_map, final_content
 
+    @staticmethod
+    def _apply_delta(lines, delta):
+        """Apply delta to lines."""
+        lines = list(lines)
+        offset = 0
+        for start, end, count, delta_lines in delta:
+            lines[offset+start:offset+end] = delta_lines
+            offset = offset + (start - end) + count
+        return lines
+
     def iter_lines_added_or_present_in_versions(self, version_ids=None, 
                                                 pb=None):
         """See VersionedFile.iter_lines_added_or_present_in_versions()."""

=== modified file 'bzrlib/versionedfile.py'
--- a/bzrlib/versionedfile.py	2007-09-21 00:27:04 +0000
+++ b/bzrlib/versionedfile.py	2007-09-21 01:36:48 +0000
@@ -193,6 +193,7 @@
         already present in file history."""
         new_version_id = osutils.safe_revision_id(new_version_id)
         old_version_id = osutils.safe_revision_id(old_version_id)
+        parents = [osutils.safe_revision_id(v) for v in parents]
         self._check_write_ok()
         return self._clone_text(new_version_id, old_version_id, parents)
 
@@ -212,12 +213,12 @@
     def get_format_signature(self):
         """Get a text description of the data encoding in this file.
         
-        :since: 0.19
+        :since: 0.90
         """
         raise NotImplementedError(self.get_format_signature)
 
     def make_mpdiffs(self, version_ids):
-        """Create multiparent diffs for specified versions"""
+        """Create multiparent diffs for specified versions."""
         knit_versions = set()
         for version_id in version_ids:
             knit_versions.add(version_id)
@@ -241,11 +242,12 @@
         return None
 
     def add_mpdiffs(self, records):
-        """Add mpdiffs to this versionedfile
+        """Add mpdiffs to this VersionedFile.
 
         Records should be iterables of version, parents, expected_sha1,
-        mpdiff.  mpdiff should be a MultiParent instance.
+        mpdiff. mpdiff should be a MultiParent instance.
         """
+        # Does this need to call self._check_write_ok()? (IanC 20070919)
         vf_parents = {}
         mpvf = multiparent.MultiMemoryVersionedFile()
         versions = []
@@ -277,7 +279,7 @@
     def get_sha1(self, version_id):
         """Get the stored sha1 sum for the given revision.
         
-        :param name: The name of the version to lookup
+        :param version_id: The name of the version to lookup
         """
         raise NotImplementedError(self.get_sha1)
 
@@ -287,7 +289,7 @@
         :param version_ids: The names of the versions to lookup
         :return: a list of sha1s in order according to the version_ids
         """
-        raise NotImplementedError(self.get_sha1)
+        raise NotImplementedError(self.get_sha1s)
 
     def get_suffixes(self):
         """Return the file suffixes associated with this versioned file."""
@@ -399,7 +401,7 @@
         """Yield list of (version-id, line) pairs for the specified
         version.
 
-        Must raise RevisionNotPresent if any of the given versions are
+        Must raise RevisionNotPresent if the given version is
         not present in file history.
         """
         raise NotImplementedError(self.annotate_iter)
@@ -407,15 +409,6 @@
     def annotate(self, version_id):
         return list(self.annotate_iter(version_id))
 
-    def _apply_delta(self, lines, delta):
-        """Apply delta to lines."""
-        lines = list(lines)
-        offset = 0
-        for start, end, count, delta_lines in delta:
-            lines[offset+start:offset+end] = delta_lines
-            offset = offset + (start - end) + count
-        return lines
-
     def join(self, other, pb=None, msg=None, version_ids=None,
              ignore_missing=False):
         """Integrate versions from other into this versioned file.
@@ -424,8 +417,8 @@
         incorporated into this versioned file.
 
         Must raise RevisionNotPresent if any of the specified versions
-        are not present in the other files history unless ignore_missing
-        is supplied when they are silently skipped.
+        are not present in the other file's history unless ignore_missing
+        is supplied in which case they are silently skipped.
         """
         self._check_write_ok()
         return InterVersionedFile.get(other, self).join(
@@ -568,7 +561,7 @@
 
 
 class WeaveMerge(PlanWeaveMerge):
-    """Weave merge that takes a VersionedFile and two versions as its input"""
+    """Weave merge that takes a VersionedFile and two versions as its input."""
 
     def __init__(self, versionedfile, ver_a, ver_b, 
         a_marker=PlanWeaveMerge.A_MARKER, b_marker=PlanWeaveMerge.B_MARKER):
@@ -577,7 +570,7 @@
 
 
 class InterVersionedFile(InterObject):
-    """This class represents operations taking place between two versionedfiles..
+    """This class represents operations taking place between two VersionedFiles.
 
     Its instances have methods like join, and contain
     references to the source and target versionedfiles these operations can be 
@@ -598,8 +591,8 @@
         incorporated into this versioned file.
 
         Must raise RevisionNotPresent if any of the specified versions
-        are not present in the other files history unless ignore_missing is 
-        supplied when they are silently skipped.
+        are not present in the other file's history unless ignore_missing is 
+        supplied in which case they are silently skipped.
         """
         # the default join: 
         # - if the target is empty, just add all the versions from 



More information about the bazaar-commits mailing list