~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_patiencediff_py.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-09-02 06:24:16 UTC
  • mfrom: (3635.1.3 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20080902062416-dxdxccqki90bcynl
(robertc) Fix repack operations on SMB connections. (Robert Collins,
        bug 255656).

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