Show More
@@ -1,104 +1,104 b'' | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | "$TESTDIR/hghave" p4 execbit symlink || exit 80 |
|
4 | 4 | |
|
5 | 5 | echo "[extensions]" >> $HGRCPATH |
|
6 | 6 | echo "convert = " >> $HGRCPATH |
|
7 | 7 | |
|
8 | 8 | echo % create p4 depot |
|
9 |
P4ROOT= |
|
|
9 | P4ROOT=`pwd`/depot; export P4ROOT | |
|
10 | 10 | P4AUDIT=$P4ROOT/audit; export P4AUDIT |
|
11 | 11 | P4JOURNAL=$P4ROOT/journal; export P4JOURNAL |
|
12 | 12 | P4LOG=$P4ROOT/log; export P4LOG |
|
13 | 13 | P4PORT=localhost:16661; export P4PORT |
|
14 | 14 | P4DEBUG=1; export P4DEBUG |
|
15 | 15 | P4CHARSET=utf8; export P4CHARSET |
|
16 | 16 | |
|
17 | 17 | echo % start the p4 server |
|
18 | 18 | [ ! -d $P4ROOT ] && mkdir $P4ROOT |
|
19 | 19 | p4d -f -J off -xi >$P4ROOT/stdout 2>$P4ROOT/stderr |
|
20 | 20 | p4d -f -J off >$P4ROOT/stdout 2>$P4ROOT/stderr & |
|
21 | 21 | trap "echo % stop the p4 server ; p4 admin stop" EXIT |
|
22 | 22 | |
|
23 | 23 | # wait for the server to initialize |
|
24 | 24 | while ! p4 ; do |
|
25 | 25 | sleep 1 |
|
26 | 26 | done >/dev/null 2>/dev/null |
|
27 | 27 | |
|
28 | 28 | echo % create a client spec |
|
29 | 29 | P4CLIENT=hg-p4-import; export P4CLIENT |
|
30 | 30 | DEPOTPATH=//depot/test-mercurial-import/... |
|
31 | 31 | p4 client -o | sed '/^View:/,$ d' >p4client |
|
32 | 32 | echo View: >>p4client |
|
33 | 33 | echo " $DEPOTPATH //$P4CLIENT/..." >>p4client |
|
34 | 34 | p4 client -i <p4client |
|
35 | 35 | |
|
36 | 36 | echo % populate the depot |
|
37 | 37 | TYPES="text binary symlink" |
|
38 | 38 | TYPES="$TYPES text+m text+w text+x text+k text+kx text+ko text+l text+C text+D text+F text+S text+S2" |
|
39 | 39 | TYPES="$TYPES binary+k binary+x binary+kx symlink+k" |
|
40 | 40 | TYPES="$TYPES ctext cxtext ktext kxtext ltext tempobj ubinary uxbinary xbinary xltext xtempobj xtext" |
|
41 | 41 | # not testing these |
|
42 | 42 | #TYPES="$TYPES apple resource unicode utf16 uresource xunicode xutf16" |
|
43 | 43 | for T in $TYPES ; do |
|
44 | 44 | T2=`echo $T | tr [:upper:] [:lower:]` |
|
45 | 45 | case $T in |
|
46 | 46 | apple) |
|
47 | 47 | ;; |
|
48 | 48 | symlink*) |
|
49 | 49 | echo "this is target $T" >target_$T2 |
|
50 | 50 | ln -s target_$T file_$T2 |
|
51 | 51 | p4 add target_$T2 |
|
52 | 52 | p4 add -t $T file_$T2 |
|
53 | 53 | ;; |
|
54 | 54 | binary*) |
|
55 | 55 | python -c "file('file_$T2', 'wb').write('this is $T')" |
|
56 | 56 | p4 add -t $T file_$T2 |
|
57 | 57 | ;; |
|
58 | 58 | *) |
|
59 | 59 | echo "this is $T" >file_$T2 |
|
60 | 60 | p4 add -t $T file_$T2 |
|
61 | 61 | ;; |
|
62 | 62 | esac |
|
63 | 63 | done |
|
64 | 64 | p4 submit -d initial |
|
65 | 65 | |
|
66 | 66 | echo % test keyword expansion |
|
67 | 67 | p4 edit file_* target_* |
|
68 | 68 | for T in $TYPES ; do |
|
69 | 69 | T2=`echo $T | tr [:upper:] [:lower:]` |
|
70 | 70 | echo '$Id$' >>file_$T2 |
|
71 | 71 | echo '$Header$' >>file_$T2 |
|
72 | 72 | echo '$Date$' >>file_$T2 |
|
73 | 73 | echo '$DateTime$' >>file_$T2 |
|
74 | 74 | echo '$Change$' >>file_$T2 |
|
75 | 75 | echo '$File$' >>file_$T2 |
|
76 | 76 | echo '$Revision$' >>file_$T2 |
|
77 | 77 | echo '$Header$$Header$Header$' >>file_$T2 |
|
78 | 78 | done |
|
79 | 79 | |
|
80 | 80 | ln -s 'target_$Header$' crazy_symlink+k |
|
81 | 81 | p4 add -t symlink+k crazy_symlink+k |
|
82 | 82 | |
|
83 | 83 | p4 submit -d keywords |
|
84 | 84 | |
|
85 | 85 | echo % check keywords in p4 |
|
86 | 86 | grep -H Header file_* |
|
87 | 87 | |
|
88 | 88 | echo % convert |
|
89 | 89 | hg convert -s p4 $DEPOTPATH dst |
|
90 | 90 | hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n'g |
|
91 | 91 | |
|
92 | 92 | echo % revision 0 |
|
93 | 93 | hg -R dst update 0 |
|
94 | 94 | head dst/file_* | cat -v |
|
95 | 95 | |
|
96 | 96 | echo |
|
97 | 97 | echo % revision 1 |
|
98 | 98 | hg -R dst update 1 |
|
99 | 99 | head dst/file_* | cat -v |
|
100 | 100 | echo |
|
101 | 101 | echo % crazy_symlink |
|
102 | 102 | readlink crazy_symlink+k |
|
103 | 103 | readlink dst/crazy_symlink+k |
|
104 | 104 |
General Comments 0
You need to be logged in to leave comments.
Login now