Show More
@@ -1,51 +1,79 | |||
|
1 | #!/bin/sh | |
|
2 | 1 | |
|
3 | echo "[extensions]" >> $HGRCPATH | |
|
4 | echo "convert=" >> $HGRCPATH | |
|
5 | echo 'graphlog =' >> $HGRCPATH | |
|
6 | ||
|
7 | glog() | |
|
8 | { | |
|
9 | hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@" | |
|
10 | } | |
|
11 | ||
|
12 | hg init repo1 | |
|
13 | cd repo1 | |
|
14 | echo a > a | |
|
15 | hg ci -Am adda | |
|
16 |
|
|
|
17 | echo a >> a | |
|
18 | hg ci -Am addb | |
|
19 | PARENTID1=`hg id --debug -i` | |
|
20 | echo c > c | |
|
21 | hg ci -Am addc | |
|
22 | PARENTID2=`hg id --debug -i` | |
|
23 | cd .. | |
|
2 | $ echo "[extensions]" >> $HGRCPATH | |
|
3 | $ echo "convert=" >> $HGRCPATH | |
|
4 | $ echo 'graphlog =' >> $HGRCPATH | |
|
5 | $ glog() | |
|
6 | > { | |
|
7 | > hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@" | |
|
8 | > } | |
|
9 | $ hg init repo1 | |
|
10 | $ cd repo1 | |
|
11 | $ echo a > a | |
|
12 | $ hg ci -Am adda | |
|
13 | adding a | |
|
14 | $ echo b > b | |
|
15 | $ echo a >> a | |
|
16 | $ hg ci -Am addb | |
|
17 | adding b | |
|
18 | $ PARENTID1=`hg id --debug -i` | |
|
19 | $ echo c > c | |
|
20 | $ hg ci -Am addc | |
|
21 | adding c | |
|
22 | $ PARENTID2=`hg id --debug -i` | |
|
23 | $ cd .. | |
|
24 | $ hg init repo2 | |
|
25 | $ cd repo2 | |
|
26 | $ echo b > a | |
|
27 | $ echo d > d | |
|
28 | $ hg ci -Am addaandd | |
|
29 | adding a | |
|
30 | adding d | |
|
31 | $ CHILDID1=`hg id --debug -i` | |
|
32 | $ echo d >> d | |
|
33 | $ hg ci -Am changed | |
|
34 | $ CHILDID2=`hg id --debug -i` | |
|
35 | $ echo e > e | |
|
36 | $ hg ci -Am adde | |
|
37 | adding e | |
|
38 | $ cd .. | |
|
24 | 39 | |
|
25 | hg init repo2 | |
|
26 | cd repo2 | |
|
27 | echo b > a | |
|
28 | echo d > d | |
|
29 | hg ci -Am addaandd | |
|
30 | CHILDID1=`hg id --debug -i` | |
|
31 | echo d >> d | |
|
32 | hg ci -Am changed | |
|
33 | CHILDID2=`hg id --debug -i` | |
|
34 | echo e > e | |
|
35 | hg ci -Am adde | |
|
36 | cd .. | |
|
40 | test invalid splicemap | |
|
41 | ||
|
42 | $ cat > splicemap <<EOF | |
|
43 | > $CHILDID2 | |
|
44 | > EOF | |
|
45 | $ hg convert --splicemap splicemap repo2 repo1 | |
|
46 | abort: syntax error in splicemap(1): key/value pair expected | |
|
47 | [255] | |
|
48 | ||
|
49 | splice repo2 on repo1 | |
|
37 | 50 | |
|
38 | echo '% test invalid splicemap' | |
|
39 | cat > splicemap <<EOF | |
|
40 | $CHILDID2 | |
|
41 | EOF | |
|
42 | hg convert --splicemap splicemap repo2 repo1 | |
|
51 | $ cat > splicemap <<EOF | |
|
52 | > $CHILDID1 $PARENTID1 | |
|
53 | > $CHILDID2 $PARENTID2,$CHILDID1 | |
|
54 | > EOF | |
|
55 | $ hg clone repo1 target1 | |
|
56 | updating to branch default | |
|
57 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
58 | $ hg convert --splicemap splicemap repo2 target1 | |
|
59 | scanning source... | |
|
60 | sorting... | |
|
61 | converting... | |
|
62 | 2 addaandd | |
|
63 | spliced in ['6d4c2037ddc2cb2627ac3a244ecce35283268f8e'] as parents of 527cdedf31fbd5ea708aa14eeecf53d4676f38db | |
|
64 | 1 changed | |
|
65 | spliced in ['e55c719b85b60e5102fac26110ba626e7cb6b7dc', '527cdedf31fbd5ea708aa14eeecf53d4676f38db'] as parents of e4ea00df91897da3079a10fab658c1eddba6617b | |
|
66 | 0 adde | |
|
67 | $ glog -R target1 | |
|
68 | o 5 "adde" files: e | |
|
69 | | | |
|
70 | o 4 "changed" files: d | |
|
71 | |\ | |
|
72 | | o 3 "addaandd" files: a d | |
|
73 | | | | |
|
74 | @ | 2 "addc" files: c | |
|
75 | |/ | |
|
76 | o 1 "addb" files: a b | |
|
77 | | | |
|
78 | o 0 "adda" files: a | |
|
43 | 79 | |
|
44 | echo '% splice repo2 on repo1' | |
|
45 | cat > splicemap <<EOF | |
|
46 | $CHILDID1 $PARENTID1 | |
|
47 | $CHILDID2 $PARENTID2,$CHILDID1 | |
|
48 | EOF | |
|
49 | hg clone repo1 target1 | |
|
50 | hg convert --splicemap splicemap repo2 target1 | |
|
51 | glog -R target1 |
|
1 | NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now