hgbook

view en/examples/daily.copy @ 609:c44d5854620b

Fix up chapter 1.
author Bryan O'Sullivan <bos@serpentine.com>
date Tue Mar 31 22:38:30 2009 -0700 (2009-03-31)
parents b252526b44aa
children 477d6a3e5023
line source
1 #!/bin/bash
3 #$ name: init
5 hg init my-copy
6 cd my-copy
7 echo line > file
8 hg add file
9 hg commit -m 'Added a file'
11 #$ name: clone
13 cd ..
14 hg clone my-copy your-copy
16 #$ name: copy
18 cd my-copy
19 hg copy file new-file
21 #$ name: status
23 hg status
25 #$ name: status-copy
27 hg status -C
28 hg commit -m 'Copied file'
30 #$ name: other
32 cd ../your-copy
33 echo 'new contents' >> file
34 hg commit -m 'Changed file'
36 #$ name: cat
38 cat file
39 cat ../my-copy/new-file
41 #$ name: merge
43 hg pull ../my-copy
44 hg merge
45 cat new-file
47 #$ name:
49 cd ..
50 hg init copy-example
51 cd copy-example
52 echo a > a
53 echo b > b
54 mkdir c
55 mkdir c/a
56 echo c > c/a/c
57 hg ci -Ama
59 #$ name: simple
61 mkdir k
62 hg copy a k
63 ls k
65 #$ name: dir-dest
67 mkdir d
68 hg copy a b d
69 ls d
71 #$ name: dir-src
73 hg copy c e
75 #$ name: dir-src-dest
77 hg copy c d
79 #$ name: after
81 cp a z
82 hg copy --after a z