import: improve error reporting
authorGreg Ward <greg@gerg.ca>
Sat, 01 Oct 2011 21:52:44 -0400
changeset 15197 7f65ce5cc011
parent 15196 7f78a4137f8f
child 15198 62dc0e7ab092
import: improve error reporting When applying a series of patch files, it's nice to be explicitly told *which* file is broken.
mercurial/commands.py
--- 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))