PageRenderTime 2819ms CodeModel.GetById 21ms RepoModel.GetById 2ms app.codeStats 0ms

/contrib/remote-helpers/test-hg.sh

https://gitlab.com/nmusco/git
Shell | 848 lines | 781 code | 58 blank | 9 comment | 16 complexity | 23b1c77ce3544a754bf9c74bae195dca MD5 | raw file
  1. #!/bin/sh
  2. #
  3. # Copyright (c) 2012 Felipe Contreras
  4. #
  5. # Base commands from hg-git tests:
  6. # https://bitbucket.org/durin42/hg-git/src
  7. #
  8. test_description='Test remote-hg'
  9. test -n "$TEST_DIRECTORY" || TEST_DIRECTORY=${0%/*}/../../t
  10. . "$TEST_DIRECTORY"/test-lib.sh
  11. if ! test_have_prereq PYTHON
  12. then
  13. skip_all='skipping remote-hg tests; python not available'
  14. test_done
  15. fi
  16. if ! python -c 'import mercurial'
  17. then
  18. skip_all='skipping remote-hg tests; mercurial not available'
  19. test_done
  20. fi
  21. check () {
  22. echo $3 >expected &&
  23. git --git-dir=$1/.git log --format='%s' -1 $2 >actual
  24. test_cmp expected actual
  25. }
  26. check_branch () {
  27. if test -n "$3"
  28. then
  29. echo $3 >expected &&
  30. hg -R $1 log -r $2 --template '{desc}\n' >actual &&
  31. test_cmp expected actual
  32. else
  33. hg -R $1 branches >out &&
  34. ! grep $2 out
  35. fi
  36. }
  37. check_bookmark () {
  38. if test -n "$3"
  39. then
  40. echo $3 >expected &&
  41. hg -R $1 log -r "bookmark('$2')" --template '{desc}\n' >actual &&
  42. test_cmp expected actual
  43. else
  44. hg -R $1 bookmarks >out &&
  45. ! grep $2 out
  46. fi
  47. }
  48. check_push () {
  49. expected_ret=$1 ret=0 ref_ret=0
  50. shift
  51. git push origin "$@" 2>error
  52. ret=$?
  53. cat error
  54. while IFS=':' read branch kind
  55. do
  56. case "$kind" in
  57. 'new')
  58. grep "^ \* \[new branch\] *${branch} -> ${branch}$" error || ref_ret=1
  59. ;;
  60. 'non-fast-forward')
  61. grep "^ ! \[rejected\] *${branch} -> ${branch} (non-fast-forward)$" error || ref_ret=1
  62. ;;
  63. 'fetch-first')
  64. grep "^ ! \[rejected\] *${branch} -> ${branch} (fetch first)$" error || ref_ret=1
  65. ;;
  66. 'forced-update')
  67. grep "^ + [a-f0-9]*\.\.\.[a-f0-9]* *${branch} -> ${branch} (forced update)$" error || ref_ret=1
  68. ;;
  69. '')
  70. grep "^ [a-f0-9]*\.\.[a-f0-9]* *${branch} -> ${branch}$" error || ref_ret=1
  71. ;;
  72. esac
  73. test $ref_ret -ne 0 && echo "match for '$branch' failed" && break
  74. done
  75. if test $expected_ret -ne $ret || test $ref_ret -ne 0
  76. then
  77. return 1
  78. fi
  79. return 0
  80. }
  81. setup () {
  82. (
  83. echo "[ui]"
  84. echo "username = H G Wells <wells@example.com>"
  85. echo "[extensions]"
  86. echo "mq ="
  87. ) >>"$HOME"/.hgrc &&
  88. GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0230" &&
  89. GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE" &&
  90. export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
  91. }
  92. setup
  93. test_expect_success 'cloning' '
  94. test_when_finished "rm -rf gitrepo*" &&
  95. (
  96. hg init hgrepo &&
  97. cd hgrepo &&
  98. echo zero >content &&
  99. hg add content &&
  100. hg commit -m zero
  101. ) &&
  102. git clone "hg::hgrepo" gitrepo &&
  103. check gitrepo HEAD zero
  104. '
  105. test_expect_success 'cloning with branches' '
  106. test_when_finished "rm -rf gitrepo*" &&
  107. (
  108. cd hgrepo &&
  109. hg branch next &&
  110. echo next >content &&
  111. hg commit -m next
  112. ) &&
  113. git clone "hg::hgrepo" gitrepo &&
  114. check gitrepo origin/branches/next next
  115. '
  116. test_expect_success 'cloning with bookmarks' '
  117. test_when_finished "rm -rf gitrepo*" &&
  118. (
  119. cd hgrepo &&
  120. hg checkout default &&
  121. hg bookmark feature-a &&
  122. echo feature-a >content &&
  123. hg commit -m feature-a
  124. ) &&
  125. git clone "hg::hgrepo" gitrepo &&
  126. check gitrepo origin/feature-a feature-a
  127. '
  128. test_expect_success 'update bookmark' '
  129. test_when_finished "rm -rf gitrepo*" &&
  130. (
  131. cd hgrepo &&
  132. hg bookmark devel
  133. ) &&
  134. (
  135. git clone "hg::hgrepo" gitrepo &&
  136. cd gitrepo &&
  137. git checkout --quiet devel &&
  138. echo devel >content &&
  139. git commit -a -m devel &&
  140. git push --quiet
  141. ) &&
  142. check_bookmark hgrepo devel devel
  143. '
  144. test_expect_success 'new bookmark' '
  145. test_when_finished "rm -rf gitrepo*" &&
  146. (
  147. git clone "hg::hgrepo" gitrepo &&
  148. cd gitrepo &&
  149. git checkout --quiet -b feature-b &&
  150. echo feature-b >content &&
  151. git commit -a -m feature-b &&
  152. git push --quiet origin feature-b
  153. ) &&
  154. check_bookmark hgrepo feature-b feature-b
  155. '
  156. # cleanup previous stuff
  157. rm -rf hgrepo
  158. author_test () {
  159. echo $1 >>content &&
  160. hg commit -u "$2" -m "add $1" &&
  161. echo "$3" >>../expected
  162. }
  163. test_expect_success 'authors' '
  164. test_when_finished "rm -rf hgrepo gitrepo" &&
  165. (
  166. hg init hgrepo &&
  167. cd hgrepo &&
  168. touch content &&
  169. hg add content &&
  170. >../expected &&
  171. author_test alpha "" "H G Wells <wells@example.com>" &&
  172. author_test beta "beta" "beta <unknown>" &&
  173. author_test gamma "gamma <test@example.com> (comment)" "gamma <test@example.com>" &&
  174. author_test delta "<delta@example.com>" "Unknown <delta@example.com>" &&
  175. author_test epsilon "epsilon<test@example.com>" "epsilon <test@example.com>" &&
  176. author_test zeta "zeta <test@example.com" "zeta <test@example.com>" &&
  177. author_test eta " eta " "eta <unknown>" &&
  178. author_test theta "theta < test@example.com >" "theta <test@example.com>" &&
  179. author_test iota "iota >test@example.com>" "iota <test@example.com>" &&
  180. author_test kappa "kappa < test <at> example <dot> com>" "kappa <unknown>" &&
  181. author_test lambda "lambda@example.com" "Unknown <lambda@example.com>" &&
  182. author_test mu "mu.mu@example.com" "Unknown <mu.mu@example.com>"
  183. ) &&
  184. git clone "hg::hgrepo" gitrepo &&
  185. git --git-dir=gitrepo/.git log --reverse --format="%an <%ae>" >actual &&
  186. test_cmp expected actual
  187. '
  188. test_expect_success 'strip' '
  189. test_when_finished "rm -rf hgrepo gitrepo" &&
  190. (
  191. hg init hgrepo &&
  192. cd hgrepo &&
  193. echo one >>content &&
  194. hg add content &&
  195. hg commit -m one &&
  196. echo two >>content &&
  197. hg commit -m two
  198. ) &&
  199. git clone "hg::hgrepo" gitrepo &&
  200. (
  201. cd hgrepo &&
  202. hg strip 1 &&
  203. echo three >>content &&
  204. hg commit -m three &&
  205. echo four >>content &&
  206. hg commit -m four
  207. ) &&
  208. (
  209. cd gitrepo &&
  210. git fetch &&
  211. git log --format="%s" origin/master >../actual
  212. ) &&
  213. hg -R hgrepo log --template "{desc}\n" >expected &&
  214. test_cmp actual expected
  215. '
  216. test_expect_success 'remote push with master bookmark' '
  217. test_when_finished "rm -rf hgrepo gitrepo*" &&
  218. (
  219. hg init hgrepo &&
  220. cd hgrepo &&
  221. echo zero >content &&
  222. hg add content &&
  223. hg commit -m zero &&
  224. hg bookmark master &&
  225. echo one >content &&
  226. hg commit -m one
  227. ) &&
  228. (
  229. git clone "hg::hgrepo" gitrepo &&
  230. cd gitrepo &&
  231. echo two >content &&
  232. git commit -a -m two &&
  233. git push
  234. ) &&
  235. check_branch hgrepo default two
  236. '
  237. cat >expected <<\EOF
  238. changeset: 0:6e2126489d3d
  239. tag: tip
  240. user: A U Thor <author@example.com>
  241. date: Mon Jan 01 00:00:00 2007 +0230
  242. summary: one
  243. EOF
  244. test_expect_success 'remote push from master branch' '
  245. test_when_finished "rm -rf hgrepo gitrepo*" &&
  246. hg init hgrepo &&
  247. (
  248. git init gitrepo &&
  249. cd gitrepo &&
  250. git remote add origin "hg::../hgrepo" &&
  251. echo one >content &&
  252. git add content &&
  253. git commit -a -m one &&
  254. git push origin master
  255. ) &&
  256. hg -R hgrepo log >actual &&
  257. cat actual &&
  258. test_cmp expected actual &&
  259. check_branch hgrepo default one
  260. '
  261. GIT_REMOTE_HG_TEST_REMOTE=1
  262. export GIT_REMOTE_HG_TEST_REMOTE
  263. test_expect_success 'remote cloning' '
  264. test_when_finished "rm -rf gitrepo*" &&
  265. (
  266. hg init hgrepo &&
  267. cd hgrepo &&
  268. echo zero >content &&
  269. hg add content &&
  270. hg commit -m zero
  271. ) &&
  272. git clone "hg::hgrepo" gitrepo &&
  273. check gitrepo HEAD zero
  274. '
  275. test_expect_success 'moving remote clone' '
  276. test_when_finished "rm -rf gitrepo*" &&
  277. (
  278. git clone "hg::hgrepo" gitrepo &&
  279. mv gitrepo gitrepo2 &&
  280. cd gitrepo2 &&
  281. git fetch
  282. )
  283. '
  284. test_expect_success 'remote update bookmark' '
  285. test_when_finished "rm -rf gitrepo*" &&
  286. (
  287. cd hgrepo &&
  288. hg bookmark devel
  289. ) &&
  290. (
  291. git clone "hg::hgrepo" gitrepo &&
  292. cd gitrepo &&
  293. git checkout --quiet devel &&
  294. echo devel >content &&
  295. git commit -a -m devel &&
  296. git push --quiet
  297. ) &&
  298. check_bookmark hgrepo devel devel
  299. '
  300. test_expect_success 'remote new bookmark' '
  301. test_when_finished "rm -rf gitrepo*" &&
  302. (
  303. git clone "hg::hgrepo" gitrepo &&
  304. cd gitrepo &&
  305. git checkout --quiet -b feature-b &&
  306. echo feature-b >content &&
  307. git commit -a -m feature-b &&
  308. git push --quiet origin feature-b
  309. ) &&
  310. check_bookmark hgrepo feature-b feature-b
  311. '
  312. test_expect_success 'remote push diverged' '
  313. test_when_finished "rm -rf gitrepo*" &&
  314. git clone "hg::hgrepo" gitrepo &&
  315. (
  316. cd hgrepo &&
  317. hg checkout default &&
  318. echo bump >content &&
  319. hg commit -m bump
  320. ) &&
  321. (
  322. cd gitrepo &&
  323. echo diverge >content &&
  324. git commit -a -m diverged &&
  325. check_push 1 <<-\EOF
  326. master:non-fast-forward
  327. EOF
  328. ) &&
  329. check_branch hgrepo default bump
  330. '
  331. test_expect_success 'remote update bookmark diverge' '
  332. test_when_finished "rm -rf gitrepo*" &&
  333. (
  334. cd hgrepo &&
  335. hg checkout tip^ &&
  336. hg bookmark diverge
  337. ) &&
  338. git clone "hg::hgrepo" gitrepo &&
  339. (
  340. cd hgrepo &&
  341. echo "bump bookmark" >content &&
  342. hg commit -m "bump bookmark"
  343. ) &&
  344. (
  345. cd gitrepo &&
  346. git checkout --quiet diverge &&
  347. echo diverge >content &&
  348. git commit -a -m diverge &&
  349. check_push 1 <<-\EOF
  350. diverge:fetch-first
  351. EOF
  352. ) &&
  353. check_bookmark hgrepo diverge "bump bookmark"
  354. '
  355. test_expect_success 'remote new bookmark multiple branch head' '
  356. test_when_finished "rm -rf gitrepo*" &&
  357. (
  358. git clone "hg::hgrepo" gitrepo &&
  359. cd gitrepo &&
  360. git checkout --quiet -b feature-c HEAD^ &&
  361. echo feature-c >content &&
  362. git commit -a -m feature-c &&
  363. git push --quiet origin feature-c
  364. ) &&
  365. check_bookmark hgrepo feature-c feature-c
  366. '
  367. # cleanup previous stuff
  368. rm -rf hgrepo
  369. test_expect_success 'fetch special filenames' '
  370. test_when_finished "rm -rf hgrepo gitrepo && LC_ALL=C" &&
  371. LC_ALL=en_US.UTF-8
  372. export LC_ALL
  373. (
  374. hg init hgrepo &&
  375. cd hgrepo &&
  376. echo test >> "æ rø" &&
  377. hg add "æ rø" &&
  378. echo test >> "ø~?" &&
  379. hg add "ø~?" &&
  380. hg commit -m add-utf-8 &&
  381. echo test >> "æ rø" &&
  382. hg commit -m test-utf-8 &&
  383. hg rm "ø~?" &&
  384. hg mv "æ rø" "ø~?" &&
  385. hg commit -m hg-mv-utf-8
  386. ) &&
  387. (
  388. git clone "hg::hgrepo" gitrepo &&
  389. cd gitrepo &&
  390. git -c core.quotepath=false ls-files > ../actual
  391. ) &&
  392. echo "ø~?" > expected &&
  393. test_cmp expected actual
  394. '
  395. test_expect_success 'push special filenames' '
  396. test_when_finished "rm -rf hgrepo gitrepo && LC_ALL=C" &&
  397. mkdir -p tmp && cd tmp &&
  398. LC_ALL=en_US.UTF-8
  399. export LC_ALL
  400. (
  401. hg init hgrepo &&
  402. cd hgrepo &&
  403. echo one >> content &&
  404. hg add content &&
  405. hg commit -m one
  406. ) &&
  407. (
  408. git clone "hg::hgrepo" gitrepo &&
  409. cd gitrepo &&
  410. echo test >> "æ rø" &&
  411. git add "æ rø" &&
  412. git commit -m utf-8 &&
  413. git push
  414. ) &&
  415. (cd hgrepo &&
  416. hg update &&
  417. hg manifest > ../actual
  418. ) &&
  419. printf "content\næ rø\n" > expected &&
  420. test_cmp expected actual
  421. '
  422. setup_big_push () {
  423. (
  424. hg init hgrepo &&
  425. cd hgrepo &&
  426. echo zero >content &&
  427. hg add content &&
  428. hg commit -m zero &&
  429. hg bookmark bad_bmark1 &&
  430. echo one >content &&
  431. hg commit -m one &&
  432. hg bookmark bad_bmark2 &&
  433. hg bookmark good_bmark &&
  434. hg bookmark -i good_bmark &&
  435. hg -q branch good_branch &&
  436. echo "good branch" >content &&
  437. hg commit -m "good branch" &&
  438. hg -q branch bad_branch &&
  439. echo "bad branch" >content &&
  440. hg commit -m "bad branch"
  441. ) &&
  442. git clone "hg::hgrepo" gitrepo &&
  443. (
  444. cd gitrepo &&
  445. echo two >content &&
  446. git commit -q -a -m two &&
  447. git checkout -q good_bmark &&
  448. echo three >content &&
  449. git commit -q -a -m three &&
  450. git checkout -q bad_bmark1 &&
  451. git reset --hard HEAD^ &&
  452. echo four >content &&
  453. git commit -q -a -m four &&
  454. git checkout -q bad_bmark2 &&
  455. git reset --hard HEAD^ &&
  456. echo five >content &&
  457. git commit -q -a -m five &&
  458. git checkout -q -b new_bmark master &&
  459. echo six >content &&
  460. git commit -q -a -m six &&
  461. git checkout -q branches/good_branch &&
  462. echo seven >content &&
  463. git commit -q -a -m seven &&
  464. echo eight >content &&
  465. git commit -q -a -m eight &&
  466. git checkout -q branches/bad_branch &&
  467. git reset --hard HEAD^ &&
  468. echo nine >content &&
  469. git commit -q -a -m nine &&
  470. git checkout -q -b branches/new_branch master &&
  471. echo ten >content &&
  472. git commit -q -a -m ten
  473. )
  474. }
  475. test_expect_success 'remote big push' '
  476. test_when_finished "rm -rf hgrepo gitrepo*" &&
  477. setup_big_push
  478. (
  479. cd gitrepo &&
  480. check_push 1 --all <<-\EOF
  481. master
  482. good_bmark
  483. branches/good_branch
  484. new_bmark:new
  485. branches/new_branch:new
  486. bad_bmark1:non-fast-forward
  487. bad_bmark2:non-fast-forward
  488. branches/bad_branch:non-fast-forward
  489. EOF
  490. ) &&
  491. check_branch hgrepo default one &&
  492. check_branch hgrepo good_branch "good branch" &&
  493. check_branch hgrepo bad_branch "bad branch" &&
  494. check_branch hgrepo new_branch '' &&
  495. check_bookmark hgrepo good_bmark one &&
  496. check_bookmark hgrepo bad_bmark1 one &&
  497. check_bookmark hgrepo bad_bmark2 one &&
  498. check_bookmark hgrepo new_bmark ''
  499. '
  500. test_expect_success 'remote big push fetch first' '
  501. test_when_finished "rm -rf hgrepo gitrepo*" &&
  502. (
  503. hg init hgrepo &&
  504. cd hgrepo &&
  505. echo zero >content &&
  506. hg add content &&
  507. hg commit -m zero &&
  508. hg bookmark bad_bmark &&
  509. hg bookmark good_bmark &&
  510. hg bookmark -i good_bmark &&
  511. hg -q branch good_branch &&
  512. echo "good branch" >content &&
  513. hg commit -m "good branch" &&
  514. hg -q branch bad_branch &&
  515. echo "bad branch" >content &&
  516. hg commit -m "bad branch"
  517. ) &&
  518. git clone "hg::hgrepo" gitrepo &&
  519. (
  520. cd hgrepo &&
  521. hg bookmark -f bad_bmark &&
  522. echo update_bmark >content &&
  523. hg commit -m "update bmark"
  524. ) &&
  525. (
  526. cd gitrepo &&
  527. echo two >content &&
  528. git commit -q -a -m two &&
  529. git checkout -q good_bmark &&
  530. echo three >content &&
  531. git commit -q -a -m three &&
  532. git checkout -q bad_bmark &&
  533. echo four >content &&
  534. git commit -q -a -m four &&
  535. git checkout -q branches/bad_branch &&
  536. echo five >content &&
  537. git commit -q -a -m five &&
  538. check_push 1 --all <<-\EOF &&
  539. master
  540. good_bmark
  541. bad_bmark:fetch-first
  542. branches/bad_branch:festch-first
  543. EOF
  544. git fetch &&
  545. check_push 1 --all <<-\EOF
  546. master
  547. good_bmark
  548. bad_bmark:non-fast-forward
  549. branches/bad_branch:non-fast-forward
  550. EOF
  551. )
  552. '
  553. test_expect_success 'remote big push force' '
  554. test_when_finished "rm -rf hgrepo gitrepo*" &&
  555. setup_big_push
  556. (
  557. cd gitrepo &&
  558. check_push 0 --force --all <<-\EOF
  559. master
  560. good_bmark
  561. branches/good_branch
  562. new_bmark:new
  563. branches/new_branch:new
  564. bad_bmark1:forced-update
  565. bad_bmark2:forced-update
  566. branches/bad_branch:forced-update
  567. EOF
  568. ) &&
  569. check_branch hgrepo default six &&
  570. check_branch hgrepo good_branch eight &&
  571. check_branch hgrepo bad_branch nine &&
  572. check_branch hgrepo new_branch ten &&
  573. check_bookmark hgrepo good_bmark three &&
  574. check_bookmark hgrepo bad_bmark1 four &&
  575. check_bookmark hgrepo bad_bmark2 five &&
  576. check_bookmark hgrepo new_bmark six
  577. '
  578. test_expect_success 'remote big push dry-run' '
  579. test_when_finished "rm -rf hgrepo gitrepo*" &&
  580. setup_big_push
  581. (
  582. cd gitrepo &&
  583. check_push 1 --dry-run --all <<-\EOF &&
  584. master
  585. good_bmark
  586. branches/good_branch
  587. new_bmark:new
  588. branches/new_branch:new
  589. bad_bmark1:non-fast-forward
  590. bad_bmark2:non-fast-forward
  591. branches/bad_branch:non-fast-forward
  592. EOF
  593. check_push 0 --dry-run master good_bmark new_bmark branches/good_branch branches/new_branch <<-\EOF
  594. master
  595. good_bmark
  596. branches/good_branch
  597. new_bmark:new
  598. branches/new_branch:new
  599. EOF
  600. ) &&
  601. check_branch hgrepo default one &&
  602. check_branch hgrepo good_branch "good branch" &&
  603. check_branch hgrepo bad_branch "bad branch" &&
  604. check_branch hgrepo new_branch '' &&
  605. check_bookmark hgrepo good_bmark one &&
  606. check_bookmark hgrepo bad_bmark1 one &&
  607. check_bookmark hgrepo bad_bmark2 one &&
  608. check_bookmark hgrepo new_bmark ''
  609. '
  610. test_expect_success 'remote double failed push' '
  611. test_when_finished "rm -rf hgrepo gitrepo*" &&
  612. (
  613. hg init hgrepo &&
  614. cd hgrepo &&
  615. echo zero >content &&
  616. hg add content &&
  617. hg commit -m zero &&
  618. echo one >content &&
  619. hg commit -m one
  620. ) &&
  621. (
  622. git clone "hg::hgrepo" gitrepo &&
  623. cd gitrepo &&
  624. git reset --hard HEAD^ &&
  625. echo two >content &&
  626. git commit -a -m two &&
  627. test_expect_code 1 git push &&
  628. test_expect_code 1 git push
  629. )
  630. '
  631. test_expect_success 'clone remote with master null bookmark, then push to the bookmark' '
  632. test_when_finished "rm -rf gitrepo* hgrepo*" &&
  633. hg init hgrepo &&
  634. (
  635. cd hgrepo &&
  636. echo a >a &&
  637. hg add a &&
  638. hg commit -m a &&
  639. hg bookmark -r null master
  640. ) &&
  641. git clone "hg::hgrepo" gitrepo &&
  642. check gitrepo HEAD a &&
  643. (
  644. cd gitrepo &&
  645. git checkout --quiet -b master &&
  646. echo b >b &&
  647. git add b &&
  648. git commit -m b &&
  649. git push origin master
  650. )
  651. '
  652. test_expect_success 'clone remote with default null bookmark, then push to the bookmark' '
  653. test_when_finished "rm -rf gitrepo* hgrepo*" &&
  654. hg init hgrepo &&
  655. (
  656. cd hgrepo &&
  657. echo a >a &&
  658. hg add a &&
  659. hg commit -m a &&
  660. hg bookmark -r null -f default
  661. ) &&
  662. git clone "hg::hgrepo" gitrepo &&
  663. check gitrepo HEAD a &&
  664. (
  665. cd gitrepo &&
  666. git checkout --quiet -b default &&
  667. echo b >b &&
  668. git add b &&
  669. git commit -m b &&
  670. git push origin default
  671. )
  672. '
  673. test_expect_success 'clone remote with generic null bookmark, then push to the bookmark' '
  674. test_when_finished "rm -rf gitrepo* hgrepo*" &&
  675. hg init hgrepo &&
  676. (
  677. cd hgrepo &&
  678. echo a >a &&
  679. hg add a &&
  680. hg commit -m a &&
  681. hg bookmark -r null bmark
  682. ) &&
  683. git clone "hg::hgrepo" gitrepo &&
  684. check gitrepo HEAD a &&
  685. (
  686. cd gitrepo &&
  687. git checkout --quiet -b bmark &&
  688. git remote -v &&
  689. echo b >b &&
  690. git add b &&
  691. git commit -m b &&
  692. git push origin bmark
  693. )
  694. '
  695. test_done