tests/test-mq-qrefresh
author Christian Ebert <blacktrash@gmx.net>
Wed, 09 Jun 2010 12:45:48 +0100
changeset 11320 e4274f9f97c8
parent 10397 8cb81d75730c
permissions -rwxr-xr-x
keyword: pass context to kwtemplater.overwrite Now that we have retrieved the context in every calling function except commit, pass it as argument to kwtemplater.overwrite to avoid looking it up twice. Reorder arguments to kwtemplater.overwrite to reflect their importance. Turn node argument into a simple boolean and rename it to iswctx.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3136
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
     1
#!/bin/sh
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
     2
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
     3
echo "[extensions]" >> $HGRCPATH
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
     4
echo "mq=" >> $HGRCPATH
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
     5
10397
8cb81d75730c mq: add parent node IDs to MQ patches on qrefresh/qnew
Steve Losh <steve@stevelosh.com>
parents: 10368
diff changeset
     6
catpatch() {
8cb81d75730c mq: add parent node IDs to MQ patches on qrefresh/qnew
Steve Losh <steve@stevelosh.com>
parents: 10368
diff changeset
     7
    cat $1 | sed -e "s/^\(# Parent \).*/\1/"
8cb81d75730c mq: add parent node IDs to MQ patches on qrefresh/qnew
Steve Losh <steve@stevelosh.com>
parents: 10368
diff changeset
     8
}
8cb81d75730c mq: add parent node IDs to MQ patches on qrefresh/qnew
Steve Losh <steve@stevelosh.com>
parents: 10368
diff changeset
     9
3136
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    10
echo % init
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    11
hg init a
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    12
cd a
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    13
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    14
echo % commit
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    15
mkdir 1 2
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    16
echo 'base' > 1/base
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    17
echo 'base' > 2/base
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    18
hg ci -Ambase -d '1 0'
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    19
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    20
echo % qnew mqbase
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    21
hg qnew -mmqbase mqbase
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    22
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    23
echo % qrefresh
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    24
echo 'patched' > 1/base
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    25
echo 'patched' > 2/base
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    26
hg qrefresh
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    27
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    28
echo % qdiff
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    29
hg qdiff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    30
               -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    31
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    32
echo % qdiff dirname
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    33
hg qdiff . | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    34
                 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    35
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    36
echo % patch file contents
10397
8cb81d75730c mq: add parent node IDs to MQ patches on qrefresh/qnew
Steve Losh <steve@stevelosh.com>
parents: 10368
diff changeset
    37
catpatch .hg/patches/mqbase | \
3136
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    38
sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    39
    -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    40
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    41
echo % qrefresh 1
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    42
echo 'patched again' > base
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    43
hg qrefresh 1
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    44
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    45
echo % qdiff
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    46
hg qdiff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    47
               -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    48
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    49
echo % qdiff dirname
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    50
hg qdiff . | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    51
                 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    52
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    53
echo % patch file contents
10397
8cb81d75730c mq: add parent node IDs to MQ patches on qrefresh/qnew
Steve Losh <steve@stevelosh.com>
parents: 10368
diff changeset
    54
catpatch .hg/patches/mqbase | \
3136
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    55
sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    56
    -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    57
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    58
echo % qrefresh . in subdir
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    59
( cd 1 ; hg qrefresh . )
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    60
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    61
echo % qdiff
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    62
hg qdiff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    63
               -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    64
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    65
echo % qdiff dirname
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    66
hg qdiff . | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    67
                 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    68
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    69
echo % patch file contents
10397
8cb81d75730c mq: add parent node IDs to MQ patches on qrefresh/qnew
Steve Losh <steve@stevelosh.com>
parents: 10368
diff changeset
    70
catpatch .hg/patches/mqbase | \
3136
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    71
sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    72
    -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    73
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    74
echo % qrefresh in hg-root again
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    75
hg qrefresh
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    76
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    77
echo % qdiff
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    78
hg qdiff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    79
               -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    80
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    81
echo % qdiff dirname
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    82
hg qdiff . | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    83
                 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    84
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    85
echo % patch file contents
10397
8cb81d75730c mq: add parent node IDs to MQ patches on qrefresh/qnew
Steve Losh <steve@stevelosh.com>
parents: 10368
diff changeset
    86
catpatch .hg/patches/mqbase | \
3136
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    87
sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    88
    -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
7113
f7fc5f5ecd62 mq: Allow qrefresh --silent to take parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 6801
diff changeset
    89
7177
09ed32b79656 mq: Fix --qrefresh --short to work with --exclude and --include
Mads Kiilerich <mads@kiilerich.com>
parents: 7113
diff changeset
    90
echo
09ed32b79656 mq: Fix --qrefresh --short to work with --exclude and --include
Mads Kiilerich <mads@kiilerich.com>
parents: 7113
diff changeset
    91
echo % qrefresh --short tests:
7113
f7fc5f5ecd62 mq: Allow qrefresh --silent to take parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 6801
diff changeset
    92
echo 'orphan' > orphanchild
f7fc5f5ecd62 mq: Allow qrefresh --silent to take parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 6801
diff changeset
    93
hg add orphanchild
7177
09ed32b79656 mq: Fix --qrefresh --short to work with --exclude and --include
Mads Kiilerich <mads@kiilerich.com>
parents: 7113
diff changeset
    94
09ed32b79656 mq: Fix --qrefresh --short to work with --exclude and --include
Mads Kiilerich <mads@kiilerich.com>
parents: 7113
diff changeset
    95
echo % - add 1/base and 2/base one by one
09ed32b79656 mq: Fix --qrefresh --short to work with --exclude and --include
Mads Kiilerich <mads@kiilerich.com>
parents: 7113
diff changeset
    96
hg qrefresh nonexistingfilename # clear patch
7113
f7fc5f5ecd62 mq: Allow qrefresh --silent to take parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 6801
diff changeset
    97
hg qrefresh --short 1/base
f7fc5f5ecd62 mq: Allow qrefresh --silent to take parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 6801
diff changeset
    98
hg qrefresh --short 2/base
f7fc5f5ecd62 mq: Allow qrefresh --silent to take parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 6801
diff changeset
    99
7177
09ed32b79656 mq: Fix --qrefresh --short to work with --exclude and --include
Mads Kiilerich <mads@kiilerich.com>
parents: 7113
diff changeset
   100
echo % -- qdiff output
7113
f7fc5f5ecd62 mq: Allow qrefresh --silent to take parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 6801
diff changeset
   101
hg qdiff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
f7fc5f5ecd62 mq: Allow qrefresh --silent to take parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 6801
diff changeset
   102
               -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
f7fc5f5ecd62 mq: Allow qrefresh --silent to take parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 6801
diff changeset
   103
7177
09ed32b79656 mq: Fix --qrefresh --short to work with --exclude and --include
Mads Kiilerich <mads@kiilerich.com>
parents: 7113
diff changeset
   104
echo % -- patch file content
10397
8cb81d75730c mq: add parent node IDs to MQ patches on qrefresh/qnew
Steve Losh <steve@stevelosh.com>
parents: 10368
diff changeset
   105
catpatch .hg/patches/mqbase | \
7113
f7fc5f5ecd62 mq: Allow qrefresh --silent to take parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 6801
diff changeset
   106
sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
f7fc5f5ecd62 mq: Allow qrefresh --silent to take parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 6801
diff changeset
   107
    -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
7177
09ed32b79656 mq: Fix --qrefresh --short to work with --exclude and --include
Mads Kiilerich <mads@kiilerich.com>
parents: 7113
diff changeset
   108
hg st
7113
f7fc5f5ecd62 mq: Allow qrefresh --silent to take parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 6801
diff changeset
   109
7177
09ed32b79656 mq: Fix --qrefresh --short to work with --exclude and --include
Mads Kiilerich <mads@kiilerich.com>
parents: 7113
diff changeset
   110
echo % -- diff shows what is not in patch
7113
f7fc5f5ecd62 mq: Allow qrefresh --silent to take parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 6801
diff changeset
   111
hg diff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
f7fc5f5ecd62 mq: Allow qrefresh --silent to take parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 6801
diff changeset
   112
              -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" \
f7fc5f5ecd62 mq: Allow qrefresh --silent to take parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 6801
diff changeset
   113
              -e "s/^\(diff\).*/\1/"
7177
09ed32b79656 mq: Fix --qrefresh --short to work with --exclude and --include
Mads Kiilerich <mads@kiilerich.com>
parents: 7113
diff changeset
   114
echo % - before starting exclusive tests
09ed32b79656 mq: Fix --qrefresh --short to work with --exclude and --include
Mads Kiilerich <mads@kiilerich.com>
parents: 7113
diff changeset
   115
sed -n '/^diff/s/diff -r [^ ]* //p' .hg/patches/mqbase
09ed32b79656 mq: Fix --qrefresh --short to work with --exclude and --include
Mads Kiilerich <mads@kiilerich.com>
parents: 7113
diff changeset
   116
echo % - exclude 2/base
09ed32b79656 mq: Fix --qrefresh --short to work with --exclude and --include
Mads Kiilerich <mads@kiilerich.com>
parents: 7113
diff changeset
   117
hg qref -s -X 2/base
09ed32b79656 mq: Fix --qrefresh --short to work with --exclude and --include
Mads Kiilerich <mads@kiilerich.com>
parents: 7113
diff changeset
   118
sed -n '/^diff/s/diff -r [^ ]* //p' .hg/patches/mqbase
09ed32b79656 mq: Fix --qrefresh --short to work with --exclude and --include
Mads Kiilerich <mads@kiilerich.com>
parents: 7113
diff changeset
   119
echo % -- status shows 2/base as dirty
09ed32b79656 mq: Fix --qrefresh --short to work with --exclude and --include
Mads Kiilerich <mads@kiilerich.com>
parents: 7113
diff changeset
   120
hg st
09ed32b79656 mq: Fix --qrefresh --short to work with --exclude and --include
Mads Kiilerich <mads@kiilerich.com>
parents: 7113
diff changeset
   121
echo % - remove 1/base and add 2/base again but not orphanchild
09ed32b79656 mq: Fix --qrefresh --short to work with --exclude and --include
Mads Kiilerich <mads@kiilerich.com>
parents: 7113
diff changeset
   122
hg qref -s -X orphanchild -X 1/base 2/base orphanchild
09ed32b79656 mq: Fix --qrefresh --short to work with --exclude and --include
Mads Kiilerich <mads@kiilerich.com>
parents: 7113
diff changeset
   123
sed -n '/^diff/s/diff -r [^ ]* //p' .hg/patches/mqbase
09ed32b79656 mq: Fix --qrefresh --short to work with --exclude and --include
Mads Kiilerich <mads@kiilerich.com>
parents: 7113
diff changeset
   124
echo % - add 1/base with include filter - and thus remove 2/base from patch
09ed32b79656 mq: Fix --qrefresh --short to work with --exclude and --include
Mads Kiilerich <mads@kiilerich.com>
parents: 7113
diff changeset
   125
