patch: move NoHunk detection up with parsing code

This commit is contained in:
Patrick Mezard 2007-12-17 22:19:21 +01:00
parent bb8be03dba
commit b4f670a426

View File

@ -1008,12 +1008,13 @@ def applydiff(ui, fp, changed, strip=1, sourcefile=None, reverse=False,
if rejmerge:
rejmerge(current_file)
rejects += len(current_file.rej)
if not rejects and hunknum == 0 and dopatch and not gitworkdone:
raise NoHunks
if updatedir and git:
updatedir(gitpatches)
if rejects:
return -1
if hunknum == 0 and dopatch and not gitworkdone:
raise NoHunks
return err
def diffopts(ui, opts={}, untrusted=False):