852 raise util.Abort(_("local changes found")) |
852 raise util.Abort(_("local changes found")) |
853 return m, a, r, d |
853 return m, a, r, d |
854 |
854 |
855 _reserved = ('series', 'status', 'guards', '.', '..') |
855 _reserved = ('series', 'status', 'guards', '.', '..') |
856 def check_reserved_name(self, name): |
856 def check_reserved_name(self, name): |
857 if (name in self._reserved or name.startswith('.hg') |
857 if name in self._reserved: |
858 or name.startswith('.mq') or '#' in name or ':' in name): |
|
859 raise util.Abort(_('"%s" cannot be used as the name of a patch') |
858 raise util.Abort(_('"%s" cannot be used as the name of a patch') |
860 % name) |
859 % name) |
|
860 for prefix in ('.hg', '.mq'): |
|
861 if name.startswith(prefix): |
|
862 raise util.Abort(_('patch name cannot begin with "%s"') |
|
863 % prefix) |
|
864 for c in ('#', ':'): |
|
865 if c in name: |
|
866 raise util.Abort(_('"%s" cannot be used in the name of a patch') |
|
867 % c) |
|
868 |
861 |
869 |
862 def new(self, repo, patchfn, *pats, **opts): |
870 def new(self, repo, patchfn, *pats, **opts): |
863 """options: |
871 """options: |
864 msg: a string or a no-argument function returning a string |
872 msg: a string or a no-argument function returning a string |
865 """ |
873 """ |