comparison 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
comparison
equal deleted inserted replaced
5648:2079faccb408 5649:a583117b536a
1006 if current_file: 1006 if current_file:
1007 current_file.close() 1007 current_file.close()
1008 if rejmerge: 1008 if rejmerge:
1009 rejmerge(current_file) 1009 rejmerge(current_file)
1010 rejects += len(current_file.rej) 1010 rejects += len(current_file.rej)
1011
1012 if not rejects and hunknum == 0 and dopatch and not gitworkdone:
1013 raise NoHunks
1011 if updatedir and git: 1014 if updatedir and git:
1012 updatedir(gitpatches) 1015 updatedir(gitpatches)
1013 if rejects: 1016 if rejects:
1014 return -1 1017 return -1
1015 if hunknum == 0 and dopatch and not gitworkdone:
1016 raise NoHunks
1017 return err 1018 return err
1018 1019
1019 def diffopts(ui, opts={}, untrusted=False): 1020 def diffopts(ui, opts={}, untrusted=False):
1020 def get(key, name=None): 1021 def get(key, name=None):
1021 return (opts.get(key) or 1022 return (opts.get(key) or