Mercurial > hg
annotate tests/test-merge-symlinks @ 6899:56a7a54e074f
store: simplify walking
- fold in main walking function
- eliminate recursion (especially recursive yielding!)
- eliminate default args
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 13 Aug 2008 20:18:43 -0500 |
parents | 36794dbe66a3 |
children | a6477aa893b8 |
rev | line source |
---|---|
5391
786c1206a029
Test *_ISLINK merge environment vars
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
1 #!/bin/sh |
786c1206a029
Test *_ISLINK merge environment vars
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
2 |
786c1206a029
Test *_ISLINK merge environment vars
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
3 cat > echo.py <<EOF |
786c1206a029
Test *_ISLINK merge environment vars
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
4 #!/usr/bin/env python |
786c1206a029
Test *_ISLINK merge environment vars
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
5 import os |
5408
36794dbe66a3
Test workingctx exec/link bit for copies.
Patrick Mezard <pmezard@gmail.com>
parents:
5391
diff
changeset
|
6 for k in ('HG_FILE', 'HG_MY_ISLINK', 'HG_OTHER_ISLINK', 'HG_BASE_ISLINK'): |
5391
786c1206a029
Test *_ISLINK merge environment vars
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
7 print k, os.environ[k] |
786c1206a029
Test *_ISLINK merge environment vars
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
8 EOF |
786c1206a029
Test *_ISLINK merge environment vars
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
9 |
786c1206a029
Test *_ISLINK merge environment vars
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
10 # Create 2 heads containing the same file, once as |
5408
36794dbe66a3
Test workingctx exec/link bit for copies.
Patrick Mezard <pmezard@gmail.com>
parents:
5391
diff
changeset
|
11 # a file, once as a link. Bundle was generated with: |
36794dbe66a3
Test workingctx exec/link bit for copies.
Patrick Mezard <pmezard@gmail.com>
parents:
5391
diff
changeset
|
12 # |
36794dbe66a3
Test workingctx exec/link bit for copies.
Patrick Mezard <pmezard@gmail.com>
parents:
5391
diff
changeset
|
13 # hg init t |
36794dbe66a3
Test workingctx exec/link bit for copies.
Patrick Mezard <pmezard@gmail.com>
parents:
5391
diff
changeset
|
14 # cd t |
36794dbe66a3
Test workingctx exec/link bit for copies.
Patrick Mezard <pmezard@gmail.com>
parents:
5391
diff
changeset
|
15 # echo a > a |
36794dbe66a3
Test workingctx exec/link bit for copies.
Patrick Mezard <pmezard@gmail.com>
parents:
5391
diff
changeset
|
16 # hg ci -qAm t0 -d '0 0' |
36794dbe66a3
Test workingctx exec/link bit for copies.
Patrick Mezard <pmezard@gmail.com>
parents:
5391
diff
changeset
|
17 # echo l > l |
36794dbe66a3
Test workingctx exec/link bit for copies.
Patrick Mezard <pmezard@gmail.com>
parents:
5391
diff
changeset
|
18 # hg ci -qAm t1 -d '1 0' |
36794dbe66a3
Test workingctx exec/link bit for copies.
Patrick Mezard <pmezard@gmail.com>
parents:
5391
diff
changeset
|
19 # hg up -C 0 |
36794dbe66a3
Test workingctx exec/link bit for copies.
Patrick Mezard <pmezard@gmail.com>
parents:
5391
diff
changeset
|
20 # ln -s a l |
36794dbe66a3
Test workingctx exec/link bit for copies.
Patrick Mezard <pmezard@gmail.com>
parents:
5391
diff
changeset
|
21 # hg ci -qAm t2 -d '2 0' |
36794dbe66a3
Test workingctx exec/link bit for copies.
Patrick Mezard <pmezard@gmail.com>
parents:
5391
diff
changeset
|
22 # echo l2 > l2 |
36794dbe66a3
Test workingctx exec/link bit for copies.
Patrick Mezard <pmezard@gmail.com>
parents:
5391
diff
changeset
|
23 # hg ci -qAm t3 -d '3 0' |
36794dbe66a3
Test workingctx exec/link bit for copies.
Patrick Mezard <pmezard@gmail.com>
parents:
5391
diff
changeset
|
24 |
5391
786c1206a029
Test *_ISLINK merge environment vars
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
25 hg init t |
786c1206a029
Test *_ISLINK merge environment vars
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
26 cd t |
5408
36794dbe66a3
Test workingctx exec/link bit for copies.
Patrick Mezard <pmezard@gmail.com>
parents:
5391
diff
changeset
|
27 hg -q pull "$TESTDIR/test-merge-symlinks.hg" |
36794dbe66a3
Test workingctx exec/link bit for copies.
Patrick Mezard <pmezard@gmail.com>
parents:
5391
diff
changeset
|
28 hg up -C 3 |
5391
786c1206a029
Test *_ISLINK merge environment vars
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
29 |
786c1206a029
Test *_ISLINK merge environment vars
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
30 # Merge them and display *_ISLINK vars |
786c1206a029
Test *_ISLINK merge environment vars
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
31 echo % merge heads |
5408
36794dbe66a3
Test workingctx exec/link bit for copies.
Patrick Mezard <pmezard@gmail.com>
parents:
5391
diff
changeset
|
32 HGMERGE="python ../echo.py" hg merge |
36794dbe66a3
Test workingctx exec/link bit for copies.
Patrick Mezard <pmezard@gmail.com>
parents:
5391
diff
changeset
|
33 |
36794dbe66a3
Test workingctx exec/link bit for copies.
Patrick Mezard <pmezard@gmail.com>
parents:
5391
diff
changeset
|
34 # Test working directory symlink bit calculation wrt copies, |
36794dbe66a3
Test workingctx exec/link bit for copies.
Patrick Mezard <pmezard@gmail.com>
parents:
5391
diff
changeset
|
35 # especially on non-supporting systems. |
36794dbe66a3
Test workingctx exec/link bit for copies.
Patrick Mezard <pmezard@gmail.com>
parents:
5391
diff
changeset
|
36 echo % merge working directory |
36794dbe66a3
Test workingctx exec/link bit for copies.
Patrick Mezard <pmezard@gmail.com>
parents:
5391
diff
changeset
|
37 hg up -C 2 |
36794dbe66a3
Test workingctx exec/link bit for copies.
Patrick Mezard <pmezard@gmail.com>
parents:
5391
diff
changeset
|
38 hg copy l l2 |
36794dbe66a3
Test workingctx exec/link bit for copies.
Patrick Mezard <pmezard@gmail.com>
parents:
5391
diff
changeset
|
39 HGMERGE="python ../echo.py" hg up 3 |