Mercurial > hg-stable
changeset 14051:2b1226693c70 stable
mq: add '.' and '..' to list of forbidden patch names
When an empty string is being passed to normname
it would return '.' causing checkfile() to always
return that a patch with that name exists.
author | Idan Kamara <idankk86@gmail.com> |
---|---|
date | Fri, 29 Apr 2011 22:21:13 +0300 |
parents | 9e8a9d45945c |
children | ecaa78594983 23fc62e0a960 |
files | hgext/mq.py tests/test-mq-qnew.t |
diffstat | 2 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/mq.py Fri Mar 04 14:00:49 2011 +0100 +++ b/hgext/mq.py Fri Apr 29 22:21:13 2011 +0300 @@ -834,7 +834,7 @@ raise util.Abort(_("local changes found")) return m, a, r, d - _reserved = ('series', 'status', 'guards') + _reserved = ('series', 'status', 'guards', '.', '..') def check_reserved_name(self, name): if (name in self._reserved or name.startswith('.hg') or name.startswith('.mq') or '#' in name or ':' in name):
--- a/tests/test-mq-qnew.t Fri Mar 04 14:00:49 2011 +0100 +++ b/tests/test-mq-qnew.t Fri Apr 29 22:21:13 2011 +0300 @@ -15,6 +15,8 @@ > hg qnew series > hg qnew status > hg qnew guards + > hg qnew . + > hg qnew .. > hg qnew .hgignore > hg qnew .mqfoo > hg qnew 'foo#bar' @@ -102,6 +104,8 @@ abort: "series" cannot be used as the name of a patch abort: "status" cannot be used as the name of a patch abort: "guards" cannot be used as the name of a patch + abort: "." cannot be used as the name of a patch + abort: ".." cannot be used as the name of a patch abort: ".hgignore" cannot be used as the name of a patch abort: ".mqfoo" cannot be used as the name of a patch abort: "foo#bar" cannot be used as the name of a patch @@ -167,6 +171,8 @@ abort: "series" cannot be used as the name of a patch abort: "status" cannot be used as the name of a patch abort: "guards" cannot be used as the name of a patch + abort: "." cannot be used as the name of a patch + abort: ".." cannot be used as the name of a patch abort: ".hgignore" cannot be used as the name of a patch abort: ".mqfoo" cannot be used as the name of a patch abort: "foo#bar" cannot be used as the name of a patch