tests/test-mq-qfold.t
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Wed, 19 Mar 2014 01:07:41 +0900
branchstable
changeset 20769 1e686e55780c
parent 12376 97ffc68f71d3
child 20859 e259d4c462b5
permissions -rw-r--r--
qfold: save manually edited commit message into ".hg/last-message.txt" Before this patch, manually edited commit message for "hg qfold -e" isn't saved into ".hg/last-message.txt" until it is saved by "localrepository.savecommitmessage()" in "localrepository.commit()". This may lose such commit message, if unexpected exception is raised. This patch saves manually edited commit message for "hg qfold -e" into ".hg/last-message.txt" just after user editing. This patch doesn't save the message specified by -m/-l options as same as other commands. This is the simplest implementation to fix on stable. Editing and saving commit message should be centralized into the framework of "localrepository.commit()" with "editor" argument in the future. This patch uses repository wrapping class for exception raising before saving commit message in "localrepository.commit()" easily and certainly, because such exception requires corner case condition.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12324
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
     1
  $ echo "[extensions]" >> $HGRCPATH
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
     2
  $ echo "mq=" >> $HGRCPATH
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
     3
  $ echo "[mq]" >> $HGRCPATH
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
     4
  $ echo "git=keep" >> $HGRCPATH
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
     5
  $ echo "[diff]" >> $HGRCPATH
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
     6
  $ echo "nodates=1" >> $HGRCPATH
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
     7
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
     8
init:
8426
2ff17c4de1da Add tests for qfold
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     9
12324
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    10
  $ hg init repo
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    11
  $ cd repo
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    12
  $ echo a > a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    13
  $ hg ci -Am adda
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    14
  adding a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    15
  $ echo a >> a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    16
  $ hg qnew -f p1
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    17
  $ echo b >> a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    18
  $ hg qnew -f p2
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    19
  $ echo c >> a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    20
  $ hg qnew -f p3
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    21
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    22
Fold in the middle of the queue:
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    23
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    24
  $ hg qpop p1
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    25
  popping p3
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    26
  popping p2
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    27
  now at: p1
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    28
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    29
  $ hg qdiff
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    30
  diff -r 07f494440405 a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    31
  --- a/a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    32
  +++ b/a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    33
  @@ -1,1 +1,2 @@
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    34
   a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    35
  +a
8426
2ff17c4de1da Add tests for qfold
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    36
12324
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    37
  $ hg qfold p2
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    38
  $ grep git .hg/patches/p1 && echo 'git patch found!'
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    39
  [1]
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    40
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    41
  $ hg qser
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    42
  p1
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    43
  p3
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    44
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    45
  $ hg qdiff
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    46
  diff -r 07f494440405 a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    47
  --- a/a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    48
  +++ b/a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    49
  @@ -1,1 +1,3 @@
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    50
   a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    51
  +a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    52
  +b
8426
2ff17c4de1da Add tests for qfold
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    53
12324
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    54
Fold with local changes:
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    55
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    56
  $ echo d >> a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    57
  $ hg qfold p3
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    58
  abort: local changes found, refresh first
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    59
  [255]
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    60
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    61
  $ hg diff -c .
12376
97ffc68f71d3 tests: add glob matching for unified tests
Brodie Rao <brodie@bitheap.org>
parents: 12375
diff changeset
    62
  diff -r 07f494440405 -r ???????????? a (glob)
12324
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    63
  --- a/a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    64
  +++ b/a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    65
  @@ -1,1 +1,3 @@
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    66
   a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    67
  +a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    68
  +b
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    69
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    70
  $ hg revert -a --no-backup
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    71
  reverting a
10397
8cb81d75730c mq: add parent node IDs to MQ patches on qrefresh/qnew
Steve Losh <steve@stevelosh.com>
parents: 10190
diff changeset
    72
12324
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    73
Fold git patch into a regular patch, expect git patch:
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    74
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    75
  $ echo a >> a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    76
  $ hg qnew -f regular
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    77
  $ hg cp a aa
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    78
  $ hg qnew --git -f git
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    79
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    80
  $ hg qpop
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    81
  popping git
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    82
  now at: regular
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    83
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    84
  $ hg qfold git
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    85
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    86
  $ cat .hg/patches/regular
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    87
  # HG changeset patch
