5 # fast-import with error handling
7 "$cfg_basedir"/bin
/darcs-fast-export
--export-marks=$
(pwd)/dfe-marks
--import-marks=$
(pwd)/dfe-marks
"$1" | \
8 git fast-import
--export-marks=$
(pwd)/gfi-marks
--import-marks=$
(pwd)/gfi-marks
9 [ ${PIPESTATUS[0]} = 0 -a ${PIPESTATUS[1]} = 0 ]
16 cd "$cfg_reporoot/$proj.git"
18 if check_interval lastrefresh
$cfg_min_mirror_interval; then
19 progress
"= [$proj] update skip (last at $(config_get lastrefresh))"
22 progress
"+ [$proj] update (`date`)"
28 url
="$(config_get baseurl)"
29 mail="$(config_get owner)"
31 bang git for-each-ref
--format '%(refname) %(objectname)' >.refs-before
35 GIT_DIR
=. bang git svn fetch
36 GIT_DIR
=. bang git fetch
39 httpurl
="${url/darcs:\/\//http://}"
40 bang git_darcs_fetch
"$httpurl"
43 [ "$url" = "$(config_get remote.origin.url)" ] || bang config_set_raw remote.origin.url
"$url"
44 bang git remote update
45 bang git remote prune origin
49 bang git update-server-info
50 bang config_set lastrefresh
"$(date -R)"
52 # Look at which refs changed and trigger ref-change for these
53 bang git for-each-ref
--format '%(refname) %(objectname)' >.refs-after
54 sockpath
="$cfg_chroot/etc/taskd.socket"
55 if [ -S "$sockpath" ] && ! cmp -s .refs-before .refs-after
; then
56 join -j 1 .refs-before .refs-after |
57 while read ref old new
; do
58 [ "$old" != "$new" ] ||
continue
59 echo "ref-change -1 $proj $old $new $ref" | nc.openbsd
-w 1 -U "$sockpath"
61 join -j 1 -v 1 .refs-before .refs-after |
62 while read ref old
; do
63 echo "ref-change -1 $proj $old 0000000000000000000000000000000000000000 $ref" | nc.openbsd
-w 1 -U "$sockpath"
65 join -j 1 -v 2 .refs-before .refs-after |
66 while read ref new
; do
67 echo "ref-change -1 $proj 0000000000000000000000000000000000000000 $new $ref" | nc.openbsd
-w 1 -U "$sockpath"
71 rm -f .refs-before .refs-after
73 if [ -e .banged
]; then
74 echo "$proj update succeeded - failure recovery" |
mail -s "[$cfg_name] $proj update succeeded" "$mail,$cfg_admin"
78 progress
"- [$proj] update (`date`)"