tests/test-parents
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
Fri, 17 Aug 2007 17:33:27 -0300
changeset 5189 60acf1432ee0
parent 4894 be5dc5e3ab2d
child 5299 5a4824f6665c
permissions -rwxr-xr-x
Move cmdtable and reposetup handling out of extensions.py A new function (extensions.extensions) allows the code that is interested in those attributes to handle them directly. This allows some cleanups of extensions.py. Notably, we can remove the extensions.commandtable hack. It also makes it easier to add standard extension attributes, like a "hgwebsetup" function or a "helptable" dict that augments the data in help.py, etc.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4584
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     1
#!/bin/sh
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     2
# test parents command
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     3
4894
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
     4
hg init repo
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
     5
cd repo
4584
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     6
echo % no working directory
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     7
hg parents
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     8
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     9
echo a > a
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    10
echo b > b
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    11
hg ci -Amab -d '0 0'
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    12
echo a >> a
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    13
hg ci -Ama -d '1 0'
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    14
echo b >> b
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    15
hg ci -Amb -d '2 0'
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    16
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    17
echo % hg parents
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    18
hg parents
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    19
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    20
echo % hg parents a
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    21
hg parents a
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    22
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    23
echo % hg parents -r 2
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    24
hg parents -r 2
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    25
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    26
echo % hg parents -r 2 a
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    27
hg parents -r 2 a
4894
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    28
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    29
echo % hg parents -r 2 ../a
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    30
hg parents -r 2 ../a
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    31
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    32
echo '% cd dir; hg parents -r 2 ../a'
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    33
mkdir dir
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    34
cd dir
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    35
hg parents -r 2 ../a
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    36
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    37
echo '% hg parents -r 2 path:a'
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    38
hg parents -r 2 path:a
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    39
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    40
echo '% hg parents -r 2 glob:a'
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    41
cd ..
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    42
hg parents -r 2 glob:a
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    43
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    44
true