tests/test-resolve
author Matt Mackall <mpm@selenic.com>
Sat, 23 May 2009 12:31:28 -0500
changeset 8560 107af208ed0b
parent 7734 9f73bddb9d0b
child 8167 6c82beaaa11a
permissions -rwxr-xr-x
Merge with crew-stable
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7734
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
     1
#!/bin/sh
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
     2
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
     3
# test that a commit clears the merge state.
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
     4
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
     5
hg init repo
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
     6
cd repo
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
     7
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
     8
echo foo > file
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
     9
hg commit -Am 'add file' -d '0 0'
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
    10
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
    11
echo bar >> file
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
    12
hg commit -Am 'append bar' -d '0 0'
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
    13
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
    14
echo % create a second head
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
    15
hg up -C 0
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
    16
echo baz >> file
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
    17
hg commit -Am 'append baz' -d '0 0'
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
    18
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
    19
echo % failing merge
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
    20
HGMERGE=internal:fail hg merge
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
    21
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
    22
echo resolved > file
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
    23
hg resolve -m file
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
    24
hg commit -m 'resolved' -d '0 0'
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
    25
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
    26
echo % resolve -l, should be empty
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
    27
hg resolve -l