hg qref -s -I 1/ o* */*
09ed32b79656 mq: Fix --qrefresh --short to work with --exclude and --include
Mads Kiilerich <mads@kiilerich.com>
parents: 7113
diff changeset
   126
sed -n '/^diff/s/diff -r [^ ]* //p' .hg/patches/mqbase
09ed32b79656 mq: Fix --qrefresh --short to work with --exclude and --include
Mads Kiilerich <mads@kiilerich.com>
parents: 7113
diff changeset
   127
echo
6801
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   128
cd ..
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   129
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   130
# Test qrefresh --git losing copy metadata
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   131
echo % create test repo
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   132
hg init repo
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   133
cd repo
7566
5f7e3f17aece mq: drop copy records when refreshing regular patches (issue1441)
Patrick Mezard <pmezard@gmail.com>
parents: 7177
diff changeset
   134
echo "[diff]" >> .hg/hgrc
5f7e3f17aece mq: drop copy records when refreshing regular patches (issue1441)
Patrick Mezard <pmezard@gmail.com>
parents: 7177
diff changeset
   135
echo "git=True" >> .hg/hgrc
6801
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   136
echo a > a
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   137
hg ci -Am adda
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   138
hg copy a ab
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   139
echo b >> ab
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   140
hg copy a ac
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   141
echo c >> ac
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   142
echo % capture changes
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   143
hg qnew -f p1
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   144
hg qdiff
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   145
echo % refresh and check changes again
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   146
hg qref
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   147
hg qdiff
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   148
cd ..
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   149
7566
5f7e3f17aece mq: drop copy records when refreshing regular patches (issue1441)
Patrick Mezard <pmezard@gmail.com>
parents: 7177
diff changeset
   150
# Test issue 1441: qrefresh confused after hg rename
5f7e3f17aece mq: drop copy records when refreshing regular patches (issue1441)
Patrick Mezard <pmezard@gmail.com>
parents: 7177
diff changeset
   151
echo % issue1441 without git patches
5f7e3f17aece mq: drop copy records when refreshing regular patches (issue1441)
Patrick Mezard <pmezard@gmail.com>
parents: 7177
diff changeset
   152
hg init repo-1441
5f7e3f17aece mq: drop copy records when refreshing regular patches (issue1441)
Patrick Mezard <pmezard@gmail.com>
parents: 7177
diff changeset
   153
cd repo-1441
5f7e3f17aece mq: drop copy records when refreshing regular patches (issue1441)
Patrick Mezard <pmezard@gmail.com>
parents: 7177
diff changeset
   154
echo a > a
5f7e3f17aece mq: drop copy records when refreshing regular patches (issue1441)
Patrick Mezard <pmezard@gmail.com>
parents: 7177
diff changeset
   155
hg add a
5f7e3f17aece mq: drop copy records when refreshing regular patches (issue1441)
Patrick Mezard <pmezard@gmail.com>
parents: 7177
diff changeset
   156
hg qnew -f p
5f7e3f17aece mq: drop copy records when refreshing regular patches (issue1441)
Patrick Mezard <pmezard@gmail.com>
parents: 7177
diff changeset
   157
hg mv a b
5f7e3f17aece mq: drop copy records when refreshing regular patches (issue1441)
Patrick Mezard <pmezard@gmail.com>
parents: 7177
diff changeset
   158
hg qrefresh
5f7e3f17aece mq: drop copy records when refreshing regular patches (issue1441)
Patrick Mezard <pmezard@gmail.com>
parents: 7177
diff changeset
   159
hg qdiff --nodates
5f7e3f17aece mq: drop copy records when refreshing regular patches (issue1441)
Patrick Mezard <pmezard@gmail.com>
parents: 7177
diff changeset
   160
cd ..
5f7e3f17aece mq: drop copy records when refreshing regular patches (issue1441)
Patrick Mezard <pmezard@gmail.com>
parents: 7177
diff changeset
   161
10367
b8801b58bbd8 test-mq-qrefresh: test qrefresh when tip != qtip
Patrick Mezard <pmezard@gmail.com>
parents: 7566
diff changeset
   162
echo '% issue2025: qrefresh does not honor filtering options when tip != qtip'
b8801b58bbd8 test-mq-qrefresh: test qrefresh when tip != qtip
Patrick Mezard <pmezard@gmail.com>
parents: 7566
diff changeset
   163
hg init repo-2025
b8801b58bbd8 test-mq-qrefresh: test qrefresh when tip != qtip
Patrick Mezard <pmezard@gmail.com>
parents: 7566
diff changeset
   164
cd repo-2025
b8801b58bbd8 test-mq-qrefresh: test qrefresh when tip != qtip
Patrick Mezard <pmezard@gmail.com>
parents: 7566
diff changeset
   165
echo a > a
b8801b58bbd8 test-mq-qrefresh: test qrefresh when tip != qtip
Patrick Mezard <pmezard@gmail.com>
parents: 7566
diff changeset
   166
echo b > b
b8801b58bbd8 test-mq-qrefresh: test qrefresh when tip != qtip
Patrick Mezard <pmezard@gmail.com>
parents: 7566
diff changeset
   167
hg ci -qAm addab
b8801b58bbd8 test-mq-qrefresh: test qrefresh when tip != qtip
Patrick Mezard <pmezard@gmail.com>
parents: 7566
diff changeset
   168
echo a >> a
b8801b58bbd8 test-mq-qrefresh: test qrefresh when tip != qtip
Patrick Mezard <pmezard@gmail.com>
parents: 7566
diff changeset
   169
echo b >> b
b8801b58bbd8 test-mq-qrefresh: test qrefresh when tip != qtip
Patrick Mezard <pmezard@gmail.com>
parents: 7566
diff changeset
   170
hg qnew -f patch
b8801b58bbd8 test-mq-qrefresh: test qrefresh when tip != qtip
Patrick Mezard <pmezard@gmail.com>
parents: 7566
diff changeset
   171
hg up -qC 0
b8801b58bbd8 test-mq-qrefresh: test qrefresh when tip != qtip
Patrick Mezard <pmezard@gmail.com>
parents: 7566
diff changeset
   172
echo c > c
b8801b58bbd8 test-mq-qrefresh: test qrefresh when tip != qtip
Patrick Mezard <pmezard@gmail.com>
parents: 7566
diff changeset
   173
hg ci -qAm addc
b8801b58bbd8 test-mq-qrefresh: test qrefresh when tip != qtip
Patrick Mezard <pmezard@gmail.com>
parents: 7566
diff changeset
   174
hg up -qC 1
b8801b58bbd8 test-mq-qrefresh: test qrefresh when tip != qtip
Patrick Mezard <pmezard@gmail.com>
parents: 7566
diff changeset
   175
echo '% refresh with tip != qtip'
b8801b58bbd8 test-mq-qrefresh: test qrefresh when tip != qtip
Patrick Mezard <pmezard@gmail.com>
parents: 7566
diff changeset
   176
hg --config diff.nodates=1 qrefresh -I b 2>&1 \
b8801b58bbd8 test-mq-qrefresh: test qrefresh when tip != qtip
Patrick Mezard <pmezard@gmail.com>
parents: 7566
diff changeset
   177
    | sed 's/saving bundle.*/saving bundle.../g'
