hgbook

view en/examples/branching @ 179:5fc4a45c069f

Continue documentation of collaboration models.
author Bryan O'Sullivan <bos@serpentine.com>
date Fri Mar 30 23:05:28 2007 -0700 (2007-03-30)
parents
children f078515438d2
line source
1 #!/bin/bash
3 #$ name: init
5 hg init main
6 cd main
7 echo 'This is a boring feature.' > myfile
8 hg commit -A -m 'We have reached an important milestone!'
10 #$ name: tag
12 hg tag v1.0
13 hg tip
14 hg tags
16 #$ name: main
18 cd ../main
19 echo 'This is exciting and new!' >> myfile
20 hg commit -m 'Add a new feature'
21 cat myfile
23 #$ name: update
25 cd ..
26 hg clone -U main main-old
27 cd main-old
28 hg update v1.0
29 cat myfile
31 #$ name: clone
33 cd ..
34 hg clone -rv1.0 main stable
36 #$ name: stable
38 hg clone stable stable-fix
39 cd stable-fix
40 echo 'This is a fix to a boring feature.' > myfile
41 hg commit -m 'Fix a bug'
42 hg push
44 #$ name:
46 export HGMERGE=$(mktemp)
47 echo '#!/bin/sh' > $HGMERGE
48 echo 'echo "This is a fix to a boring feature." > "$1"' >> $HGMERGE
49 echo 'echo "This is exciting and new!" >> "$1"' >> $HGMERGE
50 chmod 700 $HGMERGE
52 #$ name: merge
54 cd ../main
55 hg pull ../stable
56 hg merge
57 hg commit -m 'Bring in bugfix from stable branch'
58 cat myfile
60 #$ name:
62 rm $HGMERGE