diff hgext/mq.py @ 12878:1634287b6ab1 stable

qnew: give better feedback when doing 'hg qnew foo/' (issue2464)
author Martin Geisler <mg@aragost.com>
date Fri, 29 Oct 2010 15:25:21 +0200
parents b59b5193d4d0
children da4a9ed369c8
line wrap: on
line diff
--- a/hgext/mq.py	Fri Oct 29 12:50:08 2010 +0200
+++ b/hgext/mq.py	Fri Oct 29 15:25:21 2010 +0200
@@ -839,8 +839,12 @@
         insert = self.full_series_end()
         wlock = repo.wlock()
         try:
-            # if patch file write fails, abort early
-            p = self.opener(patchfn, "w")
+            try:
+                # if patch file write fails, abort early
+                p = self.opener(patchfn, "w")
+            except IOError, e:
+                raise util.Abort(_('cannot write patch "%s": %s')
+                                 % (patchfn, e.strerror))
             try:
                 if self.plainmode:
                     if user: