~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge_directive.py

  • Committer: Aaron Bentley
  • Date: 2007-03-01 01:34:55 UTC
  • mto: (2323.6.9 0.15-integration)
  • mto: This revision was merged to the branch mainline in revision 2330.
  • Revision ID: abentley@panoramicfeedback.com-20070301013455-4i2rtr2x7ykhedt6
Add failing test

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 
10
10
class MergeDirective(object):
11
11
 
12
 
    def __init__(self, revision, testament_sha1, time, timezone,
 
12
    def __init__(self, revision_id, testament_sha1, time, timezone,
13
13
                 submit_location, patch=None, patch_type=None,
14
14
                 public_location=None):
15
15
        assert patch_type in (None, 'diff', 'bundle')
17
17
            raise errors.NoMergeSource()
18
18
        if patch_type is not None and patch is None:
19
19
            raise errors.PatchMissing(patch_type)
20
 
        self.revision = revision
 
20
        self.revision_id = revision_id
21
21
        self.testament_sha1 = testament_sha1
22
22
        self.time = time
23
23
        self.timezone = timezone
44
44
        time, timezone = bundle_serializer.unpack_highres_date(
45
45
            stanza.get('timestamp'))
46
46
        kwargs = {}
47
 
        for key in ('revision', 'testament_sha1', 'submit_location',
 
47
        for key in ('revision_id', 'testament_sha1', 'submit_location',
48
48
                    'public_location'):
49
49
            try:
50
50
                kwargs[key] = stanza.get(key)
56
56
    def to_lines(self):
57
57
        timestamp = bundle_serializer.format_highres_date(self.time,
58
58
                                                          self.timezone)
59
 
        stanza = rio.Stanza(revision=self.revision, timestamp=timestamp,
 
59
        stanza = rio.Stanza(revision_id=self.revision_id, timestamp=timestamp,
60
60
                            submit_location=self.submit_location,
61
61
                            testament_sha1=self.testament_sha1)
62
62
        for key in ('public_location',):
69
69
        return lines
70
70
 
71
71
    @classmethod
72
 
    def from_objects(klass, repository, revision, submit_location,
 
72
    def from_objects(klass, repository, revision_id, submit_location,
73
73
                 patch_type='bundle', local_submit_location=None,
74
74
                 public_location=None):
75
75
        if patch_type == 'bundle':
76
 
            patch = klass._generate_bundle(repository, revision,
 
76
            patch = klass._generate_bundle(repository, revision_id,
77
77
                                           submit_location)
78
78
        elif patch_type == 'diff':
79
 
            patch = klass._generate_diff(repository, revision,
 
79
            patch = klass._generate_diff(repository, revision_id,
80
80
                                         submit_location)
81
81
        else:
82
82
            patch = None
83
 
        return MergeDirective(revision, submit_location, patch, patch_type,
 
83
        return MergeDirective(revision_id, submit_location, patch, patch_type,
84
84
                              public_location)