b8801b58bbd8 test-mq-qrefresh: test qrefresh when tip != qtip
Patrick Mezard <pmezard@gmail.com>
parents: 7566
diff changeset
   178
echo '% status after refresh'
b8801b58bbd8 test-mq-qrefresh: test qrefresh when tip != qtip
Patrick Mezard <pmezard@gmail.com>
parents: 7566
diff changeset
   179
hg st
b8801b58bbd8 test-mq-qrefresh: test qrefresh when tip != qtip
Patrick Mezard <pmezard@gmail.com>
parents: 7566
diff changeset
   180
echo '% b after refresh'
b8801b58bbd8 test-mq-qrefresh: test qrefresh when tip != qtip
Patrick Mezard <pmezard@gmail.com>
parents: 7566
diff changeset
   181
cat b
b8801b58bbd8 test-mq-qrefresh: test qrefresh when tip != qtip
Patrick Mezard <pmezard@gmail.com>
parents: 7566
diff changeset
   182
echo '% patch file after refresh'
10397
8cb81d75730c mq: add parent node IDs to MQ patches on qrefresh/qnew
Steve Losh <steve@stevelosh.com>
parents: 10368
diff changeset
   183
catpatch .hg/patches/patch
10367
b8801b58bbd8 test-mq-qrefresh: test qrefresh when tip != qtip
Patrick Mezard <pmezard@gmail.com>
parents: 7566
diff changeset
   184
cd ..
b8801b58bbd8 test-mq-qrefresh: test qrefresh when tip != qtip
Patrick Mezard <pmezard@gmail.com>
parents: 7566
diff changeset
   185
b8801b58bbd8 test-mq-qrefresh: test qrefresh when tip != qtip
Patrick Mezard <pmezard@gmail.com>
parents: 7566
diff changeset
   186
7566
5f7e3f17aece mq: drop copy records when refreshing regular patches (issue1441)
Patrick Mezard <pmezard@gmail.com>
parents: 7177
diff changeset
   187
echo % issue1441 with git patches
5f7e3f17aece mq: drop copy records when refreshing regular patches (issue1441)
Patrick Mezard <pmezard@gmail.com>
parents: 7177
diff changeset
   188
hg init repo-1441-git
5f7e3f17aece mq: drop copy records when refreshing regular patches (issue1441)
Patrick Mezard <pmezard@gmail.com>
parents: 7177
diff changeset
   189
cd repo-1441-git
5f7e3f17aece mq: drop copy records when refreshing regular patches (issue1441)
Patrick Mezard <pmezard@gmail.com>
parents: 7177
diff changeset
   190
echo "[diff]" >> .hg/hgrc
5f7e3f17aece mq: drop copy records when refreshing regular patches (issue1441)
Patrick Mezard <pmezard@gmail.com>
parents: 7177
diff changeset
   191
echo "git=True" >> .hg/hgrc
5f7e3f17aece mq: drop copy records when refreshing regular patches (issue1441)
Patrick Mezard <pmezard@gmail.com>
parents: 7177
diff changeset
   192
echo a > a
5f7e3f17aece mq: drop copy records when refreshing regular patches (issue1441)
Patrick Mezard <pmezard@gmail.com>
parents: 7177
diff changeset
   193
hg add a
5f7e3f17aece mq: drop copy records when refreshing regular patches (issue1441)
Patrick Mezard <pmezard@gmail.com>
parents: 7177
diff changeset
   194
hg qnew -f p
5f7e3f17aece mq: drop copy records when refreshing regular patches (issue1441)
Patrick Mezard <pmezard@gmail.com>
parents: 7177
diff changeset
   195
hg mv a b
5f7e3f17aece mq: drop copy records when refreshing regular patches (issue1441)
Patrick Mezard <pmezard@gmail.com>
parents: 7177
diff changeset
   196
hg qrefresh
5f7e3f17aece mq: drop copy records when refreshing regular patches (issue1441)
Patrick Mezard <pmezard@gmail.com>
parents: 7177
diff changeset
   197
hg qdiff --nodates
10282
08a0f04b56bd many, many trivial check-code fixups
Matt Mackall <mpm@selenic.com>
parents: 7566
diff changeset
   198
cd ..