tests/test-mq-qrefresh
author David Soria Parra <dsp@php.net>
Sun, 07 Dec 2008 08:47:02 +0100
changeset 7485 ecfb683675ed
parent 7177 09ed32b79656
child 7566 5f7e3f17aece
permissions -rwxr-xr-x
Merge bookmarks
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
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
     6
echo % init
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
     7
hg init a
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
     8
cd a
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
     9
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    10
echo % commit
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    11
mkdir 1 2
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    12
echo 'base' > 1/base
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    13
echo 'base' > 2/base
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    14
hg ci -Ambase -d '1 0'
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    15
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    16
echo % qnew mqbase
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    17
hg qnew -mmqbase mqbase
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    18
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    19
echo % qrefresh
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    20
echo 'patched' > 1/base
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    21
echo 'patched' > 2/base
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    22
hg qrefresh
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    23
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    24
echo % qdiff
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    25
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
    26
               -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
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 dirname
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 % patch file contents
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    33
cat .hg/patches/mqbase | \
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    34
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
    35
    -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    36
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    37
echo % qrefresh 1
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    38
echo 'patched again' > base
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    39
hg qrefresh 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 % qdiff
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    42
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
    43
               -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\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 dirname
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 % patch file contents
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    50
cat .hg/patches/mqbase | \
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    51
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
    52
    -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    53
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    54
echo % qrefresh . in subdir
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    55
( cd 1 ; hg qrefresh . )
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    56
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    57
echo % qdiff
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    58
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
    59
               -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
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 dirname
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 % patch file contents
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    66
cat .hg/patches/mqbase | \
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    67
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
    68
    -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    69
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    70
echo % qrefresh in hg-root again
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    71
hg qrefresh
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    72
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    73
echo % qdiff
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    74
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
    75
               -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
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 dirname
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 % patch file contents
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    82
cat .hg/patches/mqbase | \
f01efb4bc258 tests: add new test; test-mq-qrefresh
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
diff changeset
    83
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
    84
    -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
    85
7177
09ed32b79656 mq: Fix --qrefresh --short to work with --exclude and --include
Mads Kiilerich <mads@kiilerich.com>
parents: 7113
diff changeset
    86
echo
09ed32b79656 mq: Fix --qrefresh --short to work with --exclude and --include
Mads Kiilerich <mads@kiilerich.com>
parents: 7113
diff changeset
    87
echo % qrefresh --short tests:
7113
f7fc5f5ecd62 mq: Allow qrefresh --silent to take parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 6801
diff changeset
    88
echo 'orphan' > orphanchild
f7fc5f5ecd62 mq: Allow qrefresh --silent to take parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 6801
diff changeset
    89
hg add orphanchild
7177
09ed32b79656 mq: Fix --qrefresh --short to work with --exclude and --include
Mads Kiilerich <mads@kiilerich.com>
parents: 7113
diff changeset
    90
09ed32b79656 mq: Fix --qrefresh --short to work with --exclude and --include
Mads Kiilerich <mads@kiilerich.com>
parents: 7113
diff changeset
    91
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
    92
hg qrefresh nonexistingfilename # clear patch
7113
f7fc5f5ecd62 mq: Allow qrefresh --silent to take parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 6801
diff changeset
    93
hg qrefresh --short 1/base
f7fc5f5ecd62 mq: Allow qrefresh --silent to take parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 6801
diff changeset
    94
hg qrefresh --short 2/base
f7fc5f5ecd62 mq: Allow qrefresh --silent to take parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 6801
diff changeset
    95
7177
09ed32b79656 mq: Fix --qrefresh --short to work with --exclude and --include
Mads Kiilerich <mads@kiilerich.com>
parents: 7113
diff changeset
    96
echo % -- qdiff output
7113
f7fc5f5ecd62 mq: Allow qrefresh --silent to take parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 6801
diff changeset
    97
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
    98
               -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
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 % -- patch file content
7113
f7fc5f5ecd62 mq: Allow qrefresh --silent to take parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 6801
diff changeset
   101
cat .hg/patches/mqbase | \
f7fc5f5ecd62 mq: Allow qrefresh --silent to take parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 6801
diff changeset
   102
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
   103
    -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
   104
hg st
7113
f7fc5f5ecd62 mq: Allow qrefresh --silent to take parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 6801
diff changeset
   105
7177
09ed32b79656 mq: Fix --qrefresh --short to work with --exclude and --include
Mads Kiilerich <mads@kiilerich.com>
parents: 7113
diff changeset
   106
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
   107
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
   108
              -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" \
f7fc5f5ecd62 mq: Allow qrefresh --silent to take parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 6801
diff changeset
   109
              -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
   110
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
   111
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
   112
echo % - exclude 2/base
09ed32b79656 mq: Fix --qrefresh --short to work with --exclude and --include
Mads Kiilerich <mads@kiilerich.com>
parents: 7113
diff changeset
   113
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
   114
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
   115
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
   116
hg st
09ed32b79656 mq: Fix --qrefresh --short to work with --exclude and --include
Mads Kiilerich <mads@kiilerich.com>
parents: 7113
diff changeset
   117
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
   118
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
   119
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
   120
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
   121
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
   122
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
   123
echo
6801
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   124
cd ..
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   125
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   126
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   127
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   128
echo "[diff]" >> $HGRCPATH
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   129
echo "git=True" >> $HGRCPATH
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   130
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   131
# Test qrefresh --git losing copy metadata
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   132
echo % create test repo
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   133
hg init repo
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   134
cd repo
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   135
echo a > a
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   136
hg ci -Am adda
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   137
hg copy a ab
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   138
echo b >> ab
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   139
hg copy a ac
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   140
echo c >> ac
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   141
echo % capture changes
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   142
hg qnew -f p1
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   143
hg qdiff
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   144
echo % refresh and check changes again
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   145
hg qref
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   146
hg qdiff
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   147
cd ..
71e339714586 mq: fix qrefresh losing copy information (issue 1134)
Patrick Mezard <pmezard@gmail.com>
parents: 3136
diff changeset
   148