~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to read_changeset.py

  • Committer: John Arbash Meinel
  • Date: 2005-06-19 22:50:45 UTC
  • mto: (0.5.85) (1185.82.1 bzr-w-changeset)
  • mto: This revision was merged to the branch mainline in revision 1738.
  • Revision ID: john@arbash-meinel.com-20050619225045-c01df86b335d67d1
Added some extra work into changeset, created some dummy files for testing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
    def create_maps(self):
45
45
        """Go through the individual id sections, and generate the id2path and path2id maps.
46
46
        """
47
 
        self.id2path[self.tree_root_id] = ''
48
 
        self.path2id[''] = self.tree_root_id
49
 
        self.id2parent[self.tree_root_id] = None # There is no parent for the tree_root_id
 
47
        # Rather than use an empty path, the changeset code seems 
 
48
        # to like to use "./." for the tree root.
 
49
        self.id2path[self.tree_root_id] = './.'
 
50
        self.path2id['./.'] = self.tree_root_id
 
51
        self.id2parent[self.tree_root_id] = bzrlib.changeset.NULL_ID
 
52
 
50
53
        for var in (self.file_ids, self.directory_ids, self.parent_ids):
51
54
            if var is not None:
52
55
                for info in var:
155
158
 
156
159
    def _read_patches(self):
157
160
        for line in self.from_file:
 
161
            if line[:3] == '***': # This is a bzr meta field
 
162
                self._parse_meta(line)
 
163
            elif line[:3] == '---': # This is the 'pre' line for a pre+post patch
 
164
                pass
 
165
            elif line[:3] == '+++': # This is the 'post' line for the pre+post patch
 
166
                pass
158
167
            if line[0] == '#':
159
168
                return line
160
169