hgbook

diff fr/examples/branching @ 992:8b0f1e2984d0

French translation : sync with original ch04-concepts
author Frédéric Bouquet <youshe.jaalon@gmail.com>
date Fri Sep 11 14:30:20 2009 +0200 (2009-09-11)
parents f078515438d2
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/fr/examples/branching	Fri Sep 11 14:30:20 2009 +0200
     1.3 @@ -0,0 +1,63 @@
     1.4 +#!/bin/bash
     1.5 +
     1.6 +#$ name: init
     1.7 +
     1.8 +hg init main
     1.9 +cd main
    1.10 +echo 'This is a boring feature.' > myfile
    1.11 +hg commit -A -m 'We have reached an important milestone!'
    1.12 +
    1.13 +#$ name: tag
    1.14 +
    1.15 +hg tag v1.0
    1.16 +hg tip
    1.17 +hg tags
    1.18 +
    1.19 +#$ name: main
    1.20 +
    1.21 +cd ../main
    1.22 +echo 'This is exciting and new!' >> myfile
    1.23 +hg commit -m 'Add a new feature'
    1.24 +cat myfile
    1.25 +
    1.26 +#$ name: update
    1.27 +
    1.28 +cd ..
    1.29 +hg clone -U main main-old
    1.30 +cd main-old
    1.31 +hg update v1.0
    1.32 +cat myfile
    1.33 +
    1.34 +#$ name: clone
    1.35 +
    1.36 +cd ..
    1.37 +hg clone -rv1.0 main stable
    1.38 +
    1.39 +#$ name: stable
    1.40 +
    1.41 +hg clone stable stable-fix
    1.42 +cd stable-fix
    1.43 +echo 'This is a fix to a boring feature.' > myfile
    1.44 +hg commit -m 'Fix a bug'
    1.45 +#$ ignore: /tmp/branching.*
    1.46 +hg push
    1.47 +
    1.48 +#$ name:
    1.49 +
    1.50 +export HGMERGE=$(mktemp)
    1.51 +echo '#!/bin/sh' > $HGMERGE
    1.52 +echo 'echo "This is a fix to a boring feature." > "$1"' >> $HGMERGE
    1.53 +echo 'echo "This is exciting and new!" >> "$1"' >> $HGMERGE
    1.54 +chmod 700 $HGMERGE
    1.55 +
    1.56 +#$ name: merge
    1.57 +
    1.58 +cd ../main
    1.59 +hg pull ../stable
    1.60 +hg merge
    1.61 +hg commit -m 'Bring in bugfix from stable branch'
    1.62 +cat myfile
    1.63 +
    1.64 +#$ name:
    1.65 +
    1.66 +rm $HGMERGE