~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-11 16:16:00 UTC
  • mto: (2323.6.9 0.15-integration)
  • mto: This revision was merged to the branch mainline in revision 2342.
  • Revision ID: aaron.bentley@utoronto.ca-20070311161600-hvtsmkf3d2z72562
Allow leading junk before merge directive header

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
        :param lines: An iterable of lines
89
89
        :return: a MergeRequest
90
90
        """
91
 
        if not lines[0].startswith('# ' + klass._format_string):
 
91
        line_iter = iter(lines)
 
92
        for line in line_iter:
 
93
            if line.startswith('# ' + klass._format_string):
 
94
                break
 
95
        else:
92
96
            raise errors.NotAMergeDirective(lines[0])
93
 
        line_iter = iter(lines[1:])
94
97
        stanza = rio.read_patch_stanza(line_iter)
95
98
        patch_lines = list(line_iter)
96
99
        if len(patch_lines) == 0: