tests/test-mq-merge
author Matt Mackall <mpm@selenic.com>
Mon, 18 May 2009 17:36:24 -0500
changeset 8503 90f86a5330bb
parent 6628 f18f14bae172
child 10119 bb5ea66789e3
child 10185 7637fe4f525d
permissions -rwxr-xr-x
commit: tidy up mergestate slightly
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4333
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     1
#!/bin/sh
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     2
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     3
# Test issue 529 - mq aborts when merging patch deleting files
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     4
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     5
rewrite_path()
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     6
{
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     7
    sed -e 's:\\:/:g' -e 's:[^ ]*/t/::g'
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     8
}
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     9
5527
0b3f910dfd17 mq: really remove undo after a qpush (and after a strip)
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4437
diff changeset
    10
checkundo()
0b3f910dfd17 mq: really remove undo after a qpush (and after a strip)
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4437
diff changeset
    11
{
0b3f910dfd17 mq: really remove undo after a qpush (and after a strip)
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4437
diff changeset
    12
    if [ -f .hg/store/undo ]; then
0b3f910dfd17 mq: really remove undo after a qpush (and after a strip)
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4437
diff changeset
    13
	echo ".hg/store/undo still exists after $1"
0b3f910dfd17 mq: really remove undo after a qpush (and after a strip)
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4437
diff changeset
    14
    fi
0b3f910dfd17 mq: really remove undo after a qpush (and after a strip)
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4437
diff changeset
    15
}
0b3f910dfd17 mq: really remove undo after a qpush (and after a strip)
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4437
diff changeset
    16
4333
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    17
echo "[extensions]" >> $HGRCPATH
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    18
echo "hgext.mq=" >> $HGRCPATH
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    19
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    20
# Commit two dummy files in "init" changeset
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    21
hg init t
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    22
cd t
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    23
echo a > a
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    24
echo b > b
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    25
hg ci -Am init
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    26
hg tag -l init
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    27
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    28
# Create a patch removing a
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    29
hg qnew rm_a
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    30
hg rm a
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    31
hg qrefresh -m "rm a"
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    32
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    33
# Save the patch queue so we can merge it later
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    34
hg qsave -c -e 2>&1 | rewrite_path
5527
0b3f910dfd17 mq: really remove undo after a qpush (and after a strip)
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4437
diff changeset
    35
checkundo qsave
4333
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    36
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    37
# Update b and commit in an "update" changeset
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    38
hg up -C init
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    39
echo b >> b
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    40
hg st
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    41
hg ci -m update
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    42
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    43
# Here, qpush used to abort with :
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    44
# The system cannot find the file specified => a
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    45
hg manifest
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    46
hg qpush -a -m 2>&1 | rewrite_path
5527
0b3f910dfd17 mq: really remove undo after a qpush (and after a strip)
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4437
diff changeset
    47
checkundo 'qpush -m'
4333
4f721e96f1de Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    48
hg manifest
4437
a210b40d0860 Make mergepatch save queue now that qpush isn't.
Brendan Cully <brendan@kublai.com>
parents: 4333
diff changeset
    49
a210b40d0860 Make mergepatch save queue now that qpush isn't.
Brendan Cully <brendan@kublai.com>
parents: 4333
diff changeset
    50
# ensure status is correct after merge
a210b40d0860 Make mergepatch save queue now that qpush isn't.
Brendan Cully <brendan@kublai.com>
parents: 4333
diff changeset
    51
hg qpop -a
6628
f18f14bae172 test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents: 5527
diff changeset
    52
cd ..
f18f14bae172 test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents: 5527
diff changeset
    53
f18f14bae172 test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents: 5527
diff changeset
    54
# Classic MQ merge sequence *with an explicit named queue*
f18f14bae172 test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents: 5527
diff changeset
    55
echo
f18f14bae172 test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents: 5527
diff changeset
    56
echo % init t2
f18f14bae172 test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents: 5527
diff changeset
    57
hg init t2
f18f14bae172 test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents: 5527
diff changeset
    58
cd t2
f18f14bae172 test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents: 5527
diff changeset
    59
echo a > a
f18f14bae172 test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents: 5527
diff changeset
    60
hg ci -Am init
f18f14bae172 test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents: 5527
diff changeset
    61
echo b >> a
f18f14bae172 test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents: 5527
diff changeset
    62
hg ci -m changea
f18f14bae172 test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents: 5527
diff changeset
    63
hg up -C 0
f18f14bae172 test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents: 5527
diff changeset
    64
echo c >> a
f18f14bae172 test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents: 5527
diff changeset
    65
hg qnew -f -e patcha
f18f14bae172 test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents: 5527
diff changeset
    66
echo % create the reference queue
f18f14bae172 test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents: 5527
diff changeset
    67
hg qsave -c -e -n refqueue 2> /dev/null
f18f14bae172 test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents: 5527
diff changeset
    68
hg up -C 1
f18f14bae172 test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents: 5527
diff changeset
    69
echo % merge
f18f14bae172 test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents: 5527
diff changeset
    70
hg qpush -m -n refqueue 2>&1 | \
f18f14bae172 test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents: 5527
diff changeset
    71
    sed 's/merging with queue at.*refqueue/merging with queue at refqueue/'
f18f14bae172 test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents: 5527
diff changeset
    72
cd ..
f18f14bae172 test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents: 5527
diff changeset
    73