##// END OF EJS Templates
py3: quote $PYTHON in test-merge-symlinks.t
Matt Harbison -
r39982:2b4c8fa0 default
parent child Browse files
Show More
@@ -1,65 +1,65
1 $ cat > echo.py <<EOF
1 $ cat > echo.py <<EOF
2 > #!$PYTHON
2 > #!$PYTHON
3 > from __future__ import absolute_import, print_function
3 > from __future__ import absolute_import, print_function
4 > import os
4 > import os
5 > import sys
5 > import sys
6 > try:
6 > try:
7 > import msvcrt
7 > import msvcrt
8 > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
8 > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
9 > msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
9 > msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
10 > except ImportError:
10 > except ImportError:
11 > pass
11 > pass
12 >
12 >
13 > for k in ('HG_FILE', 'HG_MY_ISLINK', 'HG_OTHER_ISLINK', 'HG_BASE_ISLINK'):
13 > for k in ('HG_FILE', 'HG_MY_ISLINK', 'HG_OTHER_ISLINK', 'HG_BASE_ISLINK'):
14 > print(k, os.environ[k])
14 > print(k, os.environ[k])
15 > EOF
15 > EOF
16
16
17 Create 2 heads containing the same file, once as
17 Create 2 heads containing the same file, once as
18 a file, once as a link. Bundle was generated with:
18 a file, once as a link. Bundle was generated with:
19
19
20 # hg init t
20 # hg init t
21 # cd t
21 # cd t
22 # echo a > a
22 # echo a > a
23 # hg ci -qAm t0 -d '0 0'
23 # hg ci -qAm t0 -d '0 0'
24 # echo l > l
24 # echo l > l
25 # hg ci -qAm t1 -d '1 0'
25 # hg ci -qAm t1 -d '1 0'
26 # hg up -C 0
26 # hg up -C 0
27 # ln -s a l
27 # ln -s a l
28 # hg ci -qAm t2 -d '2 0'
28 # hg ci -qAm t2 -d '2 0'
29 # echo l2 > l2
29 # echo l2 > l2
30 # hg ci -qAm t3 -d '3 0'
30 # hg ci -qAm t3 -d '3 0'
31
31
32 $ hg init t
32 $ hg init t
33 $ cd t
33 $ cd t
34 $ hg -q unbundle "$TESTDIR/bundles/test-merge-symlinks.hg"
34 $ hg -q unbundle "$TESTDIR/bundles/test-merge-symlinks.hg"
35 $ hg up -C 3
35 $ hg up -C 3
36 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
36 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
37
37
38 Merge them and display *_ISLINK vars
38 Merge them and display *_ISLINK vars
39 merge heads
39 merge heads
40
40
41 $ hg merge --tool="$PYTHON ../echo.py"
41 $ hg merge --tool="\"$PYTHON\" ../echo.py"
42 merging l
42 merging l
43 HG_FILE l
43 HG_FILE l
44 HG_MY_ISLINK 1
44 HG_MY_ISLINK 1
45 HG_OTHER_ISLINK 0
45 HG_OTHER_ISLINK 0
46 HG_BASE_ISLINK 0
46 HG_BASE_ISLINK 0
47 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
47 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
48 (branch merge, don't forget to commit)
48 (branch merge, don't forget to commit)
49
49
50 Test working directory symlink bit calculation wrt copies,
50 Test working directory symlink bit calculation wrt copies,
51 especially on non-supporting systems.
51 especially on non-supporting systems.
52 merge working directory
52 merge working directory
53
53
54 $ hg up -C 2
54 $ hg up -C 2
55 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
55 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
56 $ hg copy l l2
56 $ hg copy l l2
57 $ HGMERGE="$PYTHON ../echo.py" hg up 3
57 $ HGMERGE="\"$PYTHON\" ../echo.py" hg up 3
58 merging l2
58 merging l2
59 HG_FILE l2
59 HG_FILE l2
60 HG_MY_ISLINK 1
60 HG_MY_ISLINK 1
61 HG_OTHER_ISLINK 0
61 HG_OTHER_ISLINK 0
62 HG_BASE_ISLINK 0
62 HG_BASE_ISLINK 0
63 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
63 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
64
64
65 $ cd ..
65 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now