tests/test-commit-amend.t
author Gregory Szorc <gregory.szorc@gmail.com>
Fri, 18 Apr 2014 22:19:25 -0700
changeset 21266 19d6fec60b81
parent 21036 a1a1bd09e4f4
child 21267 e4f451c8c05c
permissions -rw-r--r--
resolve: print message when no unresolved files remain (issue4214) When using resolve, users often have to consult with the output of |hg resolve -l| to see if any unresolved files remain. This step is tedious and adds overhead to resolving. This patch will notify a user if there are no unresolved files remaining after executing |hg resolve|:: no unresolved files; you may continue your unfinished operation The patch stops short of telling the user exactly what command should be executed to continue the unfinished operation. That is because this information is not currently captured anywhere. This would make a compelling follow-up feature.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
     1
  $ hg init
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
     2
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
     3
Setup:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
     4
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
     5
  $ echo a >> a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
     6
  $ hg ci -Am 'base'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
     7
  adding a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
     8
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
     9
Refuse to amend public csets:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    10
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    11
  $ hg phase -r . -p
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    12
  $ hg ci --amend
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    13
  abort: cannot amend public changesets
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    14
  [255]
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    15
  $ hg phase -r . -f -d
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    16
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    17
  $ echo a >> a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    18
  $ hg ci -Am 'base1'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    19
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    20
Nothing to amend:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    21
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    22
  $ hg ci --amend
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    23
  nothing changed
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    24
  [1]
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    25
17060
69fa0459dd3b test-commit-amend: adapt for Windows after fba17a64fa49
Adrian Buehlmann <adrian@cadifra.com>
parents: 17059
diff changeset
    26
  $ cat >> $HGRCPATH <<EOF
69fa0459dd3b test-commit-amend: adapt for Windows after fba17a64fa49
Adrian Buehlmann <adrian@cadifra.com>
parents: 17059
diff changeset
    27
  > [hooks]
17462
8085fed2bf0a tests: correct quoting of double quotes in here documents used to write hooks
Jim Hague <jim.hague@acm.org>
parents: 17461
diff changeset
    28
  > pretxncommit.foo = sh -c "echo \\"pretxncommit \$HG_NODE\\"; hg id -r \$HG_NODE"
17060
69fa0459dd3b test-commit-amend: adapt for Windows after fba17a64fa49
Adrian Buehlmann <adrian@cadifra.com>
parents: 17059
diff changeset
    29
  > EOF
17049
2440822446ce amend: disable hooks when creating intermediate commit (issue3501)
Idan Kamara <idankk86@gmail.com>
parents: 16630
diff changeset
    30
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    31
Amending changeset with changes in working dir:
17924
45bd0cd7ca04 amend: force editor only if old message is reused (issue3698)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17863
diff changeset
    32
(and check that --message does not trigger an editor)
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    33
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    34
  $ echo a >> a
17924
45bd0cd7ca04 amend: force editor only if old message is reused (issue3698)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17863
diff changeset
    35
  $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -m 'amend base1'
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
    36
  pretxncommit 43f1ba15f28a50abf0aae529cf8a16bfced7b149
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
    37
  43f1ba15f28a tip
17060
69fa0459dd3b test-commit-amend: adapt for Windows after fba17a64fa49
Adrian Buehlmann <adrian@cadifra.com>
parents: 17059
diff changeset
    38
  saved backup bundle to $TESTTMP/.hg/strip-backup/489edb5b847d-amend-backup.hg (glob)
17049
2440822446ce amend: disable hooks when creating intermediate commit (issue3501)
Idan Kamara <idankk86@gmail.com>
parents: 16630
diff changeset
    39
  $ echo 'pretxncommit.foo = ' >> $HGRCPATH
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    40
  $ hg diff -c .
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
    41
  diff -r ad120869acf0 -r 43f1ba15f28a a
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    42
  --- a/a	Thu Jan 01 00:00:00 1970 +0000
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    43
  +++ b/a	Thu Jan 01 00:00:00 1970 +0000
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    44
  @@ -1,1 +1,3 @@
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    45
   a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    46
  +a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    47
  +a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    48
  $ hg log
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
    49
  changeset:   1:43f1ba15f28a
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    50
  tag:         tip
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    51
  user:        test
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    52
  date:        Thu Jan 01 00:00:00 1970 +0000
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    53
  summary:     amend base1
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    54
  
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    55
  changeset:   0:ad120869acf0
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    56
  user:        test
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    57
  date:        Thu Jan 01 00:00:00 1970 +0000
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    58
  summary:     base
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    59
  
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    60
18197
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    61
Check proper abort for empty message
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    62
18197
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    63
  $ cat > editor.sh << '__EOF__'
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    64
  > #!/bin/sh
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    65
  > echo "" > "$1"
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    66
  > __EOF__
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    67
  $ echo b > b
