1#!/bin/sh
2cd `dirname "$0"`
3mtn sy
4if [ ! -d .git ]; then
5 git init # --initial-branch=trunk # not yet supported on WSL
6 git checkout -b trunk
7 git remote add origin git@github.com:lapo-luchini/asn1js.git
8 rm git-marks1.txt git-marks2.txt
9fi
10touch git-marks1.txt git-marks2.txt
11[ -f git-authors.txt ] || echo 'lapo@lapo.it = Lapo Luchini <lapo@lapo.it>' > git-authors.txt
12mtn ls branches --ignore-suspend-certs | sort -V | awk -F . '{ print $0 " = " ($4 ? $4 : "trunk") }' > git-branches.txt
13mtn --quiet --authors=git-authors.txt --branches-file=git-branches.txt --import-marks=git-marks1.txt --export-marks=git-marks1.txt git_export | \
14 git fast-import --import-marks=git-marks2.txt --export-marks=git-marks2.txt
15git push --mirror origin
16git reset # to update working copy state (doesn't change files)