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