|
#!/bin/bash
|
|
|
|
# Caso 1: Ramos nomeados do Mercurial
|
|
#
|
|
# (1)----(2) > stable
|
|
# / \
|
|
# (0)---(3)---(4)---(7) > default/master
|
|
# \ \ /
|
|
# \ (5)---(6) > bug
|
|
# \ \
|
|
# (8)---------(9) > feature
|
|
|
|
|
|
#
|
|
# Mercurial Usando Bookmarks
|
|
#
|
|
|
|
cd /tmp
|
|
if [ -d hg-bookmarks ]; then
|
|
rm -rf hg-bookmarks
|
|
fi
|
|
|
|
hg init hg-bookmarks
|
|
cd hg-bookmarks
|
|
echo 'zero' > default.txt
|
|
hg commit -Am zero
|
|
|
|
hg bookmark stable
|
|
echo 'um' > stable.txt
|
|
hg add
|
|
hg commit -m um
|
|
|
|
echo 'dois' >> stable.txt
|
|
hg commit -m dois
|
|
|
|
hg bookmark -r 0 default-bookmark
|
|
hg update default-bookmark
|
|
echo 'três' >> default.txt
|
|
hg commit -m tres
|
|
|
|
hg merge stable
|
|
hg commit -m quatro
|
|
|
|
hg update 3
|
|
hg bookmark bug
|
|
echo 'cinco' > bug.txt
|
|
hg add
|
|
hg commit -m cinco
|
|
|
|
echo 'seis' >> bug.txt
|
|
hg commit -m seis
|
|
|
|
hg update default-bookmark
|
|
hg merge bug
|
|
hg commit -m sete
|
|
|
|
hg up 0
|
|
hg bookmark feature
|
|
echo 'oito' > feature.txt
|
|
hg add
|
|
hg commit -m oito
|
|
|
|
hg merge bug
|
|
hg commit -m nove
|
|
|
|
echo -e '\n\n================\ndefault-bookmark\n================'
|
|
hg log -Gqr default-bookmark:0
|
|
echo -e '\n\n=======\nfeature\n======='
|
|
hg log -Gqr feature:0
|
|
echo -e '\n\n===\nbug\n==='
|
|
hg log -Gqr bug:0
|
|
echo -e '\n\n======\nstable\n======'
|
|
hg log -Gqr stable:0
|