# HG changeset patch # User Patrick Mezard # Date 1197926361 -3600 # Node ID a583117b536ade82c9a2191a43c57362e7eed1eb # Parent 2079faccb4081c851c49a4634671b07e5f8f459d patch: move NoHunk detection up with parsing code diff -r 2079faccb408 -r a583117b536a mercurial/patch.py --- a/mercurial/patch.py Mon Dec 17 13:45:30 2007 +0100 +++ b/mercurial/patch.py Mon Dec 17 22:19:21 2007 +0100 @@ -1008,12 +1008,13 @@ 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):