author | Patrick Mezard <pmezard@gmail.com> |
Sun, 04 Oct 2009 22:23:11 +0200 | |
changeset 9526 | 457a30ed8ffb |
parent 8167 | 6c82beaaa11a |
permissions | -rwxr-xr-x |
5222
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
1 |
#!/bin/sh |
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
2 |
# test basic functionality of url#rev syntax |
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
3 |
|
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
4 |
hg init repo |
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
5 |
cd repo |
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
6 |
echo a > a |
8167
6c82beaaa11a
tests: removed redundant "-d '0 0'" from test scripts
Martin Geisler <mg@lazybytes.net>
parents:
5224
diff
changeset
|
7 |
hg ci -qAm 'add a' |
5222
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
8 |
hg branch foo |
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
9 |
echo >> a |
8167
6c82beaaa11a
tests: removed redundant "-d '0 0'" from test scripts
Martin Geisler <mg@lazybytes.net>
parents:
5224
diff
changeset
|
10 |
hg ci -m 'change a' |
5222
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
11 |
cd .. |
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
12 |
|
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
13 |
echo '% clone repo#foo' |
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
14 |
hg clone 'repo#foo' clone |
5223
fe55e3d6dc0b
clone: if "url#rev" was given, update to rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5222
diff
changeset
|
15 |
echo '% heads' |
5222
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
16 |
hg --cwd clone heads |
5223
fe55e3d6dc0b
clone: if "url#rev" was given, update to rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5222
diff
changeset
|
17 |
echo '% parents' |
fe55e3d6dc0b
clone: if "url#rev" was given, update to rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5222
diff
changeset
|
18 |
hg --cwd clone parents |
5222
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
19 |
sed -e 's/default.*#/default = #/' clone/.hg/hgrc |
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
20 |
echo |
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
21 |
|
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
22 |
echo '% changing original repo' |
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
23 |
cd repo |
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
24 |
echo >> a |
8167
6c82beaaa11a
tests: removed redundant "-d '0 0'" from test scripts
Martin Geisler <mg@lazybytes.net>
parents:
5224
diff
changeset
|
25 |
hg ci -m 'new head of branch foo' |
5222
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
26 |
hg up -qC default |
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
27 |
echo bar > bar |
8167
6c82beaaa11a
tests: removed redundant "-d '0 0'" from test scripts
Martin Geisler <mg@lazybytes.net>
parents:
5224
diff
changeset
|
28 |
hg ci -qAm 'add bar' |
5222
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
29 |
hg log |
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
30 |
echo |
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
31 |
|
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
32 |
echo '% outgoing' |
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
33 |
hg -q outgoing '../clone#foo' |
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
34 |
echo |
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
35 |
|
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
36 |
echo '% push' |
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
37 |
hg -q push '../clone#foo' |
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
38 |
hg --cwd ../clone heads |
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
39 |
cd .. |
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
40 |
echo |
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
41 |
|
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
42 |
echo '% rolling back' |
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
43 |
cd clone |
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
44 |
hg rollback |
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
45 |
|
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
46 |
echo '% incoming' |
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
47 |
hg -q incoming |
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
48 |
|
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
49 |
echo '% pull' |
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
50 |
hg -q pull |
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
51 |
hg heads |
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
52 |
echo |
cbe6e263357b
parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
53 |
|
5224
20817af258d8
pull -u: if "url#rev" was given, update to rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5223
diff
changeset
|
54 |
echo '% pull should not have updated' |
20817af258d8
pull -u: if "url#rev" was given, update to rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5223
diff
changeset
|
55 |
hg parents -q |
20817af258d8
pull -u: if "url#rev" was given, update to rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5223
diff
changeset
|
56 |
echo '% going back to the default branch' |
20817af258d8
pull -u: if "url#rev" was given, update to rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5223
diff
changeset
|
57 |
hg up -C 0 |
20817af258d8
pull -u: if "url#rev" was given, update to rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5223
diff
changeset
|
58 |
hg parents |
20817af258d8
pull -u: if "url#rev" was given, update to rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5223
diff
changeset
|
59 |
echo '% no new revs, no update' |
20817af258d8
pull -u: if "url#rev" was given, update to rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5223
diff
changeset
|
60 |
hg pull -qu |
20817af258d8
pull -u: if "url#rev" was given, update to rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5223
diff
changeset
|
61 |
hg parents -q |
20817af258d8
pull -u: if "url#rev" was given, update to rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5223
diff
changeset
|
62 |
echo '% rollback' |
20817af258d8
pull -u: if "url#rev" was given, update to rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5223
diff
changeset
|
63 |
hg rollback |
20817af258d8
pull -u: if "url#rev" was given, update to rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5223
diff
changeset
|
64 |
hg up -C 0 |
20817af258d8
pull -u: if "url#rev" was given, update to rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5223
diff
changeset
|
65 |
hg parents -q |
20817af258d8
pull -u: if "url#rev" was given, update to rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5223
diff
changeset
|
66 |
echo '% pull -u takes us back to branch foo' |
20817af258d8
pull -u: if "url#rev" was given, update to rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5223
diff
changeset
|
67 |
hg pull -qu |
20817af258d8
pull -u: if "url#rev" was given, update to rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5223
diff
changeset
|
68 |
hg parents |
20817af258d8
pull -u: if "url#rev" was given, update to rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5223
diff
changeset
|
69 |
|
20817af258d8
pull -u: if "url#rev" was given, update to rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5223
diff
changeset
|
70 |
echo '% rollback' |
20817af258d8
pull -u: if "url#rev" was given, update to rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5223
diff
changeset
|
71 |
hg rollback |
20817af258d8
pull -u: if "url#rev" was given, update to rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5223
diff
changeset
|
72 |
hg up -C 0 |
20817af258d8
pull -u: if "url#rev" was given, update to rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5223
diff
changeset
|
73 |
echo '% parents' |
20817af258d8
pull -u: if "url#rev" was given, update to rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5223
diff
changeset
|
74 |
hg parents -q |
20817af258d8
pull -u: if "url#rev" was given, update to rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5223
diff
changeset
|
75 |
echo '% heads' |
20817af258d8
pull -u: if "url#rev" was given, update to rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5223
diff
changeset
|
76 |
hg heads -q |
20817af258d8
pull -u: if "url#rev" was given, update to rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5223
diff
changeset
|
77 |
echo '% pull -u -r otherrev url#rev updates to rev' |
20817af258d8
pull -u: if "url#rev" was given, update to rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5223
diff
changeset
|
78 |
hg pull -qur default default |
20817af258d8
pull -u: if "url#rev" was given, update to rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5223
diff
changeset
|
79 |
echo '% parents' |
20817af258d8
pull -u: if "url#rev" was given, update to rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5223
diff
changeset
|
80 |
hg parents |
20817af258d8
pull -u: if "url#rev" was given, update to rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5223
diff
changeset
|
81 |
echo '% heads' |
20817af258d8
pull -u: if "url#rev" was given, update to rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5223
diff
changeset
|
82 |
hg heads |
20817af258d8
pull -u: if "url#rev" was given, update to rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5223
diff
changeset
|
83 |