Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.9, 0.9.1, and 0.9.1.1

thgconfig: monkeypatch iniparse to prevent 'rem' comments

Fixes #628, refs #548

Backs out changeset 3a38f9125e73

Changeset 380aec437000

Parent 4540bcf71bbc

by Steve Borho

Changes to one file · Browse files at 380aec437000 Showing diff from parent 4540bcf71bbc Diff from another changeset...

 
656
657
658
659
660
661
662
 
 
663
664
 
665
666
667
 
1055
1056
1057
 
 
 
 
1058
1059
1060
 
656
657
658
 
 
 
 
659
660
661
 
662
663
664
665
 
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
@@ -656,12 +656,10 @@
  self.refresh_vlist()   self.pathdata.clear()   if 'paths' in self.ini: - from mercurial import config - cfg = config.config() - cfg.read(self.fn, sections=('paths',)) - for alias, path in cfg.items('paths'): + for name in self.ini['paths']: + path = self.ini['paths'][name]   safepath = hglib.toutf(url.hidepassword(path)) - self.pathdata.append([hglib.toutf(alias), safepath, + self.pathdata.append([hglib.toutf(name), safepath,   hglib.toutf(path)])   self.refresh_path_list()   self._btn_apply.set_sensitive(False) @@ -1055,6 +1053,10 @@
  self.fn = fn   try:   import iniparse + # Monkypatch this regex to prevent iniparse from considering + # 'rem' as a comment + iniparse.ini.CommentLine.regex = \ + re.compile(r'^(?P<csep>[;#])(?P<comment>.*)$')   return iniparse.INIConfig(file(fn), optionxformvalue=None)   except ImportError:   from mercurial import config