Mercurial > hgbook
annotate en/examples/branch-repo @ 832:d5688822c51d
Preface, now with actual text
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Thu, 07 May 2009 22:32:55 -0700 |
parents | 58e3a6c76725 |
children |
rev | line source |
---|---|
198
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
1 #!/bin/bash |
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
2 |
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
3 hg init myproject |
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
4 cd myproject |
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
5 echo hello > myfile |
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
6 hg commit -A -m 'Initial commit' |
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
7 cd .. |
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
8 |
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
9 #$ name: tag |
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
10 |
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
11 cd myproject |
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
12 hg tag v1.0 |
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
13 |
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
14 #$ name: clone |
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
15 |
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
16 cd .. |
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
17 hg clone myproject myproject-1.0.1 |
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
18 |
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
19 #$ name: bugfix |
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
20 |
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
21 hg clone myproject-1.0.1 my-1.0.1-bugfix |
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
22 cd my-1.0.1-bugfix |
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
23 echo 'I fixed a bug using only echo!' >> myfile |
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
24 hg commit -m 'Important fix for 1.0.1' |
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
25 #$ ignore: /tmp/branch-repo.* |
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
26 hg push |
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
27 |
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
28 #$ name: new |
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
29 |
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
30 cd .. |
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
31 hg clone myproject my-feature |
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
32 cd my-feature |
199
58e3a6c76725
More branch/merge stuff.
Bryan O'Sullivan <bos@serpentine.com>
parents:
198
diff
changeset
|
33 echo 'This sure is an exciting new feature!' > mynewfile |
198
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
34 hg commit -A -m 'New feature' |
199
58e3a6c76725
More branch/merge stuff.
Bryan O'Sullivan <bos@serpentine.com>
parents:
198
diff
changeset
|
35 hg push |
198
615f3c6b30e1
Start to describe branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
36 |
199
58e3a6c76725
More branch/merge stuff.
Bryan O'Sullivan <bos@serpentine.com>
parents:
198
diff
changeset
|
37 #$ name: pull |
58e3a6c76725
More branch/merge stuff.
Bryan O'Sullivan <bos@serpentine.com>
parents:
198
diff
changeset
|
38 |
58e3a6c76725
More branch/merge stuff.
Bryan O'Sullivan <bos@serpentine.com>
parents:
198
diff
changeset
|
39 cd .. |
58e3a6c76725
More branch/merge stuff.
Bryan O'Sullivan <bos@serpentine.com>
parents:
198
diff
changeset
|
40 hg clone myproject myproject-merge |
58e3a6c76725
More branch/merge stuff.
Bryan O'Sullivan <bos@serpentine.com>
parents:
198
diff
changeset
|
41 cd myproject-merge |
58e3a6c76725
More branch/merge stuff.
Bryan O'Sullivan <bos@serpentine.com>
parents:
198
diff
changeset
|
42 hg pull ../myproject-1.0.1 |
58e3a6c76725
More branch/merge stuff.
Bryan O'Sullivan <bos@serpentine.com>
parents:
198
diff
changeset
|
43 |
58e3a6c76725
More branch/merge stuff.
Bryan O'Sullivan <bos@serpentine.com>
parents:
198
diff
changeset
|
44 #$ name: merge |
58e3a6c76725
More branch/merge stuff.
Bryan O'Sullivan <bos@serpentine.com>
parents:
198
diff
changeset
|
45 |
58e3a6c76725
More branch/merge stuff.
Bryan O'Sullivan <bos@serpentine.com>
parents:
198
diff
changeset
|
46 hg merge |
58e3a6c76725
More branch/merge stuff.
Bryan O'Sullivan <bos@serpentine.com>
parents:
198
diff
changeset
|
47 hg commit -m 'Merge bugfix from 1.0.1 branch' |
58e3a6c76725
More branch/merge stuff.
Bryan O'Sullivan <bos@serpentine.com>
parents:
198
diff
changeset
|
48 hg push |