##// END OF EJS Templates
tests: unify test-merge-symlinks
Matt Mackall -
r12459:15f07e8e default
parent child Browse files
Show More
@@ -1,46 +1,62 b''
1 #!/bin/sh
2 1
3 cat > echo.py <<EOF
4 #!/usr/bin/env python
5 import os, sys
6 try:
7 import msvcrt
8 msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
9 msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
10 except ImportError:
11 pass
2 $ cat > echo.py <<EOF
3 > #!/usr/bin/env python
4 > import os, sys
5 > try:
6 > import msvcrt
7 > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
8 > msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
9 > except ImportError:
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'):
14 print k, os.environ[k]
15 EOF
16 Create 2 heads containing the same file, once as
17 a file, once as a link. Bundle was generated with:
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 19 # hg init t
21 20 # cd t
22 21 # echo a > a
23 22 # hg ci -qAm t0 -d '0 0'
24 23 # echo l > l
25 24 # hg ci -qAm t1 -d '1 0'
26 25 # hg up -C 0
27 26 # ln -s a l
28 27 # hg ci -qAm t2 -d '2 0'
29 28 # echo l2 > l2
30 29 # hg ci -qAm t3 -d '3 0'
31 30
32 hg init t
33 cd t
34 hg -q pull "$TESTDIR/test-merge-symlinks.hg"
35 hg up -C 3
31 $ hg init t
32 $ cd t
33 $ hg -q pull "$TESTDIR/test-merge-symlinks.hg"
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
38 echo % merge heads
39 HGMERGE="python ../echo.py" hg merge
40 $ HGMERGE="python ../echo.py" hg merge
41 HG_FILE l
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,
42 # especially on non-supporting systems.
43 echo % merge working directory
44 hg up -C 2
45 hg copy l l2
46 HGMERGE="python ../echo.py" hg up 3
49 Test working directory symlink bit calculation wrt copies,
50 especially on non-supporting systems.
51 merge working directory
52
53 $ hg up -C 2
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
General Comments 0
You need to be logged in to leave comments. Login now