summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2016-05-04 19:23:57 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2016-05-04 19:23:57 +0200
commit2ef975ae7d4174ae8aa46d4ff581adb5fd9867d9 (patch)
treeb9af9c342182349d75c4029e8a113debe06a2c37
parent66892eb133865ec02faa8e64cdfa2f867f9e1e87 (diff)
downloadplan9front-2ef975ae7d4174ae8aa46d4ff581adb5fd9867d9.tar.xz
hg: set $HOME when not already set to avoid silly uid lookups which can fail if theres no /adm/users
-rwxr-xr-xrc/bin/hg9
1 files changed, 7 insertions, 2 deletions
diff --git a/rc/bin/hg b/rc/bin/hg
index 255bdf7b2..71d977404 100755
--- a/rc/bin/hg
+++ b/rc/bin/hg
@@ -22,12 +22,17 @@ import mercurial.util
import mercurial.dispatch
if sys.platform == 'plan9':
+ import os
+
+ home = os.environ['home']
+ if not 'HOME' in os.environ:
+ os.environ['HOME'] = home
+
def p9sys_rcpath():
return ['/sys/lib/hgrc']
def p9usr_rcpath():
- import os
- return [os.environ['home']+'/lib/hgrc']
+ return [home+'/lib/hgrc']
import mercurial.posix
mercurial.posix.system_rcpath = p9sys_rcpath