Mercurial > hg
comparison tests/test-convert-p4.t @ 16673:775a8d33e6f0
tests: unify the last sh tests
This requires a slightly smarter check-code check for sed output filtering.
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Wed, 25 Apr 2012 01:35:39 +0200 |
parents | tests/test-convert-p4@d4d4da54ab05 |
children | 7a9cbb315d84 |
comparison
equal
deleted
inserted
replaced
16672:d046eb97d21e | 16673:775a8d33e6f0 |
---|---|
1 $ "$TESTDIR/hghave" p4 || exit 80 | |
2 | |
3 $ echo "[extensions]" >> $HGRCPATH | |
4 $ echo "convert = " >> $HGRCPATH | |
5 | |
6 create p4 depot | |
7 $ P4ROOT=`pwd`/depot; export P4ROOT | |
8 $ P4AUDIT=$P4ROOT/audit; export P4AUDIT | |
9 $ P4JOURNAL=$P4ROOT/journal; export P4JOURNAL | |
10 $ P4LOG=$P4ROOT/log; export P4LOG | |
11 $ P4PORT=localhost:16661; export P4PORT | |
12 $ P4DEBUG=1; export P4DEBUG | |
13 | |
14 start the p4 server | |
15 $ [ ! -d $P4ROOT ] && mkdir $P4ROOT | |
16 $ p4d -f -J off >$P4ROOT/stdout 2>$P4ROOT/stderr & | |
17 $ echo $! >> $DAEMON_PIDS | |
18 $ trap "echo stopping the p4 server ; p4 admin stop" EXIT | |
19 | |
20 $ # wait for the server to initialize | |
21 $ while ! p4 ; do | |
22 > sleep 1 | |
23 > done >/dev/null 2>/dev/null | |
24 | |
25 create a client spec | |
26 $ P4CLIENT=hg-p4-import; export P4CLIENT | |
27 $ DEPOTPATH=//depot/test-mercurial-import/... | |
28 $ p4 client -o | sed '/^View:/,$ d' >p4client | |
29 $ echo View: >>p4client | |
30 $ echo " $DEPOTPATH //$P4CLIENT/..." >>p4client | |
31 $ p4 client -i <p4client | |
32 Client hg-p4-import saved. | |
33 | |
34 populate the depot | |
35 $ echo a > a | |
36 $ mkdir b | |
37 $ echo c > b/c | |
38 $ p4 add a b/c | |
39 //depot/test-mercurial-import/a#1 - opened for add | |
40 //depot/test-mercurial-import/b/c#1 - opened for add | |
41 $ p4 submit -d initial | |
42 Submitting change 1. | |
43 Locking 2 files ... | |
44 add //depot/test-mercurial-import/a#1 | |
45 add //depot/test-mercurial-import/b/c#1 | |
46 Change 1 submitted. | |
47 | |
48 change some files | |
49 $ p4 edit a | |
50 //depot/test-mercurial-import/a#1 - opened for edit | |
51 $ echo aa >> a | |
52 $ p4 submit -d "change a" | |
53 Submitting change 2. | |
54 Locking 1 files ... | |
55 edit //depot/test-mercurial-import/a#2 | |
56 Change 2 submitted. | |
57 | |
58 $ p4 edit b/c | |
59 //depot/test-mercurial-import/b/c#1 - opened for edit | |
60 $ echo cc >> b/c | |
61 $ p4 submit -d "change b/c" | |
62 Submitting change 3. | |
63 Locking 1 files ... | |
64 edit //depot/test-mercurial-import/b/c#2 | |
65 Change 3 submitted. | |
66 | |
67 convert | |
68 $ hg convert -s p4 $DEPOTPATH dst | |
69 initializing destination dst repository | |
70 reading p4 views | |
71 collecting p4 changelists | |
72 1 initial | |
73 2 change a | |
74 3 change b/c | |
75 scanning source... | |
76 sorting... | |
77 converting... | |
78 2 initial | |
79 1 change a | |
80 0 change b/c | |
81 $ hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n' | |
82 rev=2 desc="change b/c" tags="tip" files="b/c" | |
83 rev=1 desc="change a" tags="" files="a" | |
84 rev=0 desc="initial" tags="" files="a b/c" | |
85 | |
86 change some files | |
87 $ p4 edit a b/c | |
88 //depot/test-mercurial-import/a#2 - opened for edit | |
89 //depot/test-mercurial-import/b/c#2 - opened for edit | |
90 $ echo aaa >> a | |
91 $ echo ccc >> b/c | |
92 $ p4 submit -d "change a b/c" | |
93 Submitting change 4. | |
94 Locking 2 files ... | |
95 edit //depot/test-mercurial-import/a#3 | |
96 edit //depot/test-mercurial-import/b/c#3 | |
97 Change 4 submitted. | |
98 | |
99 convert again | |
100 $ hg convert -s p4 $DEPOTPATH dst | |
101 reading p4 views | |
102 collecting p4 changelists | |
103 1 initial | |
104 2 change a | |
105 3 change b/c | |
106 4 change a b/c | |
107 scanning source... | |
108 sorting... | |
109 converting... | |
110 0 change a b/c | |
111 $ hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n' | |
112 rev=3 desc="change a b/c" tags="tip" files="a b/c" | |
113 rev=2 desc="change b/c" tags="" files="b/c" | |
114 rev=1 desc="change a" tags="" files="a" | |
115 rev=0 desc="initial" tags="" files="a b/c" | |
116 | |
117 interesting names | |
118 $ echo dddd > "d d" | |
119 $ mkdir " e" | |
120 $ echo fff >" e/ f" | |
121 $ p4 add "d d" " e/ f" | |
122 //depot/test-mercurial-import/d d#1 - opened for add | |
123 //depot/test-mercurial-import/ e/ f#1 - opened for add | |
124 $ p4 submit -d "add d e f" | |
125 Submitting change 5. | |
126 Locking 2 files ... | |
127 add //depot/test-mercurial-import/ e/ f#1 | |
128 add //depot/test-mercurial-import/d d#1 | |
129 Change 5 submitted. | |
130 | |
131 convert again | |
132 $ hg convert -s p4 $DEPOTPATH dst | |
133 reading p4 views | |
134 collecting p4 changelists | |
135 1 initial | |
136 2 change a | |
137 3 change b/c | |
138 4 change a b/c | |
139 5 add d e f | |
140 scanning source... | |
141 sorting... | |
142 converting... | |
143 0 add d e f | |
144 $ hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n' | |
145 rev=4 desc="add d e f" tags="tip" files=" e/ f d d" | |
146 rev=3 desc="change a b/c" tags="" files="a b/c" | |
147 rev=2 desc="change b/c" tags="" files="b/c" | |
148 rev=1 desc="change a" tags="" files="a" | |
149 rev=0 desc="initial" tags="" files="a b/c" | |
150 | |
151 exit trap: | |
152 stopping the p4 server |