~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/changeset/__init__.py

  • Committer: John Arbash Meinel
  • Date: 2005-11-19 04:22:51 UTC
  • mto: (1185.82.108 w-changeset)
  • mto: This revision was merged to the branch mainline in revision 1738.
  • Revision ID: john@arbash-meinel.com-20051119042251-aaa8514b7d68c29f
Working on creating a factor for serializing changesets.

Show diffs side-by-side

added added

removed removed

Lines of Context:
849
849
 
850
850
class Changeset(object):
851
851
    """A set of changes to apply"""
852
 
    def __init__(self):
 
852
    def __init__(self, base_id=None, target_id=None):
 
853
        self.base_id = base_id
 
854
        self.target_id = target_id
853
855
        self.entries = {}
854
856
 
855
857
    def add_entry(self, entry):
1418
1420
                yield file_id
1419
1421
 
1420
1422
    def __call__(self):
1421
 
        cset = Changeset()
 
1423
        base_id = hasattr(self.tree_a, 'get_revision_id') and self.tree_a.get_revision_id()
 
1424
        target_id = hasattr(self.tree_b, 'get_revision_id') and self.tree_b.get_revision_id()
 
1425
        cset = Changeset(base_id, target_id)
1422
1426
        for file_id in self.iter_both_tree_ids():
1423
1427
            cs_entry = self.make_entry(file_id)
1424
1428
            if cs_entry is not None and not cs_entry.is_boring():