Mercurial > public > mercurial-scm > hg-stable
diff mercurial/bundlerepo.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 | 75b53b809e87 |
line wrap: on
line diff
--- a/mercurial/bundlerepo.py Mon Sep 24 22:46:22 2018 -0400 +++ b/mercurial/bundlerepo.py Fri Sep 21 19:48:23 2018 -0400 @@ -25,6 +25,7 @@ changelog, cmdutil, discovery, + encoding, error, exchange, filelog, @@ -432,7 +433,7 @@ return bundlepeer(self) def getcwd(self): - return pycompat.getcwd() # always outside the repo + return encoding.getcwd() # always outside the repo # Check if parents exist in localrepo before setting def setparents(self, p1, p2=nullid): @@ -452,13 +453,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: