Mercurial > hg-stable
diff mercurial/bundlerepo.py @ 30528: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 | 11b8b740d54a |
children | be5b2098a817 |
line wrap: on
line diff
--- a/mercurial/bundlerepo.py Wed Aug 17 20:57:15 2016 -0700 +++ b/mercurial/bundlerepo.py Wed Nov 23 00:03:11 2016 +0530 @@ -35,6 +35,7 @@ node as nodemod, pathutil, phases, + pycompat, revlog, scmutil, util, @@ -392,7 +393,7 @@ return bundlepeer(self) def getcwd(self): - return os.getcwd() # always outside the repo + return pycompat.getcwd() # always outside the repo # Check if parents exist in localrepo before setting def setparents(self, p1, p2=nullid): @@ -412,13 +413,13 @@ parentpath = ui.config("bundle", "mainreporoot", "") if not parentpath: # try to find the correct path to the working directory repo - parentpath = cmdutil.findrepo(os.getcwd()) + parentpath = cmdutil.findrepo(pycompat.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 = os.getcwd() + cwd = pycompat.getcwd() if parentpath == cwd: parentpath = '' else: