[oe-commits] org.oe.dev mtn2git: Add an example script that can be used to update the git mirror
freyther commit
oe at amethyst.openembedded.net
Mon Mar 31 16:07:40 UTC 2008
mtn2git: Add an example script that can be used to update the git mirror
This is an example as it is using relative paths and needs some changes
to work for you.
It assumes that you have a git repository (git-init was ran) and then
will update it there. Before each update it will clone the git repository
and copy the old state files into the repository. So in case something
goes wrong you can do a post mortom. The state files are relatively small
and the git repository is working with hardlinks so it does not even take
too much space.
On first pull you need to run git-repack or git-gc
Author: freyther at openembedded.org
Branch: org.openembedded.dev
Revision: 774a9654f13013fc4f169930d4cfec26a95b97e5
ViewMTN: http://monotone.openembedded.org/revision/info/774a9654f13013fc4f169930d4cfec26a95b97e5
Files:
1
contrib/mtn2git/update-script.example
Diffs:
#
# mt diff -r66d3e4d8cef1bda054ca920f51dabfa57f252141 -r774a9654f13013fc4f169930d4cfec26a95b97e5
#
#
#
# add_file "contrib/mtn2git/update-script.example"
# content [9f8caa85b400e9a7af49d8714a42648ffc346027]
#
============================================================
--- contrib/mtn2git/update-script.example 9f8caa85b400e9a7af49d8714a42648ffc346027
+++ contrib/mtn2git/update-script.example 9f8caa85b400e9a7af49d8714a42648ffc346027
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+export PATH=/home/zecke/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
+
+cd $HOME/mtn2git-scm/oe-convert/
+
+# Update monotone
+mtn --db ../OE.mtn pull monotone.linuxtogo.org "org.openembedded.*"
+
+OLD_OE_DIR=openembedded-git.$$.$RANDOM
+
+git-clone -l openembedded-git $OLD_OE_DIR
+cp git-import-marks2 $OLD_OE_DIR/
+cp mtn2git-status.v2 $OLD_OE_DIR/
+cp mtn2git-marks $OLD_OE_DIR/
+
+cd openembedded-git
+# Convert (this could fail as our marks are not complete...) and we hardcode the revision
+#../../mtn2git/mtn2git.py --db ../../OE.mtn --marks=../mtn2git-marks --status=../mtn2git-status.v2 2> /dev/null | git-fast-import --date-format=rfc2822 --import-marks=../git-import-marks2 --export-marks=../git-import-marks2
+../../mtn2git/mtn2git.py --db ../../OE.mtn --marks=../mtn2git-marks --status=../mtn2git-status.v2 | git-fast-import --date-format=rfc2822 --import-marks=../git-import-marks2 --export-marks=../git-import-marks2
+
+
+
+# Push all changes to the server, update the master tag as well
+for branch in dev dreambox documentation oetest oz354x packaged-staging oz354fam083 angstrom-2007.12-stable entity stable;
+do
+ git-push --force git+ssh://ABC@repo.or.cz/srv/git/org.openembedded.dev.git org.openembedded.$branch;
+done
+
+#dev is our master
+git-push --force git+ssh://ABC@repo.or.cz/srv/git/org.openembedded.dev.git org.openembedded.dev:master;
+
More information about the Openembedded-commits
mailing list