18197
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    68
  $ hg add b
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    69
  $ hg summary
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    70
  parent: 1:43f1ba15f28a tip
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    71
   amend base1
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    72
  branch: default
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    73
  commit: 1 added, 1 unknown
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    74
  update: (current)
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    75
  $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    76
  transaction abort!
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    77
  rollback completed
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    78
  abort: empty commit message
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    79
  [255]
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    80
  $ hg summary
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    81
  parent: 1:43f1ba15f28a tip
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    82
   amend base1
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    83
  branch: default
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    84
  commit: 1 added, 1 unknown
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    85
  update: (current)
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    86
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    87
Add new file:
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    88
  $ hg ci --amend -m 'amend base1 new file'
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
    89
  saved backup bundle to $TESTTMP/.hg/strip-backup/43f1ba15f28a-amend-backup.hg (glob)
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    90
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    91
Remove file that was added in amended commit:
17863
034e55bbf7c0 amend: fix incompatibity between logfile and message option (issue3675)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17811
diff changeset
    92
(and test logfile option)
17924
45bd0cd7ca04 amend: force editor only if old message is reused (issue3698)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17863
diff changeset
    93
(and test that logfile option do not trigger an editor)
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    94
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    95
  $ hg rm b
17863
034e55bbf7c0 amend: fix incompatibity between logfile and message option (issue3675)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17811
diff changeset
    96
  $ echo 'amend base1 remove new file' > ../logfile
17924
45bd0cd7ca04 amend: force editor only if old message is reused (issue3698)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17863
diff changeset
    97
  $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg ci --amend --logfile ../logfile
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
    98
  saved backup bundle to $TESTTMP/.hg/strip-backup/b8e3cb2b3882-amend-backup.hg (glob)
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    99
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   100
  $ hg cat b
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   101
  b: no such file in rev 74609c7f506e
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   102
  [1]
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   103
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   104
No changes, just a different message:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   105
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   106
  $ hg ci -v --amend -m 'no changes, new message'
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   107
  amending changeset 74609c7f506e
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   108
  copying changeset 74609c7f506e to ad120869acf0
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   109
  a
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   110
  stripping amended changeset 74609c7f506e
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   111
  1 changesets found
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   112
  saved backup bundle to $TESTTMP/.hg/strip-backup/74609c7f506e-amend-backup.hg (glob)
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   113
  1 changesets found
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   114
  adding branch
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   115
  adding changesets
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   116
  adding manifests
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   117
  adding file changes
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   118
  added 1 changesets with 1 changes to 1 files
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   119
  committed changeset 1:1cd866679df8
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   120
  $ hg diff -c .
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   121
  diff -r ad120869acf0 -r 1cd866679df8 a
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   122
  --- a/a	Thu Jan 01 00:00:00 1970 +0000
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   123
  +++ b/a	Thu Jan 01 00:00:00 1970 +0000
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   124
  @@ -1,1 +1,3 @@
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   125
   a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   126
  +a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   127
  +a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   128
  $ hg log
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   129
  changeset:   1:1cd866679df8
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   130
  tag:         tip
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   131
  user:        test
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   132
  date:        Thu Jan 01 00:00:00 1970 +0000
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   133
  summary:     no changes, new message
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   134
  
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   135
  changeset:   0:ad120869acf0
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   136
  user:        test
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   137
  date:        Thu Jan 01 00:00:00 1970 +0000
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   138
  summary:     base
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   139
  
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   140
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   141
Disable default date on commit so when -d isn't given, the old date is preserved:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   142
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   143
  $ echo '[defaults]' >> $HGRCPATH
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   144
  $ echo 'commit=' >> $HGRCPATH
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   145
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   146
Test -u/-d:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   147
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   148
  $ hg ci --amend -u foo -d '1 0'
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   149
  saved backup bundle to $TESTTMP/.hg/strip-backup/1cd866679df8-amend-backup.hg (glob)
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   150
  $ echo a >> a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   151
  $ hg ci --amend -u foo -d '1 0'
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   152
  saved backup bundle to $TESTTMP/.hg/strip-backup/780e6f23e03d-amend-backup.hg (glob)
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   153
  $ hg log -r .
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   154
  changeset:   1:5f357c7560ab
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   155
  tag:         tip
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   156
  user:        foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   157
  date:        Thu Jan 01 00:00:01 1970 +0000
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   158
  summary:     no changes, new message
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   159
  
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   160
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   161
Open editor with old commit message if a message isn't given otherwise:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   162
16901
5b89700cce30 tests: consistently use a HGEDITOR pattern that works with msys on windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16900
diff changeset
   163
  $ cat > editor.sh << '__EOF__'
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   164
  > #!/bin/sh
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   165
  > cat $1
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   166
  > echo "another precious commit message" > "$1"
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   167
  > __EOF__
