hgext/mq.py
branchstable
changeset 12879 da4a9ed369c8
parent 12878 1634287b6ab1
child 12948 de6a28ff5ffc
child 13035 f08df4d38442
--- a/hgext/mq.py	Fri Oct 29 15:25:21 2010 +0200
+++ b/hgext/mq.py	Fri Oct 29 14:06:06 2010 +0200
@@ -821,7 +821,11 @@
         diffopts = self.diffopts({'git': opts.get('git')})
         self.check_reserved_name(patchfn)
         if os.path.exists(self.join(patchfn)):
-            raise util.Abort(_('patch "%s" already exists') % patchfn)
+            if os.path.isdir(self.join(patchfn)):
+                raise util.Abort(_('"%s" already exists as a directory')
+                                 % patchfn)
+            else:
+                raise util.Abort(_('patch "%s" already exists') % patchfn)
         if opts.get('include') or opts.get('exclude') or pats:
             match = cmdutil.match(repo, pats, opts)
             # detect missing files in pats