Mercurial > public > mercurial-scm > hg
comparison mercurial/merge.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 | d6f3877b72c7 |
children | 43a9e02a7b7f |
comparison
equal
deleted
inserted
replaced
30518:a8b17859684a | 30519:20a42325fdef |
---|---|
26 from . import ( | 26 from . import ( |
27 copies, | 27 copies, |
28 error, | 28 error, |
29 filemerge, | 29 filemerge, |
30 obsolete, | 30 obsolete, |
31 pycompat, | |
31 scmutil, | 32 scmutil, |
32 subrepo, | 33 subrepo, |
33 util, | 34 util, |
34 worker, | 35 worker, |
35 ) | 36 ) |
1038 verbose = repo.ui.verbose | 1039 verbose = repo.ui.verbose |
1039 unlink = util.unlinkpath | 1040 unlink = util.unlinkpath |
1040 wjoin = repo.wjoin | 1041 wjoin = repo.wjoin |
1041 audit = repo.wvfs.audit | 1042 audit = repo.wvfs.audit |
1042 try: | 1043 try: |
1043 cwd = os.getcwd() | 1044 cwd = pycompat.getcwd() |
1044 except OSError as err: | 1045 except OSError as err: |
1045 if err.errno != errno.ENOENT: | 1046 if err.errno != errno.ENOENT: |
1046 raise | 1047 raise |
1047 cwd = None | 1048 cwd = None |
1048 i = 0 | 1049 i = 0 |
1064 yield i, f | 1065 yield i, f |
1065 if cwd: | 1066 if cwd: |
1066 # cwd was present before we started to remove files | 1067 # cwd was present before we started to remove files |
1067 # let's check if it is present after we removed them | 1068 # let's check if it is present after we removed them |
1068 try: | 1069 try: |
1069 os.getcwd() | 1070 pycompat.getcwd() |
1070 except OSError as err: | 1071 except OSError as err: |
1071 if err.errno != errno.ENOENT: | 1072 if err.errno != errno.ENOENT: |
1072 raise | 1073 raise |
1073 # Print a warning if cwd was deleted | 1074 # Print a warning if cwd was deleted |
1074 repo.ui.warn(_("current directory was removed\n" | 1075 repo.ui.warn(_("current directory was removed\n" |