tests/test-url-rev
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
Mon, 27 Aug 2007 01:44:35 -0300
changeset 5223 fe55e3d6dc0b
parent 5222 cbe6e263357b
child 5224 20817af258d8
permissions -rwxr-xr-x
clone: if "url#rev" was given, update to rev
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
cbe6e263357b parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     7
hg ci -qAm 'add a' -d '0 0'
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
cbe6e263357b parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    10
hg ci -m 'change a' -d '0 0'
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
cbe6e263357b parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    25
hg ci -m 'new head of branch foo' -d '0 0'
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
cbe6e263357b parseurl: also return the revision after the "#"; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    28
hg ci -qAm 'add bar' -d '0 0'
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