# HG changeset patch
# User Pulkit Goyal <7895pul...@gmail.com>
# Date 1482007139 -19800
#      Sun Dec 18 02:08:59 2016 +0530
# Node ID 6dbdae9bb9c6e5a038a2e9c9676fdd6663d235eb
# Parent  fc020b58c3081d84af150e5ed700bc67b7616c2b
py3: replace os.environ with encoding.environ (part 5 of 5)

diff -r fc020b58c308 -r 6dbdae9bb9c6 hgext/color.py
--- a/hgext/color.py    Sun Dec 18 02:06:00 2016 +0530
+++ b/hgext/color.py    Sun Dec 18 02:08:59 2016 +0530
@@ -171,6 +171,7 @@
     cmdutil,
     commands,
     dispatch,
+    encoding,
     extensions,
     subrepo,
     ui as uimod,
@@ -245,7 +246,8 @@
     if not always and not auto:
         return None
 
-    formatted = always or (os.environ.get('TERM') != 'dumb' and ui.formatted())
+    formatted = always or (encoding.environ.get('TERM') != 'dumb'\
+                        and ui.formatted())
 
     mode = ui.config('color', 'mode', 'auto')
 
@@ -256,7 +258,7 @@
     realmode = mode
     if mode == 'auto':
         if os.name == 'nt':
-            term = os.environ.get('TERM')
+            term = encoding.environ.get('TERM')
             # TERM won't be defined in a vanilla cmd.exe environment.
 
             # UNIX-like environments on Windows such as Cygwin and MSYS will
diff -r fc020b58c308 -r 6dbdae9bb9c6 hgext/convert/cvs.py
--- a/hgext/convert/cvs.py      Sun Dec 18 02:06:00 2016 +0530
+++ b/hgext/convert/cvs.py      Sun Dec 18 02:08:59 2016 +0530
@@ -189,7 +189,7 @@
 
         if conntype != "pserver":
             if conntype == "rsh":
-                rsh = os.environ.get("CVS_RSH") or "ssh"
+                rsh = encoding.environ.get("CVS_RSH") or "ssh"
                 if user:
                     cmd = [rsh, '-l', user, host] + cmd
                 else:
diff -r fc020b58c308 -r 6dbdae9bb9c6 hgext/convert/cvsps.py
--- a/hgext/convert/cvsps.py    Sun Dec 18 02:06:00 2016 +0530
+++ b/hgext/convert/cvsps.py    Sun Dec 18 02:08:59 2016 +0530
@@ -11,6 +11,7 @@
 
 from mercurial.i18n import _
 from mercurial import (
+    encoding,
     hook,
     pycompat,
     util,
@@ -147,7 +148,7 @@
             pass
 
     if not root:
-        root = os.environ.get('CVSROOT', '')
+        root = encoding.environ.get('CVSROOT', '')
 
     # read log cache if one exists
     oldlog = []
diff -r fc020b58c308 -r 6dbdae9bb9c6 hgext/logtoprocess.py
--- a/hgext/logtoprocess.py     Sun Dec 18 02:06:00 2016 +0530
+++ b/hgext/logtoprocess.py     Sun Dec 18 02:08:59 2016 +0530
@@ -40,6 +40,8 @@
 import subprocess
 import sys
 
+from mercurial import encoding
+
 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' 
for
 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
 # be specifying the version(s) of Mercurial they are tested with, or
@@ -117,7 +119,7 @@
                 optpairs = (
                     ('OPT_{0}'.format(key.upper()), str(value))
                     for key, value in opts.iteritems())
-                env = dict(itertools.chain(os.environ.items(),
+                env = dict(itertools.chain(encoding.environ.items(),
                                            msgpairs, optpairs),
                            EVENT=event, HGPID=str(os.getpid()))
                 # Connect stdin to /dev/null to prevent child processes messing
diff -r fc020b58c308 -r 6dbdae9bb9c6 hgext/pager.py
--- a/hgext/pager.py    Sun Dec 18 02:06:00 2016 +0530
+++ b/hgext/pager.py    Sun Dec 18 02:08:59 2016 +0530
@@ -71,6 +71,7 @@
     cmdutil,
     commands,
     dispatch,
+    encoding,
     extensions,
     util,
     )
@@ -123,7 +124,7 @@
         return
 
     def pagecmd(orig, ui, options, cmd, cmdfunc):
-        p = ui.config("pager", "pager", os.environ.get("PAGER"))
+        p = ui.config("pager", "pager", encoding.environ.get("PAGER"))
         usepager = False
         always = util.parsebool(options['pager'])
         auto = options['pager'] == 'auto'
diff -r fc020b58c308 -r 6dbdae9bb9c6 hgext/patchbomb.py
--- a/hgext/patchbomb.py        Sun Dec 18 02:06:00 2016 +0530
+++ b/hgext/patchbomb.py        Sun Dec 18 02:08:59 2016 +0530
@@ -75,6 +75,7 @@
 from mercurial import (
     cmdutil,
     commands,
+    encoding,
     error,
     hg,
     mail,
@@ -693,8 +694,8 @@
         if opts.get('test'):
             ui.status(_('displaying '), subj, ' ...\n')
             ui.flush()
-            if 'PAGER' in os.environ and not ui.plain():
-                fp = util.popen(os.environ['PAGER'], 'w')
+            if 'PAGER' in encoding.environ and not ui.plain():
+                fp = util.popen(encoding.environ['PAGER'], 'w')
             else:
                 fp = ui
             generator = emailmod.Generator.Generator(fp, mangle_from_=False)
diff -r fc020b58c308 -r 6dbdae9bb9c6 tests/test-check-config.t
--- a/tests/test-check-config.t Sun Dec 18 02:06:00 2016 +0530
+++ b/tests/test-check-config.t Sun Dec 18 02:08:59 2016 +0530
@@ -7,6 +7,3 @@
 
   $ hg files "set:(**.py or **.txt) - tests/**" | sed 's|\\|/|g' |
   >   python contrib/check-config.py
-      p = ui.config("pager", "pager", encoding.environ.get("PAGER"))
-  
-  conflict on pager.pager: ('str', 'encoding.environ.get("PAGER"') != ('str', 
'os.environ.get("PAGER"')
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to