Skip to content

Commit 6cf9e21

Browse files
committed
#5 Accept fuzzy patches
Signed-off-by: Uilian Ries <uilianries@gmail.com>
1 parent 3437668 commit 6cf9e21

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

patch_ng.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -305,16 +305,6 @@ def __init__(self):
305305
self.desc=''
306306
self.text=[]
307307

308-
# def apply(self, estream):
309-
# """ write hunk data into enumerable stream
310-
# return strings one by one until hunk is
311-
# over
312-
#
313-
# enumerable stream are tuples (lineno, line)
314-
# where lineno starts with 0
315-
# """
316-
# pass
317-
318308

319309
class Patch(object):
320310
""" Patch for a single file.
@@ -1247,8 +1237,9 @@ def get_line():
12471237
continue
12481238
else:
12491239
if not hline.startswith(b"+"):
1250-
get_line()
1240+
yield get_line()
12511241
srclineno += 1
1242+
continue
12521243
line2write = hline[1:]
12531244
# detect if line ends are consistent in source file
12541245
if sum([bool(lineends[x]) for x in lineends]) == 1:

tests/07google_code_wiki.from

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,4 @@ How to create your own I/O Spyder plugins:
8484

8585
== Other Spyder plugins ==
8686

87-
See the example of the `pylint` third-party plugin in Spyder v2.0.
87+
See the example of the `pylint` third-party plugin in Spyder v2.0.

0 commit comments

Comments
 (0)