hgext/mq.py
branchstable
changeset 12879 da4a9ed369c8
parent 12878 1634287b6ab1
child 12948 de6a28ff5ffc
child 13035 f08df4d38442
equal deleted inserted replaced
12878:1634287b6ab1 12879:da4a9ed369c8
   819         if date:
   819         if date:
   820             date = util.parsedate(date)
   820             date = util.parsedate(date)
   821         diffopts = self.diffopts({'git': opts.get('git')})
   821         diffopts = self.diffopts({'git': opts.get('git')})
   822         self.check_reserved_name(patchfn)
   822         self.check_reserved_name(patchfn)
   823         if os.path.exists(self.join(patchfn)):
   823         if os.path.exists(self.join(patchfn)):
   824             raise util.Abort(_('patch "%s" already exists') % patchfn)
   824             if os.path.isdir(self.join(patchfn)):
       
   825                 raise util.Abort(_('"%s" already exists as a directory')
       
   826                                  % patchfn)
       
   827             else:
       
   828                 raise util.Abort(_('patch "%s" already exists') % patchfn)
   825         if opts.get('include') or opts.get('exclude') or pats:
   829         if opts.get('include') or opts.get('exclude') or pats:
   826             match = cmdutil.match(repo, pats, opts)
   830             match = cmdutil.match(repo, pats, opts)
   827             # detect missing files in pats
   831             # detect missing files in pats
   828             def badfn(f, msg):
   832             def badfn(f, msg):
   829                 raise util.Abort('%s: %s' % (f, msg))
   833                 raise util.Abort('%s: %s' % (f, msg))