20771
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   168
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   169
at first, test saving last-message.txt
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   170
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   171
  $ cat > .hg/hgrc << '__EOF__'
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   172
  > [hooks]
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   173
  > pretxncommit.test-saving-last-message = false
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   174
  > __EOF__
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   175
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   176
  $ rm -f .hg/last-message.txt
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   177
  $ hg commit --amend -v -m "message given from command line"
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   178
  amending changeset 5f357c7560ab
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   179
  copying changeset 5f357c7560ab to ad120869acf0
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   180
  a
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   181
  running hook pretxncommit.test-saving-last-message: false
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   182
  transaction abort!
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   183
  rollback completed
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   184
  abort: pretxncommit.test-saving-last-message hook exited with status 1
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   185
  [255]
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   186
  $ cat .hg/last-message.txt
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   187
  message given from command line (no-eol)
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   188
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   189
  $ rm -f .hg/last-message.txt
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   190
  $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   191
  amending changeset 5f357c7560ab
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   192
  copying changeset 5f357c7560ab to ad120869acf0
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   193
  no changes, new message
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   194
  
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   195
  
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   196
  HG: Enter commit message.  Lines beginning with 'HG:' are removed.
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   197
  HG: Leave message empty to abort commit.
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   198
  HG: --
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   199
  HG: user: foo
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   200
  HG: branch 'default'
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   201
  HG: changed a
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   202
  a
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   203
  running hook pretxncommit.test-saving-last-message: false
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   204
  transaction abort!
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   205
  rollback completed
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   206
  abort: pretxncommit.test-saving-last-message hook exited with status 1
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   207
  [255]
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   208
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   209
  $ cat .hg/last-message.txt
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   210
  another precious commit message
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   211
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   212
  $ cat > .hg/hgrc << '__EOF__'
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   213
  > [hooks]
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   214
  > pretxncommit.test-saving-last-message =
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   215
  > __EOF__
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   216
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   217
then, test editing custom commit message
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   218
16901
5b89700cce30 tests: consistently use a HGEDITOR pattern that works with msys on windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16900
diff changeset
   219
  $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   220
  amending changeset 5f357c7560ab
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   221
  copying changeset 5f357c7560ab to ad120869acf0
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   222
  no changes, new message
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   223
  
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   224
  
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   225
  HG: Enter commit message.  Lines beginning with 'HG:' are removed.
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   226
  HG: Leave message empty to abort commit.
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   227
  HG: --
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   228
  HG: user: foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   229
  HG: branch 'default'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   230
  HG: changed a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   231
  a
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   232
  stripping amended changeset 5f357c7560ab
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   233
  1 changesets found
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   234
  saved backup bundle to $TESTTMP/.hg/strip-backup/5f357c7560ab-amend-backup.hg (glob)
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   235
  1 changesets found
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   236
  adding branch
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   237
  adding changesets
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   238
  adding manifests
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   239
  adding file changes
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   240
  added 1 changesets with 1 changes to 1 files
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   241
  committed changeset 1:7ab3bf440b54
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   242
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   243
Same, but with changes in working dir (different code path):
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   244
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   245
  $ echo a >> a
16901
5b89700cce30 tests: consistently use a HGEDITOR pattern that works with msys on windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16900
diff changeset
   246
  $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   247
  amending changeset 7ab3bf440b54
17473
9732473aa24b amend: use an explicit commit message for temporary amending commit
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17462
diff changeset
   248
  a
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   249
  copying changeset a0ea9b1a4c8c to ad120869acf0
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   250
  another precious commit message
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   251
  
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   252
  
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   253
  HG: Enter commit message.  Lines beginning with 'HG:' are removed.
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   254
  HG: Leave message empty to abort commit.
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   255
  HG: --
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   256
  HG: user: foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   257
  HG: branch 'default'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   258
  HG: changed a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   259
  a
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   260
  stripping intermediate changeset a0ea9b1a4c8c
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   261
  stripping amended changeset 7ab3bf440b54
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   262
  2 changesets found
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   263
  saved backup bundle to $TESTTMP/.hg/strip-backup/7ab3bf440b54-amend-backup.hg (glob)
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   264
  1 changesets found
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   265
  adding branch
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   266
  adding changesets
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   267
  adding manifests
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   268
  adding file changes
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   269
  added 1 changesets with 1 changes to 1 files
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   270
  committed changeset 1:ea22a388757c
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   271
16901
5b89700cce30 tests: consistently use a HGEDITOR pattern that works with msys on windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16900
diff changeset
   272
  $ rm editor.sh
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   273
  $ hg log -r .
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   274
  changeset:   1:ea22a388757c
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   275
  tag:         tip
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   276
  user:        foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   277
  date:        Thu Jan 01 00:00:01 1970 +0000
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   278
  summary:     another precious commit message
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   279
  
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   280
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   281
Moving bookmarks, preserve active bookmark:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   282
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   283
  $ hg book book1
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   284
  $ hg book book2
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   285
  $ hg ci --amend -m 'move bookmarks'
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   286
  saved backup bundle to $TESTTMP/.hg/strip-backup/ea22a388757c-amend-backup.hg (glob)
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   287
  $ hg book
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   288
     book1                     1:6cec5aa930e2
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   289
   * book2                     1:6cec5aa930e2
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   290
  $ echo a >> a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   291
  $ hg ci --amend -m 'move bookmarks'
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   292
  saved backup bundle to $TESTTMP/.hg/strip-backup/6cec5aa930e2-amend-backup.hg (glob)
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   293
  $ hg book
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   294
     book1                     1:48bb6e53a15f
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   295
   * book2                     1:48bb6e53a15f
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   296
18198
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
   297
