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