Mercurial > hgbook
annotate en/examples/backout @ 807:7226e5e750a6
Clean up chapter 8, and add content
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Tue, 21 Apr 2009 23:49:27 -0700 |
parents | 5fc4a45c069f |
children |
rev | line source |
---|---|
124
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
1 #!/bin/bash |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
2 |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
3 # We have to fake the merges here, because they cause conflicts with |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
4 # three-way command-line merge, and kdiff3 may not be available. |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
5 |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
6 export HGMERGE=$(mktemp) |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
7 echo '#!/bin/sh' >> $HGMERGE |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
8 echo 'echo first change > "$1"' >> $HGMERGE |
179
5fc4a45c069f
Continue documentation of collaboration models.
Bryan O'Sullivan <bos@serpentine.com>
parents:
141
diff
changeset
|
9 echo 'echo third change >> "$1"' >> $HGMERGE |
124
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
10 chmod 700 $HGMERGE |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
11 |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
12 #$ name: init |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
13 |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
14 hg init myrepo |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
15 cd myrepo |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
16 echo first change >> myfile |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
17 hg add myfile |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
18 hg commit -m 'first change' |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
19 echo second change >> myfile |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
20 hg commit -m 'second change' |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
21 |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
22 #$ name: simple |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
23 |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
24 hg backout -m 'back out second change' tip |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
25 cat myfile |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
26 |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
27 #$ name: simple.log |
141
627effec9d4e
More attempts to tidy up regexps for ignoring.
Bryan O'Sullivan <bos@serpentine.com>
parents:
124
diff
changeset
|
28 #$ ignore: \s+200[78]-.* |
124
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
29 |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
30 hg log --style compact |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
31 |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
32 #$ name: non-tip.clone |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
33 |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
34 cd .. |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
35 hg clone -r1 myrepo non-tip-repo |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
36 cd non-tip-repo |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
37 |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
38 #$ name: non-tip.backout |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
39 |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
40 echo third change >> myfile |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
41 hg commit -m 'third change' |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
42 hg backout --merge -m 'back out second change' 1 |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
43 |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
44 #$ name: non-tip.cat |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
45 cat myfile |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
46 |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
47 #$ name: manual.clone |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
48 |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
49 cd .. |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
50 hg clone -r1 myrepo newrepo |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
51 cd newrepo |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
52 |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
53 #$ name: manual.backout |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
54 |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
55 echo third change >> myfile |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
56 hg commit -m 'third change' |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
57 hg backout -m 'back out second change' 1 |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
58 |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
59 #$ name: manual.log |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
60 |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
61 hg log --style compact |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
62 |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
63 #$ name: manual.parents |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
64 |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
65 hg parents |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
66 |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
67 #$ name: manual.heads |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
68 |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
69 hg heads |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
70 |
807
7226e5e750a6
Clean up chapter 8, and add content
Bryan O'Sullivan <bos@serpentine.com>
parents:
179
diff
changeset
|
71 #$ name: |
7226e5e750a6
Clean up chapter 8, and add content
Bryan O'Sullivan <bos@serpentine.com>
parents:
179
diff
changeset
|
72 |
7226e5e750a6
Clean up chapter 8, and add content
Bryan O'Sullivan <bos@serpentine.com>
parents:
179
diff
changeset
|
73 echo 'first change' > myfile |
7226e5e750a6
Clean up chapter 8, and add content
Bryan O'Sullivan <bos@serpentine.com>
parents:
179
diff
changeset
|
74 |
124
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
75 #$ name: manual.cat |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
76 |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
77 cat myfile |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
78 |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
79 #$ name: manual.merge |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
80 |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
81 hg merge |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
82 hg commit -m 'merged backout with previous tip' |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
83 cat myfile |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
84 |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
85 #$ name: |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
86 |
c9aad709bd3a
Document the backout command.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
87 rm $HGMERGE |