changeset 1958:f92cf4a8cedd

merge with crew
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Wed, 15 Mar 2006 07:15:13 +0100
parents 295010327271 (diff) 34d0e2e559ff (current diff)
children eff46e2c9d67
files mercurial/util.py
diffstat 2 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/templater.py	Tue Mar 14 22:02:41 2006 -0800
+++ b/mercurial/templater.py	Wed Mar 15 07:15:13 2006 +0100
@@ -8,7 +8,7 @@
 import re
 from demandload import demandload
 from i18n import gettext as _
-demandload(globals(), "cStringIO cgi os time urllib util")
+demandload(globals(), "cStringIO cgi sys os time urllib util")
 
 esctable = {
     '\\': '\\',
@@ -235,3 +235,7 @@
         p = os.path.join(os.path.dirname(__file__), *fl)
         if (name and os.path.exists(p)) or os.path.isdir(p):
             return os.path.normpath(p)
+    else:
+        # executable version (py2exe) doesn't support __file__
+        if hasattr(sys, 'frozen'):
+            return os.path.join(sys.prefix, "templates")
--- a/mercurial/util.py	Tue Mar 14 22:02:41 2006 -0800
+++ b/mercurial/util.py	Wed Mar 15 07:15:13 2006 +0100
@@ -789,14 +789,12 @@
             _rcpath = []
             for p in os.environ['HGRCPATH'].split(os.pathsep):
                 if not p: continue
-                try:
+                if os.path.isdir(p):
                     for f in os.listdir(p):
                         if f.endswith('.rc'):
                             _rcpath.append(os.path.join(p, f))
-                    continue
-                except:
-                    pass
-                _rcpath.append(p)
+                else:
+                    _rcpath.append(p)
         else:
             _rcpath = os_rcpath()
     return _rcpath