comparison mercurial/patch.py @ 14240:28762bb767dc

patch: remove unused ui arg to iterhunks
author Idan Kamara <idankk86@gmail.com>
date Fri, 06 May 2011 18:45:12 +0300
parents 600e64004eb5
children 576256a81cb6
comparison
equal deleted inserted replaced
14239:967be4bb42a7 14240:28762bb767dc
992 gitlr.push(firstline) 992 gitlr.push(firstline)
993 gitpatches = readgitpatch(gitlr) 993 gitpatches = readgitpatch(gitlr)
994 fp.seek(pos) 994 fp.seek(pos)
995 return gitpatches 995 return gitpatches
996 996
997 def iterhunks(ui, fp): 997 def iterhunks(fp):
998 """Read a patch and yield the following events: 998 """Read a patch and yield the following events:
999 - ("file", afile, bfile, firsthunk): select a new target file. 999 - ("file", afile, bfile, firsthunk): select a new target file.
1000 - ("hunk", hunk): a new hunk is ready to be applied, follows a 1000 - ("hunk", hunk): a new hunk is ready to be applied, follows a
1001 "file" event. 1001 "file" event.
1002 - ("git", gitchanges): current diff is in git format, gitchanges 1002 - ("git", gitchanges): current diff is in git format, gitchanges
1112 err = 0 1112 err = 0
1113 current_file = None 1113 current_file = None
1114 cwd = os.getcwd() 1114 cwd = os.getcwd()
1115 opener = scmutil.opener(cwd) 1115 opener = scmutil.opener(cwd)
1116 1116
1117 for state, values in iterhunks(ui, fp): 1117 for state, values in iterhunks(fp):
1118 if state == 'hunk': 1118 if state == 'hunk':
1119 if not current_file: 1119 if not current_file:
1120 continue 1120 continue
1121 ret = current_file.apply(values) 1121 ret = current_file.apply(values)
1122 if ret >= 0: 1122 if ret >= 0: