Commits

Steve Borho  committed c593f05

thgconfig: prevent broken paths from being stored

Mercurial and thg react badly to broken config files, so try to
prevent them.

Fixes #201

  • Participants
  • Parent commits 5f27792

Comments (0)

Files changed (1)

File hggtk/thgconfig.py

 import shlib
 import shelve
 import iniparse
+import gdialog
 
 _unspecstr = '<unspecified>'
 
             refreshlist = []
             for row in self.pathdata:
                 name = fromutf(row[0])
+                if not name:
+                    gdialog.Prompt(_('Invalid path'),
+                           _('Skipped saving path with no alias'), self).run()
+                    continue
                 path = fromutf(row[1])
                 cpath = '.'.join(['paths', name])
                 self.record_new_value(cpath, path, False)