tests/test-mq-qnew.t
author Martin Geisler <mg@lazybytes.net>
Wed, 27 Oct 2010 12:05:37 +0200
branchstable
changeset 12857 a9f91c844a3b
parent 12466 3160698100c6
child 12878 1634287b6ab1
permissions -rw-r--r--
README: add small introduction
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7296
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
     1
12466
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
     2
  $ catpatch() {
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
     3
  >     cat $1 | sed -e "s/^\(# Parent \).*/\1/"
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
     4
  > }
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
     5
  $ echo "[extensions]" >> $HGRCPATH
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
     6
  $ echo "mq=" >> $HGRCPATH
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
     7
  $ runtest() {
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
     8
  >     hg init mq
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
     9
  >     cd mq
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    10
  > 
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    11
  >     echo a > a
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    12
  >     hg ci -Ama
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    13
  > 
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    14
  >     echo '% qnew should refuse bad patch names'
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    15
  >     hg qnew series
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    16
  >     hg qnew status
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    17
  >     hg qnew guards
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    18
  >     hg qnew .hgignore
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    19
  >     hg qnew .mqfoo
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    20
  >     hg qnew 'foo#bar'
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    21
  >     hg qnew 'foo:bar'
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    22
  > 
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    23
  >     hg qinit -c
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    24
  > 
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    25
  >     echo '% qnew with name containing slash'
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    26
  >     hg qnew foo/bar.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    27
  >     hg qseries
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    28
  >     hg qpop
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    29
  >     hg qdelete foo/bar.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    30
  > 
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    31
  >     echo '% qnew with uncommitted changes'
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    32
  >     echo a > somefile
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    33
  >     hg add somefile
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    34
  >     hg qnew uncommitted.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    35
  >     hg st
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    36
  >     hg qseries
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    37
  > 
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    38
  >     echo '% qnew implies add'
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    39
  >     hg -R .hg/patches st
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    40
  > 
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    41
  >     echo '% qnew missing'
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    42
  >     hg qnew missing.patch missing
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    43
  > 
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    44
  >     echo '% qnew -m'
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    45
  >     hg qnew -m 'foo bar' mtest.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    46
  >     catpatch .hg/patches/mtest.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    47
  > 
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    48
  >     echo '% qnew twice'
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    49
  >     hg qnew first.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    50
  >     hg qnew first.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    51
  > 
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    52
  >     touch ../first.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    53
  >     hg qimport ../first.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    54
  > 
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    55
  >     echo '% qnew -f from a subdirectory'
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    56
  >     hg qpop -a
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    57
  >     mkdir d
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    58
  >     cd d
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    59
  >     echo b > b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    60
  >     hg ci -Am t
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    61
  >     echo b >> b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    62
  >     hg st
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    63
  >     hg qnew -g -f p
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    64
  >     catpatch ../.hg/patches/p
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    65
  > 
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    66
  >     echo '% qnew -u with no username configured'
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    67
  >     HGUSER= hg qnew -u blue red
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    68
  >     catpatch ../.hg/patches/red
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    69
  > 
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    70
  >     echo '% qnew -e -u with no username configured'
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    71
  >     HGUSER= hg qnew -e -u chartreuse fucsia
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    72
  >     catpatch ../.hg/patches/fucsia
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    73
  > 
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    74
  >     echo '% fail when trying to import a merge'
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    75
  >     hg init merge
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    76
  >     cd merge
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    77
  >     touch a
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    78
  >     hg ci -Am null
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    79
  >     echo a >> a
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    80
  >     hg ci -m a
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    81
  >     hg up -r 0
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    82
  >     echo b >> a
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    83
  >     hg ci -m b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    84
  >     hg merge -f 1
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    85
  >     hg resolve --mark a
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    86
  >     hg qnew -f merge
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    87
  > 
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    88
  >     cd ../../..
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    89
  >     rm -r mq
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    90
  > }
10397
8cb81d75730c mq: add parent node IDs to MQ patches on qrefresh/qnew
Steve Losh <steve@stevelosh.com>
parents: 10372
diff changeset
    91
12466
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    92
plain headers
7296
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
    93
