[PATCH 6 of 6 V2] eliminate win32.user_rcpath_win32()

Adrian Buehlmann adrian at cadifra.com
Mon Feb 14 07:44:34 CST 2011


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1297678385 -3600
# Node ID 67743d5f49b61ec459b819d0f84c2b2c80e94da7
# Parent  244772f67ac1945b15a42afcf9b8ca22caa66358
eliminate win32.user_rcpath_win32()

diff --git a/mercurial/win32.py b/mercurial/win32.py
--- a/mercurial/win32.py
+++ b/mercurial/win32.py
@@ -222,12 +222,6 @@ def executable_path():
         raise ctypes.WinError(_ERROR_INSUFFICIENT_BUFFER)
     return buf.value
 
-def user_rcpath_win32():
-    '''return os-specific hgrc search path to the user dir'''
-    userdir = os.path.expanduser('~')
-    return [os.path.join(userdir, 'mercurial.ini'),
-            os.path.join(userdir, '.hgrc')]
-
 def getuser():
     '''return name of current user'''
     adv = ctypes.windll.advapi32
diff --git a/mercurial/windows.py b/mercurial/windows.py
--- a/mercurial/windows.py
+++ b/mercurial/windows.py
@@ -107,12 +107,9 @@ def system_rcpath():
 
 def user_rcpath():
     '''return os-specific hgrc search path to the user dir'''
-    try:
-        path = user_rcpath_win32()
-    except:
-        home = os.path.expanduser('~')
-        path = [os.path.join(home, 'mercurial.ini'),
-                os.path.join(home, '.hgrc')]
+    home = os.path.expanduser('~')
+    path = [os.path.join(home, 'mercurial.ini'),
+            os.path.join(home, '.hgrc')]
     userprofile = os.environ.get('USERPROFILE')
     if userprofile:
         path.append(os.path.join(userprofile, 'mercurial.ini'))


More information about the Mercurial-devel mailing list