HG environment variables take precedence over hgrc
authormpm@selenic.com
Wed, 13 Jul 2005 01:48:03 -0800
changeset 691 61c6b4178b9e
parent 690 f762860f82c6
child 692 695dd9a491da
HG environment variables take precedence over hgrc manifest hash: c128b53429f861c0b75c2a81c6ad4907e4779810
mercurial/hg.py
mercurial/ui.py
--- a/mercurial/hg.py	Wed Jul 13 01:46:50 2005 -0800
+++ b/mercurial/hg.py	Wed Jul 13 01:48:03 2005 -0800
@@ -1498,8 +1498,8 @@
         self.ui.debug("file %s: other %s ancestor %s\n" %
                               (fn, short(other), short(base)))
 
-        cmd = self.ui.config("ui", "merge") or \
-              os.environ.get("HGMERGE", "hgmerge")
+        cmd = os.environ.get("HGMERGE", "hgmerge") or \
+              self.ui.config("ui", "merge")
         r = os.system("%s %s %s %s" % (cmd, a, b, c))
         if r:
             self.ui.warn("merging %s failed!\n" % fn)
--- a/mercurial/ui.py	Wed Jul 13 01:46:50 2005 -0800
+++ b/mercurial/ui.py	Wed Jul 13 01:48:03 2005 -0800
@@ -44,8 +44,8 @@
         return []
 
     def username(self):
-        return (self.config("ui", "username") or
-                os.environ.get("HGUSER") or
+        return (os.environ.get("HGUSER") or
+                self.config("ui", "username") or
                 os.environ.get("EMAIL") or
                 (os.environ.get("LOGNAME",
                                 os.environ.get("USERNAME", "unknown"))
@@ -93,8 +93,8 @@
         f.write(text)
         f.close()
 
-        editor = (self.config("ui", "editor") or
-                  os.environ.get("HGEDITOR") or
+        editor = (os.environ.get("HGEDITOR") or
+                  self.config("ui", "editor") or
                   os.environ.get("EDITOR", "vi"))
 
         os.environ["HGUSER"] = self.username()