12466
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    94
  $ echo "[mq]" >> $HGRCPATH
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    95
  $ echo "plain=true" >> $HGRCPATH
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    96
  $ mkdir sandbox
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    97
  $ (cd sandbox ; runtest)
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    98
  adding a
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
    99
  % qnew should refuse bad patch names
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   100
  abort: "series" cannot be used as the name of a patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   101
  abort: "status" cannot be used as the name of a patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   102
  abort: "guards" cannot be used as the name of a patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   103
  abort: ".hgignore" cannot be used as the name of a patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   104
  abort: ".mqfoo" cannot be used as the name of a patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   105
  abort: "foo#bar" cannot be used as the name of a patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   106
  abort: "foo:bar" cannot be used as the name of a patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   107
  % qnew with name containing slash
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   108
  foo/bar.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   109
  popping foo/bar.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   110
  patch queue now empty
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   111
  % qnew with uncommitted changes
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   112
  uncommitted.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   113
  % qnew implies add
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   114
  A .hgignore
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   115
  A series
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   116
  A uncommitted.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   117
  % qnew missing
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   118
  abort: missing: No such file or directory
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   119
  % qnew -m
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   120
  foo bar
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   121
  
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   122
  % qnew twice
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   123
  abort: patch "first.patch" already exists
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   124
  abort: patch "first.patch" already exists
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   125
  % qnew -f from a subdirectory
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   126
  popping first.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   127
  popping mtest.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   128
  popping uncommitted.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   129
  patch queue now empty
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   130
  adding d/b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   131
  M d/b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   132
  diff --git a/d/b b/d/b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   133
  --- a/d/b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   134
  +++ b/d/b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   135
  @@ -1,1 +1,2 @@
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   136
   b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   137
  +b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   138
  % qnew -u with no username configured
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   139
  From: blue
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   140
  
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   141
  % qnew -e -u with no username configured
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   142
  From: chartreuse
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   143
  
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   144
  % fail when trying to import a merge
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   145
  adding a
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   146
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   147
  created new head
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   148
  merging a
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   149
  warning: conflicts during merge.
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   150
  merging a failed!
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   151
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   152
  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   153
  abort: cannot manage merge changesets
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   154
  $ rm -r sandbox
2714
85070b784896 Fix test-mq-qnew-twice exit code and output.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2711
diff changeset
   155
12466
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   156
hg headers
11575
a5903e612f07 mq: evaluate --user before invoking editor with -e (issue2289)
Brendan Cully <brendan@kublai.com>
parents: 11513
diff changeset
   157
12466
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   158
  $ echo "plain=false" >> $HGRCPATH
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   159
  $ mkdir sandbox
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   160
  $ (cd sandbox ; runtest)
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   161
  adding a
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   162
  % qnew should refuse bad patch names
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   163
  abort: "series" cannot be used as the name of a patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   164
  abort: "status" cannot be used as the name of a patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   165
  abort: "guards" cannot be used as the name of a patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   166
  abort: ".hgignore" cannot be used as the name of a patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   167
  abort: ".mqfoo" cannot be used as the name of a patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   168
  abort: "foo#bar" cannot be used as the name of a patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   169
  abort: "foo:bar" cannot be used as the name of a patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   170
  % qnew with name containing slash
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   171
  foo/bar.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   172
  popping foo/bar.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   173
  patch queue now empty
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   174
  % qnew with uncommitted changes
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   175
  uncommitted.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   176
  % qnew implies add
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   177
  A .hgignore
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   178
  A series
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   179
  A uncommitted.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   180
  % qnew missing
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   181
  abort: missing: No such file or directory
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   182
  % qnew -m
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   183
  # HG changeset patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   184
  # Parent 
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   185
  foo bar
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   186
  
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   187
  % qnew twice
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   188
  abort: patch "first.patch" already exists
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   189
  abort: patch "first.patch" already exists
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   190
  % qnew -f from a subdirectory
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   191
  popping first.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   192
  popping mtest.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   193
  popping uncommitted.patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   194
  patch queue now empty
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   195
  adding d/b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   196
  M d/b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   197
  # HG changeset patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   198
  # Parent 
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   199
  diff --git a/d/b b/d/b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   200
  --- a/d/b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   201
  +++ b/d/b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   202
  @@ -1,1 +1,2 @@
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   203
   b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   204
  +b
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   205
  % qnew -u with no username configured
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   206
  # HG changeset patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   207
  # Parent 
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   208
  # User blue
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   209
  % qnew -e -u with no username configured
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   210
  # HG changeset patch
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   211
  # Parent 
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   212
  # User chartreuse
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   213
  % fail when trying to import a merge
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   214
  adding a
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   215
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   216
  created new head
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   217
  merging a
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   218
  warning: conflicts during merge.
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   219
  merging a failed!
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   220
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   221
  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   222
  abort: cannot manage merge changesets
3160698100c6 tests: unify test-mq-qnew
Matt Mackall <mpm@selenic.com>
parents: 11575
diff changeset
   223
  $ rm -r sandbox