equal
deleted
inserted
replaced
27 from .i18n import _ |
27 from .i18n import _ |
28 from .node import ( |
28 from .node import ( |
29 hex, |
29 hex, |
30 nullrev, |
30 nullrev, |
31 short, |
31 short, |
32 ) |
|
33 from .pycompat import ( |
|
34 open, |
|
35 ) |
32 ) |
36 from .thirdparty import attr |
33 from .thirdparty import attr |
37 |
34 |
38 # Force pytype to use the non-vendored package |
35 # Force pytype to use the non-vendored package |
39 if typing.TYPE_CHECKING: |
36 if typing.TYPE_CHECKING: |
1404 fp = repo.ui.fout |
1401 fp = repo.ui.fout |
1405 else: |
1402 else: |
1406 fp = repo.ui.fin |
1403 fp = repo.ui.fin |
1407 return _unclosablefile(fp) |
1404 return _unclosablefile(fp) |
1408 fn = makefilename(ctx, pat, **props) |
1405 fn = makefilename(ctx, pat, **props) |
1409 return open(fn, mode) |
1406 return open(fn, pycompat.sysstr(mode)) |
1410 |
1407 |
1411 |
1408 |
1412 def openstorage(repo, cmd, file_, opts, returnrevlog=False): |
1409 def openstorage(repo, cmd, file_, opts, returnrevlog=False): |
1413 """opens the changelog, manifest, a filelog or a given revlog""" |
1410 """opens the changelog, manifest, a filelog or a given revlog""" |
1414 cl = opts[b'changelog'] |
1411 cl = opts[b'changelog'] |