diff mercurial/cmdutil.py @ 30519:20a42325fdef

py3: use pycompat.getcwd() instead of os.getcwd() We have pycompat.getcwd() which returns bytes path on Python 3. This patch changes most of the occurences of the os.getcwd() with pycompat one.
author Pulkit Goyal <7895pulkit@gmail.com>
date Wed, 23 Nov 2016 00:03:11 +0530
parents d9d8d78e6bc9
children 74013a831872
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Wed Aug 17 20:57:15 2016 -0700
+++ b/mercurial/cmdutil.py	Wed Nov 23 00:03:11 2016 +0530
@@ -38,6 +38,7 @@
     patch,
     pathutil,
     phases,
+    pycompat,
     repair,
     revlog,
     revset,
@@ -570,7 +571,7 @@
             raise error.CommandError(cmd, _('invalid arguments'))
         if not os.path.isfile(file_):
             raise error.Abort(_("revlog '%s' not found") % file_)
-        r = revlog.revlog(scmutil.opener(os.getcwd(), audit=False),
+        r = revlog.revlog(scmutil.opener(pycompat.getcwd(), audit=False),
                           file_[:-2] + ".i")
     return r
 
@@ -2744,7 +2745,7 @@
         committext = buildcommittext(repo, ctx, subs, extramsg)
 
     # run editor in the repository root
-    olddir = os.getcwd()
+    olddir = pycompat.getcwd()
     os.chdir(repo.root)
 
     # make in-memory changes visible to external process