comparison mercurial/commands.py @ 15197:7f65ce5cc011

import: improve error reporting When applying a series of patch files, it's nice to be explicitly told *which* file is broken.
author Greg Ward <greg@gerg.ca>
date Sat, 01 Oct 2011 21:52:44 -0400
parents 7f78a4137f8f
children 62dc0e7ab092
comparison
equal deleted inserted replaced
15196:7f78a4137f8f 15197:7f65ce5cc011
3373 parents = repo.parents() 3373 parents = repo.parents()
3374 for patchurl in patches: 3374 for patchurl in patches:
3375 if patchurl == '-': 3375 if patchurl == '-':
3376 ui.status(_('applying patch from stdin\n')) 3376 ui.status(_('applying patch from stdin\n'))
3377 patchfile = ui.fin 3377 patchfile = ui.fin
3378 patchurl = 'stdin' # for error message
3378 else: 3379 else:
3379 patchurl = os.path.join(base, patchurl) 3380 patchurl = os.path.join(base, patchurl)
3380 ui.status(_('applying %s\n') % patchurl) 3381 ui.status(_('applying %s\n') % patchurl)
3381 patchfile = url.open(ui, patchurl) 3382 patchfile = url.open(ui, patchurl)
3382 3383
3390 parents = repo.parents() 3391 parents = repo.parents()
3391 else: 3392 else:
3392 parents = [repo[node]] 3393 parents = [repo[node]]
3393 3394
3394 if not haspatch: 3395 if not haspatch:
3395 raise util.Abort(_('no diffs found')) 3396 raise util.Abort(_('%s: no diffs found') % patchurl)
3396 3397
3397 if msgs: 3398 if msgs:
3398 repo.savecommitmessage('\n* * *\n'.join(msgs)) 3399 repo.savecommitmessage('\n* * *\n'.join(msgs))
3399 finally: 3400 finally:
3400 release(lock, wlock) 3401 release(lock, wlock)