~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_patiencediff_py.py

(vila) Fix test failures blocking package builds. (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
#
14
14
# You should have received a copy of the GNU General Public License
15
15
# along with this program; if not, write to the Free Software
16
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
16
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
17
 
 
18
from __future__ import absolute_import
18
19
 
19
20
from bisect import bisect
20
21
import difflib
49
50
        else:
50
51
            index[line]= i
51
52
    # make btoa[i] = position of line i in a, unless
52
 
    # that line doesn't occur exactly once in both, 
 
53
    # that line doesn't occur exactly once in both,
53
54
    # in which case it's set to None
54
55
    btoa = [None] * len(b)
55
56
    index2 = {}
79
80
            k = len(stacks)
80
81
        # as an optimization, check if the next line comes right after
81
82
        # the previous line, because usually it does
82
 
        elif stacks and stacks[k] < apos and (k == len(stacks) - 1 or 
 
83
        elif stacks and stacks[k] < apos and (k == len(stacks) - 1 or
83
84
                                              stacks[k+1] > apos):
84
85
            k += 1
85
86
        else:
230
231
        >>> s.get_matching_blocks()
231
232
        [(0, 0, 2), (3, 2, 2), (5, 4, 0)]
232
233
        """
233
 
        # jam 20060525 This is the python 2.4.1 difflib get_matching_blocks 
 
234
        # jam 20060525 This is the python 2.4.1 difflib get_matching_blocks
234
235
        # implementation which uses __helper. 2.4.3 got rid of helper for
235
236
        # doing it inline with a queue.
236
237
        # We should consider doing the same for recurse_matches