All pastes #2116521 Raw Edit

multi_io

public text v1 · immutable
#2116521 ·published 2012-02-10 16:02 UTC
rendered paste body
#!/bin/sh

set -e

rm -rf orig converted splicemap

hg init orig
cd orig

echo default1 >>default.txt
hg add default.txt
hg commit -m default1

echo default2 >>default.txt 
hg commit -m default2

hg branch br

echo br1 >>br.txt
hg add br.txt
hg commit -m br1

echo br2 >>br.txt
hg commit -m br2
br2="`hg log --template '{node}' -r tip`"

hg co default

echo default3 >>default.txt 
hg commit -m default3
default3="`hg log --template '{node}' -r tip`"

# now create a commit in default that looks like
# a merge from br
echo br1 >br.txt
echo br2 >>br.txt
hg add br.txt
hg commit -m merged
merged="`hg log --template '{node}' -r tip`"

cd ..

# now convert this into a repo in which the $merged commit is indeed a merge from br.

echo "$merged $default3,$br2" >splicemap

hg convert --splicemap=splicemap orig converted

echo SUCCESS!