~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/inventory_delta.py

  • Committer: Andrew Bennetts
  • Date: 2009-07-08 01:35:28 UTC
  • mto: (4476.3.44 inventory-delta)
  • mto: This revision was merged to the branch mainline in revision 4608.
  • Revision ID: andrew.bennetts@canonical.com-20090708013528-d8eic6goftb5rudl
Add some more comments and docstring text to inventory_delta.py.

Show diffs side-by-side

added added

removed removed

Lines of Context:
119
119
class InventoryDeltaSerializer(object):
120
120
    """Serialize and deserialize inventory deltas."""
121
121
 
 
122
    # XXX: really, the serializer and deserializer should be two separate
 
123
    # classes.
 
124
 
122
125
    FORMAT_1 = 'bzr inventory delta v1 (bzr 1.14)'
123
126
 
124
127
    def __init__(self):
132
135
        }
133
136
 
134
137
    def require_flags(self, versioned_root=None, tree_references=None):
135
 
        """XXX
 
138
        """Set the versioned_root and/or tree_references flags for this
 
139
        (de)serializer.
136
140
 
137
141
        :param versioned_root: If True, any root entry that is seen is expected
138
142
            to be versioned, and root entries can have any fileid.
152
156
    def delta_to_lines(self, old_name, new_name, delta_to_new):
153
157
        """Return a line sequence for delta_to_new.
154
158
 
 
159
        Both the versioned_root and tree_references flags must be set via
 
160
        require_flags before calling this.
 
161
 
155
162
        :param old_name: A UTF8 revision id for the old inventory.  May be
156
163
            NULL_REVISION if there is no older inventory and delta_to_new
157
164
            includes the entire inventory contents.
236
243
    def parse_text_bytes(self, bytes):
237
244
        """Parse the text bytes of a serialized inventory delta.
238
245
 
 
246
        If versioned_root and/or tree_references flags were set via
 
247
        require_flags, then the parsed flags must match or a BzrError will be
 
248
        raised.
 
249
 
239
250
        :param bytes: The bytes to parse. This can be obtained by calling
240
251
            delta_to_lines and then doing ''.join(delta_lines).
241
252
        :return: (parent_id, new_id, versioned_root, tree_references,