view tests/test-repair-strip @ 14050:9e8a9d45945c stable

subrepo: handle svn tracked/unknown directory collisions This happens more often than expected. Say you have an svn subrepository with python code. Python would have generated unknown .pyc files. Now, you rebase this setup on a revision where a directory containing python code does not exist. Subversion is first asked to remove this directory when updating, but will not because it contains untracked items. Then it will have to bring back the directory after the merge but will fail because it now collides with an untracked directory. Using --force is not very elegant and only works with svn >= 1.5 but the only alternative I can think of is to write our own purge command for subversion.
author Patrick Mezard <pmezard@gmail.com>
date Fri, 04 Mar 2011 14:00:49 +0100
parents 4bb4895e1693
children
line wrap: on
line source

#!/bin/sh

echo "[extensions]" >> $HGRCPATH
echo "mq=">> $HGRCPATH

teststrip() {
    hg -q up -C $1
    echo % before update $1, strip $2
    hg parents
    chmod -$3 $4
    hg strip $2 2>&1 | sed 's/\(bundle\).*/\1/' | sed 's/Permission denied.*\.hg\/store\/\(.*\)/Permission denied \.hg\/store\/\1/'
    echo % after update $1, strip $2
    chmod +$3 $4
    hg verify
    echo % journal contents
    if [ -f .hg/store/journal ]; then
        sed -e 's/\.i[^\n]*/\.i/' .hg/store/journal
    else
        echo "(no journal)"
    fi
    ls .hg/store/journal >/dev/null 2>&1 && hg recover
    ls .hg/strip-backup/* >/dev/null 2>&1 && hg unbundle -q .hg/strip-backup/*
    rm -rf .hg/strip-backup
}

hg init test
cd test

echo a > a
hg -q ci -m "a" -A

echo b > b
hg -q ci -m "b" -A

echo b2 >> b
hg -q ci -m "b2" -A

echo c > c
hg -q ci -m "c" -A
 
teststrip 0 2 w .hg/store/data/b.i
teststrip 0 2 r .hg/store/data/b.i
teststrip 0 2 w .hg/store/00manifest.i