~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge_directive.py

  • Committer: Jelmer Vernooij
  • Date: 2010-03-13 02:49:14 UTC
  • mto: This revision was merged to the branch mainline in revision 5089.
  • Revision ID: jelmer@samba.org-20100313024914-rpuoguinoxpxt05b
Allow merge directives to output multiple patch files. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
 
70
70
    This is the base class that all merge directive implementations 
71
71
    should derive from.
 
72
 
 
73
    :cvar multiple_output_files: Whether or not this merge directive 
 
74
        stores a set of revisions in more than one file
72
75
    """
73
76
 
74
77
    hooks = MergeDirectiveHooks()
75
78
 
 
79
    multiple_output_files = False
 
80
 
76
81
    def __init__(self, revision_id, testament_sha1, time, timezone,
77
82
                 target_branch, patch=None, source_branch=None, message=None,
78
83
                 bundle=None):
104
109
        """
105
110
        raise NotImplementedError(self.to_lines)
106
111
 
 
112
    def to_files(self):
 
113
        """Serialize as a set of files.
 
114
 
 
115
        :return: List of tuples with filename and contents as lines
 
116
        """
 
117
        raise NotImplementedError(self.to_files)
 
118
 
107
119
    def get_raw_bundle(self):
108
120
        """Return the bundle for this merge directive.
109
121
 
130
142
        lines.append('# \n')
131
143
        return lines
132
144
 
 
145
    def write_to_directory(self, path):
 
146
        """Write this merge directive to a series of files in a directory.
 
147
 
 
148
        :param path: Filesystem path to write to
 
149
        """
 
150
        raise NotImplementedError(self.write_to_directory)
 
151
 
133
152
    @classmethod
134
153
    def from_objects(klass, repository, revision_id, time, timezone,
135
154
                 target_branch, patch_type='bundle',