abort does not loose bookmarks
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
   298
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
   299
  $ cat > editor.sh << '__EOF__'
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
   300
  > #!/bin/sh
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
   301
  > echo "" > "$1"
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
   302
  > __EOF__
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
   303
  $ echo a >> a
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
   304
  $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
   305
  transaction abort!
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
   306
  rollback completed
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
   307
  abort: empty commit message
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
   308
  [255]
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
   309
  $ hg book
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
   310
     book1                     1:48bb6e53a15f
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
   311
   * book2                     1:48bb6e53a15f
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
   312
  $ hg revert -Caq
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
   313
  $ rm editor.sh
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
   314
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   315
  $ echo '[defaults]' >> $HGRCPATH
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   316
  $ echo "commit=-d '0 0'" >> $HGRCPATH
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   317
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   318
Moving branches:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   319
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   320
  $ hg branch foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   321
  marked working directory as branch foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   322
  (branches are permanent and global, did you want a bookmark?)
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   323
  $ echo a >> a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   324
  $ hg ci -m 'branch foo'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   325
  $ hg branch default -f
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   326
  marked working directory as branch default
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   327
  (branches are permanent and global, did you want a bookmark?)
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   328
  $ hg ci --amend -m 'back to default'
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   329
  saved backup bundle to $TESTTMP/.hg/strip-backup/8ac881fbf49d-amend-backup.hg (glob)
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   330
  $ hg branches
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   331
  default                        2:ce12b0b57d46
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   332
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   333
Close branch:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   334
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   335
  $ hg up -q 0
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   336
  $ echo b >> b
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   337
  $ hg branch foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   338
  marked working directory as branch foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   339
  (branches are permanent and global, did you want a bookmark?)
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   340
  $ hg ci -Am 'fork'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   341
  adding b
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   342
  $ echo b >> b
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   343
  $ hg ci -mb
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   344
  $ hg ci --amend --close-branch -m 'closing branch foo'
