# HG changeset patch
# User Yuki KODAMA <endflow.net@gmail.com>
# Date 1252936966 -32400
# Node ID 7cddf7bba3a7da44acf7d6ea32ea5f9300a3f782
# Parent  f0be49afe1ab5f979b7a56ddeb20c5dfb32f6eea
thgconfig: workaround for comment line starts with 'rem' in INI file

fixes issue #548

diff --git a/tortoisehg/hgtk/thgconfig.py b/tortoisehg/hgtk/thgconfig.py
--- a/tortoisehg/hgtk/thgconfig.py
+++ b/tortoisehg/hgtk/thgconfig.py
@@ -658,10 +658,12 @@
         self.refresh_vlist()
         self.pathdata.clear()
         if 'paths' in self.ini:
-            for name in self.ini['paths']:
-                path = self.ini['paths'][name]
+            from mercurial import config
+            cfg = config.config()
+            cfg.read(self.fn, sections=('paths',))
+            for alias, path in cfg.items('paths'):
                 safepath = hglib.toutf(url.hidepassword(path))
-                self.pathdata.append([hglib.toutf(name), safepath,
+                self.pathdata.append([hglib.toutf(alias), safepath,
                     hglib.toutf(path)])
         self.refresh_path_list()
         self._btn_apply.set_sensitive(False)
