import: improve error reporting
When applying a series of patch files, it's nice to be explicitly told *which* file is broken.
--- a/mercurial/commands.py Sat Oct 01 21:51:25 2011 -0400
+++ b/mercurial/commands.py Sat Oct 01 21:52:44 2011 -0400
@@ -3375,6 +3375,7 @@
if patchurl == '-':
ui.status(_('applying patch from stdin\n'))
patchfile = ui.fin
+ patchurl = 'stdin' # for error message
else:
patchurl = os.path.join(base, patchurl)
ui.status(_('applying %s\n') % patchurl)
@@ -3392,7 +3393,7 @@
parents = [repo[node]]
if not haspatch:
- raise util.Abort(_('no diffs found'))
+ raise util.Abort(_('%s: no diffs found') % patchurl)
if msgs:
repo.savecommitmessage('\n* * *\n'.join(msgs))