Mercurial > public > mercurial-scm > hg-stable
diff mercurial/debugcommands.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 | a8b17859684a |
children | 1ee358c3ed26 |
line wrap: on
line diff
--- a/mercurial/debugcommands.py Wed Aug 17 20:57:15 2016 -0700 +++ b/mercurial/debugcommands.py Wed Nov 23 00:03:11 2016 +0530 @@ -8,7 +8,6 @@ from __future__ import absolute_import import operator -import os import random from .i18n import _ @@ -30,6 +29,7 @@ hg, localrepo, lock as lockmod, + pycompat, revlog, scmutil, setdiscovery, @@ -50,7 +50,7 @@ """find the ancestor revision of two revisions in a given index""" if len(args) == 3: index, rev1, rev2 = args - r = revlog.revlog(scmutil.opener(os.getcwd(), audit=False), index) + r = revlog.revlog(scmutil.opener(pycompat.getcwd(), audit=False), index) lookup = r.lookup elif len(args) == 2: if not repo: @@ -385,7 +385,8 @@ spaces = opts.get('spaces') dots = opts.get('dots') if file_: - rlog = revlog.revlog(scmutil.opener(os.getcwd(), audit=False), file_) + rlog = revlog.revlog(scmutil.opener(pycompat.getcwd(), audit=False), + file_) revs = set((int(r) for r in revs)) def events(): for r in rlog: