File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ # This script uses Git for Windows' remote-hg to mirror Mercurial repositories.
4+ # It is meant to be run as a Jenkins job.
5+
6+ set -e
7+
8+ GIT_HG=" $( cd ../../ && pwd) " /git-hg
9+ test -d " $GIT_HG " /src || {
10+ mkdir -p " $GIT_HG "
11+ git clone git://github.com/msysgit/git " $GIT_HG " /src
12+ }
13+ test -x " $GIT_HG " /bin/git || (
14+ if ! dpkg -l libcurl4-openssl-dev libexpat1-dev gettext mercurial \
15+ > /dev/null
16+ then
17+ echo " Missing packages" >&2
18+ exit 1
19+ fi
20+ cd " $GIT_HG " /src &&
21+ git checkout devel &&
22+ make install prefix=" $GIT_HG "
23+ )
24+
25+ export PATH=" $GIT_HG " /bin:$PATH
26+
27+ HG_URL=" $1 "
28+ shift
29+
30+ test -d .git || git init
31+ test a" hg::$HG_URL " = a" $( git config remote.origin.url) " ||
32+ git remote add --mirror=fetch origin hg::" $HG_URL "
33+
34+ git fetch origin
35+
36+ for url
37+ do
38+ git push --all " $url "
39+ git push --tags " $url "
40+ done
You can’t perform that action at this time.
0 commit comments