~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revision.py

  • Committer: Martin Pool
  • Date: 2005-06-11 01:39:37 UTC
  • Revision ID: mbp@sourcefrog.net-20050611013937-fa6a4081ce78b100
- revision records include the hash of their inventory and
  of their predecessor.
  patch from John A Meinel

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
    """
39
39
    def __init__(self, **args):
40
40
        self.inventory_id = None
 
41
        self.inventory_sha1 = None
41
42
        self.revision_id = None
42
43
        self.timestamp = None
43
44
        self.message = None
44
45
        self.timezone = None
45
46
        self.committer = None
46
47
        self.precursor = None
 
48
        self.precursor_sha1 = None
47
49
        self.__dict__.update(args)
48
50
 
49
51
 
57
59
                       timestamp = '%.9f' % self.timestamp,
58
60
                       revision_id = self.revision_id,
59
61
                       inventory_id = self.inventory_id,
 
62
                       inventory_sha1 = self.inventory_sha1,
60
63
                       timezone = str(self.timezone))
61
64
        if self.precursor:
62
65
            root.set('precursor', self.precursor)
 
66
            if self.precursor_sha1:
 
67
                root.set('precursor_sha1', self.precursor_sha1)
63
68
        root.text = '\n'
64
69
        
65
70
        msg = SubElement(root, 'message')
77
82
        cs = cls(committer = elt.get('committer'),
78
83
                 timestamp = float(elt.get('timestamp')),
79
84
                 precursor = elt.get('precursor'),
 
85
                 precursor_sha1 = elt.get('precursor_sha1'),
80
86
                 revision_id = elt.get('revision_id'),
81
 
                 inventory_id = elt.get('inventory_id'))
 
87
                 inventory_id = elt.get('inventory_id'),
 
88
                 inventory_sha1 = elt.get('inventory_sha1')
 
89
                 )
82
90
 
83
91
        v = elt.get('timezone')
84
92
        cs.timezone = v and int(v)