Show More
@@ -1,19 +1,19 b'' | |||
|
1 | 1 | # this file holds the definitions that are used in various bzr tests |
|
2 | 2 | |
|
3 | 3 | "$TESTDIR/hghave" bzr || exit 80 |
|
4 | 4 | |
|
5 | 5 | export TERM=dumb |
|
6 | 6 | echo '[extensions]' >> $HGRCPATH |
|
7 | 7 | echo 'convert = ' >> $HGRCPATH |
|
8 | 8 | echo 'hgext.graphlog = ' >> $HGRCPATH |
|
9 | 9 | |
|
10 | 10 | glog() |
|
11 | 11 | { |
|
12 |
hg glog --template ' |
|
|
12 | hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@" | |
|
13 | 13 | } |
|
14 | 14 | |
|
15 | 15 | manifest() |
|
16 | 16 | { |
|
17 | 17 | echo "% manifest of $2" |
|
18 | 18 | hg -R $1 manifest -v -r $2 |
|
19 | 19 | } |
@@ -1,113 +1,113 b'' | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | heads() |
|
4 | 4 | { |
|
5 |
hg heads --template ' |
|
|
5 | hg heads --template '{rev}: {desc|firstline|strip}\n' "$@" | |
|
6 | 6 | } |
|
7 | 7 | |
|
8 | 8 | hg init a |
|
9 | 9 | cd a |
|
10 | 10 | echo 'root' >root |
|
11 | 11 | hg add root |
|
12 | 12 | hg commit -m "Adding root node" |
|
13 | 13 | heads |
|
14 | 14 | echo '-------' |
|
15 | 15 | heads . |
|
16 | 16 | |
|
17 | 17 | echo '=======' |
|
18 | 18 | echo 'a' >a |
|
19 | 19 | hg add a |
|
20 | 20 | hg branch a |
|
21 | 21 | hg commit -m "Adding a branch" |
|
22 | 22 | heads |
|
23 | 23 | echo '-------' |
|
24 | 24 | heads . |
|
25 | 25 | |
|
26 | 26 | echo '=======' |
|
27 | 27 | hg update -C 0 |
|
28 | 28 | echo 'b' >b |
|
29 | 29 | hg add b |
|
30 | 30 | hg branch b |
|
31 | 31 | hg commit -m "Adding b branch" |
|
32 | 32 | heads |
|
33 | 33 | echo '-------' |
|
34 | 34 | heads . |
|
35 | 35 | |
|
36 | 36 | echo '=======' |
|
37 | 37 | echo 'bh1' >bh1 |
|
38 | 38 | hg add bh1 |
|
39 | 39 | hg commit -m "Adding b branch head 1" |
|
40 | 40 | heads |
|
41 | 41 | echo '-------' |
|
42 | 42 | heads . |
|
43 | 43 | |
|
44 | 44 | echo '=======' |
|
45 | 45 | hg update -C 2 |
|
46 | 46 | echo 'bh2' >bh2 |
|
47 | 47 | hg add bh2 |
|
48 | 48 | hg commit -m "Adding b branch head 2" |
|
49 | 49 | heads |
|
50 | 50 | echo '-------' |
|
51 | 51 | heads . |
|
52 | 52 | |
|
53 | 53 | echo '=======' |
|
54 | 54 | hg update -C 2 |
|
55 | 55 | echo 'bh3' >bh3 |
|
56 | 56 | hg add bh3 |
|
57 | 57 | hg commit -m "Adding b branch head 3" |
|
58 | 58 | heads |
|
59 | 59 | echo '-------' |
|
60 | 60 | heads . |
|
61 | 61 | |
|
62 | 62 | echo '=======' |
|
63 | 63 | hg merge 4 |
|
64 | 64 | hg commit -m "Merging b branch head 2 and b branch head 3" |
|
65 | 65 | heads |
|
66 | 66 | echo '-------' |
|
67 | 67 | heads . |
|
68 | 68 | |
|
69 | 69 | echo '=======' |
|
70 | 70 | echo 'c' >c |
|
71 | 71 | hg add c |
|
72 | 72 | hg branch c |
|
73 | 73 | hg commit -m "Adding c branch" |
|
74 | 74 | heads |
|
75 | 75 | echo '-------' |
|
76 | 76 | heads . |
|
77 | 77 | |
|
78 | 78 | echo '=======' |
|
79 | 79 | heads -r 3 . |
|
80 | 80 | echo $? |
|
81 | 81 | echo '-------' |
|
82 | 82 | heads -r 2 . |
|
83 | 83 | echo $? |
|
84 | 84 | echo '-------' |
|
85 | 85 | hg update -C 4 |
|
86 | 86 | echo $? |
|
87 | 87 | echo '-------' |
|
88 | 88 | heads -r 3 . |
|
89 | 89 | echo $? |
|
90 | 90 | echo '-------' |
|
91 | 91 | heads -r 2 . |
|
92 | 92 | echo $? |
|
93 | 93 | echo '-------' |
|
94 | 94 | heads -r 7 . |
|
95 | 95 | echo $? |
|
96 | 96 | |
|
97 | 97 | echo '=======' |
|
98 | 98 | for i in 0 1 2 3 4 5 6 7; do |
|
99 | 99 | hg update -C "$i" |
|
100 | 100 | heads |
|
101 | 101 | echo '-------' |
|
102 | 102 | heads . |
|
103 | 103 | echo '-------' |
|
104 | 104 | done |
|
105 | 105 | |
|
106 | 106 | echo '=======' |
|
107 | 107 | for i in a b c z; do |
|
108 | 108 | heads "$i" |
|
109 | 109 | echo '-------' |
|
110 | 110 | done |
|
111 | 111 | |
|
112 | 112 | echo '=======' |
|
113 | 113 | heads 0 1 2 3 4 5 6 7 |
@@ -1,130 +1,130 b'' | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | hg init a |
|
4 | 4 | cd a |
|
5 | 5 | echo a > a |
|
6 | 6 | hg add a |
|
7 | 7 | echo line 1 > b |
|
8 | 8 | echo line 2 >> b |
|
9 | 9 | hg commit -l b -d '1000000 0' -u 'User Name <user@hostname>' |
|
10 | 10 | hg add b |
|
11 | 11 | echo other 1 > c |
|
12 | 12 | echo other 2 >> c |
|
13 | 13 | echo >> c |
|
14 | 14 | echo other 3 >> c |
|
15 | 15 | hg commit -l c -d '1100000 0' -u 'A. N. Other <other@place>' |
|
16 | 16 | hg add c |
|
17 | 17 | hg commit -m 'no person' -d '1200000 0' -u 'other@place' |
|
18 | 18 | echo c >> c |
|
19 | 19 | hg commit -m 'no user, no domain' -d '1300000 0' -u 'person' |
|
20 | 20 | echo foo > .hg/branch |
|
21 | 21 | hg commit -m 'new branch' -d '1400000 0' -u 'person' |
|
22 | 22 | hg co -q 3 |
|
23 | 23 | echo other 4 >> d |
|
24 | 24 | hg add d |
|
25 | 25 | hg commit -m 'new head' -d '1500000 0' -u 'person' |
|
26 | 26 | hg merge -q foo |
|
27 | 27 | hg commit -m 'merge' -d '1500001 0' -u 'person' |
|
28 | 28 | # second branch starting at nullrev |
|
29 | 29 | hg update null |
|
30 | 30 | echo second > second |
|
31 | 31 | hg add second |
|
32 | 32 | hg commit -m second -d '1000000 0' -u 'User Name <user@hostname>' |
|
33 | 33 | echo third > third |
|
34 | 34 | hg add third |
|
35 | 35 | hg commit -m third -d "2020-01-01 10:01" |
|
36 | 36 | |
|
37 | 37 | # make sure user/global hgrc does not affect tests |
|
38 | 38 | echo '[ui]' > .hg/hgrc |
|
39 | 39 | echo 'logtemplate =' >> .hg/hgrc |
|
40 | 40 | echo 'style =' >> .hg/hgrc |
|
41 | 41 | |
|
42 | 42 | echo '# default style is like normal output' |
|
43 | 43 | echo '# normal' |
|
44 | 44 | hg log > log.out |
|
45 | 45 | hg log --style default > style.out |
|
46 | 46 | diff -u log.out style.out |
|
47 | 47 | echo '# verbose' |
|
48 | 48 | hg log -v > log.out |
|
49 | 49 | hg log -v --style default > style.out |
|
50 | 50 | diff -u log.out style.out |
|
51 | 51 | echo '# debug' |
|
52 | 52 | hg log --debug > log.out |
|
53 | 53 | hg log --debug --style default > style.out |
|
54 | 54 | diff -u log.out style.out |
|
55 | 55 | |
|
56 | 56 | echo '# revision with no copies (used to print a traceback)' |
|
57 | 57 | hg tip -v --template '\n' |
|
58 | 58 | |
|
59 | 59 | echo '# compact style works' |
|
60 | 60 | hg log --style compact |
|
61 | 61 | hg log -v --style compact |
|
62 | 62 | hg log --debug --style compact |
|
63 | 63 | |
|
64 | 64 | echo '# error if style not readable' |
|
65 | 65 | touch q |
|
66 | 66 | chmod 0 q |
|
67 | 67 | hg log --style ./q |
|
68 | 68 | |
|
69 | 69 | echo '# error if no style' |
|
70 | 70 | hg log --style notexist |
|
71 | 71 | |
|
72 | 72 | echo '# error if style missing key' |
|
73 | 73 | echo 'q = q' > t |
|
74 | 74 | hg log --style ./t |
|
75 | 75 | |
|
76 | 76 | echo '# error if include fails' |
|
77 | 77 | echo 'changeset = q' >> t |
|
78 | 78 | hg log --style ./t |
|
79 | 79 | |
|
80 | 80 | echo '# include works' |
|
81 | 81 | rm q |
|
82 | 82 | echo '{rev}' > q |
|
83 | 83 | hg log --style ./t |
|
84 | 84 | |
|
85 | 85 | echo '# ui.style works' |
|
86 | 86 | echo '[ui]' > .hg/hgrc |
|
87 | 87 | echo 'style = t' >> .hg/hgrc |
|
88 | 88 | hg log |
|
89 | 89 | |
|
90 | 90 | echo '# issue338' |
|
91 | 91 | hg log --style=changelog > changelog |
|
92 | 92 | cat changelog |
|
93 | 93 | |
|
94 | 94 | echo "# keys work" |
|
95 | 95 | for key in author branches date desc file_adds file_dels file_mods \ |
|
96 | 96 | files manifest node parents rev tags diffstat; do |
|
97 | 97 | for mode in '' --verbose --debug; do |
|
98 | 98 | hg log $mode --template "$key$mode: {$key}\n" |
|
99 | 99 | done |
|
100 | 100 | done |
|
101 | 101 | |
|
102 | 102 | echo '# filters work' |
|
103 | 103 | hg log --template '{author|domain}\n' |
|
104 | 104 | hg log --template '{author|person}\n' |
|
105 | 105 | hg log --template '{author|user}\n' |
|
106 | 106 | hg log --template '{date|age}\n' > /dev/null || exit 1 |
|
107 | 107 | hg log -l1 --template '{date|age}\n' |
|
108 | 108 | hg log --template '{date|date}\n' |
|
109 | 109 | hg log --template '{date|isodate}\n' |
|
110 | 110 | hg log --template '{date|isodatesec}\n' |
|
111 | 111 | hg log --template '{date|rfc822date}\n' |
|
112 | 112 | hg log --template '{desc|firstline}\n' |
|
113 | 113 | hg log --template '{node|short}\n' |
|
114 | 114 | hg log --template '<changeset author="{author|xmlescape}"/>\n' |
|
115 | 115 | |
|
116 | 116 | echo '# formatnode filter works' |
|
117 | 117 | echo '# quiet' |
|
118 |
hg -q log -r 0 --template ' |
|
|
118 | hg -q log -r 0 --template '{node|formatnode}\n' | |
|
119 | 119 | echo '# normal' |
|
120 |
hg log -r 0 --template ' |
|
|
120 | hg log -r 0 --template '{node|formatnode}\n' | |
|
121 | 121 | echo '# verbose' |
|
122 |
hg -v log -r 0 --template ' |
|
|
122 | hg -v log -r 0 --template '{node|formatnode}\n' | |
|
123 | 123 | echo '# debug' |
|
124 |
hg --debug log -r 0 --template ' |
|
|
124 | hg --debug log -r 0 --template '{node|formatnode}\n' | |
|
125 | 125 | |
|
126 | 126 | echo '# error on syntax' |
|
127 | 127 | echo 'x = "f' >> t |
|
128 | 128 | hg log |
|
129 | 129 | |
|
130 | 130 | echo '# done' |
@@ -1,83 +1,83 b'' | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | "$TESTDIR/hghave" baz || exit 80 |
|
4 | 4 | |
|
5 | 5 | mkdir do_not_use_HOME_baz |
|
6 | 6 | cd do_not_use_HOME_baz |
|
7 | 7 | HOME=`pwd`; export HOME |
|
8 | 8 | cd .. |
|
9 | 9 | baz my-id "mercurial <mercurial@selenic.com>" |
|
10 | 10 | |
|
11 | 11 | echo "[extensions]" >> $HGRCPATH |
|
12 | 12 | echo "convert=" >> $HGRCPATH |
|
13 | 13 | echo 'hgext.graphlog =' >> $HGRCPATH |
|
14 | 14 | |
|
15 | 15 | echo % create baz archive |
|
16 | 16 | baz make-archive baz@mercurial--convert hg-test-convert-baz |
|
17 | 17 | |
|
18 | 18 | echo % initialize baz repo |
|
19 | 19 | mkdir baz-repo |
|
20 | 20 | cd baz-repo/ |
|
21 | 21 | baz init-tree baz@mercurial--convert/baz--test--0 |
|
22 | 22 | baz import |
|
23 | 23 | |
|
24 | 24 | echo % create initial files |
|
25 | 25 | echo 'this is a file' > a |
|
26 | 26 | baz add a |
|
27 | 27 | mkdir src |
|
28 | 28 | baz add src |
|
29 | 29 | cd src |
|
30 | 30 | dd count=1 if=/dev/zero of=b > /dev/null 2> /dev/null |
|
31 | 31 | baz add b |
|
32 | 32 | # HACK: hide GNU tar-1.22 "tar: The --preserve option is deprecated, use --preserve-permissions --preserve-order instead" |
|
33 | 33 | baz commit -s "added a file, src and src/b (binary)" 2>&1 | grep -v ^tar |
|
34 | 34 | |
|
35 | 35 | echo % create link file and modify a |
|
36 | 36 | ln -s ../a a-link |
|
37 | 37 | baz add a-link |
|
38 | 38 | echo 'this a modification to a' >> ../a |
|
39 | 39 | baz commit -s "added link to a and modify a" |
|
40 | 40 | |
|
41 | 41 | echo % create second link and modify b |
|
42 | 42 | ln -s ../a a-link-2 |
|
43 | 43 | baz add a-link-2 |
|
44 | 44 | dd count=1 seek=1 if=/dev/zero of=b > /dev/null 2> /dev/null |
|
45 | 45 | baz commit -s "added second link and modify b" |
|
46 | 46 | |
|
47 | 47 | echo % b file to link and a-link-2 to regular file |
|
48 | 48 | rm -f a-link-2 |
|
49 | 49 | echo 'this is now a regular file' > a-link-2 |
|
50 | 50 | ln -sf ../a b |
|
51 | 51 | baz commit -s "file to link and link to file test" |
|
52 | 52 | |
|
53 | 53 | echo % move a-link-2 file and src directory |
|
54 | 54 | cd .. |
|
55 | 55 | baz mv src/a-link-2 c |
|
56 | 56 | baz mv src test |
|
57 | 57 | baz commit -s "move and rename a-link-2 file and src directory" |
|
58 | 58 | |
|
59 | 59 | echo % move and add the moved file again |
|
60 | 60 | echo e > e |
|
61 | 61 | baz add e |
|
62 | 62 | baz commit -s "add e" |
|
63 | 63 | baz mv e f |
|
64 | 64 | echo ee > e |
|
65 | 65 | baz add e |
|
66 | 66 | baz commit -s "move e and recreate it again" |
|
67 | 67 | cd .. |
|
68 | 68 | |
|
69 | 69 | echo % converting baz repo to Mercurial |
|
70 | 70 | hg convert baz-repo baz-repo-hg |
|
71 | 71 | |
|
72 | 72 | baz register-archive -d baz@mercurial--convert |
|
73 | 73 | |
|
74 | 74 | glog() |
|
75 | 75 | { |
|
76 |
hg glog --template ' |
|
|
76 | hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@" | |
|
77 | 77 | } |
|
78 | 78 | |
|
79 | 79 | echo % show graph log |
|
80 | 80 | glog -R baz-repo-hg |
|
81 | 81 | hg up -q -R baz-repo-hg |
|
82 | 82 | hg -R baz-repo-hg manifest --debug |
|
83 | 83 | hg -R baz-repo-hg log -r 5 -r 7 -C --debug | grep copies |
@@ -1,105 +1,105 b'' | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | "$TESTDIR/hghave" cvs cvsps || exit 80 |
|
4 | 4 | |
|
5 | 5 | cvscall() |
|
6 | 6 | { |
|
7 | 7 | cvs -f $@ |
|
8 | 8 | } |
|
9 | 9 | |
|
10 | 10 | hgcat() |
|
11 | 11 | { |
|
12 | 12 | hg --cwd src-hg cat -r tip "$1" |
|
13 | 13 | } |
|
14 | 14 | |
|
15 | 15 | # Test legacy configuration with external cvsps |
|
16 | 16 | echo "[extensions]" >> $HGRCPATH |
|
17 | 17 | echo "convert = " >> $HGRCPATH |
|
18 | 18 | echo "graphlog = " >> $HGRCPATH |
|
19 | 19 | echo "[convert]" >> $HGRCPATH |
|
20 | 20 | echo "cvsps=cvsps -A -u --cvs-direct -q" >> $HGRCPATH |
|
21 | 21 | |
|
22 | 22 | echo % create cvs repository |
|
23 | 23 | mkdir cvsrepo |
|
24 | 24 | cd cvsrepo |
|
25 | 25 | CVSROOT=`pwd` |
|
26 | 26 | export CVSROOT |
|
27 | 27 | CVS_OPTIONS=-f |
|
28 | 28 | export CVS_OPTIONS |
|
29 | 29 | cd .. |
|
30 | 30 | |
|
31 | 31 | cvscall -q -d "$CVSROOT" init |
|
32 | 32 | |
|
33 | 33 | echo % create source directory |
|
34 | 34 | mkdir src-temp |
|
35 | 35 | cd src-temp |
|
36 | 36 | echo a > a |
|
37 | 37 | mkdir b |
|
38 | 38 | cd b |
|
39 | 39 | echo c > c |
|
40 | 40 | cd .. |
|
41 | 41 | |
|
42 | 42 | echo % import source directory |
|
43 | 43 | cvscall -q import -m import src INITIAL start |
|
44 | 44 | cd .. |
|
45 | 45 | |
|
46 | 46 | echo % checkout source directory |
|
47 | 47 | cvscall -q checkout src |
|
48 | 48 | |
|
49 | 49 | echo % commit a new revision changing b/c |
|
50 | 50 | cd src |
|
51 | 51 | sleep 1 |
|
52 | 52 | echo c >> b/c |
|
53 | 53 | cvscall -q commit -mci0 . | grep '<--' |\ |
|
54 | 54 | sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g' |
|
55 | 55 | cd .. |
|
56 | 56 | |
|
57 | 57 | echo % convert fresh repo |
|
58 | 58 | hg convert src src-hg | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g' |
|
59 | 59 | hgcat a |
|
60 | 60 | hgcat b/c |
|
61 | 61 | |
|
62 | 62 | echo % convert fresh repo with --filemap |
|
63 | 63 | echo include b/c > filemap |
|
64 | 64 | hg convert --filemap filemap src src-filemap | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g' |
|
65 | 65 | hgcat b/c |
|
66 |
hg -R src-filemap log --template ' |
|
|
66 | hg -R src-filemap log --template '{rev} {desc} files: {files}\n' | |
|
67 | 67 | |
|
68 | 68 | echo % commit new file revisions |
|
69 | 69 | cd src |
|
70 | 70 | echo a >> a |
|
71 | 71 | echo c >> b/c |
|
72 | 72 | cvscall -q commit -mci1 . | grep '<--' |\ |
|
73 | 73 | sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g' |
|
74 | 74 | cd .. |
|
75 | 75 | |
|
76 | 76 | echo % convert again |
|
77 | 77 | hg convert src src-hg | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g' |
|
78 | 78 | hgcat a |
|
79 | 79 | hgcat b/c |
|
80 | 80 | |
|
81 | 81 | echo % convert again with --filemap |
|
82 | 82 | hg convert --filemap filemap src src-filemap | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g' |
|
83 | 83 | hgcat b/c |
|
84 |
hg -R src-filemap log --template ' |
|
|
84 | hg -R src-filemap log --template '{rev} {desc} files: {files}\n' | |
|
85 | 85 | |
|
86 | 86 | echo % commit branch |
|
87 | 87 | cd src |
|
88 | 88 | cvs -q update -r1.1 b/c |
|
89 | 89 | cvs -q tag -b branch |
|
90 | 90 | cvs -q update -r branch > /dev/null |
|
91 | 91 | echo d >> b/c |
|
92 | 92 | cvs -q commit -mci2 . | grep '<--' |\ |
|
93 | 93 | sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g' |
|
94 | 94 | cd .. |
|
95 | 95 | |
|
96 | 96 | echo % convert again |
|
97 | 97 | hg convert src src-hg | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g' |
|
98 | 98 | hgcat a |
|
99 | 99 | hgcat b/c |
|
100 | 100 | |
|
101 | 101 | echo % convert again with --filemap |
|
102 | 102 | hg convert --filemap filemap src src-filemap | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g' |
|
103 | 103 | hgcat b/c |
|
104 |
hg -R src-filemap log --template ' |
|
|
105 |
hg -R src-hg glog --template ' |
|
|
104 | hg -R src-filemap log --template '{rev} {desc} files: {files}\n' | |
|
105 | hg -R src-hg glog --template '{rev} ({branches}) {desc} files: {files}\n' |
@@ -1,64 +1,64 b'' | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | # This is http://www.selenic.com/mercurial/bts/issue1148 |
|
4 | 4 | |
|
5 | 5 | "$TESTDIR/hghave" cvs || exit 80 |
|
6 | 6 | |
|
7 | 7 | cvscall() |
|
8 | 8 | { |
|
9 | 9 | cvs -f "$@" |
|
10 | 10 | } |
|
11 | 11 | |
|
12 | 12 | echo "[extensions]" >> $HGRCPATH |
|
13 | 13 | echo "convert = " >> $HGRCPATH |
|
14 | 14 | echo "graphlog = " >> $HGRCPATH |
|
15 | 15 | echo "[convert]" >> $HGRCPATH |
|
16 | 16 | echo "cvsps=builtin" >> $HGRCPATH |
|
17 | 17 | echo "cvsps.cache=0" >> $HGRCPATH |
|
18 | 18 | |
|
19 | 19 | echo % create cvs repository |
|
20 | 20 | mkdir cvsrepo |
|
21 | 21 | cd cvsrepo |
|
22 | 22 | CVSROOT=`pwd` |
|
23 | 23 | export CVSROOT |
|
24 | 24 | CVS_OPTIONS=-f |
|
25 | 25 | export CVS_OPTIONS |
|
26 | 26 | cd .. |
|
27 | 27 | |
|
28 | 28 | cvscall -q -d "$CVSROOT" init |
|
29 | 29 | |
|
30 | 30 | echo % Create a new project |
|
31 | 31 | |
|
32 | 32 | mkdir src |
|
33 | 33 | cd src |
|
34 | 34 | echo "1" > a |
|
35 | 35 | echo "1" > b |
|
36 | 36 | cvscall import -m "init" src v0 r0 | sort |
|
37 | 37 | cd .. |
|
38 | 38 | cvscall co src |
|
39 | 39 | cd src |
|
40 | 40 | |
|
41 | 41 | echo % Branch the project |
|
42 | 42 | |
|
43 | 43 | cvscall tag -b BRANCH |
|
44 | 44 | cvscall up -r BRANCH > /dev/null |
|
45 | 45 | |
|
46 | 46 | echo % Modify file a, then b, then a |
|
47 | 47 | |
|
48 | 48 | echo "2" > a |
|
49 | 49 | cvscall ci -m "mod a" | grep '<--' | sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g' |
|
50 | 50 | |
|
51 | 51 | echo "2" > b |
|
52 | 52 | cvscall ci -m "mod b" | grep '<--' | sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g' |
|
53 | 53 | |
|
54 | 54 | echo "3" > a |
|
55 | 55 | cvscall ci -m "mod a again" | grep '<--' | sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g' |
|
56 | 56 | |
|
57 | 57 | echo % Convert |
|
58 | 58 | |
|
59 | 59 | cd .. |
|
60 | 60 | hg convert src | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g' |
|
61 | 61 | |
|
62 | 62 | echo % Check the result |
|
63 | 63 | |
|
64 |
hg -R src-hg glog --template ' |
|
|
64 | hg -R src-hg glog --template '{rev} ({branches}) {desc} files: {files}\n' |
@@ -1,123 +1,123 b'' | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | "$TESTDIR/hghave" cvs || exit 80 |
|
4 | 4 | |
|
5 | 5 | cvscall() |
|
6 | 6 | { |
|
7 | 7 | cvs -f "$@" |
|
8 | 8 | } |
|
9 | 9 | |
|
10 | 10 | hgcat() |
|
11 | 11 | { |
|
12 | 12 | hg --cwd src-hg cat -r tip "$1" |
|
13 | 13 | } |
|
14 | 14 | |
|
15 | 15 | echo "[extensions]" >> $HGRCPATH |
|
16 | 16 | echo "convert = " >> $HGRCPATH |
|
17 | 17 | echo "graphlog = " >> $HGRCPATH |
|
18 | 18 | echo "[convert]" >> $HGRCPATH |
|
19 | 19 | echo "cvsps=builtin" >> $HGRCPATH |
|
20 | 20 | |
|
21 | 21 | echo % create cvs repository |
|
22 | 22 | mkdir cvsrepo |
|
23 | 23 | cd cvsrepo |
|
24 | 24 | CVSROOT=`pwd` |
|
25 | 25 | export CVSROOT |
|
26 | 26 | CVS_OPTIONS=-f |
|
27 | 27 | export CVS_OPTIONS |
|
28 | 28 | cd .. |
|
29 | 29 | |
|
30 | 30 | cvscall -q -d "$CVSROOT" init |
|
31 | 31 | |
|
32 | 32 | echo % create source directory |
|
33 | 33 | mkdir src-temp |
|
34 | 34 | cd src-temp |
|
35 | 35 | echo a > a |
|
36 | 36 | mkdir b |
|
37 | 37 | cd b |
|
38 | 38 | echo c > c |
|
39 | 39 | cd .. |
|
40 | 40 | |
|
41 | 41 | echo % import source directory |
|
42 | 42 | cvscall -q import -m import src INITIAL start |
|
43 | 43 | cd .. |
|
44 | 44 | |
|
45 | 45 | echo % checkout source directory |
|
46 | 46 | cvscall -q checkout src |
|
47 | 47 | |
|
48 | 48 | echo % commit a new revision changing b/c |
|
49 | 49 | cd src |
|
50 | 50 | sleep 1 |
|
51 | 51 | echo c >> b/c |
|
52 | 52 | cvscall -q commit -mci0 . | grep '<--' |\ |
|
53 | 53 | sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g' |
|
54 | 54 | cd .. |
|
55 | 55 | |
|
56 | 56 | echo % convert fresh repo |
|
57 | 57 | hg convert src src-hg | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g' |
|
58 | 58 | hgcat a |
|
59 | 59 | hgcat b/c |
|
60 | 60 | |
|
61 | 61 | echo % convert fresh repo with --filemap |
|
62 | 62 | echo include b/c > filemap |
|
63 | 63 | hg convert --filemap filemap src src-filemap | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g' |
|
64 | 64 | hgcat b/c |
|
65 |
hg -R src-filemap log --template ' |
|
|
65 | hg -R src-filemap log --template '{rev} {desc} files: {files}\n' | |
|
66 | 66 | |
|
67 | 67 | echo % commit new file revisions |
|
68 | 68 | cd src |
|
69 | 69 | echo a >> a |
|
70 | 70 | echo c >> b/c |
|
71 | 71 | cvscall -q commit -mci1 . | grep '<--' |\ |
|
72 | 72 | sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g' |
|
73 | 73 | cd .. |
|
74 | 74 | |
|
75 | 75 | echo % convert again |
|
76 | 76 | hg convert src src-hg | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g' |
|
77 | 77 | hgcat a |
|
78 | 78 | hgcat b/c |
|
79 | 79 | |
|
80 | 80 | echo % convert again with --filemap |
|
81 | 81 | hg convert --filemap filemap src src-filemap | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g' |
|
82 | 82 | hgcat b/c |
|
83 |
hg -R src-filemap log --template ' |
|
|
83 | hg -R src-filemap log --template '{rev} {desc} files: {files}\n' | |
|
84 | 84 | |
|
85 | 85 | echo % commit branch |
|
86 | 86 | cd src |
|
87 | 87 | cvs -q update -r1.1 b/c |
|
88 | 88 | cvs -q tag -b branch |
|
89 | 89 | cvs -q update -r branch > /dev/null |
|
90 | 90 | echo d >> b/c |
|
91 | 91 | cvs -q commit -mci2 . | grep '<--' |\ |
|
92 | 92 | sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g' |
|
93 | 93 | cd .. |
|
94 | 94 | |
|
95 | 95 | echo % convert again |
|
96 | 96 | hg convert src src-hg | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g' |
|
97 | 97 | hgcat a |
|
98 | 98 | hgcat b/c |
|
99 | 99 | |
|
100 | 100 | echo % convert again with --filemap |
|
101 | 101 | hg convert --filemap filemap src src-filemap | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g' |
|
102 | 102 | hgcat b/c |
|
103 |
hg -R src-filemap log --template ' |
|
|
103 | hg -R src-filemap log --template '{rev} {desc} files: {files}\n' | |
|
104 | 104 | |
|
105 | 105 | echo % commit a new revision with funny log message |
|
106 | 106 | cd src |
|
107 | 107 | sleep 1 |
|
108 | 108 | echo e >> a |
|
109 | 109 | cvscall -q commit -m'funny |
|
110 | 110 | ---------------------------- |
|
111 | 111 | log message' . | grep '<--' |\ |
|
112 | 112 | sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g' |
|
113 | 113 | cd .. |
|
114 | 114 | |
|
115 | 115 | echo % convert again |
|
116 | 116 | hg convert src src-hg | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g' |
|
117 | 117 | |
|
118 | 118 | echo "graphlog = " >> $HGRCPATH |
|
119 |
hg -R src-hg glog --template ' |
|
|
119 | hg -R src-hg glog --template '{rev} ({branches}) {desc} files: {files}\n' | |
|
120 | 120 | |
|
121 | 121 | echo % testing debugcvsps |
|
122 | 122 | cd src |
|
123 | 123 | hg debugcvsps | sed -e 's/Author:.*/Author:/' -e 's/Date:.*/Date:/' |
@@ -1,68 +1,68 b'' | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | "$TESTDIR/hghave" darcs || exit 80 |
|
4 | 4 | if darcs --version 2>&1 | grep '^2\.' > /dev/null; then |
|
5 | 5 | # FIXME: darcs 2 will fail with |
|
6 | 6 | ### Abort: timeout after 180 seconds. |
|
7 | 7 | echo 'skipped: test currently disabled for darcs 2' |
|
8 | 8 | exit 80 |
|
9 | 9 | fi |
|
10 | 10 | |
|
11 | 11 | echo "[extensions]" >> $HGRCPATH |
|
12 | 12 | echo "convert=" >> $HGRCPATH |
|
13 | 13 | echo 'hgext.graphlog =' >> $HGRCPATH |
|
14 | 14 | |
|
15 | 15 | DARCS_EMAIL='test@example.org'; export DARCS_EMAIL |
|
16 | 16 | HOME=do_not_use_HOME_darcs; export HOME |
|
17 | 17 | |
|
18 | 18 | # skip if we can't import elementtree |
|
19 | 19 | mkdir dummy |
|
20 | 20 | mkdir dummy/_darcs |
|
21 | 21 | if hg convert dummy 2>&1 | grep ElementTree > /dev/null; then |
|
22 | 22 | echo 'skipped: missing feature: elementtree module' |
|
23 | 23 | exit 80 |
|
24 | 24 | fi |
|
25 | 25 | |
|
26 | 26 | echo % initialize darcs repo |
|
27 | 27 | mkdir darcs-repo |
|
28 | 28 | cd darcs-repo |
|
29 | 29 | darcs init |
|
30 | 30 | echo a > a |
|
31 | 31 | darcs record -a -l -m p0 |
|
32 | 32 | cd .. |
|
33 | 33 | |
|
34 | 34 | echo % branch and update |
|
35 | 35 | darcs get darcs-repo darcs-clone >/dev/null |
|
36 | 36 | cd darcs-clone |
|
37 | 37 | echo c >> a |
|
38 | 38 | echo c > c |
|
39 | 39 | darcs record -a -l -m p1.1 |
|
40 | 40 | cd .. |
|
41 | 41 | |
|
42 | 42 | echo % update source |
|
43 | 43 | cd darcs-repo |
|
44 | 44 | echo b >> a |
|
45 | 45 | echo b > b |
|
46 | 46 | darcs record -a -l -m p1.2 |
|
47 | 47 | |
|
48 | 48 | echo % merge branch |
|
49 | 49 | darcs pull -a ../darcs-clone |
|
50 | 50 | echo e > a |
|
51 | 51 | darcs record -a -l -m p2 |
|
52 | 52 | cd .. |
|
53 | 53 | |
|
54 | 54 | glog() |
|
55 | 55 | { |
|
56 |
hg glog --template ' |
|
|
56 | hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@" | |
|
57 | 57 | } |
|
58 | 58 | |
|
59 | 59 | hg convert darcs-repo darcs-repo-hg 2>&1 | grep -v hGetLine | grep -v '^$' |
|
60 | 60 | # The converter does not currently handle patch conflicts very well. |
|
61 | 61 | # When they occur, it reverts *all* changes and moves forward, |
|
62 | 62 | # letting the conflict resolving patch fix collisions. |
|
63 | 63 | # Unfortunately, non-conflicting changes, like the addition of the |
|
64 | 64 | # "c" file in p1.1 patch are reverted too. |
|
65 | 65 | # Just to say that manifest not listing "c" here is a bug. |
|
66 | 66 | glog -R darcs-repo-hg |
|
67 | 67 | hg up -q -R darcs-repo-hg |
|
68 | 68 | hg -R darcs-repo-hg manifest --debug |
@@ -1,40 +1,40 b'' | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | cat >> $HGRCPATH <<EOF |
|
4 | 4 | [extensions] |
|
5 | 5 | convert= |
|
6 | 6 | graphlog= |
|
7 | 7 | EOF |
|
8 | 8 | |
|
9 | 9 | hg init t |
|
10 | 10 | cd t |
|
11 | 11 | echo a >> a |
|
12 | 12 | hg ci -Am a0 -d '1 0' |
|
13 | 13 | hg branch brancha |
|
14 | 14 | echo a >> a |
|
15 | 15 | hg ci -m a1 -d '2 0' |
|
16 | 16 | echo a >> a |
|
17 | 17 | hg ci -m a2 -d '3 0' |
|
18 | 18 | echo a >> a |
|
19 | 19 | hg ci -m a3 -d '4 0' |
|
20 | 20 | hg up -C 0 |
|
21 | 21 | hg branch branchb |
|
22 | 22 | echo b >> b |
|
23 | 23 | hg ci -Am b0 -d '5 0' |
|
24 | 24 | hg up -C brancha |
|
25 | 25 | echo a >> a |
|
26 | 26 | hg ci -m a4 -d '6 0' |
|
27 | 27 | echo a >> a |
|
28 | 28 | hg ci -m a5 -d '7 0' |
|
29 | 29 | echo a >> a |
|
30 | 30 | hg ci -m a6 -d '8 0' |
|
31 | 31 | hg up -C branchb |
|
32 | 32 | echo b >> b |
|
33 | 33 | hg ci -m b1 -d '9 0' |
|
34 | 34 | cd .. |
|
35 | 35 | |
|
36 | 36 | echo % convert with datesort |
|
37 | 37 | hg convert --datesort t t2 |
|
38 | 38 | echo % graph converted repo |
|
39 |
hg -R t2 glog --template ' |
|
|
39 | hg -R t2 glog --template '{rev} "{desc}"\n' | |
|
40 | 40 |
@@ -1,126 +1,126 b'' | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | HGMERGE=true; export HGMERGE |
|
4 | 4 | |
|
5 | 5 | echo '[extensions]' >> $HGRCPATH |
|
6 | 6 | echo 'hgext.graphlog =' >> $HGRCPATH |
|
7 | 7 | echo 'hgext.convert =' >> $HGRCPATH |
|
8 | 8 | |
|
9 | 9 | glog() |
|
10 | 10 | { |
|
11 |
hg glog --template ' |
|
|
11 | hg glog --template '{rev} "{desc}" files: {files}\n' "$@" | |
|
12 | 12 | } |
|
13 | 13 | |
|
14 | 14 | hg init source |
|
15 | 15 | cd source |
|
16 | 16 | |
|
17 | 17 | echo foo > foo |
|
18 | 18 | echo baz > baz |
|
19 | 19 | mkdir dir |
|
20 | 20 | echo dir/file >> dir/file |
|
21 | 21 | echo dir/file2 >> dir/file2 |
|
22 | 22 | hg ci -d '0 0' -qAm '0: add foo baz dir/' |
|
23 | 23 | |
|
24 | 24 | echo bar > bar |
|
25 | 25 | echo quux > quux |
|
26 | 26 | hg copy foo copied |
|
27 | 27 | hg ci -d '1 0' -qAm '1: add bar quux; copy foo to copied' |
|
28 | 28 | |
|
29 | 29 | echo >> foo |
|
30 | 30 | hg ci -d '2 0' -m '2: change foo' |
|
31 | 31 | |
|
32 | 32 | hg up -qC 1 |
|
33 | 33 | echo >> bar |
|
34 | 34 | echo >> quux |
|
35 | 35 | hg ci -d '3 0' -m '3: change bar quux' |
|
36 | 36 | |
|
37 | 37 | hg up -qC 2 |
|
38 | 38 | hg merge -qr 3 |
|
39 | 39 | echo >> bar |
|
40 | 40 | echo >> baz |
|
41 | 41 | hg ci -d '4 0' -m '4: first merge; change bar baz' |
|
42 | 42 | |
|
43 | 43 | echo >> bar |
|
44 | 44 | echo 1 >> baz |
|
45 | 45 | echo >> quux |
|
46 | 46 | hg ci -d '5 0' -m '5: change bar baz quux' |
|
47 | 47 | |
|
48 | 48 | hg up -qC 4 |
|
49 | 49 | echo >> foo |
|
50 | 50 | echo 2 >> baz |
|
51 | 51 | hg ci -d '6 0' -m '6: change foo baz' |
|
52 | 52 | |
|
53 | 53 | hg up -qC 5 |
|
54 | 54 | hg merge -qr 6 |
|
55 | 55 | echo >> bar |
|
56 | 56 | hg ci -d '7 0' -m '7: second merge; change bar' |
|
57 | 57 | |
|
58 | 58 | echo >> foo |
|
59 | 59 | hg ci -m '8: change foo' |
|
60 | 60 | |
|
61 | 61 | glog |
|
62 | 62 | |
|
63 | 63 | echo '% final file versions in this repo:' |
|
64 | 64 | hg manifest --debug |
|
65 | 65 | hg debugrename copied |
|
66 | 66 | echo |
|
67 | 67 | |
|
68 | 68 | cd .. |
|
69 | 69 | |
|
70 | 70 | splitrepo() |
|
71 | 71 | { |
|
72 | 72 | msg="$1" |
|
73 | 73 | files="$2" |
|
74 | 74 | opts=$3 |
|
75 | 75 | echo "% $files: $msg" |
|
76 | 76 | prefix=`echo "$files" | sed -e 's/ /-/g'` |
|
77 | 77 | fmap="$prefix.fmap" |
|
78 | 78 | repo="$prefix.repo" |
|
79 | 79 | for i in $files; do |
|
80 | 80 | echo "include $i" >> "$fmap" |
|
81 | 81 | done |
|
82 | 82 | hg -q convert $opts --filemap "$fmap" --datesort source "$repo" |
|
83 | 83 | hg up -q -R "$repo" |
|
84 | 84 | glog -R "$repo" |
|
85 | 85 | hg -R "$repo" manifest --debug |
|
86 | 86 | } |
|
87 | 87 | |
|
88 | 88 | splitrepo 'skip unwanted merges; use 1st parent in 1st merge, 2nd in 2nd' foo |
|
89 | 89 | |
|
90 | 90 | splitrepo 'merges are not merges anymore' bar |
|
91 | 91 | |
|
92 | 92 | splitrepo '1st merge is not a merge anymore; 2nd still is' baz |
|
93 | 93 | |
|
94 | 94 | splitrepo 'we add additional merges when they are interesting' 'foo quux' |
|
95 | 95 | |
|
96 | 96 | splitrepo 'partial conversion' 'bar quux' '-r 3' |
|
97 | 97 | splitrepo 'complete the partial conversion' 'bar quux' |
|
98 | 98 | |
|
99 | 99 | rm -r foo.repo |
|
100 | 100 | splitrepo 'partial conversion' 'foo' '-r 3' |
|
101 | 101 | splitrepo 'complete the partial conversion' 'foo' |
|
102 | 102 | |
|
103 | 103 | splitrepo 'copied file; source not included in new repo' copied |
|
104 | 104 | hg --cwd copied.repo debugrename copied |
|
105 | 105 | |
|
106 | 106 | splitrepo 'copied file; source included in new repo' 'foo copied' |
|
107 | 107 | hg --cwd foo-copied.repo debugrename copied |
|
108 | 108 | |
|
109 | 109 | cat > renames.fmap <<EOF |
|
110 | 110 | include dir |
|
111 | 111 | exclude dir/file2 |
|
112 | 112 | rename dir dir2 |
|
113 | 113 | include foo |
|
114 | 114 | include copied |
|
115 | 115 | rename foo foo2 |
|
116 | 116 | rename copied copied2 |
|
117 | 117 | EOF |
|
118 | 118 | hg -q convert --filemap renames.fmap --datesort source renames.repo |
|
119 | 119 | hg up -q -R renames.repo |
|
120 | 120 | glog -R renames.repo |
|
121 | 121 | hg -R renames.repo manifest --debug |
|
122 | 122 | hg --cwd renames.repo debugrename copied2 |
|
123 | 123 | echo 'copied:' |
|
124 | 124 | hg --cwd source cat copied |
|
125 | 125 | echo 'copied2:' |
|
126 | 126 | hg --cwd renames.repo cat copied2 |
@@ -1,169 +1,169 b'' | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | "$TESTDIR/hghave" git || exit 80 |
|
4 | 4 | |
|
5 | 5 | echo "[extensions]" >> $HGRCPATH |
|
6 | 6 | echo "convert=" >> $HGRCPATH |
|
7 | 7 | echo 'hgext.graphlog =' >> $HGRCPATH |
|
8 | 8 | |
|
9 | 9 | GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME |
|
10 | 10 | GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL |
|
11 | 11 | GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE |
|
12 | 12 | GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME |
|
13 | 13 | GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL |
|
14 | 14 | GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE |
|
15 | 15 | |
|
16 | 16 | count=10 |
|
17 | 17 | commit() |
|
18 | 18 | { |
|
19 | 19 | GIT_AUTHOR_DATE="2007-01-01 00:00:$count +0000" |
|
20 | 20 | GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE" |
|
21 | 21 | git commit "$@" >/dev/null 2>/dev/null || echo "git commit error" |
|
22 | 22 | count=`expr $count + 1` |
|
23 | 23 | } |
|
24 | 24 | |
|
25 | 25 | mkdir git-repo |
|
26 | 26 | cd git-repo |
|
27 | 27 | git init-db >/dev/null 2>/dev/null |
|
28 | 28 | echo a > a |
|
29 | 29 | mkdir d |
|
30 | 30 | echo b > d/b |
|
31 | 31 | git add a d |
|
32 | 32 | commit -a -m t1 |
|
33 | 33 | |
|
34 | 34 | # Remove the directory, then try to replace it with a file |
|
35 | 35 | # (issue 754) |
|
36 | 36 | git rm -f d/b |
|
37 | 37 | commit -m t2 |
|
38 | 38 | echo d > d |
|
39 | 39 | git add d |
|
40 | 40 | commit -m t3 |
|
41 | 41 | |
|
42 | 42 | echo b >> a |
|
43 | 43 | commit -a -m t4.1 |
|
44 | 44 | |
|
45 | 45 | git checkout -b other HEAD^ >/dev/null 2>/dev/null |
|
46 | 46 | echo c > a |
|
47 | 47 | echo a >> a |
|
48 | 48 | commit -a -m t4.2 |
|
49 | 49 | |
|
50 | 50 | git checkout master >/dev/null 2>/dev/null |
|
51 | 51 | git pull --no-commit . other > /dev/null 2>/dev/null |
|
52 | 52 | commit -m 'Merge branch other' |
|
53 | 53 | cd .. |
|
54 | 54 | |
|
55 | 55 | hg convert --datesort git-repo |
|
56 | 56 | hg up -q -R git-repo-hg |
|
57 | 57 | hg -R git-repo-hg tip -v |
|
58 | 58 | |
|
59 | 59 | count=10 |
|
60 | 60 | mkdir git-repo2 |
|
61 | 61 | cd git-repo2 |
|
62 | 62 | git init-db >/dev/null 2>/dev/null |
|
63 | 63 | |
|
64 | 64 | echo foo > foo |
|
65 | 65 | git add foo |
|
66 | 66 | commit -a -m 'add foo' |
|
67 | 67 | |
|
68 | 68 | echo >> foo |
|
69 | 69 | commit -a -m 'change foo' |
|
70 | 70 | |
|
71 | 71 | git checkout -b Bar HEAD^ >/dev/null 2>/dev/null |
|
72 | 72 | echo quux >> quux |
|
73 | 73 | git add quux |
|
74 | 74 | commit -a -m 'add quux' |
|
75 | 75 | |
|
76 | 76 | echo bar > bar |
|
77 | 77 | git add bar |
|
78 | 78 | commit -a -m 'add bar' |
|
79 | 79 | |
|
80 | 80 | git checkout -b Baz HEAD^ >/dev/null 2>/dev/null |
|
81 | 81 | echo baz > baz |
|
82 | 82 | git add baz |
|
83 | 83 | commit -a -m 'add baz' |
|
84 | 84 | |
|
85 | 85 | git checkout master >/dev/null 2>/dev/null |
|
86 | 86 | git pull --no-commit . Bar Baz > /dev/null 2>/dev/null |
|
87 | 87 | commit -m 'Octopus merge' |
|
88 | 88 | |
|
89 | 89 | echo bar >> bar |
|
90 | 90 | commit -a -m 'change bar' |
|
91 | 91 | |
|
92 | 92 | git checkout -b Foo HEAD^ >/dev/null 2>/dev/null |
|
93 | 93 | echo >> foo |
|
94 | 94 | commit -a -m 'change foo' |
|
95 | 95 | |
|
96 | 96 | git checkout master >/dev/null 2>/dev/null |
|
97 | 97 | git pull --no-commit -s ours . Foo > /dev/null 2>/dev/null |
|
98 | 98 | commit -m 'Discard change to foo' |
|
99 | 99 | |
|
100 | 100 | cd .. |
|
101 | 101 | |
|
102 | 102 | glog() |
|
103 | 103 | { |
|
104 |
hg glog --template ' |
|
|
104 | hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@" | |
|
105 | 105 | } |
|
106 | 106 | |
|
107 | 107 | splitrepo() |
|
108 | 108 | { |
|
109 | 109 | msg="$1" |
|
110 | 110 | files="$2" |
|
111 | 111 | opts=$3 |
|
112 | 112 | echo "% $files: $msg" |
|
113 | 113 | prefix=`echo "$files" | sed -e 's/ /-/g'` |
|
114 | 114 | fmap="$prefix.fmap" |
|
115 | 115 | repo="$prefix.repo" |
|
116 | 116 | for i in $files; do |
|
117 | 117 | echo "include $i" >> "$fmap" |
|
118 | 118 | done |
|
119 | 119 | hg -q convert $opts --filemap "$fmap" --datesort git-repo2 "$repo" |
|
120 | 120 | hg up -q -R "$repo" |
|
121 | 121 | glog -R "$repo" |
|
122 | 122 | hg -R "$repo" manifest --debug |
|
123 | 123 | } |
|
124 | 124 | |
|
125 | 125 | echo '% full conversion' |
|
126 | 126 | hg -q convert --datesort git-repo2 fullrepo |
|
127 | 127 | hg up -q -R fullrepo |
|
128 | 128 | glog -R fullrepo |
|
129 | 129 | hg -R fullrepo manifest --debug |
|
130 | 130 | |
|
131 | 131 | splitrepo 'octopus merge' 'foo bar baz' |
|
132 | 132 | |
|
133 | 133 | splitrepo 'only some parents of an octopus merge; "discard" a head' 'foo baz quux' |
|
134 | 134 | |
|
135 | 135 | echo |
|
136 | 136 | echo '% test binary conversion (issue 1359)' |
|
137 | 137 | mkdir git-repo3 |
|
138 | 138 | cd git-repo3 |
|
139 | 139 | git init-db >/dev/null 2>/dev/null |
|
140 | 140 | python -c 'file("b", "wb").write("".join([chr(i) for i in range(256)])*16)' |
|
141 | 141 | git add b |
|
142 | 142 | commit -a -m addbinary |
|
143 | 143 | cd .. |
|
144 | 144 | |
|
145 | 145 | echo '% convert binary file' |
|
146 | 146 | hg convert git-repo3 git-repo3-hg |
|
147 | 147 | |
|
148 | 148 | cd git-repo3-hg |
|
149 | 149 | hg up -C |
|
150 | 150 | python -c 'print len(file("b", "rb").read())' |
|
151 | 151 | cd .. |
|
152 | 152 | |
|
153 | 153 | echo |
|
154 | 154 | echo '% test author vs committer' |
|
155 | 155 | mkdir git-repo4 |
|
156 | 156 | cd git-repo4 |
|
157 | 157 | git init-db >/dev/null 2>/dev/null |
|
158 | 158 | echo >> foo |
|
159 | 159 | git add foo |
|
160 | 160 | commit -a -m addfoo |
|
161 | 161 | echo >> foo |
|
162 | 162 | GIT_AUTHOR_NAME="nottest" |
|
163 | 163 | commit -a -m addfoo2 |
|
164 | 164 | cd .. |
|
165 | 165 | |
|
166 | 166 | echo '% convert author committer' |
|
167 | 167 | hg convert git-repo4 git-repo4-hg |
|
168 | 168 | cd git-repo4-hg |
|
169 | 169 | hg log -v |
@@ -1,61 +1,61 b'' | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | echo '[extensions]' >> $HGRCPATH |
|
4 | 4 | echo 'hgext.graphlog =' >> $HGRCPATH |
|
5 | 5 | echo 'hgext.convert =' >> $HGRCPATH |
|
6 | 6 | |
|
7 | 7 | glog() |
|
8 | 8 | { |
|
9 |
hg -R "$1" glog --template ' |
|
|
9 | hg -R "$1" glog --template '{rev} "{desc}" files: {files}\n' | |
|
10 | 10 | } |
|
11 | 11 | |
|
12 | 12 | hg init source |
|
13 | 13 | cd source |
|
14 | 14 | |
|
15 | 15 | echo a > a |
|
16 | 16 | echo b > b |
|
17 | 17 | hg ci -d '0 0' -qAm '0: add a b' |
|
18 | 18 | echo c > c |
|
19 | 19 | hg ci -d '1 0' -qAm '1: add c' |
|
20 | 20 | hg copy a e |
|
21 | 21 | echo b >> b |
|
22 | 22 | hg ci -d '2 0' -qAm '2: copy e from a, change b' |
|
23 | 23 | hg up -C 0 |
|
24 | 24 | echo a >> a |
|
25 | 25 | hg ci -d '3 0' -qAm '3: change a' |
|
26 | 26 | hg merge |
|
27 | 27 | hg copy b d |
|
28 | 28 | hg ci -d '4 0' -qAm '4: merge 2 and 3, copy d from b' |
|
29 | 29 | echo a >> a |
|
30 | 30 | hg ci -d '5 0' -qAm '5: change a' |
|
31 | 31 | cd .. |
|
32 | 32 | |
|
33 | 33 | echo % convert from null revision |
|
34 | 34 | hg convert --config convert.hg.startrev=null source empty |
|
35 | 35 | glog empty |
|
36 | 36 | |
|
37 | 37 | echo % convert from zero revision |
|
38 | 38 | hg convert --config convert.hg.startrev=0 source full |
|
39 | 39 | glog full |
|
40 | 40 | |
|
41 | 41 | echo % convert from merge parent |
|
42 | 42 | hg convert --config convert.hg.startrev=1 source conv1 |
|
43 | 43 | glog conv1 |
|
44 | 44 | cd conv1 |
|
45 | 45 | echo % check copy preservation |
|
46 | 46 | hg log --follow --copies e |
|
47 | 47 | echo % check copy removal on missing parent |
|
48 | 48 | hg log --follow --copies d |
|
49 | 49 | hg cat -r tip a b |
|
50 | 50 | hg -q verify |
|
51 | 51 | cd .. |
|
52 | 52 | |
|
53 | 53 | echo % convert from merge |
|
54 | 54 | hg convert --config convert.hg.startrev=4 source conv4 |
|
55 | 55 | glog conv4 |
|
56 | 56 | cd conv4 |
|
57 | 57 | hg up -C |
|
58 | 58 | hg cat -r tip a b |
|
59 | 59 | hg -q verify |
|
60 | 60 | cd .. |
|
61 | 61 |
@@ -1,146 +1,146 b'' | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | "$TESTDIR/hghave" mtn || exit 80 |
|
4 | 4 | |
|
5 | 5 | # Monotone directory is called .monotone on *nix and monotone |
|
6 | 6 | # on Windows. Having a variable here ease test patching. |
|
7 | 7 | mtndir=.monotone |
|
8 | 8 | echo "[extensions]" >> $HGRCPATH |
|
9 | 9 | echo "convert=" >> $HGRCPATH |
|
10 | 10 | echo 'hgext.graphlog =' >> $HGRCPATH |
|
11 | 11 | |
|
12 | 12 | HOME=`pwd`/do_not_use_HOME_mtn; export HOME |
|
13 | 13 | # Windows version of monotone home |
|
14 | 14 | APPDATA=$HOME; export APPDATA |
|
15 | 15 | |
|
16 | 16 | echo % tedious monotone keys configuration |
|
17 | 17 | # The /dev/null redirection is necessary under Windows, or |
|
18 | 18 | # it complains about home directory permissions |
|
19 | 19 | mtn --quiet genkey test@selenic.com 1>/dev/null 2>&1 <<EOF |
|
20 | 20 | passphrase |
|
21 | 21 | passphrase |
|
22 | 22 | EOF |
|
23 | 23 | cat >> $HOME/$mtndir/monotonerc <<EOF |
|
24 | 24 | function get_passphrase(keypair_id) |
|
25 | 25 | return "passphrase" |
|
26 | 26 | end |
|
27 | 27 | EOF |
|
28 | 28 | |
|
29 | 29 | echo % create monotone repository |
|
30 | 30 | mtn db init --db=repo.mtn |
|
31 | 31 | mtn --db=repo.mtn --branch=com.selenic.test setup workingdir |
|
32 | 32 | cd workingdir |
|
33 | 33 | echo a > a |
|
34 | 34 | mkdir dir |
|
35 | 35 | echo b > dir/b |
|
36 | 36 | echo d > dir/d |
|
37 | 37 | python -c 'file("bin", "wb").write("a\\x00b")' |
|
38 | 38 | echo c > c |
|
39 | 39 | mtn add a dir/b dir/d c bin |
|
40 | 40 | mtn ci -m initialize |
|
41 | 41 | echo % update monotone working directory |
|
42 | 42 | mtn mv a dir/a |
|
43 | 43 | echo a >> dir/a |
|
44 | 44 | echo b >> dir/b |
|
45 | 45 | mtn drop c |
|
46 | 46 | python -c 'file("bin", "wb").write("b\\x00c")' |
|
47 | 47 | mtn ci -m update1 |
|
48 | 48 | cd .. |
|
49 | 49 | |
|
50 | 50 | echo % convert once |
|
51 | 51 | hg convert -s mtn repo.mtn |
|
52 | 52 | |
|
53 | 53 | cd workingdir |
|
54 | 54 | echo e > e |
|
55 | 55 | mtn add e |
|
56 | 56 | mtn drop dir/b |
|
57 | 57 | mtn mv bin bin2 |
|
58 | 58 | mtn ci -m 'update2 "with" quotes' |
|
59 | 59 | echo '% test directory move' |
|
60 | 60 | mkdir -p dir1/subdir1 |
|
61 | 61 | mkdir -p dir1/subdir2_other |
|
62 | 62 | echo file1 > dir1/subdir1/file1 |
|
63 | 63 | echo file2 > dir1/subdir2_other/file1 |
|
64 | 64 | mtn add dir1/subdir1/file1 dir1/subdir2_other/file1 |
|
65 | 65 | mtn ci -m createdir1 |
|
66 | 66 | mtn rename dir1/subdir1 dir1/subdir2 |
|
67 | 67 | mtn ci -m movedir1 |
|
68 | 68 | echo '% test subdirectory move' |
|
69 | 69 | mtn mv dir dir2 |
|
70 | 70 | echo newfile > dir2/newfile |
|
71 | 71 | mtn drop dir2/d |
|
72 | 72 | mtn add dir2/newfile |
|
73 | 73 | mtn ci -m movedir |
|
74 | 74 | # Test directory removal with empty directory |
|
75 | 75 | mkdir dir2/dir |
|
76 | 76 | mkdir dir2/dir/subdir |
|
77 | 77 | echo f > dir2/dir/subdir/f |
|
78 | 78 | mkdir dir2/dir/emptydir |
|
79 | 79 | mtn add --quiet -R dir2/dir |
|
80 | 80 | mtn ci -m emptydir |
|
81 | 81 | mtn drop -R dir2/dir |
|
82 | 82 | mtn ci -m dropdirectory |
|
83 | 83 | echo '% test directory and file move' |
|
84 | 84 | mkdir -p dir3/d1 |
|
85 | 85 | echo a > dir3/a |
|
86 | 86 | mtn add dir3/a dir3/d1 |
|
87 | 87 | mtn ci -m dirfilemove |
|
88 | 88 | mtn mv dir3/a dir3/d1/a |
|
89 | 89 | mtn mv dir3/d1 dir3/d2 |
|
90 | 90 | mtn ci -m dirfilemove2 |
|
91 | 91 | echo '% test directory move into another directory move' |
|
92 | 92 | mkdir dir4 |
|
93 | 93 | mkdir dir5 |
|
94 | 94 | echo a > dir4/a |
|
95 | 95 | mtn add dir4/a dir5 |
|
96 | 96 | mtn ci -m dirdirmove |
|
97 | 97 | mtn mv dir5 dir6 |
|
98 | 98 | mtn mv dir4 dir6/dir4 |
|
99 | 99 | mtn ci -m dirdirmove2 |
|
100 | 100 | echo '% test diverging directory moves' |
|
101 | 101 | mkdir -p dir7/dir9/dir8 |
|
102 | 102 | echo a > dir7/dir9/dir8/a |
|
103 | 103 | echo b > dir7/dir9/b |
|
104 | 104 | echo c > dir7/c |
|
105 | 105 | mtn add -R dir7 |
|
106 | 106 | mtn ci -m divergentdirmove |
|
107 | 107 | mtn mv dir7 dir7-2 |
|
108 | 108 | mtn mv dir7-2/dir9 dir9-2 |
|
109 | 109 | mtn mv dir9-2/dir8 dir8-2 |
|
110 | 110 | mtn ci -m divergentdirmove2 |
|
111 | 111 | cd .. |
|
112 | 112 | |
|
113 | 113 | echo % convert incrementally |
|
114 | 114 | hg convert -s mtn repo.mtn |
|
115 | 115 | |
|
116 | 116 | glog() |
|
117 | 117 | { |
|
118 |
hg glog --template ' |
|
|
118 | hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@" | |
|
119 | 119 | } |
|
120 | 120 | |
|
121 | 121 | cd repo.mtn-hg |
|
122 | 122 | hg up -C |
|
123 | 123 | glog |
|
124 | 124 | echo % manifest |
|
125 | 125 | hg manifest |
|
126 | 126 | echo % contents |
|
127 | 127 | cat dir2/a |
|
128 | 128 | test -d dir2/dir && echo 'removed dir2/dir is still there!' |
|
129 | 129 | |
|
130 | 130 | echo % file move |
|
131 | 131 | hg log -v -C -r 1 | grep copies |
|
132 | 132 | echo % check directory move |
|
133 | 133 | hg manifest -r 4 |
|
134 | 134 | test -d dir1/subdir2 || echo 'new dir1/subdir2 does not exist!' |
|
135 | 135 | test -d dir1/subdir1 && echo 'renamed dir1/subdir1 is still there!' |
|
136 | 136 | hg log -v -C -r 4 | grep copies |
|
137 | 137 | echo % check file remove with directory move |
|
138 | 138 | hg manifest -r 5 |
|
139 | 139 | echo % check file move with directory move |
|
140 | 140 | hg manifest -r 9 |
|
141 | 141 | echo % check file directory directory move |
|
142 | 142 | hg manifest -r 11 |
|
143 | 143 | echo % check divergent directory moves |
|
144 | 144 | hg manifest -r 13 |
|
145 | 145 | exit 0 |
|
146 | 146 |
@@ -1,75 +1,75 b'' | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | "$TESTDIR/hghave" p4 || exit 80 |
|
4 | 4 | |
|
5 | 5 | echo "[extensions]" >> $HGRCPATH |
|
6 | 6 | echo "convert = " >> $HGRCPATH |
|
7 | 7 | |
|
8 | 8 | echo % create p4 depot |
|
9 | 9 | export P4ROOT=$PWD/depot |
|
10 | 10 | export P4AUDIT=$P4ROOT/audit |
|
11 | 11 | export P4JOURNAL=$P4ROOT/journal |
|
12 | 12 | export P4LOG=$P4ROOT/log |
|
13 | 13 | export P4PORT=localhost:16661 |
|
14 | 14 | export P4DEBUG=1 |
|
15 | 15 | |
|
16 | 16 | echo % start the p4 server |
|
17 | 17 | [ ! -d $P4ROOT ] && mkdir $P4ROOT |
|
18 | 18 | p4d -f -J off >$P4ROOT/stdout 2>$P4ROOT/stderr & |
|
19 | 19 | trap "echo % stop the p4 server ; p4 admin stop" EXIT |
|
20 | 20 | |
|
21 | 21 | # wait for the server to initialize |
|
22 | 22 | while ! p4 ; do |
|
23 | 23 | sleep 1 |
|
24 | 24 | done >/dev/null 2>/dev/null |
|
25 | 25 | |
|
26 | 26 | echo % create a client spec |
|
27 | 27 | export P4CLIENT=hg-p4-import |
|
28 | 28 | DEPOTPATH=//depot/test-mercurial-import/... |
|
29 | 29 | p4 client -o | sed '/^View:/,$ d' >p4client |
|
30 | 30 | echo View: >>p4client |
|
31 | 31 | echo " $DEPOTPATH //$P4CLIENT/..." >>p4client |
|
32 | 32 | p4 client -i <p4client |
|
33 | 33 | |
|
34 | 34 | echo % populate the depot |
|
35 | 35 | echo a > a |
|
36 | 36 | mkdir b |
|
37 | 37 | echo c > b/c |
|
38 | 38 | p4 add a b/c |
|
39 | 39 | p4 submit -d initial |
|
40 | 40 | |
|
41 | 41 | echo % change some files |
|
42 | 42 | p4 edit a |
|
43 | 43 | echo aa >> a |
|
44 | 44 | p4 submit -d "change a" |
|
45 | 45 | |
|
46 | 46 | p4 edit b/c |
|
47 | 47 | echo cc >> b/c |
|
48 | 48 | p4 submit -d "change b/c" |
|
49 | 49 | |
|
50 | 50 | echo % convert |
|
51 | 51 | hg convert -s p4 $DEPOTPATH dst |
|
52 |
hg -R dst log --template 'rev= |
|
|
52 | hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n' | |
|
53 | 53 | |
|
54 | 54 | echo % change some files |
|
55 | 55 | p4 edit a b/c |
|
56 | 56 | echo aaa >> a |
|
57 | 57 | echo ccc >> b/c |
|
58 | 58 | p4 submit -d "change a b/c" |
|
59 | 59 | |
|
60 | 60 | echo % convert again |
|
61 | 61 | hg convert -s p4 $DEPOTPATH dst |
|
62 |
hg -R dst log --template 'rev= |
|
|
62 | hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n' | |
|
63 | 63 | |
|
64 | 64 | echo % interesting names |
|
65 | 65 | echo dddd > "d d" |
|
66 | 66 | mkdir " e" |
|
67 | 67 | echo fff >" e/ f" |
|
68 | 68 | p4 add "d d" " e/ f" |
|
69 | 69 | p4 submit -d "add d e f" |
|
70 | 70 | |
|
71 | 71 | echo % convert again |
|
72 | 72 | hg convert -s p4 $DEPOTPATH dst |
|
73 |
hg -R dst log --template 'rev= |
|
|
73 | hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n' | |
|
74 | 74 | |
|
75 | 75 |
@@ -1,51 +1,51 b'' | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | echo "[extensions]" >> $HGRCPATH |
|
4 | 4 | echo "convert=" >> $HGRCPATH |
|
5 | 5 | echo 'hgext.graphlog =' >> $HGRCPATH |
|
6 | 6 | |
|
7 | 7 | glog() |
|
8 | 8 | { |
|
9 |
hg glog --template ' |
|
|
9 | hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@" | |
|
10 | 10 | } |
|
11 | 11 | |
|
12 | 12 | hg init repo1 |
|
13 | 13 | cd repo1 |
|
14 | 14 | echo a > a |
|
15 | 15 | hg ci -Am adda |
|
16 | 16 | echo b > b |
|
17 | 17 | echo a >> a |
|
18 | 18 | hg ci -Am addb |
|
19 | 19 | PARENTID1=`hg id --debug -i` |
|
20 | 20 | echo c > c |
|
21 | 21 | hg ci -Am addc |
|
22 | 22 | PARENTID2=`hg id --debug -i` |
|
23 | 23 | cd .. |
|
24 | 24 | |
|
25 | 25 | hg init repo2 |
|
26 | 26 | cd repo2 |
|
27 | 27 | echo b > a |
|
28 | 28 | echo d > d |
|
29 | 29 | hg ci -Am addaandd |
|
30 | 30 | CHILDID1=`hg id --debug -i` |
|
31 | 31 | echo d >> d |
|
32 | 32 | hg ci -Am changed |
|
33 | 33 | CHILDID2=`hg id --debug -i` |
|
34 | 34 | echo e > e |
|
35 | 35 | hg ci -Am adde |
|
36 | 36 | cd .. |
|
37 | 37 | |
|
38 | 38 | echo '% test invalid splicemap' |
|
39 | 39 | cat > splicemap <<EOF |
|
40 | 40 | $CHILDID2 |
|
41 | 41 | EOF |
|
42 | 42 | hg convert --splicemap splicemap repo2 repo1 |
|
43 | 43 | |
|
44 | 44 | echo '% splice repo2 on repo1' |
|
45 | 45 | cat > splicemap <<EOF |
|
46 | 46 | $CHILDID1 $PARENTID1 |
|
47 | 47 | $CHILDID2 $PARENTID2,$CHILDID1 |
|
48 | 48 | EOF |
|
49 | 49 | hg clone repo1 target1 |
|
50 | 50 | hg convert --splicemap splicemap repo2 target1 |
|
51 | 51 | glog -R target1 |
@@ -1,39 +1,39 b'' | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | "$TESTDIR/hghave" svn svn-bindings || exit 80 |
|
4 | 4 | |
|
5 | 5 | fix_path() |
|
6 | 6 | { |
|
7 | 7 | tr '\\' / |
|
8 | 8 | } |
|
9 | 9 | |
|
10 | 10 | echo "[extensions]" >> $HGRCPATH |
|
11 | 11 | echo "convert = " >> $HGRCPATH |
|
12 | 12 | echo "hgext.graphlog =" >> $HGRCPATH |
|
13 | 13 | |
|
14 | 14 | svnadmin create svn-repo |
|
15 | 15 | cat "$TESTDIR/svn/branches.svndump" | svnadmin load svn-repo > /dev/null |
|
16 | 16 | |
|
17 | 17 | svnpath=`pwd | fix_path` |
|
18 | 18 | # SVN wants all paths to start with a slash. Unfortunately, |
|
19 | 19 | # Windows ones don't. Handle that. |
|
20 | 20 | expr $svnpath : "\/" > /dev/null |
|
21 | 21 | if [ $? -ne 0 ]; then |
|
22 | 22 | svnpath='/'$svnpath |
|
23 | 23 | fi |
|
24 | 24 | svnurl=file://$svnpath/svn-repo |
|
25 | 25 | |
|
26 | 26 | echo % convert trunk and branches |
|
27 | 27 | cat >branchmap <<EOF |
|
28 | 28 | old3 newbranch |
|
29 | 29 | EOF |
|
30 | 30 | hg convert --branchmap=branchmap --datesort -r 10 $svnurl A-hg |
|
31 | 31 | |
|
32 | 32 | echo % convert again |
|
33 | 33 | hg convert --branchmap=branchmap --datesort $svnurl A-hg |
|
34 | 34 | |
|
35 | 35 | cd A-hg |
|
36 |
hg glog --template 'branch= |
|
|
36 | hg glog --template 'branch={branches} {rev} {desc|firstline} files: {files}\n' | |
|
37 | 37 | hg branches | sed 's/:.*/:/' |
|
38 | 38 | hg tags -q |
|
39 | 39 | cd .. |
@@ -1,32 +1,32 b'' | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | "$TESTDIR/hghave" svn svn-bindings || exit 80 |
|
4 | 4 | |
|
5 | 5 | fix_path() |
|
6 | 6 | { |
|
7 | 7 | tr '\\' / |
|
8 | 8 | } |
|
9 | 9 | |
|
10 | 10 | echo "[extensions]" >> $HGRCPATH |
|
11 | 11 | echo "convert = " >> $HGRCPATH |
|
12 | 12 | echo "hgext.graphlog =" >> $HGRCPATH |
|
13 | 13 | |
|
14 | 14 | svnadmin create svn-repo |
|
15 | 15 | cat "$TESTDIR/svn/move.svndump" | svnadmin load svn-repo > /dev/null |
|
16 | 16 | |
|
17 | 17 | svnpath=`pwd | fix_path` |
|
18 | 18 | # SVN wants all paths to start with a slash. Unfortunately, |
|
19 | 19 | # Windows ones don't. Handle that. |
|
20 | 20 | expr $svnpath : "\/" > /dev/null |
|
21 | 21 | if [ $? -ne 0 ]; then |
|
22 | 22 | svnpath='/'$svnpath |
|
23 | 23 | fi |
|
24 | 24 | svnurl=file://$svnpath/svn-repo |
|
25 | 25 | |
|
26 | 26 | echo % convert trunk and branches |
|
27 | 27 | hg convert --datesort $svnurl/subproject A-hg |
|
28 | 28 | |
|
29 | 29 | cd A-hg |
|
30 |
hg glog --template ' |
|
|
30 | hg glog --template '{rev} {desc|firstline} files: {files}\n' | |
|
31 | 31 | hg branches | sed 's/:.*/:/' |
|
32 | 32 | cd .. |
@@ -1,89 +1,89 b'' | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | "$TESTDIR/hghave" svn svn-bindings || exit 80 |
|
4 | 4 | |
|
5 | 5 | fix_path() |
|
6 | 6 | { |
|
7 | 7 | tr '\\' / |
|
8 | 8 | } |
|
9 | 9 | |
|
10 | 10 | echo "[extensions]" >> $HGRCPATH |
|
11 | 11 | echo "convert = " >> $HGRCPATH |
|
12 | 12 | echo 'hgext.graphlog =' >> $HGRCPATH |
|
13 | 13 | |
|
14 | 14 | svnadmin create svn-repo |
|
15 | 15 | |
|
16 | 16 | svnpath=`pwd | fix_path` |
|
17 | 17 | # SVN wants all paths to start with a slash. Unfortunately, |
|
18 | 18 | # Windows ones don't. Handle that. |
|
19 | 19 | expr $svnpath : "\/" > /dev/null |
|
20 | 20 | if [ $? -ne 0 ]; then |
|
21 | 21 | svnpath='/'$svnpath |
|
22 | 22 | fi |
|
23 | 23 | |
|
24 | 24 | echo "# now tests that it works with trunk/tags layout, but no branches yet" |
|
25 | 25 | echo |
|
26 | 26 | echo % initial svn import |
|
27 | 27 | mkdir projB |
|
28 | 28 | cd projB |
|
29 | 29 | mkdir trunk |
|
30 | 30 | mkdir tags |
|
31 | 31 | cd .. |
|
32 | 32 | |
|
33 | 33 | svnurl=file://$svnpath/svn-repo/proj%20B |
|
34 | 34 | svn import -m "init projB" projB $svnurl | fix_path |
|
35 | 35 | |
|
36 | 36 | |
|
37 | 37 | echo % update svn repository |
|
38 | 38 | svn co $svnurl/trunk B | fix_path |
|
39 | 39 | cd B |
|
40 | 40 | echo hello > 'letter .txt' |
|
41 | 41 | svn add 'letter .txt' |
|
42 | 42 | svn ci -m hello |
|
43 | 43 | |
|
44 | 44 | "$TESTDIR/svn-safe-append.py" world 'letter .txt' |
|
45 | 45 | svn ci -m world |
|
46 | 46 | |
|
47 | 47 | svn copy -m "tag v0.1" $svnurl/trunk $svnurl/tags/v0.1 |
|
48 | 48 | |
|
49 | 49 | "$TESTDIR/svn-safe-append.py" 'nice day today!' 'letter .txt' |
|
50 | 50 | svn ci -m "nice day" |
|
51 | 51 | cd .. |
|
52 | 52 | |
|
53 | 53 | echo % convert to hg once |
|
54 | 54 | hg convert $svnurl B-hg |
|
55 | 55 | |
|
56 | 56 | echo % update svn repository again |
|
57 | 57 | cd B |
|
58 | 58 | "$TESTDIR/svn-safe-append.py" "see second letter" 'letter .txt' |
|
59 | 59 | echo "nice to meet you" > letter2.txt |
|
60 | 60 | svn add letter2.txt |
|
61 | 61 | svn ci -m "second letter" |
|
62 | 62 | |
|
63 | 63 | svn copy -m "tag v0.2" $svnurl/trunk $svnurl/tags/v0.2 |
|
64 | 64 | |
|
65 | 65 | "$TESTDIR/svn-safe-append.py" "blah-blah-blah" letter2.txt |
|
66 | 66 | svn ci -m "work in progress" |
|
67 | 67 | cd .. |
|
68 | 68 | |
|
69 | 69 | ######################################## |
|
70 | 70 | |
|
71 | 71 | echo % test incremental conversion |
|
72 | 72 | hg convert $svnurl B-hg |
|
73 | 73 | |
|
74 | 74 | cd B-hg |
|
75 |
hg glog --template ' |
|
|
75 | hg glog --template '{rev} {desc|firstline} files: {files}\n' | |
|
76 | 76 | hg tags -q |
|
77 | 77 | cd .. |
|
78 | 78 | |
|
79 | 79 | echo % test filemap |
|
80 | 80 | echo 'include letter2.txt' > filemap |
|
81 | 81 | hg convert --filemap filemap $svnurl/trunk fmap |
|
82 |
hg glog -R fmap --template ' |
|
|
82 | hg glog -R fmap --template '{rev} {desc|firstline} files: {files}\n' | |
|
83 | 83 | |
|
84 | 84 | echo % test stop revision |
|
85 | 85 | hg convert --rev 1 $svnurl/trunk stoprev |
|
86 | 86 | # Check convert_revision extra-records. |
|
87 | 87 | # This is also the only place testing more than one extra field |
|
88 | 88 | # in a revision. |
|
89 | 89 | hg --cwd stoprev tip --debug | grep extra | sed 's/=.*/=/' |
@@ -1,46 +1,46 b'' | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | "$TESTDIR/hghave" svn svn-bindings || exit 80 |
|
4 | 4 | |
|
5 | 5 | fix_path() |
|
6 | 6 | { |
|
7 | 7 | tr '\\' / |
|
8 | 8 | } |
|
9 | 9 | |
|
10 | 10 | echo "[extensions]" >> $HGRCPATH |
|
11 | 11 | echo "convert = " >> $HGRCPATH |
|
12 | 12 | echo "hgext.graphlog =" >> $HGRCPATH |
|
13 | 13 | |
|
14 | 14 | svnadmin create svn-repo |
|
15 | 15 | cat "$TESTDIR/svn/startrev.svndump" | svnadmin load svn-repo > /dev/null |
|
16 | 16 | |
|
17 | 17 | svnpath=`pwd | fix_path` |
|
18 | 18 | # SVN wants all paths to start with a slash. Unfortunately, |
|
19 | 19 | # Windows ones don't. Handle that. |
|
20 | 20 | expr $svnpath : "\/" > /dev/null |
|
21 | 21 | if [ $? -ne 0 ]; then |
|
22 | 22 | svnpath='/'$svnpath |
|
23 | 23 | fi |
|
24 | 24 | svnurl=file://$svnpath/svn-repo |
|
25 | 25 | |
|
26 | 26 | convert() |
|
27 | 27 | { |
|
28 | 28 | startrev=$1 |
|
29 | 29 | repopath=A-r$startrev-hg |
|
30 | 30 | hg convert --config convert.svn.startrev=$startrev \ |
|
31 | 31 | --config convert.svn.trunk=branches/branch1 \ |
|
32 | 32 | --config convert.svn.branches=" " \ |
|
33 | 33 | --config convert.svn.tags= \ |
|
34 | 34 | --datesort $svnurl $repopath |
|
35 |
hg -R $repopath glog --template ' |
|
|
35 | hg -R $repopath glog --template '{rev} {desc|firstline} files: {files}\n' | |
|
36 | 36 | echo |
|
37 | 37 | } |
|
38 | 38 | |
|
39 | 39 | echo % convert before branching point |
|
40 | 40 | convert 3 |
|
41 | 41 | echo % convert before branching point |
|
42 | 42 | convert 4 |
|
43 | 43 | echo % convert at branching point |
|
44 | 44 | convert 5 |
|
45 | 45 | echo % convert last revision only |
|
46 | 46 | convert 6 |
@@ -1,37 +1,37 b'' | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | "$TESTDIR/hghave" svn svn-bindings || exit 80 |
|
4 | 4 | |
|
5 | 5 | fix_path() |
|
6 | 6 | { |
|
7 | 7 | tr '\\' / |
|
8 | 8 | } |
|
9 | 9 | |
|
10 | 10 | echo "[extensions]" >> $HGRCPATH |
|
11 | 11 | echo "convert = " >> $HGRCPATH |
|
12 | 12 | echo "hgext.graphlog =" >> $HGRCPATH |
|
13 | 13 | |
|
14 | 14 | svnadmin create svn-repo |
|
15 | 15 | cat "$TESTDIR/svn/tags.svndump" | svnadmin load svn-repo > /dev/null |
|
16 | 16 | |
|
17 | 17 | svnpath=`pwd | fix_path` |
|
18 | 18 | # SVN wants all paths to start with a slash. Unfortunately, |
|
19 | 19 | # Windows ones don't. Handle that. |
|
20 | 20 | expr $svnpath : "\/" > /dev/null |
|
21 | 21 | if [ $? -ne 0 ]; then |
|
22 | 22 | svnpath='/'$svnpath |
|
23 | 23 | fi |
|
24 | 24 | svnurl=file://$svnpath/svn-repo |
|
25 | 25 | |
|
26 | 26 | echo % convert |
|
27 | 27 | hg convert --datesort $svnurl A-hg |
|
28 | 28 | |
|
29 | 29 | cd A-hg |
|
30 |
hg glog --template ' |
|
|
30 | hg glog --template '{rev} {desc|firstline} tags: {tags}\n' | |
|
31 | 31 | hg tags | sed 's/:.*/:/' |
|
32 | 32 | cd .. |
|
33 | 33 | |
|
34 | 34 | echo % convert without tags |
|
35 | 35 | hg convert --datesort --config convert.svn.tags= $svnurl A-notags-hg |
|
36 | 36 | hg -R A-notags-hg tags -q |
|
37 | 37 |
@@ -1,73 +1,73 b'' | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | "$TESTDIR/hghave" tla || exit 80 |
|
4 | 4 | |
|
5 | 5 | mkdir do_not_use_HOME_tla |
|
6 | 6 | cd do_not_use_HOME_tla |
|
7 | 7 | HOME=`pwd`; export HOME |
|
8 | 8 | cd .. |
|
9 | 9 | tla my-id "mercurial <mercurial@selenic.com>" |
|
10 | 10 | |
|
11 | 11 | echo "[extensions]" >> $HGRCPATH |
|
12 | 12 | echo "convert=" >> $HGRCPATH |
|
13 | 13 | echo 'hgext.graphlog =' >> $HGRCPATH |
|
14 | 14 | |
|
15 | 15 | echo % create tla archive |
|
16 | 16 | tla make-archive tla@mercurial--convert `pwd`/hg-test-convert-tla |
|
17 | 17 | |
|
18 | 18 | echo % initialize tla repo |
|
19 | 19 | mkdir tla-repo |
|
20 | 20 | cd tla-repo/ |
|
21 | 21 | tla init-tree tla@mercurial--convert/tla--test--0 |
|
22 | 22 | tla import |
|
23 | 23 | |
|
24 | 24 | echo % create initial files |
|
25 | 25 | echo 'this is a file' > a |
|
26 | 26 | tla add a |
|
27 | 27 | mkdir src |
|
28 | 28 | tla add src |
|
29 | 29 | cd src |
|
30 | 30 | dd count=1 if=/dev/zero of=b > /dev/null 2> /dev/null |
|
31 | 31 | tla add b |
|
32 | 32 | tla commit -s "added a file, src and src/b (binary)" |
|
33 | 33 | |
|
34 | 34 | echo % create link file and modify a |
|
35 | 35 | ln -s ../a a-link |
|
36 | 36 | tla add a-link |
|
37 | 37 | echo 'this a modification to a' >> ../a |
|
38 | 38 | tla commit -s "added link to a and modify a" |
|
39 | 39 | |
|
40 | 40 | echo % create second link and modify b |
|
41 | 41 | ln -s ../a a-link-2 |
|
42 | 42 | tla add a-link-2 |
|
43 | 43 | dd count=1 seek=1 if=/dev/zero of=b > /dev/null 2> /dev/null |
|
44 | 44 | tla commit -s "added second link and modify b" |
|
45 | 45 | |
|
46 | 46 | echo % b file to link and a-link-2 to regular file |
|
47 | 47 | rm -f a-link-2 |
|
48 | 48 | echo 'this is now a regular file' > a-link-2 |
|
49 | 49 | ln -sf ../a b |
|
50 | 50 | tla commit -s "file to link and link to file test" |
|
51 | 51 | |
|
52 | 52 | echo % move a-link-2 file and src directory |
|
53 | 53 | cd .. |
|
54 | 54 | tla mv src/a-link-2 c |
|
55 | 55 | tla mv src test |
|
56 | 56 | tla commit -s "move and rename a-link-2 file and src directory" |
|
57 | 57 | |
|
58 | 58 | cd .. |
|
59 | 59 | |
|
60 | 60 | echo % converting tla repo to Mercurial |
|
61 | 61 | hg convert tla-repo tla-repo-hg |
|
62 | 62 | |
|
63 | 63 | tla register-archive -d tla@mercurial--convert |
|
64 | 64 | |
|
65 | 65 | glog() |
|
66 | 66 | { |
|
67 |
hg glog --template ' |
|
|
67 | hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@" | |
|
68 | 68 | } |
|
69 | 69 | |
|
70 | 70 | echo % show graph log |
|
71 | 71 | glog -R tla-repo-hg |
|
72 | 72 | hg up -q -R tla-repo-hg |
|
73 | 73 | hg -R tla-repo-hg manifest --debug |
@@ -1,50 +1,50 b'' | |||
|
1 | 1 | #!/bin/sh -e |
|
2 | 2 | |
|
3 | 3 | umask 027 |
|
4 | 4 | mkdir test1 |
|
5 | 5 | cd test1 |
|
6 | 6 | |
|
7 | 7 | hg init |
|
8 | 8 | touch a b |
|
9 | 9 | hg add a b |
|
10 | 10 | hg ci -m "added a b" -d "1000000 0" |
|
11 | 11 | |
|
12 | 12 | cd .. |
|
13 | 13 | hg clone test1 test3 |
|
14 | 14 | mkdir test2 |
|
15 | 15 | cd test2 |
|
16 | 16 | |
|
17 | 17 | hg init |
|
18 | 18 | hg pull ../test1 |
|
19 | 19 | hg co |
|
20 | 20 | chmod +x a |
|
21 | 21 | hg ci -m "chmod +x a" -d "1000000 0" |
|
22 | 22 | echo % the changelog should mention file a: |
|
23 |
hg tip --template ' |
|
|
23 | hg tip --template '{files}\n' | |
|
24 | 24 | |
|
25 | 25 | cd ../test1 |
|
26 | 26 | echo 123 >>a |
|
27 | 27 | hg ci -m "a updated" -d "1000000 0" |
|
28 | 28 | |
|
29 | 29 | hg pull ../test2 |
|
30 | 30 | hg heads |
|
31 | 31 | hg history |
|
32 | 32 | |
|
33 | 33 | hg -v merge |
|
34 | 34 | |
|
35 | 35 | cd ../test3 |
|
36 | 36 | echo 123 >>b |
|
37 | 37 | hg ci -m "b updated" -d "1000000 0" |
|
38 | 38 | |
|
39 | 39 | hg pull ../test2 |
|
40 | 40 | hg heads |
|
41 | 41 | hg history |
|
42 | 42 | |
|
43 | 43 | hg -v merge |
|
44 | 44 | |
|
45 | 45 | ls -l ../test[123]/a > foo |
|
46 | 46 | cut -b 1-10 < foo |
|
47 | 47 | |
|
48 | 48 | hg debugindex .hg/store/data/a.i |
|
49 | 49 | hg debugindex ../test2/.hg/store/data/a.i |
|
50 | 50 | hg debugindex ../test1/.hg/store/data/a.i |
@@ -1,334 +1,334 b'' | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | hg init a |
|
4 | 4 | mkdir a/d1 |
|
5 | 5 | mkdir a/d1/d2 |
|
6 | 6 | echo line 1 > a/a |
|
7 | 7 | echo line 1 > a/d1/d2/a |
|
8 | 8 | hg --cwd a ci -Ama |
|
9 | 9 | |
|
10 | 10 | echo line 2 >> a/a |
|
11 | 11 | hg --cwd a ci -u someone -d '1 0' -m'second change' |
|
12 | 12 | |
|
13 | 13 | echo % import exported patch |
|
14 | 14 | hg clone -r0 a b |
|
15 | 15 | hg --cwd a export tip > tip.patch |
|
16 | 16 | hg --cwd b import ../tip.patch |
|
17 | 17 | echo % message should be same |
|
18 | 18 | hg --cwd b tip | grep 'second change' |
|
19 | 19 | echo % committer should be same |
|
20 | 20 | hg --cwd b tip | grep someone |
|
21 | 21 | rm -r b |
|
22 | 22 | |
|
23 | 23 | echo % import exported patch with external patcher |
|
24 | 24 | cat > dummypatch.py <<EOF |
|
25 | 25 | print 'patching file a' |
|
26 | 26 | file('a', 'wb').write('line2\n') |
|
27 | 27 | EOF |
|
28 | 28 | chmod +x dummypatch.py |
|
29 | 29 | hg clone -r0 a b |
|
30 | 30 | hg --cwd a export tip > tip.patch |
|
31 | 31 | hg --config ui.patch='python ../dummypatch.py' --cwd b import ../tip.patch |
|
32 | 32 | cat b/a |
|
33 | 33 | rm -r b |
|
34 | 34 | |
|
35 | 35 | echo % import of plain diff should fail without message |
|
36 | 36 | hg clone -r0 a b |
|
37 | 37 | hg --cwd a diff -r0:1 > tip.patch |
|
38 | 38 | hg --cwd b import ../tip.patch |
|
39 | 39 | rm -r b |
|
40 | 40 | |
|
41 | 41 | echo % import of plain diff should be ok with message |
|
42 | 42 | hg clone -r0 a b |
|
43 | 43 | hg --cwd a diff -r0:1 > tip.patch |
|
44 | 44 | hg --cwd b import -mpatch ../tip.patch |
|
45 | 45 | rm -r b |
|
46 | 46 | |
|
47 | 47 | echo % import of plain diff with specific date and user |
|
48 | 48 | hg clone -r0 a b |
|
49 | 49 | hg --cwd a diff -r0:1 > tip.patch |
|
50 | 50 | hg --cwd b import -mpatch -d '1 0' -u 'user@nowhere.net' ../tip.patch |
|
51 | 51 | hg -R b tip -pv |
|
52 | 52 | rm -r b |
|
53 | 53 | |
|
54 | 54 | echo % import of plain diff should be ok with --no-commit |
|
55 | 55 | hg clone -r0 a b |
|
56 | 56 | hg --cwd a diff -r0:1 > tip.patch |
|
57 | 57 | hg --cwd b import --no-commit ../tip.patch |
|
58 | 58 | hg --cwd b diff --nodates |
|
59 | 59 | rm -r b |
|
60 | 60 | |
|
61 | 61 | echo % hg -R repo import |
|
62 | 62 | # put the clone in a subdir - having a directory named "a" |
|
63 | 63 | # used to hide a bug. |
|
64 | 64 | mkdir dir |
|
65 | 65 | hg clone -r0 a dir/b |
|
66 | 66 | hg --cwd a export tip > dir/tip.patch |
|
67 | 67 | cd dir |
|
68 | 68 | hg -R b import tip.patch |
|
69 | 69 | cd .. |
|
70 | 70 | rm -r dir |
|
71 | 71 | |
|
72 | 72 | echo % import from stdin |
|
73 | 73 | hg clone -r0 a b |
|
74 | 74 | hg --cwd a export tip | hg --cwd b import - |
|
75 | 75 | rm -r b |
|
76 | 76 | |
|
77 | 77 | echo % override commit message |
|
78 | 78 | hg clone -r0 a b |
|
79 | 79 | hg --cwd a export tip | hg --cwd b import -m 'override' - |
|
80 | 80 | hg --cwd b tip | grep override |
|
81 | 81 | rm -r b |
|
82 | 82 | |
|
83 | 83 | cat > mkmsg.py <<EOF |
|
84 | 84 | import email.Message, sys |
|
85 | 85 | msg = email.Message.Message() |
|
86 | 86 | msg.set_payload('email commit message\n' + open('tip.patch', 'rb').read()) |
|
87 | 87 | msg['Subject'] = 'email patch' |
|
88 | 88 | msg['From'] = 'email patcher' |
|
89 | 89 | sys.stdout.write(msg.as_string()) |
|
90 | 90 | EOF |
|
91 | 91 | |
|
92 | 92 | echo % plain diff in email, subject, message body |
|
93 | 93 | hg clone -r0 a b |
|
94 | 94 | hg --cwd a diff -r0:1 > tip.patch |
|
95 | 95 | python mkmsg.py > msg.patch |
|
96 | 96 | hg --cwd b import ../msg.patch |
|
97 | 97 | hg --cwd b tip | grep email |
|
98 | 98 | rm -r b |
|
99 | 99 | |
|
100 | 100 | echo % plain diff in email, no subject, message body |
|
101 | 101 | hg clone -r0 a b |
|
102 | 102 | grep -v '^Subject:' msg.patch | hg --cwd b import - |
|
103 | 103 | rm -r b |
|
104 | 104 | |
|
105 | 105 | echo % plain diff in email, subject, no message body |
|
106 | 106 | hg clone -r0 a b |
|
107 | 107 | grep -v '^email ' msg.patch | hg --cwd b import - |
|
108 | 108 | rm -r b |
|
109 | 109 | |
|
110 | 110 | echo % plain diff in email, no subject, no message body, should fail |
|
111 | 111 | hg clone -r0 a b |
|
112 | 112 | egrep -v '^(Subject|email)' msg.patch | hg --cwd b import - |
|
113 | 113 | rm -r b |
|
114 | 114 | |
|
115 | 115 | echo % hg export in email, should use patch header |
|
116 | 116 | hg clone -r0 a b |
|
117 | 117 | hg --cwd a export tip > tip.patch |
|
118 | 118 | python mkmsg.py | hg --cwd b import - |
|
119 | 119 | hg --cwd b tip | grep second |
|
120 | 120 | rm -r b |
|
121 | 121 | |
|
122 | 122 | # subject: duplicate detection, removal of [PATCH] |
|
123 | 123 | # The '---' tests the gitsendmail handling without proper mail headers |
|
124 | 124 | cat > mkmsg2.py <<EOF |
|
125 | 125 | import email.Message, sys |
|
126 | 126 | msg = email.Message.Message() |
|
127 | 127 | msg.set_payload('email patch\n\nnext line\n---\n' + open('tip.patch').read()) |
|
128 | 128 | msg['Subject'] = '[PATCH] email patch' |
|
129 | 129 | msg['From'] = 'email patcher' |
|
130 | 130 | sys.stdout.write(msg.as_string()) |
|
131 | 131 | EOF |
|
132 | 132 | |
|
133 | 133 | echo '% plain diff in email, [PATCH] subject, message body with subject' |
|
134 | 134 | hg clone -r0 a b |
|
135 | 135 | hg --cwd a diff -r0:1 > tip.patch |
|
136 | 136 | python mkmsg2.py | hg --cwd b import - |
|
137 | 137 | hg --cwd b tip --template '{desc}\n' |
|
138 | 138 | rm -r b |
|
139 | 139 | |
|
140 | 140 | # We weren't backing up the correct dirstate file when importing many patches |
|
141 | 141 | # (issue963) |
|
142 | 142 | echo '% import patch1 patch2; rollback' |
|
143 | 143 | echo line 3 >> a/a |
|
144 | 144 | hg --cwd a ci -m'third change' |
|
145 | 145 | hg --cwd a export -o '../patch%R' 1 2 |
|
146 | 146 | hg clone -qr0 a b |
|
147 |
hg --cwd b parents --template 'parent: |
|
|
147 | hg --cwd b parents --template 'parent: {rev}\n' | |
|
148 | 148 | hg --cwd b import ../patch1 ../patch2 |
|
149 | 149 | hg --cwd b rollback |
|
150 |
hg --cwd b parents --template 'parent: |
|
|
150 | hg --cwd b parents --template 'parent: {rev}\n' | |
|
151 | 151 | rm -r b |
|
152 | 152 | |
|
153 | 153 | # bug non regression test |
|
154 | 154 | # importing a patch in a subdirectory failed at the commit stage |
|
155 | 155 | echo line 2 >> a/d1/d2/a |
|
156 | 156 | hg --cwd a ci -u someoneelse -d '1 0' -m'subdir change' |
|
157 | 157 | echo % hg import in a subdirectory |
|
158 | 158 | hg clone -r0 a b |
|
159 | 159 | hg --cwd a export tip | sed -e 's/d1\/d2\///' > tip.patch |
|
160 | 160 | dir=`pwd` |
|
161 | 161 | cd b/d1/d2 2>&1 > /dev/null |
|
162 | 162 | hg import ../../../tip.patch |
|
163 | 163 | cd $dir |
|
164 | 164 | echo "% message should be 'subdir change'" |
|
165 | 165 | hg --cwd b tip | grep 'subdir change' |
|
166 | 166 | echo "% committer should be 'someoneelse'" |
|
167 | 167 | hg --cwd b tip | grep someoneelse |
|
168 | 168 | echo "% should be empty" |
|
169 | 169 | hg --cwd b status |
|
170 | 170 | |
|
171 | 171 | |
|
172 | 172 | # Test fuzziness (ambiguous patch location, fuzz=2) |
|
173 | 173 | echo % test fuzziness |
|
174 | 174 | hg init fuzzy |
|
175 | 175 | cd fuzzy |
|
176 | 176 | echo line1 > a |
|
177 | 177 | echo line0 >> a |
|
178 | 178 | echo line3 >> a |
|
179 | 179 | hg ci -Am adda |
|
180 | 180 | echo line1 > a |
|
181 | 181 | echo line2 >> a |
|
182 | 182 | echo line0 >> a |
|
183 | 183 | echo line3 >> a |
|
184 | 184 | hg ci -m change a |
|
185 | 185 | hg export tip > tip.patch |
|
186 | 186 | hg up -C 0 |
|
187 | 187 | echo line1 > a |
|
188 | 188 | echo line0 >> a |
|
189 | 189 | echo line1 >> a |
|
190 | 190 | echo line0 >> a |
|
191 | 191 | hg ci -m brancha |
|
192 | 192 | hg import -v tip.patch |
|
193 | 193 | cd .. |
|
194 | 194 | |
|
195 | 195 | # Test hunk touching empty files (issue906) |
|
196 | 196 | hg init empty |
|
197 | 197 | cd empty |
|
198 | 198 | touch a |
|
199 | 199 | touch b1 |
|
200 | 200 | touch c1 |
|
201 | 201 | echo d > d |
|
202 | 202 | hg ci -Am init |
|
203 | 203 | echo a > a |
|
204 | 204 | echo b > b1 |
|
205 | 205 | hg mv b1 b2 |
|
206 | 206 | echo c > c1 |
|
207 | 207 | hg copy c1 c2 |
|
208 | 208 | rm d |
|
209 | 209 | touch d |
|
210 | 210 | hg diff --git |
|
211 | 211 | hg ci -m empty |
|
212 | 212 | hg export --git tip > empty.diff |
|
213 | 213 | hg up -C 0 |
|
214 | 214 | hg import empty.diff |
|
215 | 215 | for name in a b1 b2 c1 c2 d; |
|
216 | 216 | do |
|
217 | 217 | echo % $name file |
|
218 | 218 | test -f $name && cat $name |
|
219 | 219 | done |
|
220 | 220 | cd .. |
|
221 | 221 | |
|
222 | 222 | # Test importing a patch ending with a binary file removal |
|
223 | 223 | echo % test trailing binary removal |
|
224 | 224 | hg init binaryremoval |
|
225 | 225 | cd binaryremoval |
|
226 | 226 | echo a > a |
|
227 | 227 | python -c "file('b', 'wb').write('a\x00b')" |
|
228 | 228 | hg ci -Am addall |
|
229 | 229 | hg rm a |
|
230 | 230 | hg rm b |
|
231 | 231 | hg st |
|
232 | 232 | hg ci -m remove |
|
233 | 233 | hg export --git . > remove.diff |
|
234 | 234 | cat remove.diff | grep git |
|
235 | 235 | hg up -C 0 |
|
236 | 236 | hg import remove.diff |
|
237 | 237 | hg manifest |
|
238 | 238 | cd .. |
|
239 | 239 | |
|
240 | 240 | echo % 'test update+rename with common name (issue 927)' |
|
241 | 241 | hg init t |
|
242 | 242 | cd t |
|
243 | 243 | touch a |
|
244 | 244 | hg ci -Am t |
|
245 | 245 | echo a > a |
|
246 | 246 | # Here, bfile.startswith(afile) |
|
247 | 247 | hg copy a a2 |
|
248 | 248 | hg ci -m copya |
|
249 | 249 | hg export --git tip > copy.diff |
|
250 | 250 | hg up -C 0 |
|
251 | 251 | hg import copy.diff |
|
252 | 252 | echo % view a |
|
253 | 253 | # a should contain an 'a' |
|
254 | 254 | cat a |
|
255 | 255 | echo % view a2 |
|
256 | 256 | # and a2 should have duplicated it |
|
257 | 257 | cat a2 |
|
258 | 258 | cd .. |
|
259 | 259 | |
|
260 | 260 | echo % 'test -p0' |
|
261 | 261 | hg init p0 |
|
262 | 262 | cd p0 |
|
263 | 263 | echo a > a |
|
264 | 264 | hg ci -Am t |
|
265 | 265 | hg import -p0 - << EOF |
|
266 | 266 | foobar |
|
267 | 267 | --- a Sat Apr 12 22:43:58 2008 -0400 |
|
268 | 268 | +++ a Sat Apr 12 22:44:05 2008 -0400 |
|
269 | 269 | @@ -1,1 +1,1 @@ |
|
270 | 270 | -a |
|
271 | 271 | +bb |
|
272 | 272 | EOF |
|
273 | 273 | hg status |
|
274 | 274 | cat a |
|
275 | 275 | cd .. |
|
276 | 276 | |
|
277 | 277 | echo % 'test paths outside repo root' |
|
278 | 278 | mkdir outside |
|
279 | 279 | touch outside/foo |
|
280 | 280 | hg init inside |
|
281 | 281 | cd inside |
|
282 | 282 | hg import - <<EOF |
|
283 | 283 | diff --git a/a b/b |
|
284 | 284 | rename from ../outside/foo |
|
285 | 285 | rename to bar |
|
286 | 286 | EOF |
|
287 | 287 | cd .. |
|
288 | 288 | |
|
289 | 289 | echo '% test import with similarity (issue295)' |
|
290 | 290 | hg init sim |
|
291 | 291 | cd sim |
|
292 | 292 | echo 'this is a test' > a |
|
293 | 293 | hg ci -Ama |
|
294 | 294 | cat > ../rename.diff <<EOF |
|
295 | 295 | diff --git a/a b/a |
|
296 | 296 | deleted file mode 100644 |
|
297 | 297 | --- a/a |
|
298 | 298 | +++ /dev/null |
|
299 | 299 | @@ -1,1 +0,0 @@ |
|
300 | 300 | -this is a test |
|
301 | 301 | diff --git a/b b/b |
|
302 | 302 | new file mode 100644 |
|
303 | 303 | --- /dev/null |
|
304 | 304 | +++ b/b |
|
305 | 305 | @@ -0,0 +1,2 @@ |
|
306 | 306 | +this is a test |
|
307 | 307 | +foo |
|
308 | 308 | EOF |
|
309 | 309 | hg import --no-commit -v -s 1 ../rename.diff |
|
310 | 310 | hg st -C |
|
311 | 311 | hg revert -a |
|
312 | 312 | rm b |
|
313 | 313 | hg import --no-commit -v -s 100 ../rename.diff |
|
314 | 314 | hg st -C |
|
315 | 315 | cd .. |
|
316 | 316 | |
|
317 | 317 | |
|
318 | 318 | echo '% add empty file from the end of patch (issue 1495)' |
|
319 | 319 | hg init addemptyend |
|
320 | 320 | cd addemptyend |
|
321 | 321 | touch a |
|
322 | 322 | hg addremove |
|
323 | 323 | hg ci -m "commit" |
|
324 | 324 | cat > a.patch <<EOF |
|
325 | 325 | diff --git a/a b/a |
|
326 | 326 | --- a/a |
|
327 | 327 | +++ b/a |
|
328 | 328 | @@ -0,0 +1,1 @@ |
|
329 | 329 | +a |
|
330 | 330 | diff --git a/b b/b |
|
331 | 331 | new file mode 100644 |
|
332 | 332 | EOF |
|
333 | 333 | hg import --no-commit a.patch |
|
334 | 334 | cd .. |
@@ -1,74 +1,74 b'' | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | # check that renames are correctly saved by a commit after a merge |
|
3 | 3 | |
|
4 | 4 | # test with the merge on 3 having the rename on the local parent |
|
5 | 5 | hg init a |
|
6 | 6 | cd a |
|
7 | 7 | |
|
8 | 8 | echo line1 > foo |
|
9 | 9 | hg add foo |
|
10 | 10 | hg ci -m '0: add foo' |
|
11 | 11 | |
|
12 | 12 | echo line2 >> foo |
|
13 | 13 | hg ci -m '1: change foo' |
|
14 | 14 | |
|
15 | 15 | hg up -C 0 |
|
16 | 16 | hg mv foo bar |
|
17 | 17 | rm bar |
|
18 | 18 | echo line0 > bar |
|
19 | 19 | echo line1 >> bar |
|
20 | 20 | hg ci -m '2: mv foo bar; change bar' |
|
21 | 21 | |
|
22 | 22 | hg merge 1 |
|
23 | 23 | echo '% contents of bar should be line0 line1 line2' |
|
24 | 24 | cat bar |
|
25 | 25 | hg ci -m '3: merge with local rename' |
|
26 | 26 | hg debugindex .hg/store/data/bar.i |
|
27 | 27 | hg debugrename bar |
|
28 | 28 | hg debugindex .hg/store/data/foo.i |
|
29 | 29 | |
|
30 | 30 | # revert the content change from rev 2 |
|
31 | 31 | hg up -C 2 |
|
32 | 32 | rm bar |
|
33 | 33 | echo line1 > bar |
|
34 | 34 | hg ci -m '4: revert content change from rev 2' |
|
35 | 35 | |
|
36 |
hg log --template ' |
|
|
36 | hg log --template '{rev}:{node|short} {parents}\n' | |
|
37 | 37 | echo '% this should use bar@rev2 as the ancestor' |
|
38 | 38 | hg --debug merge 3 |
|
39 | 39 | echo '% contents of bar should be line1 line2' |
|
40 | 40 | cat bar |
|
41 | 41 | hg ci -m '5: merge' |
|
42 | 42 | hg debugindex .hg/store/data/bar.i |
|
43 | 43 | |
|
44 | 44 | |
|
45 | 45 | # same thing, but with the merge on 3 having the rename on the remote parent |
|
46 | 46 | echo |
|
47 | 47 | echo |
|
48 | 48 | cd .. |
|
49 | 49 | hg clone -U -r 1 -r 2 a b |
|
50 | 50 | cd b |
|
51 | 51 | |
|
52 | 52 | hg up -C 1 |
|
53 | 53 | hg merge 2 |
|
54 | 54 | echo '% contents of bar should be line0 line1 line2' |
|
55 | 55 | cat bar |
|
56 | 56 | hg ci -m '3: merge with remote rename' |
|
57 | 57 | hg debugindex .hg/store/data/bar.i |
|
58 | 58 | hg debugrename bar |
|
59 | 59 | hg debugindex .hg/store/data/foo.i |
|
60 | 60 | |
|
61 | 61 | # revert the content change from rev 2 |
|
62 | 62 | hg up -C 2 |
|
63 | 63 | rm bar |
|
64 | 64 | echo line1 > bar |
|
65 | 65 | hg ci -m '4: revert content change from rev 2' |
|
66 | 66 | |
|
67 |
hg log --template ' |
|
|
67 | hg log --template '{rev}:{node|short} {parents}\n' | |
|
68 | 68 | echo '% this should use bar@rev2 as the ancestor' |
|
69 | 69 | hg --debug merge 3 |
|
70 | 70 | echo '% contents of bar should be line1 line2' |
|
71 | 71 | cat bar |
|
72 | 72 | hg ci -m '5: merge' |
|
73 | 73 | hg debugindex .hg/store/data/bar.i |
|
74 | 74 |
@@ -1,78 +1,78 b'' | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | branches=.hg/branchheads.cache |
|
4 | 4 | echo '[extensions]' >> $HGRCPATH |
|
5 | 5 | echo 'hgext.mq=' >> $HGRCPATH |
|
6 | 6 | |
|
7 | 7 | show_branch_cache() |
|
8 | 8 | { |
|
9 | 9 | # force cache (re)generation |
|
10 | 10 | hg log -r does-not-exist 2> /dev/null |
|
11 |
hg log -r tip --template 'tip: |
|
|
11 | hg log -r tip --template 'tip: {rev}\n' | |
|
12 | 12 | if [ -f $branches ]; then |
|
13 | 13 | sort $branches |
|
14 | 14 | else |
|
15 | 15 | echo No branch cache |
|
16 | 16 | fi |
|
17 | 17 | if [ "$1" = 1 ]; then |
|
18 | 18 | for b in foo bar; do |
|
19 |
hg log -r $b --template "branch $b: "' |
|
|
19 | hg log -r $b --template "branch $b: "'{rev}\n' | |
|
20 | 20 | done |
|
21 | 21 | fi |
|
22 | 22 | } |
|
23 | 23 | |
|
24 | 24 | hg init a |
|
25 | 25 | cd a |
|
26 | 26 | hg qinit -c |
|
27 | 27 | |
|
28 | 28 | echo '# mq patch on an empty repo' |
|
29 | 29 | hg qnew p1 |
|
30 | 30 | show_branch_cache |
|
31 | 31 | |
|
32 | 32 | echo > pfile |
|
33 | 33 | hg add pfile |
|
34 | 34 | hg qrefresh -m 'patch 1' |
|
35 | 35 | show_branch_cache |
|
36 | 36 | |
|
37 | 37 | echo |
|
38 | 38 | echo '# some regular revisions' |
|
39 | 39 | hg qpop |
|
40 | 40 | echo foo > foo |
|
41 | 41 | hg add foo |
|
42 | 42 | echo foo > .hg/branch |
|
43 | 43 | hg ci -m 'branch foo' -d '1000000 0' |
|
44 | 44 | |
|
45 | 45 | echo bar > bar |
|
46 | 46 | hg add bar |
|
47 | 47 | echo bar > .hg/branch |
|
48 | 48 | hg ci -m 'branch bar' -d '1000000 0' |
|
49 | 49 | show_branch_cache |
|
50 | 50 | |
|
51 | 51 | echo |
|
52 | 52 | echo '# add some mq patches' |
|
53 | 53 | hg qpush |
|
54 | 54 | show_branch_cache |
|
55 | 55 | |
|
56 | 56 | hg qnew p2 |
|
57 | 57 | echo foo > .hg/branch |
|
58 | 58 | echo foo2 >> foo |
|
59 | 59 | hg qrefresh -m 'patch 2' |
|
60 | 60 | show_branch_cache 1 |
|
61 | 61 | |
|
62 | 62 | echo |
|
63 | 63 | echo '# removing the cache' |
|
64 | 64 | rm $branches |
|
65 | 65 | show_branch_cache 1 |
|
66 | 66 | |
|
67 | 67 | echo |
|
68 | 68 | echo '# importing rev 1 (the cache now ends in one of the patches)' |
|
69 | 69 | hg qimport -r 1 -n p0 |
|
70 | 70 | show_branch_cache 1 |
|
71 |
hg log -r qbase --template 'qbase: |
|
|
71 | hg log -r qbase --template 'qbase: {rev}\n' | |
|
72 | 72 | |
|
73 | 73 | echo |
|
74 | 74 | echo '# detect an invalid cache' |
|
75 | 75 | hg qpop -a |
|
76 | 76 | hg qpush -a |
|
77 | 77 | show_branch_cache |
|
78 | 78 |
@@ -1,44 +1,44 b'' | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | echo '[extensions]' >> $HGRCPATH |
|
4 | 4 | echo 'hgext.mq =' >> $HGRCPATH |
|
5 | 5 | |
|
6 | 6 | hg init repo |
|
7 | 7 | cd repo |
|
8 | 8 | |
|
9 | 9 | echo foo > foo |
|
10 | 10 | hg ci -qAm 'add a file' |
|
11 | 11 | |
|
12 | 12 | hg qinit |
|
13 | 13 | |
|
14 | 14 | hg qnew foo |
|
15 | 15 | echo foo >> foo |
|
16 | 16 | hg qrefresh -m 'append foo' |
|
17 | 17 | |
|
18 | 18 | hg qnew bar |
|
19 | 19 | echo bar >> foo |
|
20 | 20 | hg qrefresh -m 'append bar' |
|
21 | 21 | |
|
22 | 22 | echo '% try to commit on top of a patch' |
|
23 | 23 | echo quux >> foo |
|
24 | 24 | hg ci -m 'append quux' |
|
25 | 25 | |
|
26 | 26 | # cheat a bit... |
|
27 | 27 | mv .hg/patches .hg/patches2 |
|
28 | 28 | hg ci -m 'append quux' |
|
29 | 29 | mv .hg/patches2 .hg/patches |
|
30 | 30 | |
|
31 | 31 | echo '% qpop/qrefresh on the wrong revision' |
|
32 | 32 | hg qpop |
|
33 | 33 | hg qpop -n patches 2>&1 | sed -e 's/\(using patch queue:\).*/\1/' |
|
34 | 34 | hg qrefresh |
|
35 | 35 | |
|
36 | 36 | hg up -C qtip |
|
37 | 37 | echo '% qpop' |
|
38 | 38 | hg qpop |
|
39 | 39 | |
|
40 | 40 | echo '% qrefresh' |
|
41 | 41 | hg qrefresh |
|
42 | 42 | |
|
43 | 43 | echo '% tip:' |
|
44 |
hg tip --template ' |
|
|
44 | hg tip --template '{rev} {desc}\n' |
@@ -1,69 +1,69 b'' | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | commit() |
|
4 | 4 | { |
|
5 | 5 | msg=$1 |
|
6 | 6 | p1=$2 |
|
7 | 7 | p2=$3 |
|
8 | 8 | |
|
9 | 9 | if [ "$p1" ]; then |
|
10 | 10 | hg up -qC $p1 |
|
11 | 11 | fi |
|
12 | 12 | |
|
13 | 13 | if [ "$p2" ]; then |
|
14 | 14 | HGMERGE=true hg merge -q $p2 |
|
15 | 15 | fi |
|
16 | 16 | |
|
17 | 17 | echo >> foo |
|
18 | 18 | |
|
19 | 19 | hg commit -qAm "$msg" |
|
20 | 20 | } |
|
21 | 21 | |
|
22 | 22 | hg init repo |
|
23 | 23 | cd repo |
|
24 | 24 | |
|
25 | 25 | echo '[extensions]' > .hg/hgrc |
|
26 | 26 | echo 'hgext.parentrevspec =' >> .hg/hgrc |
|
27 | 27 | |
|
28 | 28 | commit '0: add foo' |
|
29 | 29 | commit '1: change foo 1' |
|
30 | 30 | commit '2: change foo 2a' |
|
31 | 31 | commit '3: change foo 3a' |
|
32 | 32 | commit '4: change foo 2b' 1 |
|
33 | 33 | commit '5: merge' 3 4 |
|
34 | 34 | commit '6: change foo again' |
|
35 | 35 | |
|
36 |
hg log --template ' |
|
|
36 | hg log --template '{rev}:{node|short} {parents}\n' | |
|
37 | 37 | echo |
|
38 | 38 | |
|
39 | 39 | lookup() |
|
40 | 40 | { |
|
41 | 41 | for rev in "$@"; do |
|
42 | 42 | printf "$rev: " |
|
43 | 43 | hg id -nr $rev |
|
44 | 44 | done |
|
45 | 45 | true |
|
46 | 46 | } |
|
47 | 47 | |
|
48 | 48 | tipnode=`hg id -ir tip` |
|
49 | 49 | |
|
50 | 50 | echo 'should work with tag/branch/node/rev' |
|
51 | 51 | for r in tip default $tipnode 6; do |
|
52 | 52 | lookup "$r^" |
|
53 | 53 | done |
|
54 | 54 | echo |
|
55 | 55 | |
|
56 | 56 | echo 'some random lookups' |
|
57 | 57 | lookup "6^^" "6^^^" "6^^^^" "6^^^^^" "6^^^^^^" "6^1" "6^2" "6^^2" "6^1^2" "6^^3" |
|
58 | 58 | lookup "6~" "6~1" "6~2" "6~3" "6~4" "6~5" "6~42" "6~1^2" "6~1^2~2" |
|
59 | 59 | echo |
|
60 | 60 | |
|
61 | 61 | echo 'with a tag "6^" pointing to rev 1' |
|
62 | 62 | hg tag -l -r 1 "6^" |
|
63 | 63 | lookup "6^" "6^1" "6~1" "6^^" |
|
64 | 64 | echo |
|
65 | 65 | |
|
66 | 66 | echo 'with a tag "foo^bar" pointing to rev 2' |
|
67 | 67 | hg tag -l -r 2 "foo^bar" |
|
68 | 68 | lookup "foo^bar" "foo^bar^" |
|
69 | 69 |
General Comments 0
You need to be logged in to leave comments.
Login now