16900
3f1a153daadb tests: glob the remaining 'saved backup bundle to' to prepare for windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16745
diff changeset
   345
  saved backup bundle to $TESTTMP/.hg/strip-backup/c962248fa264-amend-backup.hg (glob)
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   346
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   347
Same thing, different code path:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   348
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   349
  $ echo b >> b
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   350
  $ hg ci -m 'reopen branch'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   351
  reopening closed branch head 4
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   352
  $ echo b >> b
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   353
  $ hg ci --amend --close-branch
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   354
  saved backup bundle to $TESTTMP/.hg/strip-backup/027371728205-amend-backup.hg (glob)
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   355
  $ hg branches
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   356
  default                        2:ce12b0b57d46
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   357
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   358
Refuse to amend during a merge:
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   359
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   360
  $ hg up -q default
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   361
  $ hg merge foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   362
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   363
  (branch merge, don't forget to commit)
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   364
  $ hg ci --amend
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   365
  abort: cannot amend while merging
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   366
  [255]
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   367
  $ hg ci -m 'merge'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   368
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   369
Follow copies/renames:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   370
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   371
  $ hg mv b c
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   372
  $ hg ci -m 'b -> c'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   373
  $ hg mv c d
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   374
  $ hg ci --amend -m 'b -> d'
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   375
  saved backup bundle to $TESTTMP/.hg/strip-backup/b8c6eac7f12e-amend-backup.hg (glob)
16483
3c4910364797 tests: ^ must be quoted when used on solaris sh
Mads Kiilerich <mads@kiilerich.com>
parents: 16458
diff changeset
   376
  $ hg st --rev '.^' --copies d
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   377
  A d
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   378
    b
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   379
  $ hg cp d e
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   380
  $ hg ci -m 'e = d'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   381
  $ hg cp e f
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   382
  $ hg ci --amend -m 'f = d'
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   383
  saved backup bundle to $TESTTMP/.hg/strip-backup/7f9761d65613-amend-backup.hg (glob)
16483
3c4910364797 tests: ^ must be quoted when used on solaris sh
Mads Kiilerich <mads@kiilerich.com>
parents: 16458
diff changeset
   384
  $ hg st --rev '.^' --copies f
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   385
  A f
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   386
    d
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   387
16552
90ca344a7c55 test-commit-amend: exhibit an --amend weirdness
Patrick Mezard <patrick@mezard.eu>
parents: 16539
diff changeset
   388
  $ mv f f.orig
90ca344a7c55 test-commit-amend: exhibit an --amend weirdness
Patrick Mezard <patrick@mezard.eu>
parents: 16539
diff changeset
   389
  $ hg rm -A f
90ca344a7c55 test-commit-amend: exhibit an --amend weirdness
Patrick Mezard <patrick@mezard.eu>
parents: 16539
diff changeset
   390
  $ hg ci -m removef
90ca344a7c55 test-commit-amend: exhibit an --amend weirdness
Patrick Mezard <patrick@mezard.eu>
parents: 16539
diff changeset
   391
  $ hg cp a f
90ca344a7c55 test-commit-amend: exhibit an --amend weirdness
Patrick Mezard <patrick@mezard.eu>
parents: 16539
diff changeset
   392
  $ mv f.orig f
90ca344a7c55 test-commit-amend: exhibit an --amend weirdness
Patrick Mezard <patrick@mezard.eu>
parents: 16539
diff changeset
   393
  $ hg ci --amend -m replacef
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   394
  saved backup bundle to $TESTTMP/.hg/strip-backup/9e8c5f7e3d95-amend-backup.hg (glob)
16552
90ca344a7c55 test-commit-amend: exhibit an --amend weirdness
Patrick Mezard <patrick@mezard.eu>
parents: 16539
diff changeset
   395
  $ hg st --change . --copies
90ca344a7c55 test-commit-amend: exhibit an --amend weirdness
Patrick Mezard <patrick@mezard.eu>
parents: 16539
diff changeset
   396
  $ hg log -r . --template "{file_copies}\n"
16553
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
   397
  
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
   398
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
   399
Move added file (issue3410):
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
   400
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
   401
  $ echo g >> g
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
   402
  $ hg ci -Am g
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
   403
  adding g
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
   404
  $ hg mv g h
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
   405
  $ hg ci --amend
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   406
  saved backup bundle to $TESTTMP/.hg/strip-backup/24aa8eacce2b-amend-backup.hg (glob)
16553
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
   407
  $ hg st --change . --copies h
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
   408
  A h
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
   409
  $ hg log -r . --template "{file_copies}\n"
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
   410
  
16552
90ca344a7c55 test-commit-amend: exhibit an --amend weirdness
Patrick Mezard <patrick@mezard.eu>
parents: 16539
diff changeset
   411
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   412
Can't rollback an amend:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   413
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   414
  $ hg rollback
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   415
  no rollback information available
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   416
  [1]
16630
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   417
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   418
Preserve extra dict (issue3430):
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   419
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   420
  $ hg branch a
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   421
  marked working directory as branch a
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   422
  (branches are permanent and global, did you want a bookmark?)
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   423
  $ echo a >> a
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   424
  $ hg ci -ma
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   425
  $ hg ci --amend -m "a'"
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   426
  saved backup bundle to $TESTTMP/.hg/strip-backup/3837aa2a2fdb-amend-backup.hg (glob)
16630
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   427
  $ hg log -r . --template "{branch}\n"
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   428
  a
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   429
  $ hg ci --amend -m "a''"
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   430
  saved backup bundle to $TESTTMP/.hg/strip-backup/c05c06be7514-amend-backup.hg (glob)
16630
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   431
  $ hg log -r . --template "{branch}\n"
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   432
  a
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   433
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   434
Also preserve other entries in the dict that are in the old commit,
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   435
first graft something so there's an additional entry:
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   436
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   437
  $ hg up 0 -q
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   438
  $ echo z > z
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   439
  $ hg ci -Am 'fork'
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   440
  adding z
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   441
  created new head
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   442
  $ hg up 11
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   443
  5 files updated, 0 files merged, 1 files removed, 0 files unresolved
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   444
  $ hg graft 12
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   445
  grafting revision 12
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   446
  $ hg ci --amend -m 'graft amend'
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   447
  saved backup bundle to $TESTTMP/.hg/strip-backup/bd010aea3f39-amend-backup.hg (glob)
16630
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   448
  $ hg log -r . --debug | grep extra
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   449
  extra:       amend_source=bd010aea3f39f3fb2a2f884b9ccb0471cd77398e
16630
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   450
  extra:       branch=a
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   451
  extra:       source=2647734878ef0236dda712fae9c1651cf694ea8a
17461
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
   452
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
   453
Preserve phase
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
   454
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
   455
  $ hg phase '.^::.'
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
   456
  11: draft
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
   457
  13: draft
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
   458
  $ hg phase --secret --force .
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
   459
  $ hg phase '.^::.'
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
   460
  11: draft
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
   461
  13: secret
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
   462
  $ hg commit --amend -m 'amend for phase' -q
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
   463
  $ hg phase '.^::.'
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
   464
  11: draft
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
   465
  13: secret
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
   466
17475
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   467
Test amend with obsolete
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   468
---------------------------
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   469
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   470
Enable obsolete
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   471
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   472
  $ cat > ${TESTTMP}/obs.py << EOF
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   473
  > import mercurial.obsolete
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   474
  > mercurial.obsolete._enabled = True
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   475
  > EOF
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   476
  $ echo '[extensions]' >> $HGRCPATH
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   477
  $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   478
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   479
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   480
Amend with no files changes
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   481
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   482
  $ hg id -n
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   483
  13
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   484
  $ hg ci --amend -m 'babar'
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   485
  $ hg id -n
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   486
  14
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   487
  $ hg log -Gl 3 --style=compact
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   488
  @  14[tip]:11   b650e6ee8614   1970-01-01 00:00 +0000   test
17475
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   489
  |    babar
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   490
  |
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   491
  | o  12:0   2647734878ef   1970-01-01 00:00 +0000   test
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   492
  | |    fork
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   493
  | |
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   494
  o |  11   3334b7925910   1970-01-01 00:00 +0000   test
17475
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   495
  | |    a''
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   496
  | |
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   497
  $ hg log -Gl 4 --hidden --style=compact
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   498
  @  14[tip]:11   b650e6ee8614   1970-01-01 00:00 +0000   test
17475
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   499
  |    babar
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   500
  |
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   501
  | x  13:11   68ff8ff97044   1970-01-01 00:00 +0000   test
17475
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   502
  |/     amend for phase
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   503
  |
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   504
  | o  12:0   2647734878ef   1970-01-01 00:00 +0000   test
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   505
  | |    fork
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   506
  | |
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   507
  o |  11   3334b7925910   1970-01-01 00:00 +0000   test
17475
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   508
  | |    a''
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   509
  | |
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   510
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   511
Amend with files changes
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   512
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   513
(note: the extra commit over 15 is a temporary junk I would be happy to get
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   514
ride of)
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   515
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   516
  $ echo 'babar' >> a
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   517
  $ hg commit --amend
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   518
  $ hg log -Gl 6 --hidden --style=compact
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   519
  @  16[tip]:11   9f9e9bccf56c   1970-01-01 00:00 +0000   test
17475
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   520
  |    babar
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   521
  |
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   522
  | x  15   90fef497c56f   1970-01-01 00:00 +0000   test
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   523
  | |    temporary amend commit for b650e6ee8614
17475
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   524
  | |
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   525
  | x  14:11   b650e6ee8614   1970-01-01 00:00 +0000   test
17475
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   526
  |/     babar
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   527
  |
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   528
  | x  13:11   68ff8ff97044   1970-01-01 00:00 +0000   test
17475
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   529
  |/     amend for phase
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   530
  |
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   531
  | o  12:0   2647734878ef   1970-01-01 00:00 +0000   test
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   532
  | |    fork
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   533
  | |
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   534
  o |  11   3334b7925910   1970-01-01 00:00 +0000   test
17475
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   535
  | |    a''
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   536
  | |
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   537
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   538
18399
66cec3c2ee00 tests: more comment cleanup related to obsolescence
Kevin Bullock <kbullock@ringworld.org>
parents: 18398
diff changeset
   539
Test that amend does not make it easy to create obsolescence cycle
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   540
---------------------------------------------------------------------
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   541
18267
5bb610f87d1d clfilter: enforce hidden changeset globally
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18206
diff changeset
   542
  $ hg id -r 14 --hidden
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   543
  b650e6ee8614 (a)
18267
5bb610f87d1d clfilter: enforce hidden changeset globally
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18206
diff changeset
   544
  $ hg revert -ar 14 --hidden
17811
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   545
  reverting a
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   546
  $ hg commit --amend
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   547
  $ hg id
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   548
  b99e5df575f7 (a) tip
18163
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
   549
18398
1a00c8451640 test: fix in-test comments related to obsolescence
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18267
diff changeset
   550
Test that rewriting leaving instability behind is allowed
18163
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
   551
---------------------------------------------------------------------
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
   552
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
   553
  $ hg up '.^'
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
   554
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
   555
  $ echo 'b' >> a
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
   556
  $ hg log --style compact -r 'children(.)'
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
   557
  18[tip]:11   b99e5df575f7   1970-01-01 00:00 +0000   test
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
   558
    babar
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
   559
  
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
   560
  $ hg commit --amend
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
   561
  $ hg log -r 'unstable()'
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
   562
  changeset:   18:b99e5df575f7
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
   563
  branch:      a
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
   564
  parent:      11:3334b7925910
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
   565
  user:        test
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
   566
  date:        Thu Jan 01 00:00:00 1970 +0000
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
   567
  summary:     babar
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
   568
  
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   569
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   570
Amend a merge changeset (with renames and conflicts from the second parent):
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   571
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   572
  $ hg up -q default
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   573
  $ hg branch -q bar
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   574
  $ hg cp a aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   575
  $ hg mv z zz
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   576
  $ echo cc > cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   577
  $ hg add cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   578
  $ hg ci -m aazzcc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   579
  $ hg up -q default
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   580
  $ echo a >> a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   581
  $ echo dd > cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   582
  $ hg add cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   583
  $ hg ci -m aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   584
  $ hg merge -q bar
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   585
  warning: conflicts during merge.
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   586
  merging cc incomplete! (edit conflicts, then use 'hg resolve --mark')
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   587
  [1]
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   588
  $ hg resolve -m cc
21266
19d6fec60b81 resolve: print message when no unresolved files remain (issue4214)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21036
diff changeset
   589
  no unresolved files; you may continue your unfinished operation
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   590
  $ hg ci -m 'merge bar'
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   591
  $ hg log --config diff.git=1 -pr .
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   592
  changeset:   23:d51446492733
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   593
  tag:         tip
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   594
  parent:      22:30d96aeaf27b
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   595
  parent:      21:1aa437659d19
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   596
  user:        test
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   597
  date:        Thu Jan 01 00:00:00 1970 +0000
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   598
  summary:     merge bar
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   599
  
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   600
  diff --git a/a b/aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   601
  copy from a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   602
  copy to aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   603
  diff --git a/cc b/cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   604
  --- a/cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   605
  +++ b/cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   606
  @@ -1,1 +1,5 @@
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   607
  +<<<<<<< local
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   608
   dd
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   609
  +=======
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   610
  +cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   611
  +>>>>>>> other
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   612
  diff --git a/z b/zz
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   613
  rename from z
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   614
  rename to zz
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   615
  
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   616
  $ hg debugrename aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   617
  aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   618
  $ hg debugrename zz
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   619
  zz renamed from z:69a1b67522704ec122181c0890bd16e9d3e7516a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   620
  $ hg debugrename cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   621
  cc not renamed
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   622
  $ hg ci --amend -m 'merge bar (amend message)'
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   623
  $ hg log --config diff.git=1 -pr .
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   624
  changeset:   24:59de3dce7a79
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   625
  tag:         tip
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   626
  parent:      22:30d96aeaf27b
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   627
  parent:      21:1aa437659d19
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   628
  user:        test
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   629
  date:        Thu Jan 01 00:00:00 1970 +0000
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   630
  summary:     merge bar (amend message)
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   631
  
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   632
  diff --git a/a b/aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   633
  copy from a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   634
  copy to aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   635
  diff --git a/cc b/cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   636
  --- a/cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   637
  +++ b/cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   638
  @@ -1,1 +1,5 @@
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   639
  +<<<<<<< local
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   640
   dd
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   641
  +=======
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   642
  +cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   643
  +>>>>>>> other
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   644
  diff --git a/z b/zz
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   645
  rename from z
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   646
  rename to zz
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   647
  
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   648
  $ hg debugrename aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   649
  aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   650
  $ hg debugrename zz
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   651
  zz renamed from z:69a1b67522704ec122181c0890bd16e9d3e7516a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   652
  $ hg debugrename cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   653
  cc not renamed
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   654
  $ hg mv zz z
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   655
  $ hg ci --amend -m 'merge bar (undo rename)'
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   656
  $ hg log --config diff.git=1 -pr .
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   657
  changeset:   26:7fb89c461f81
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   658
  tag:         tip
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   659
  parent:      22:30d96aeaf27b
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   660
  parent:      21:1aa437659d19
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   661
  user:        test
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   662
  date:        Thu Jan 01 00:00:00 1970 +0000
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   663
  summary:     merge bar (undo rename)
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   664
  
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   665
  diff --git a/a b/aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   666
  copy from a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   667
  copy to aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   668
  diff --git a/cc b/cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   669
  --- a/cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   670
  +++ b/cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   671
  @@ -1,1 +1,5 @@
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   672
  +<<<<<<< local
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   673
   dd
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   674
  +=======
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   675
  +cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   676
  +>>>>>>> other
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   677
  
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   678
  $ hg debugrename z
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   679
  z not renamed
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   680
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   681
Amend a merge changeset (with renames during the merge):
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   682
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   683
  $ hg up -q bar
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   684
  $ echo x > x
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   685
  $ hg add x
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   686
  $ hg ci -m x
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   687
  $ hg up -q default
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   688
  $ hg merge -q bar
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   689
  $ hg mv aa aaa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   690
  $ echo aa >> aaa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   691
  $ hg ci -m 'merge bar again'
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   692
  $ hg log --config diff.git=1 -pr .
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   693
  changeset:   28:982d7a34ffee
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   694
  tag:         tip
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   695
  parent:      26:7fb89c461f81
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   696
  parent:      27:4c94d5bc65f5
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   697
  user:        test
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   698
  date:        Thu Jan 01 00:00:00 1970 +0000
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   699
  summary:     merge bar again
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   700
  
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   701
  diff --git a/aa b/aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   702
  deleted file mode 100644
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   703
  --- a/aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   704
  +++ /dev/null
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   705
  @@ -1,2 +0,0 @@
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   706
  -a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   707
  -a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   708
  diff --git a/aaa b/aaa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   709
  new file mode 100644
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   710
  --- /dev/null
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   711
  +++ b/aaa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   712
  @@ -0,0 +1,3 @@
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   713
  +a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   714
  +a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   715
  +aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   716
  diff --git a/x b/x
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   717
  new file mode 100644
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   718
  --- /dev/null
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   719
  +++ b/x
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   720
  @@ -0,0 +1,1 @@
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   721
  +x
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   722
  
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   723
  $ hg debugrename aaa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   724
  aaa renamed from aa:37d9b5d994eab34eda9c16b195ace52c7b129980
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   725
  $ hg mv aaa aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   726
  $ hg ci --amend -m 'merge bar again (undo rename)'
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   727
  $ hg log --config diff.git=1 -pr .
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   728
  changeset:   30:522688c0e71b
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   729
  tag:         tip
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   730
  parent:      26:7fb89c461f81
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   731
  parent:      27:4c94d5bc65f5
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   732
  user:        test
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   733
  date:        Thu Jan 01 00:00:00 1970 +0000
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   734
  summary:     merge bar again (undo rename)
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   735
  
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   736
  diff --git a/aa b/aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   737
  --- a/aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   738
  +++ b/aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   739
  @@ -1,2 +1,3 @@
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   740
   a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   741
   a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   742
  +aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   743
  diff --git a/x b/x
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   744
  new file mode 100644
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   745
  --- /dev/null
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   746
  +++ b/x
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   747
  @@ -0,0 +1,1 @@
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   748
  +x
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   749
  
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   750
  $ hg debugrename aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   751
  aa not renamed
18912
4e1ae55e63ef test-commit-amend.t: fix check-code violation from 3a72c89a83ec
Augie Fackler <raf@durin42.com>
parents: 18909
diff changeset
   752
  $ hg debugrename -r '.^' aa
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   753
  aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   754
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   755
Amend a merge changeset (with manifest-level conflicts):
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   756
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   757
  $ hg up -q bar
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   758
  $ hg rm aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   759
  $ hg ci -m 'rm aa'
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   760
  $ hg up -q default
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   761
  $ echo aa >> aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   762
  $ hg ci -m aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   763
  $ hg merge -q bar
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   764
  local changed aa which remote deleted
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   765
  use (c)hanged version or (d)elete? c
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   766
  $ hg ci -m 'merge bar (with conflicts)'
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   767
  $ hg log --config diff.git=1 -pr .
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   768
  changeset:   33:5f9904c491b8
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   769
  tag:         tip
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   770
  parent:      32:01780b896f58
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   771
  parent:      31:67db8847a540
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   772
  user:        test
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   773
  date:        Thu Jan 01 00:00:00 1970 +0000
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   774
  summary:     merge bar (with conflicts)
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   775
  
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   776
  
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   777
  $ hg rm aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   778
  $ hg ci --amend -m 'merge bar (with conflicts, amended)'
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   779
  $ hg log --config diff.git=1 -pr .
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   780
  changeset:   35:6ce0c89781a3
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   781
  tag:         tip
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   782
  parent:      32:01780b896f58
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   783
  parent:      31:67db8847a540
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   784
  user:        test
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   785
  date:        Thu Jan 01 00:00:00 1970 +0000
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   786
  summary:     merge bar (with conflicts, amended)
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   787
  
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   788
  diff --git a/aa b/aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   789
  deleted file mode 100644
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   790
  --- a/aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   791
  +++ /dev/null
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   792
  @@ -1,4 +0,0 @@
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   793
  -a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   794
  -a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   795
  -aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   796
  -aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   797
  
19305
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   798
Issue 3445: amending with --close-branch a commit that created a new head should fail
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   799
This shouldn't be possible:
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   800
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   801
  $ hg up -q default
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   802
  $ hg branch closewithamend
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   803
  marked working directory as branch closewithamend
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   804
  (branches are permanent and global, did you want a bookmark?)
19980
0151b61fed97 test: do not add .pyc and .orig in test-commit-amend.t (issue4085)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19305
diff changeset
   805
  $ hg add obs.py
0151b61fed97 test: do not add .pyc and .orig in test-commit-amend.t (issue4085)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19305
diff changeset
   806
  $ hg ci -m..
19305
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   807
  $ hg ci --amend --close-branch -m 'closing'
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   808
  abort: can only close branch heads
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   809
  [255]
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   810
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   811
This silliness fails:
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   812
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   813
  $ hg branch silliness
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   814
  marked working directory as branch silliness
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   815
  (branches are permanent and global, did you want a bookmark?)
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   816
  $ echo b >> b
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   817
  $ hg ci --close-branch -m'open and close'
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   818
  abort: can only close branch heads
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   819
  [255]
20700
b0153cb8b64e commit: create new amend changeset as secret correctly for "--secret" option
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19980
diff changeset
   820
b0153cb8b64e commit: create new amend changeset as secret correctly for "--secret" option
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19980
diff changeset
   821
Test that amend with --secret creates new secret changeset forcibly
b0153cb8b64e commit: create new amend changeset as secret correctly for "--secret" option
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19980
diff changeset
   822
---------------------------------------------------------------------
b0153cb8b64e commit: create new amend changeset as secret correctly for "--secret" option
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19980
diff changeset
   823
b0153cb8b64e commit: create new amend changeset as secret correctly for "--secret" option
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19980
diff changeset
   824
  $ hg phase '.^::.'
b0153cb8b64e commit: create new amend changeset as secret correctly for "--secret" option
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19980
diff changeset
   825
  35: draft
b0153cb8b64e commit: create new amend changeset as secret correctly for "--secret" option
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19980
diff changeset
   826
  36: draft
b0153cb8b64e commit: create new amend changeset as secret correctly for "--secret" option
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19980
diff changeset
   827
  $ hg commit --amend --secret -m 'amend as secret' -q
b0153cb8b64e commit: create new amend changeset as secret correctly for "--secret" option
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19980
diff changeset
   828
  $ hg phase '.^::.'
b0153cb8b64e commit: create new amend changeset as secret correctly for "--secret" option
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19980
diff changeset
   829
  35: draft
b0153cb8b64e commit: create new amend changeset as secret correctly for "--secret" option
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19980
diff changeset
   830
  38: secret
21036
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
   831
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
   832
Test that amend with --edit invokes editor forcibly
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
   833
---------------------------------------------------
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
   834
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
   835
  $ hg parents --template "{desc}\n"
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
   836
  amend as secret
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
   837
  $ HGEDITOR=cat hg commit --amend -m "editor should be suppressed"
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
   838
  $ hg parents --template "{desc}\n"
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
   839
  editor should be suppressed
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
   840
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
   841
  $ HGEDITOR=cat hg commit --amend -m "editor should be invoked" --edit
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
   842
  editor should be invoked
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
   843
  
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
   844
  
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
   845
  HG: Enter commit message.  Lines beginning with 'HG:' are removed.
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
   846
  HG: Leave message empty to abort commit.
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
   847
  HG: --
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
   848
  HG: user: test
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
   849
  HG: branch 'silliness'
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
   850
  HG: changed obs.py
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
   851
  $ hg parents --template "{desc}\n"
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
   852
  editor should be invoked