Mercurial > hg
diff hgext/narrow/narrowcommands.py @ 39818:24e493ec2229
py3: rename pycompat.getcwd() to encoding.getcwd() (API)
We need to avoid os.getcwdb() on Windows to avoid DeprecationWarnings, and we
need encoding.strtolocal() to encode the result of os.getcwd().
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Fri, 21 Sep 2018 19:48:23 -0400 |
parents | 9d5c919b6dc3 |
children | d5498db5f86a |
line wrap: on
line diff
--- a/hgext/narrow/narrowcommands.py Mon Sep 24 22:46:22 2018 -0400 +++ b/hgext/narrow/narrowcommands.py Fri Sep 21 19:48:23 2018 -0400 @@ -69,7 +69,7 @@ narrowspecfile = opts['narrowspec'] if narrowspecfile: - filepath = os.path.join(pycompat.getcwd(), narrowspecfile) + filepath = os.path.join(encoding.getcwd(), narrowspecfile) ui.status(_("reading narrowspec from '%s'\n") % filepath) try: fdata = util.readfile(filepath) @@ -349,7 +349,7 @@ newrules = opts.get('import_rules') if newrules: try: - filepath = os.path.join(pycompat.getcwd(), newrules) + filepath = os.path.join(encoding.getcwd(), newrules) fdata = util.readfile(filepath) except IOError as inst: raise error.Abort(_("cannot read narrowspecs from '%s': %s") %