Mercurial > hg
comparison hgext/bookmarks.py @ 11704:18c47562d331 stable
bookmarks: don't allow name to contain whitespaces only
author | Idan Kamara <idankk86@gmail.com> |
---|---|
date | Sat, 24 Jul 2010 11:20:21 +0300 |
parents | ead7550f1aab |
children | e95bacedae12 31dde4c3bb83 |
comparison
equal
deleted
inserted
replaced
11657:5ed6802e6bcb | 11704:18c47562d331 |
---|---|
134 | 134 |
135 if mark != None: | 135 if mark != None: |
136 if "\n" in mark: | 136 if "\n" in mark: |
137 raise util.Abort(_("bookmark name cannot contain newlines")) | 137 raise util.Abort(_("bookmark name cannot contain newlines")) |
138 mark = mark.strip() | 138 mark = mark.strip() |
139 if not mark: | |
140 raise util.Abort(_("bookmark names cannot consist entirely of " | |
141 "whitespace")) | |
139 if mark in marks and not force: | 142 if mark in marks and not force: |
140 raise util.Abort(_("a bookmark of the same name already exists")) | 143 raise util.Abort(_("a bookmark of the same name already exists")) |
141 if ((mark in repo.branchtags() or mark == repo.dirstate.branch()) | 144 if ((mark in repo.branchtags() or mark == repo.dirstate.branch()) |
142 and not force): | 145 and not force): |
143 raise util.Abort( | 146 raise util.Abort( |