Show More
@@ -7,9 +7,6 b' import hashlib' | |||||
7 | import hmac |
|
7 | import hmac | |
8 | import json |
|
8 | import json | |
9 | import logging |
|
9 | import logging | |
10 | try: |
|
|||
11 | import cPickle as pickle |
|
|||
12 | except ImportError: |
|
|||
13 |
|
|
10 | import pickle | |
14 | import sys |
|
11 | import sys | |
15 | import threading |
|
12 | import threading |
@@ -32,8 +32,8 b' import time' | |||||
32 | import collections |
|
32 | import collections | |
33 | import difflib |
|
33 | import difflib | |
34 | import logging |
|
34 | import logging | |
35 |
import |
|
35 | import pickle | |
36 |
from itertools import tee |
|
36 | from itertools import tee | |
37 |
|
37 | |||
38 | from rhodecode.lib.vcs.exceptions import VCSError |
|
38 | from rhodecode.lib.vcs.exceptions import VCSError | |
39 | from rhodecode.lib.vcs.nodes import FileNode, SubModuleNode |
|
39 | from rhodecode.lib.vcs.nodes import FileNode, SubModuleNode | |
@@ -430,10 +430,10 b' class DiffProcessor(object):' | |||||
430 | lineiter = iter(chunk) |
|
430 | lineiter = iter(chunk) | |
431 | try: |
|
431 | try: | |
432 | while 1: |
|
432 | while 1: | |
433 |
line = |
|
433 | line = next(lineiter) | |
434 | if line['action'] not in ( |
|
434 | if line['action'] not in ( | |
435 | Action.UNMODIFIED, Action.CONTEXT): |
|
435 | Action.UNMODIFIED, Action.CONTEXT): | |
436 |
nextline = |
|
436 | nextline = next(lineiter) | |
437 | if nextline['action'] in ['unmod', 'context'] or \ |
|
437 | if nextline['action'] in ['unmod', 'context'] or \ | |
438 | nextline['action'] == line['action']: |
|
438 | nextline['action'] == line['action']: | |
439 | continue |
|
439 | continue | |
@@ -633,7 +633,7 b' class DiffProcessor(object):' | |||||
633 | raw_diff = [] |
|
633 | raw_diff = [] | |
634 |
|
634 | |||
635 | try: |
|
635 | try: | |
636 |
line = |
|
636 | line = next(diff_iter) | |
637 |
|
637 | |||
638 | while line: |
|
638 | while line: | |
639 | raw_diff.append(line) |
|
639 | raw_diff.append(line) | |
@@ -665,7 +665,7 b' class DiffProcessor(object):' | |||||
665 | 'line': line, |
|
665 | 'line': line, | |
666 | }) |
|
666 | }) | |
667 |
|
667 | |||
668 |
line = |
|
668 | line = next(diff_iter) | |
669 |
|
669 | |||
670 | while old_line < old_end or new_line < new_end: |
|
670 | while old_line < old_end or new_line < new_end: | |
671 | command = ' ' |
|
671 | command = ' ' | |
@@ -700,7 +700,7 b' class DiffProcessor(object):' | |||||
700 | }) |
|
700 | }) | |
701 | raw_diff.append(line) |
|
701 | raw_diff.append(line) | |
702 |
|
702 | |||
703 |
line = |
|
703 | line = next(diff_iter) | |
704 |
|
704 | |||
705 | if self._newline_marker.match(line): |
|
705 | if self._newline_marker.match(line): | |
706 | # we need to append to lines, since this is not |
|
706 | # we need to append to lines, since this is not | |
@@ -727,7 +727,7 b' class DiffProcessor(object):' | |||||
727 | raw_diff = [] |
|
727 | raw_diff = [] | |
728 |
|
728 | |||
729 | try: |
|
729 | try: | |
730 |
line = |
|
730 | line = next(diff_iter) | |
731 |
|
731 | |||
732 | while line: |
|
732 | while line: | |
733 | raw_diff.append(line) |
|
733 | raw_diff.append(line) | |
@@ -759,7 +759,7 b' class DiffProcessor(object):' | |||||
759 | old_end += old_line |
|
759 | old_end += old_line | |
760 | new_end += new_line |
|
760 | new_end += new_line | |
761 |
|
761 | |||
762 |
line = |
|
762 | line = next(diff_iter) | |
763 |
|
763 | |||
764 | while old_line < old_end or new_line < new_end: |
|
764 | while old_line < old_end or new_line < new_end: | |
765 | command = ' ' |
|
765 | command = ' ' | |
@@ -794,7 +794,7 b' class DiffProcessor(object):' | |||||
794 | }) |
|
794 | }) | |
795 | raw_diff.append(line) |
|
795 | raw_diff.append(line) | |
796 |
|
796 | |||
797 |
line = |
|
797 | line = next(diff_iter) | |
798 |
|
798 | |||
799 | if self._newline_marker.match(line): |
|
799 | if self._newline_marker.match(line): | |
800 | # we need to append to lines, since this is not |
|
800 | # we need to append to lines, since this is not | |
@@ -1066,7 +1066,7 b' class DiffProcessor(object):' | |||||
1066 | context_iter = iter(context) |
|
1066 | context_iter = iter(context) | |
1067 | for line_idx, line in enumerate(chunk): |
|
1067 | for line_idx, line in enumerate(chunk): | |
1068 | try: |
|
1068 | try: | |
1069 |
if _context_line(line) == |
|
1069 | if _context_line(line) == next(context_iter): | |
1070 | continue |
|
1070 | continue | |
1071 | except StopIteration: |
|
1071 | except StopIteration: | |
1072 | matches.append((line_idx, chunk)) |
|
1072 | matches.append((line_idx, chunk)) | |
@@ -1076,7 +1076,7 b' class DiffProcessor(object):' | |||||
1076 | # if we had a match at the end |
|
1076 | # if we had a match at the end | |
1077 | line_idx += 1 |
|
1077 | line_idx += 1 | |
1078 | try: |
|
1078 | try: | |
1079 |
|
|
1079 | next(context_iter) | |
1080 | except StopIteration: |
|
1080 | except StopIteration: | |
1081 | matches.append((line_idx, chunk)) |
|
1081 | matches.append((line_idx, chunk)) | |
1082 |
|
1082 |
General Comments 0
You need to be logged in to leave comments.
Login now