Mercurial commands take more than 20 seconds when run as root-user

0

when I call any mercurial command (hg init, hg status, hg manifest, hg add, etc) as root user, the commands take more than 20 seconds to complete:

# time hg init

real    0m25.226s
user    0m0.156s
sys     0m0.044s

The above was called in an empty directory. Other commands also take slightly above 25 seconds to complete. It feels like the commands block for 25 seconds, and then do what they're supposed to do in a fraction of a second. When run as a non-root user, hg init in an empty directory takes about 0.2 seconds. Does anybody have an idea what could cause this behaviour or how one could narrow possible causes down?

My operating system is Ubuntu 14.

jan

Posted 2014-12-20T19:44:45.740

Reputation: 168

Just run it with -v. It should give you useful information. – davidbaumann – 2014-12-20T20:57:26.503

Answers

0

While I still can't explain the behaviour, I found that it stems from the $HOME environment-variable still pointing to my user's home-directory. If I

export HOME=/root

before executing mercurial commands, they work alright. The message that pointed me to this was:

not trusting file /home/jan/.hg/hgrc from untrusted user jan, group jan

which was displayed after calling hg init.

jan

Posted 2014-12-20T19:44:45.740

Reputation: 168