##// END OF EJS Templates
patch: introduce changedfiles...
Idan Kamara -
r14255:576256a8 default
parent child Browse files
Show More
@@ -1246,6 +1246,28 b' def patch(patchname, ui, strip=1, cwd=No'
1246 except PatchError, err:
1246 except PatchError, err:
1247 raise util.Abort(str(err))
1247 raise util.Abort(str(err))
1248
1248
1249 def changedfiles(patchpath, strip=1):
1250 fp = open(patchpath, 'rb')
1251 try:
1252 changed = set()
1253 for state, values in iterhunks(fp):
1254 if state == 'hunk':
1255 continue
1256 elif state == 'file':
1257 afile, bfile, first_hunk = values
1258 current_file, missing = selectfile(afile, bfile,
1259 first_hunk, strip)
1260 changed.add(current_file)
1261 elif state == 'git':
1262 for gp in values:
1263 gp.path = pathstrip(gp.path, strip - 1)[1]
1264 changed.add(gp.path)
1265 else:
1266 raise util.Abort(_('unsupported parser state: %s') % state)
1267 return changed
1268 finally:
1269 fp.close()
1270
1249 def b85diff(to, tn):
1271 def b85diff(to, tn):
1250 '''print base85-encoded binary diff'''
1272 '''print base85-encoded binary diff'''
1251 def gitindex(text):
1273 def gitindex(text):
General Comments 0
You need to be logged in to leave comments. Login now