Page MenuHomePhabricator
Paste P4906

page-history-xml dump to non-bare git repo
ActivePublic

Authored by Lokal_Profil on Feb 7 2017, 11:12 AM.
#!/usr/bin/env bash
target_dir=repo
git_dir="$target_dir"/.git
infile=""
if [ -n "$1" ];
then
infile="$1"
else
echo "Give page history xml file as first parameter"
exit
fi
rm -rf $target_dir
mkdir $target_dir
cd $target_dir || exit
git init
cd .. || exit
(./levitation.py -w --only-blobs \
| GIT_DIR=$git_dir git fast-import \
--import-marks-if-exists=.import-mark \
--export-marks=.import-mark ) < "$infile"
./levitation.py -w \
| GIT_DIR=$git_dir git fast-import --import-marks=.import-mark
GIT_DIR=$git_dir git gc
rm meta.pkl
rm .import-*
cd $target_dir || exit
git checkout
cd .. || exit

Event Timeline

This requires https://github.com/cscorley/levitation and pages exported (with history) from Special:Export and should be run from a checked out version of that repo