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