Mercurial > public > mercurial-scm > hg-stable
diff mercurial/unionrepo.py @ 39823: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 | 5ccd791344f3 |
children | 39f51064e9f5 |
line wrap: on
line diff
--- a/mercurial/unionrepo.py Mon Sep 24 22:46:22 2018 -0400 +++ b/mercurial/unionrepo.py Fri Sep 21 19:48:23 2018 -0400 @@ -19,13 +19,13 @@ from . import ( changelog, cmdutil, + encoding, error, filelog, localrepo, manifest, mdiff, pathutil, - pycompat, revlog, util, vfs as vfsmod, @@ -240,7 +240,7 @@ return unionpeer(self) def getcwd(self): - return pycompat.getcwd() # always outside the repo + return encoding.getcwd() # always outside the repo def instance(ui, path, create, intents=None, createopts=None): if create: @@ -248,13 +248,13 @@ parentpath = ui.config("bundle", "mainreporoot") if not parentpath: # try to find the correct path to the working directory repo - parentpath = cmdutil.findrepo(pycompat.getcwd()) + parentpath = cmdutil.findrepo(encoding.getcwd()) if parentpath is None: parentpath = '' if parentpath: # Try to make the full path relative so we get a nice, short URL. # In particular, we don't want temp dir names in test outputs. - cwd = pycompat.getcwd() + cwd = encoding.getcwd() if parentpath == cwd: parentpath = '' else: