Mercurial > hg > mercurial-source
comparison tests/test-clone @ 9714:2f1ab7f77ddc
clone: add option -u/--updaterev
author | Adrian Buehlmann <adrian@cadifra.com> |
---|---|
date | Thu, 05 Nov 2009 11:05:13 +0100 |
parents | 6c82beaaa11a |
children | 2770d03ae49f |
comparison
equal
deleted
inserted
replaced
9713:d193cc97c4e8 | 9714:2f1ab7f77ddc |
---|---|
65 mkdir h | 65 mkdir h |
66 cd h | 66 cd h |
67 hg clone ../a . | 67 hg clone ../a . |
68 cd .. | 68 cd .. |
69 | 69 |
70 echo | |
71 echo | |
72 echo % "*** tests for option -u ***" | |
73 echo | |
74 | |
75 | |
76 echo | |
77 echo % "adding some more history to repo a" | |
78 cd a | |
79 echo % "tag ref1" | |
80 hg tag ref1 | |
81 echo the quick brown fox >a | |
82 hg ci -m "hacked default" | |
83 echo % "updating back to ref1" | |
84 hg up ref1 | |
85 echo | |
86 echo % "add branch 'stable' to repo a for later tests" | |
87 hg branch stable | |
88 echo some text >a | |
89 hg ci -m "starting branch stable" | |
90 echo % "tag ref2" | |
91 hg tag ref2 | |
92 echo some more text >a | |
93 hg ci -m "another change for branch stable" | |
94 echo | |
95 echo % "updating back to ref2" | |
96 hg up ref2 | |
97 echo | |
98 echo % "parents of repo a" | |
99 hg parents | |
100 echo | |
101 echo % "repo a has two heads" | |
102 hg heads | |
103 cd .. | |
104 | |
105 echo | |
106 echo % "testing clone -U -u 1 a ua (must abort)" | |
107 hg clone -U -u 1 a ua | |
108 | |
109 echo | |
110 echo % "testing clone -u . a ua" | |
111 hg clone -u . a ua | |
112 echo | |
113 echo % "repo ua has both heads" | |
114 hg -R ua heads | |
115 echo | |
116 echo % "same revision checked out in repo a and ua" | |
117 hg -R a parents --template "{node|short}\n" | |
118 hg -R ua parents --template "{node|short}\n" | |
119 rm -r ua | |
120 | |
121 echo | |
122 echo % "testing clone --pull -u . a ua" | |
123 hg clone --pull -u . a ua | |
124 echo | |
125 echo % "repo ua has both heads" | |
126 hg -R ua heads | |
127 echo | |
128 echo % "same revision checked out in repo a and ua" | |
129 hg -R a parents --template "{node|short}\n" | |
130 hg -R ua parents --template "{node|short}\n" | |
131 rm -r ua | |
132 | |
133 echo | |
134 echo % "testing clone -u stable a ua" | |
135 hg clone -u stable a ua | |
136 echo | |
137 echo % "repo ua has both heads" | |
138 hg -R ua heads | |
139 echo | |
140 echo % "branch stable is checked out" | |
141 hg -R ua parents | |
142 rm -r ua | |
143 | |
144 echo | |
145 echo % "testing clone a ua" | |
146 hg clone a ua | |
147 echo | |
148 echo % "repo ua has both heads" | |
149 hg -R ua heads | |
150 echo | |
151 echo % "branch default is checked out" | |
152 hg -R ua parents | |
153 rm -r ua | |
154 | |
155 echo | |
156 echo % "testing clone -u . a#stable ua" | |
157 hg clone -u . a#stable ua | |
158 echo | |
159 echo % "repo ua has only branch stable" | |
160 hg -R ua heads | |
161 echo | |
162 echo % "same revision checked out in repo a and ua" | |
163 hg -R a parents --template "{node|short}\n" | |
164 hg -R ua parents --template "{node|short}\n" | |
165 rm -r ua | |
166 | |
167 echo | |
168 echo % "testing clone -u . -r stable a ua" | |
169 hg clone -u . -r stable a ua | |
170 echo | |
171 echo % "repo ua has only branch stable" | |
172 hg -R ua heads | |
173 echo | |
174 echo % "same revision checked out in repo a and ua" | |
175 hg -R a parents --template "{node|short}\n" | |
176 hg -R ua parents --template "{node|short}\n" | |
177 rm -r ua | |
178 | |
179 echo | |
180 echo % "testing clone -r stable a ua" | |
181 hg clone -r stable a ua | |
182 echo | |
183 echo % "repo ua has only branch stable" | |
184 hg -R ua heads | |
185 echo | |
186 echo % "branch stable is checked out" | |
187 hg -R ua parents | |
188 rm -r ua | |
189 | |
190 echo | |
191 echo % "testing clone -u . -r stable -r default a ua" | |
192 hg clone -u . -r stable -r default a ua | |
193 echo | |
194 echo % "repo ua has two heads" | |
195 hg -R ua heads | |
196 echo | |
197 echo % "same revision checked out in repo a and ua" | |
198 hg -R a parents --template "{node|short}\n" | |
199 hg -R ua parents --template "{node|short}\n" | |
200 rm -r ua | |
201 | |
70 exit 0 | 202 exit 0 |