Mercurial > hg-stable
annotate tests/test-branch-option @ 10365:d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Previously, the name part of an repo#name url was interpreted as a
revision, similar to using the --rev option. Now it is instead looked
up as a branch first, and if that succeeds all the heads of the branch
will be processed instead of just its tip-most head. If the branch
lookup fails, it will be assumed to be an revision as before (e.g. for
tags).
author | Sune Foldager <cryo@cyanite.org> |
---|---|
date | Sun, 07 Feb 2010 14:29:07 +0100 |
parents | |
children | a78bfaf988e1 |
rev | line source |
---|---|
10365
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
1 #!/bin/sh |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
2 |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
3 # test branch selection options |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
4 hg init branch |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
5 cd branch |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
6 hg branch a |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
7 echo a > foo |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
8 hg ci -d '0 0' -Ama |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
9 echo a2 > foo |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
10 hg ci -d '0 0' -ma2 |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
11 hg up 0 |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
12 hg branch c |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
13 echo c > foo |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
14 hg ci -d '0 0' -mc |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
15 cd .. |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
16 hg clone -r 0 branch branch2 |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
17 cd branch2 |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
18 hg up 0 |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
19 hg branch b |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
20 echo b > foo |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
21 hg ci -d '0 0' -mb |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
22 hg up 0 |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
23 hg branch -f b |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
24 echo b2 > foo |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
25 hg ci -d '0 0' -mb2 |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
26 |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
27 echo in rev c branch a |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
28 hg in -qr c ../branch#a |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
29 echo out branch . |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
30 hg out -q ../branch#. |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
31 echo clone branch b |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
32 cd .. |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
33 hg clone branch2#b branch3 |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
34 hg -q -R branch3 heads b |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
35 hg -q -R branch3 parents |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
36 rm -rf branch3 |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
37 echo clone rev a branch b |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
38 hg clone -r a branch2#b branch3 |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
39 hg -q -R branch3 heads b |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
40 hg -q -R branch3 parents |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
41 rm -rf branch3 |