Mercurial > public > mercurial-scm > hg-stable
diff mercurial/patch.py @ 5649:a583117b536a
patch: move NoHunk detection up with parsing code
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Mon, 17 Dec 2007 22:19:21 +0100 |
parents | 8a8c341bd292 |
children | 5d3e2f918d65 |
line wrap: on
line diff
--- 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):