Mercurial > hg
comparison tests/test-hardlinks.t @ 48876:42d2b31cee0b
tests: remove from __future__ from inline Python in tests
This is no longer required since we require Python 3 and the linter
no longer requires these statements.
Differential Revision: https://phab.mercurial-scm.org/D12255
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 20 Feb 2022 15:28:44 -0700 |
parents | 7ee07e1a25c0 |
children | 2f2682f40ea0 |
comparison
equal
deleted
inserted
replaced
48875:6000f5b25c9b | 48876:42d2b31cee0b |
---|---|
1 #require hardlink reporevlogstore | 1 #require hardlink reporevlogstore |
2 | 2 |
3 $ cat > nlinks.py <<EOF | 3 $ cat > nlinks.py <<EOF |
4 > from __future__ import print_function | |
5 > import sys | 4 > import sys |
6 > from mercurial import pycompat, util | 5 > from mercurial import pycompat, util |
7 > for f in sorted(sys.stdin.readlines()): | 6 > for f in sorted(sys.stdin.readlines()): |
8 > f = f[:-1] | 7 > f = f[:-1] |
9 > print(util.nlinks(pycompat.fsencode(f)), f) | 8 > print(util.nlinks(pycompat.fsencode(f)), f) |
15 > } | 14 > } |
16 | 15 |
17 Some implementations of cp can't create hardlinks (replaces 'cp -al' on Linux): | 16 Some implementations of cp can't create hardlinks (replaces 'cp -al' on Linux): |
18 | 17 |
19 $ cat > linkcp.py <<EOF | 18 $ cat > linkcp.py <<EOF |
20 > from __future__ import absolute_import | |
21 > import sys | 19 > import sys |
22 > from mercurial import pycompat, util | 20 > from mercurial import pycompat, util |
23 > util.copyfiles(pycompat.fsencode(sys.argv[1]), | 21 > util.copyfiles(pycompat.fsencode(sys.argv[1]), |
24 > pycompat.fsencode(sys.argv[2]), hardlink=True) | 22 > pycompat.fsencode(sys.argv[2]), hardlink=True) |
25 > EOF | 23 > EOF |