Mercurial > public > mercurial-scm > hg
comparison mercurial/cmdutil.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 | d9d8d78e6bc9 |
children | 74013a831872 |
comparison
equal
deleted
inserted
replaced
30518:a8b17859684a | 30519:20a42325fdef |
---|---|
36 mergeutil, | 36 mergeutil, |
37 obsolete, | 37 obsolete, |
38 patch, | 38 patch, |
39 pathutil, | 39 pathutil, |
40 phases, | 40 phases, |
41 pycompat, | |
41 repair, | 42 repair, |
42 revlog, | 43 revlog, |
43 revset, | 44 revset, |
44 scmutil, | 45 scmutil, |
45 templatekw, | 46 templatekw, |
568 if not r: | 569 if not r: |
569 if not file_: | 570 if not file_: |
570 raise error.CommandError(cmd, _('invalid arguments')) | 571 raise error.CommandError(cmd, _('invalid arguments')) |
571 if not os.path.isfile(file_): | 572 if not os.path.isfile(file_): |
572 raise error.Abort(_("revlog '%s' not found") % file_) | 573 raise error.Abort(_("revlog '%s' not found") % file_) |
573 r = revlog.revlog(scmutil.opener(os.getcwd(), audit=False), | 574 r = revlog.revlog(scmutil.opener(pycompat.getcwd(), audit=False), |
574 file_[:-2] + ".i") | 575 file_[:-2] + ".i") |
575 return r | 576 return r |
576 | 577 |
577 def copy(ui, repo, pats, opts, rename=False): | 578 def copy(ui, repo, pats, opts, rename=False): |
578 # called with the repo lock held | 579 # called with the repo lock held |
2742 forms.pop() | 2743 forms.pop() |
2743 else: | 2744 else: |
2744 committext = buildcommittext(repo, ctx, subs, extramsg) | 2745 committext = buildcommittext(repo, ctx, subs, extramsg) |
2745 | 2746 |
2746 # run editor in the repository root | 2747 # run editor in the repository root |
2747 olddir = os.getcwd() | 2748 olddir = pycompat.getcwd() |
2748 os.chdir(repo.root) | 2749 os.chdir(repo.root) |
2749 | 2750 |
2750 # make in-memory changes visible to external process | 2751 # make in-memory changes visible to external process |
2751 tr = repo.currenttransaction() | 2752 tr = repo.currenttransaction() |
2752 repo.dirstate.write(tr) | 2753 repo.dirstate.write(tr) |