~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge3.py

  • Committer: Ian Clatworthy
  • Date: 2007-11-30 04:28:32 UTC
  • mto: (3054.1.1 ianc-integration)
  • mto: This revision was merged to the branch mainline in revision 3055.
  • Revision ID: ian.clatworthy@internode.on.net-20071130042832-6prruj0kzg3fodm8
chapter 2 tweaks

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2004, 2005 by Canonical Ltd
 
1
# Copyright (C) 2004, 2005 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
88
88
                    reprocess=False):
89
89
        """Return merge in cvs-like form.
90
90
        """
 
91
        newline = '\n'
 
92
        if len(self.a) > 0:
 
93
            if self.a[0].endswith('\r\n'):
 
94
                newline = '\r\n'
 
95
            elif self.a[0].endswith('\r'):
 
96
                newline = '\r'
91
97
        if base_marker and reprocess:
92
98
            raise CantReprocessAndShowBase()
93
99
        if name_a:
111
117
                for i in range(t[1], t[2]):
112
118
                    yield self.b[i]
113
119
            elif what == 'conflict':
114
 
                yield start_marker + '\n'
 
120
                yield start_marker + newline
115
121
                for i in range(t[3], t[4]):
116
122
                    yield self.a[i]
117
123
                if base_marker is not None:
118
 
                    yield base_marker + '\n'
 
124
                    yield base_marker + newline
119
125
                    for i in range(t[1], t[2]):
120
126
                        yield self.base[i]
121
 
                yield mid_marker + '\n'
 
127
                yield mid_marker + newline
122
128
                for i in range(t[5], t[6]):
123
129
                    yield self.b[i]
124
 
                yield end_marker + '\n'
 
130
                yield end_marker + newline
125
131
            else:
126
132
                raise ValueError(what)
127
133