diff mercurial/scmutil.py @ 16383:f5dd179bfa4a

plan9: initial support for plan 9 from bell labs This patch contains support for Plan 9 from Bell Labs. A README is provided in contrib/plan9 which describes the port in greater detail. A new extension is also provided named factotum which permits the factotum(4) authentication agent to provide credentials for HTTP repositories. This extension is also applicable to other POSIX platforms which make use of Plan 9 from User Space (aka plan9ports).
author Steven Stallion <sstallion@gmail.com>
date Sun, 08 Apr 2012 12:43:41 -0700
parents 5cbfbb838198
children 4df76d5506a9
line wrap: on
line diff
--- a/mercurial/scmutil.py	Sun Apr 08 22:17:51 2012 -0500
+++ b/mercurial/scmutil.py	Sun Apr 08 12:43:41 2012 -0700
@@ -436,15 +436,22 @@
 
     def systemrcpath():
         path = []
+        if sys.platform == 'plan9':
+            root = '/lib/mercurial'
+        else:
+            root = '/etc/mercurial'
         # old mod_python does not set sys.argv
         if len(getattr(sys, 'argv', [])) > 0:
             p = os.path.dirname(os.path.dirname(sys.argv[0]))
-            path.extend(rcfiles(os.path.join(p, 'etc/mercurial')))
-        path.extend(rcfiles('/etc/mercurial'))
+            path.extend(rcfiles(os.path.join(p, root)))
+        path.extend(rcfiles(root))
         return path
 
     def userrcpath():
-        return [os.path.expanduser('~/.hgrc')]
+        if sys.platform == 'plan9':
+            return [os.environ['home'] + '/lib/hgrc']
+        else:
+            return [os.path.expanduser('~/.hgrc')]
 
 else: