hgbook

annotate ja/examples/branching @ 1114:527b86d55d4a

inotify: update installation information

inotify is shipped in Mercurial since 1.0, which greatly simplifies the installation process
author Nicolas Dumazet <nicdumz.commits@gmail.com>
date Sun Dec 13 16:35:56 2009 +0900 (2009-12-13)
parents
children
rev   line source
foozy@708 1 #!/bin/bash
foozy@708 2
foozy@708 3 #$ name: init
foozy@708 4
foozy@708 5 hg init main
foozy@708 6 cd main
foozy@708 7 echo 'This is a boring feature.' > myfile
foozy@708 8 hg commit -A -m 'We have reached an important milestone!'
foozy@708 9
foozy@708 10 #$ name: tag
foozy@708 11
foozy@708 12 hg tag v1.0
foozy@708 13 hg tip
foozy@708 14 hg tags
foozy@708 15
foozy@708 16 #$ name: main
foozy@708 17
foozy@708 18 cd ../main
foozy@708 19 echo 'This is exciting and new!' >> myfile
foozy@708 20 hg commit -m 'Add a new feature'
foozy@708 21 cat myfile
foozy@708 22
foozy@708 23 #$ name: update
foozy@708 24
foozy@708 25 cd ..
foozy@708 26 hg clone -U main main-old
foozy@708 27 cd main-old
foozy@708 28 hg update v1.0
foozy@708 29 cat myfile
foozy@708 30
foozy@708 31 #$ name: clone
foozy@708 32
foozy@708 33 cd ..
foozy@708 34 hg clone -rv1.0 main stable
foozy@708 35
foozy@708 36 #$ name: stable
foozy@708 37
foozy@708 38 hg clone stable stable-fix
foozy@708 39 cd stable-fix
foozy@708 40 echo 'This is a fix to a boring feature.' > myfile
foozy@708 41 hg commit -m 'Fix a bug'
foozy@708 42 #$ ignore: /tmp/branching.*
foozy@708 43 hg push
foozy@708 44
foozy@708 45 #$ name:
foozy@708 46
foozy@708 47 export HGMERGE=$(mktemp)
foozy@708 48 echo '#!/bin/sh' > $HGMERGE
foozy@708 49 echo 'echo "This is a fix to a boring feature." > "$1"' >> $HGMERGE
foozy@708 50 echo 'echo "This is exciting and new!" >> "$1"' >> $HGMERGE
foozy@708 51 chmod 700 $HGMERGE
foozy@708 52
foozy@708 53 #$ name: merge
foozy@708 54
foozy@708 55 cd ../main
foozy@708 56 hg pull ../stable
foozy@708 57 hg merge
foozy@708 58 hg commit -m 'Bring in bugfix from stable branch'
foozy@708 59 cat myfile
foozy@708 60
foozy@708 61 #$ name:
foozy@708 62
foozy@708 63 rm $HGMERGE