comparison mercurial/commands.py @ 30519: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
comparison
equal deleted inserted replaced
30518:a8b17859684a 30519:20a42325fdef
2628 Completion extends only to the next path segment unless 2628 Completion extends only to the next path segment unless
2629 --full is specified, in which case entire paths are used.''' 2629 --full is specified, in which case entire paths are used.'''
2630 2630
2631 def complete(path, acceptable): 2631 def complete(path, acceptable):
2632 dirstate = repo.dirstate 2632 dirstate = repo.dirstate
2633 spec = os.path.normpath(os.path.join(os.getcwd(), path)) 2633 spec = os.path.normpath(os.path.join(pycompat.getcwd(), path))
2634 rootdir = repo.root + os.sep 2634 rootdir = repo.root + os.sep
2635 if spec != repo.root and not spec.startswith(rootdir): 2635 if spec != repo.root and not spec.startswith(rootdir):
2636 return [], [] 2636 return [], []
2637 if os.path.isdir(spec): 2637 if os.path.isdir(spec):
2638 spec += '/' 2638 spec += '/'