Commits

Steve Borho committed 4b773e8

shelve: prevent the use of bad characters in shelf files (fixes #765)

Comments (0)

Files changed (1)

tortoisehg/hgqt/shelve.py

             if not ok:
                 return
             shelve = hglib.fromunicode(name)
+            invalids = (':', '#', '/', '\\', '<', '>', '|')
+            bads = [c for c in shelve if c in invalids]
+            if bads:
+                qtlib.ErrorMsgBox(_('Bad filename'),
+                                  _('A shelf name cannot contain :#/\\<>|'))
+                return
         try:
             fn = os.path.join('shelves', shelve)
             shelfpath = self.repo.join(fn)