12376
97ffc68f71d3 tests: add glob matching for unified tests
Brodie Rao <brodie@bitheap.org>
parents: 12375
diff changeset
    88
  # Parent ???????????????????????????????????????? (glob)
12324
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    89
  
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    90
  diff --git a/a b/a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    91
  --- a/a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    92
  +++ b/a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    93
  @@ -1,3 +1,4 @@
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    94
   a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    95
   a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    96
   b
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    97
  +a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    98
  diff --git a/a b/aa
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
    99
  copy from a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   100
  copy to aa
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   101
  --- a/a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   102
  +++ b/aa
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   103
  @@ -1,3 +1,4 @@
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   104
   a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   105
   a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   106
   b
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   107
  +a
10186
296a0b14a686 mq: preserve --git flag when folding patches
Patrick Mezard <pmezard@gmail.com>
parents: 8426
diff changeset
   108
12324
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   109
  $ hg qpop
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   110
  popping regular
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   111
  now at: p1
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   112
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   113
  $ hg qdel regular
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   114
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   115
Fold regular patch into a git patch, expect git patch:
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   116
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   117
  $ hg cp a aa
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   118
  $ hg qnew --git -f git
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   119
  $ echo b >> aa
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   120
  $ hg qnew -f regular
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   121
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   122
  $ hg qpop
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   123
  popping regular
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   124
  now at: git
10186
296a0b14a686 mq: preserve --git flag when folding patches
Patrick Mezard <pmezard@gmail.com>
parents: 8426
diff changeset
   125
12324
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   126
  $ hg qfold regular
10186
296a0b14a686 mq: preserve --git flag when folding patches
Patrick Mezard <pmezard@gmail.com>
parents: 8426
diff changeset
   127
12324
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   128
  $ cat .hg/patches/git
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   129
  # HG changeset patch
12376
97ffc68f71d3 tests: add glob matching for unified tests
Brodie Rao <brodie@bitheap.org>
parents: 12375
diff changeset
   130
  # Parent ???????????????????????????????????????? (glob)
12324
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   131
  
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   132
  diff --git a/a b/aa
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   133
  copy from a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   134
  copy to aa
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   135
  --- a/a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   136
  +++ b/aa
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   137
  @@ -1,3 +1,4 @@
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   138
   a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   139
   a
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   140
   b
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   141
  +b
8426
2ff17c4de1da Add tests for qfold
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   142
20769
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   143
Test saving last-message.txt:
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   144
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   145
  $ hg qrefresh -m "original message"
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   146
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   147
  $ cat > $TESTDIR/commitfailure.py <<EOF
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   148
  > from mercurial import util
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   149
  > def reposetup(ui, repo):
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   150
  >     class commitfailure(repo.__class__):
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   151
  >         def commit(self, *args, **kwargs):
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   152
  >             raise util.Abort('emulating unexpected abort')
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   153
  >     repo.__class__ = commitfailure
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   154
  > EOF
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   155
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   156
  $ cat > .hg/hgrc <<EOF
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   157
  > [extensions]
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   158
  > commitfailure = $TESTDIR/commitfailure.py
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   159
  > EOF
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   160
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   161
  $ cat > $TESTDIR/editor.sh << EOF
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   162
  > echo "==== before editing"
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   163
  > cat \$1
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   164
  > echo "===="
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   165
  > (echo; echo "test saving last-message.txt") >> \$1
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   166
  > EOF
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   167
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   168
  $ rm -f .hg/last-message.txt
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   169
  $ HGEDITOR="sh $TESTDIR/editor.sh" hg qfold -e p3
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   170
  ==== before editing
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   171
  original message====
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   172
  refresh interrupted while patch was popped! (revert --all, qpush to recover)
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   173
  abort: emulating unexpected abort
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   174
  [255]
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   175
  $ cat .hg/last-message.txt
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   176
  original message
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   177
  test saving last-message.txt
1e686e55780c qfold: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 12376
diff changeset
   178
12324
b701610f6c56 tests: unify some of test-mq*
Adrian Buehlmann <adrian@cadifra.com>
parents: 10397
diff changeset
   179
  $ cd ..
8426
2ff17c4de1da Add tests for qfold
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   180