igor@333: #!/bin/bash igor@333: igor@333: #$ name: init igor@333: igor@333: hg init main igor@333: cd main igor@333: echo 'This is a boring feature.' > myfile igor@333: hg commit -A -m 'We have reached an important milestone!' igor@333: igor@333: #$ name: tag igor@333: igor@333: hg tag v1.0 igor@333: hg tip igor@333: hg tags igor@333: igor@333: #$ name: main igor@333: igor@333: cd ../main igor@333: echo 'This is exciting and new!' >> myfile igor@333: hg commit -m 'Add a new feature' igor@333: cat myfile igor@333: igor@333: #$ name: update igor@333: igor@333: cd .. igor@333: hg clone -U main main-old igor@333: cd main-old igor@333: hg update v1.0 igor@333: cat myfile igor@333: igor@333: #$ name: clone igor@333: igor@333: cd .. igor@333: hg clone -rv1.0 main stable igor@333: igor@333: #$ name: stable igor@333: igor@333: hg clone stable stable-fix igor@333: cd stable-fix igor@333: echo 'This is a fix to a boring feature.' > myfile igor@333: hg commit -m 'Fix a bug' igor@333: #$ ignore: /tmp/branching.* igor@333: hg push igor@333: igor@333: #$ name: igor@333: igor@333: export HGMERGE=$(mktemp) igor@333: echo '#!/bin/sh' > $HGMERGE igor@333: echo 'echo "This is a fix to a boring feature." > "$1"' >> $HGMERGE igor@333: echo 'echo "This is exciting and new!" >> "$1"' >> $HGMERGE igor@333: chmod 700 $HGMERGE igor@333: igor@333: #$ name: merge igor@333: igor@333: cd ../main igor@333: hg pull ../stable igor@333: hg merge igor@333: hg commit -m 'Bring in bugfix from stable branch' igor@333: cat myfile igor@333: igor@333: #$ name: igor@333: igor@333: rm $HGMERGE