remote-hg: ensure remote rebasing works

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Felipe Contreras committed May 24, 2013 at 21:29 UTC 9529cce86e508d1910395d7493b7b8706ea7cd37
2 files changed +41
contrib/remote-helpers/git-remote-hg
+1
@@ -621,6 +621,7 @@ def do_import(parser):
621 if os.path.exists(path):
622 print "feature import-marks=%s" % path
623 print "feature export-marks=%s" % path
624 + print "feature force"
625 sys.stdout.flush()
626
627 tmp = encoding.encoding
contrib/remote-helpers/test-hg.sh
+40
@@ -37,6 +37,8 @@ setup () {
37 (
38 echo "[ui]"
39 echo "username = H G Wells <wells@example.com>"
40 + echo "[extensions]"
41 + echo "mq ="
42 ) >> "$HOME"/.hgrc
43 }
44
@@ -161,4 +163,42 @@ test_expect_success 'authors' '
163 test_cmp expected actual
164 '
165
166 +test_expect_success 'strip' '
167 + test_when_finished "rm -rf hgrepo gitrepo" &&
168 +
169 + (
170 + hg init hgrepo &&
171 + cd hgrepo &&
172 +
173 + echo one >> content &&
174 + hg add content &&
175 + hg commit -m one &&
176 +
177 + echo two >> content &&
178 + hg commit -m two
179 + ) &&
180 +
181 + git clone "hg::hgrepo" gitrepo &&
182 +
183 + (
184 + cd hgrepo &&
185 + hg strip 1 &&
186 +
187 + echo three >> content &&
188 + hg commit -m three &&
189 +
190 + echo four >> content &&
191 + hg commit -m four
192 + ) &&
193 +
194 + (
195 + cd gitrepo &&
196 + git fetch &&
197 + git log --format="%s" origin/master > ../actual
198 + ) &&
199 +
200 + hg -R hgrepo log --template "{desc}\n" > expected &&
201 + test_cmp actual expected
202 +'
203 +
204 test_done