tests/test-commit-amend.t
author Matt Harbison <matt_harbison@yahoo.com>
Wed, 21 Aug 2024 16:13:14 -0400
changeset 51820 71fb6e0a7a35
parent 50381 2cf264e9aa75
permissions -rw-r--r--
typing: add type hints to the `opener` attributes and arguments of revlog When making revlog and filelog classes visible to pytype, it got confused quite a bit in `mercurial/revlogutils/rewrite.py`, thinking it had a plain `Callable`, and flagging additional methods on it like `join()` and `rename()`. I couldn't figure out how it reduced to that (and PyCharm flagged `opener` references as `Any`), but this makes it happy. So make this change before making the classes visible. The vfs class hierarchy is a bit wonky (e.g. `filteredvfs` is not a `vfs`), so this may need to be revisited with a Protocol class that covers all of the `vfs` classes. But for now, everything works.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
49621
55c6ebd11cb9 tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49252
diff changeset
     1
  $ hg init repo
55c6ebd11cb9 tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49252
diff changeset
     2
  $ cd repo
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
     3
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
     4
Setup:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
     5
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
     6
  $ echo a >> a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
     7
  $ hg ci -Am 'base'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
     8
  adding a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
     9
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    10
Refuse to amend public csets:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    11
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    12
  $ hg phase -r . -p
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    13
  $ hg ci --amend
47069
5b6dd0d9171b rewriteutil: give examples of public changesets that can't be rewritten
Martin von Zweigbergk <martinvonz@google.com>
parents: 47019
diff changeset
    14
  abort: cannot amend public changesets: ad120869acf0
35244
98f97eb20597 rewriteutil: use precheck() in uncommit and amend commands
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34867
diff changeset
    15
  (see 'hg help phases' for details)
45853
b4694ef45db5 errors: raise more specific errors from rewriteutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 45827
diff changeset
    16
  [10]
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    17
  $ hg phase -r . -f -d
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    18
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    19
  $ echo a >> a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    20
  $ hg ci -Am 'base1'
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
Nothing to amend:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    23
26750
9f9ec4abe700 cmdutil: make in-memory changes visible to external editor (issue4378)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26614
diff changeset
    24
  $ hg ci --amend -m 'base1'
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    25
  nothing changed
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    26
  [1]
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    27
17060
69fa0459dd3b test-commit-amend: adapt for Windows after fba17a64fa49
Adrian Buehlmann <adrian@cadifra.com>
parents: 17059
diff changeset
    28
  $ cat >> $HGRCPATH <<EOF
69fa0459dd3b test-commit-amend: adapt for Windows after fba17a64fa49
Adrian Buehlmann <adrian@cadifra.com>
parents: 17059
diff changeset
    29
  > [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
    30
  > 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
    31
  > EOF
17049
2440822446ce amend: disable hooks when creating intermediate commit (issue3501)
Idan Kamara <idankk86@gmail.com>
parents: 16630
diff changeset
    32
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    33
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
    34
(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
    35
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    36
  $ 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
    37
  $ 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
    38
  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
    39
  43f1ba15f28a tip
49621
55c6ebd11cb9 tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49252
diff changeset
    40
  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/489edb5b847d-5ab4f721-amend.hg
17049
2440822446ce amend: disable hooks when creating intermediate commit (issue3501)
Idan Kamara <idankk86@gmail.com>
parents: 16630
diff changeset
    41
  $ echo 'pretxncommit.foo = ' >> $HGRCPATH
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    42
  $ 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
    43
  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
    44
  --- 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
    45
  +++ 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
    46
  @@ -1,1 +1,3 @@
30432
3633403888ae bdiff: give slight preference to appending lines
Mads Kiilerich <madski@unity3d.com>
parents: 30431
diff changeset
    47
   a
30431
8c0c75aa3ff4 bdiff: give slight preference to longest matches in the middle of the B side
Mads Kiilerich <madski@unity3d.com>
parents: 30240
diff changeset
    48
  +a
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    49
  +a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    50
  $ 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
    51
  changeset:   1:43f1ba15f28a
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    52
  tag:         tip
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    53
  user:        test
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    54
  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
    55
  summary:     amend base1
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    56
  
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    57
  changeset:   0:ad120869acf0
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    58
  user:        test
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    59
  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
    60
  summary:     base
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    61
  
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
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
    64
18197
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    65
  $ 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
    66
  > #!/bin/sh
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    67
  > echo "" > "$1"
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    68
  > __EOF__
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
    69
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
    70
Update the existing file to ensure that the dirstate is not in pending state
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
    71
(where the status of some files in the working copy is not known yet). This in
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
    72
turn ensures that when the transaction is aborted due to an empty message during
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
    73
the amend, there should be no rollback.
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
    74
  $ echo a >> a
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
    75
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
    76
  $ 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
    77
  $ 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
    78
  $ hg summary
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    79
  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
    80
   amend base1
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    81
  branch: default
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
    82
  commit: 1 modified, 1 added, 1 unknown
18197
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    83
  update: (current)
25382
6084926366b9 summary: move the parents phase marker to commit line (issue4688)
Gilles Moris <gilles.moris@free.fr>
parents: 25295
diff changeset
    84
  phases: 2 draft
18197
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    85
  $ 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
    86
  abort: empty commit message
45827
8d72e29ad1e0 errors: introduce InputError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 42621
diff changeset
    87
  [10]
18197
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    88
  $ hg summary
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    89
  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
    90
   amend base1
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    91
  branch: default
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
    92
  commit: 1 modified, 1 added, 1 unknown
18197
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    93
  update: (current)
25382
6084926366b9 summary: move the parents phase marker to commit line (issue4688)
Gilles Moris <gilles.moris@free.fr>
parents: 25295
diff changeset
    94
  phases: 2 draft
18197
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    95
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
    96
Add new file along with modified existing file:
18197
153659e86a5f amend: invalidate dirstate in case of failure (issue3670)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
    97
  $ hg ci --amend -m 'amend base1 new file'
49621
55c6ebd11cb9 tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49252
diff changeset
    98
  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/43f1ba15f28a-007467c2-amend.hg
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
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
   101
(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
   102
(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
   103
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   104
  $ 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
   105
  $ 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
   106
  $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg ci --amend --logfile ../logfile
49621
55c6ebd11cb9 tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49252
diff changeset
   107
  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/c16295aaf401-1ada9901-amend.hg
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   108
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   109
  $ hg cat b
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   110
  b: no such file in rev 47343646fa3d
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   111
  [1]
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   112
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   113
No changes, just a different message:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   114
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   115
  $ hg ci -v --amend -m 'no changes, new message'
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   116
  amending changeset 47343646fa3d
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   117
  copying changeset 47343646fa3d to ad120869acf0
23749
a387b0390082 localrepo: show headline notes in commitctx before showing filenames
Mads Kiilerich <madski@unity3d.com>
parents: 23748
diff changeset
   118
  committing files:
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   119
  a
23749
a387b0390082 localrepo: show headline notes in commitctx before showing filenames
Mads Kiilerich <madski@unity3d.com>
parents: 23748
diff changeset
   120
  committing manifest
a387b0390082 localrepo: show headline notes in commitctx before showing filenames
Mads Kiilerich <madski@unity3d.com>
parents: 23748
diff changeset
   121
  committing changelog
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   122
  1 changesets found
23748
4ab66de46a96 bundle: when verbose, show what takes up the space in the generated bundle
Mads Kiilerich <madski@unity3d.com>
parents: 23589
diff changeset
   123
  uncompressed size of bundle content:
50381
2cf264e9aa75 configitems: enable changegroup3 by default (unless using infinitepush)
Matt Harbison <matt_harbison@yahoo.com>
parents: 49777
diff changeset
   124
       256 (changelog)
2cf264e9aa75 configitems: enable changegroup3 by default (unless using infinitepush)
Matt Harbison <matt_harbison@yahoo.com>
parents: 49777
diff changeset
   125
       165 (manifests)
2cf264e9aa75 configitems: enable changegroup3 by default (unless using infinitepush)
Matt Harbison <matt_harbison@yahoo.com>
parents: 49777
diff changeset
   126
       135  a
49621
55c6ebd11cb9 tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49252
diff changeset
   127
  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/47343646fa3d-c2758885-amend.hg
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   128
  1 changesets found
23748
4ab66de46a96 bundle: when verbose, show what takes up the space in the generated bundle
Mads Kiilerich <madski@unity3d.com>
parents: 23589
diff changeset
   129
  uncompressed size of bundle content:
50381
2cf264e9aa75 configitems: enable changegroup3 by default (unless using infinitepush)
Matt Harbison <matt_harbison@yahoo.com>
parents: 49777
diff changeset
   130
       252 (changelog)
2cf264e9aa75 configitems: enable changegroup3 by default (unless using infinitepush)
Matt Harbison <matt_harbison@yahoo.com>
parents: 49777
diff changeset
   131
       165 (manifests)
2cf264e9aa75 configitems: enable changegroup3 by default (unless using infinitepush)
Matt Harbison <matt_harbison@yahoo.com>
parents: 49777
diff changeset
   132
       135  a
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   133
  adding branch
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   134
  adding changesets
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   135
  adding manifests
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   136
  adding file changes
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   137
  added 1 changesets with 1 changes to 1 files
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   138
  committed changeset 1:401431e913a1
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   139
  $ hg diff -c .
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   140
  diff -r ad120869acf0 -r 401431e913a1 a
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   141
  --- 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
   142
  +++ b/a	Thu Jan 01 00:00:00 1970 +0000
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   143
  @@ -1,1 +1,4 @@
30432
3633403888ae bdiff: give slight preference to appending lines
Mads Kiilerich <madski@unity3d.com>
parents: 30431
diff changeset
   144
   a
30431
8c0c75aa3ff4 bdiff: give slight preference to longest matches in the middle of the B side
Mads Kiilerich <madski@unity3d.com>
parents: 30240
diff changeset
   145
  +a
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   146
  +a
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   147
  +a
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   148
  $ hg log
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   149
  changeset:   1:401431e913a1
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   150
  tag:         tip
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   151
  user:        test
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   152
  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
   153
  summary:     no changes, new message
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   154
  
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   155
  changeset:   0:ad120869acf0
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   156
  user:        test
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:00 1970 +0000
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   158
  summary:     base
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
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
   162
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   163
  $ echo '[defaults]' >> $HGRCPATH
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   164
  $ echo 'commit=' >> $HGRCPATH
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   165
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   166
Test -u/-d:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   167
22249
f5ff18f65b73 commit: change "editform" to distinguish merge commits from other (--amend)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21947
diff changeset
   168
  $ cat > .hg/checkeditform.sh <<EOF
f5ff18f65b73 commit: change "editform" to distinguish merge commits from other (--amend)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21947
diff changeset
   169
  > env | grep HGEDITFORM
f5ff18f65b73 commit: change "editform" to distinguish merge commits from other (--amend)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21947
diff changeset
   170
  > true
f5ff18f65b73 commit: change "editform" to distinguish merge commits from other (--amend)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21947
diff changeset
   171
  > EOF
f5ff18f65b73 commit: change "editform" to distinguish merge commits from other (--amend)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21947
diff changeset
   172
  $ HGEDITOR="sh .hg/checkeditform.sh" hg ci --amend -u foo -d '1 0'
f5ff18f65b73 commit: change "editform" to distinguish merge commits from other (--amend)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21947
diff changeset
   173
  HGEDITFORM=commit.amend.normal
49621
55c6ebd11cb9 tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49252
diff changeset
   174
  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/401431e913a1-5e8e532c-amend.hg
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   175
  $ echo a >> a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   176
  $ hg ci --amend -u foo -d '1 0'
49621
55c6ebd11cb9 tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49252
diff changeset
   177
  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/d96b1d28ae33-677e0afb-amend.hg
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   178
  $ hg log -r .
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   179
  changeset:   1:a9a13940fc03
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   180
  tag:         tip
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   181
  user:        foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   182
  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
   183
  summary:     no changes, new message
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   184
  
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   185
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   186
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
   187
16901
5b89700cce30 tests: consistently use a HGEDITOR pattern that works with msys on windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16900
diff changeset
   188
  $ cat > editor.sh << '__EOF__'
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   189
  > #!/bin/sh
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   190
  > cat $1
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   191
  > echo "another precious commit message" > "$1"
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   192
  > __EOF__
20771
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   193
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   194
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
   195
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   196
  $ 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
   197
  > [hooks]
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   198
  > 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
   199
  > __EOF__
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   200
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   201
  $ 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
   202
  $ hg commit --amend -v -m "message given from command line"
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   203
  amending changeset a9a13940fc03
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   204
  copying changeset a9a13940fc03 to ad120869acf0
23749
a387b0390082 localrepo: show headline notes in commitctx before showing filenames
Mads Kiilerich <madski@unity3d.com>
parents: 23748
diff changeset
   205
  committing files:
20771
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   206
  a
23749
a387b0390082 localrepo: show headline notes in commitctx before showing filenames
Mads Kiilerich <madski@unity3d.com>
parents: 23748
diff changeset
   207
  committing manifest
a387b0390082 localrepo: show headline notes in commitctx before showing filenames
Mads Kiilerich <madski@unity3d.com>
parents: 23748
diff changeset
   208
  committing changelog
20771
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   209
  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
   210
  transaction abort!
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   211
  rollback completed
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   212
  abort: pretxncommit.test-saving-last-message hook exited with status 1
46417
768056549737 errors: use exit code 40 for when a hook fails
Martin von Zweigbergk <martinvonz@google.com>
parents: 45916
diff changeset
   213
  [40]
20771
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   214
  $ 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
   215
  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
   216
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   217
  $ 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
   218
  $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   219
  amending changeset a9a13940fc03
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   220
  copying changeset a9a13940fc03 to ad120869acf0
20771
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   221
  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
   222
  
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   223
  
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   224
  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
   225
  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
   226
  HG: --
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   227
  HG: user: foo
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   228
  HG: branch 'default'
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   229
  HG: changed a
23749
a387b0390082 localrepo: show headline notes in commitctx before showing filenames
Mads Kiilerich <madski@unity3d.com>
parents: 23748
diff changeset
   230
  committing files:
20771
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   231
  a
23749
a387b0390082 localrepo: show headline notes in commitctx before showing filenames
Mads Kiilerich <madski@unity3d.com>
parents: 23748
diff changeset
   232
  committing manifest
a387b0390082 localrepo: show headline notes in commitctx before showing filenames
Mads Kiilerich <madski@unity3d.com>
parents: 23748
diff changeset
   233
  committing changelog
20771
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   234
  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
   235
  transaction abort!
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   236
  rollback completed
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   237
  abort: pretxncommit.test-saving-last-message hook exited with status 1
46417
768056549737 errors: use exit code 40 for when a hook fails
Martin von Zweigbergk <martinvonz@google.com>
parents: 45916
diff changeset
   238
  [40]
20771
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   239
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   240
  $ 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
   241
  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
   242
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   243
  $ 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
   244
  > [hooks]
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   245
  > 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
   246
  > __EOF__
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   247
434619dae569 amend: save commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20700
diff changeset
   248
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
   249
16901
5b89700cce30 tests: consistently use a HGEDITOR pattern that works with msys on windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16900
diff changeset
   250
  $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   251
  amending changeset a9a13940fc03
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   252
  copying changeset a9a13940fc03 to ad120869acf0
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   253
  no changes, new message
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   254
  
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   255
  
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   256
  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
   257
  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
   258
  HG: --
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   259
  HG: user: foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   260
  HG: branch 'default'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   261
  HG: changed a
23749
a387b0390082 localrepo: show headline notes in commitctx before showing filenames
Mads Kiilerich <madski@unity3d.com>
parents: 23748
diff changeset
   262
  committing files:
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   263
  a
23749
a387b0390082 localrepo: show headline notes in commitctx before showing filenames
Mads Kiilerich <madski@unity3d.com>
parents: 23748
diff changeset
   264
  committing manifest
a387b0390082 localrepo: show headline notes in commitctx before showing filenames
Mads Kiilerich <madski@unity3d.com>
parents: 23748
diff changeset
   265
  committing changelog
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   266
  1 changesets found
23748
4ab66de46a96 bundle: when verbose, show what takes up the space in the generated bundle
Mads Kiilerich <madski@unity3d.com>
parents: 23589
diff changeset
   267
  uncompressed size of bundle content:
50381
2cf264e9aa75 configitems: enable changegroup3 by default (unless using infinitepush)
Matt Harbison <matt_harbison@yahoo.com>
parents: 49777
diff changeset
   268
       251 (changelog)
2cf264e9aa75 configitems: enable changegroup3 by default (unless using infinitepush)
Matt Harbison <matt_harbison@yahoo.com>
parents: 49777
diff changeset
   269
       165 (manifests)
2cf264e9aa75 configitems: enable changegroup3 by default (unless using infinitepush)
Matt Harbison <matt_harbison@yahoo.com>
parents: 49777
diff changeset
   270
       137  a
49621
55c6ebd11cb9 tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49252
diff changeset
   271
  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/a9a13940fc03-7c2e8674-amend.hg
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   272
  1 changesets found
23748
4ab66de46a96 bundle: when verbose, show what takes up the space in the generated bundle
Mads Kiilerich <madski@unity3d.com>
parents: 23589
diff changeset
   273
  uncompressed size of bundle content:
50381
2cf264e9aa75 configitems: enable changegroup3 by default (unless using infinitepush)
Matt Harbison <matt_harbison@yahoo.com>
parents: 49777
diff changeset
   274
       259 (changelog)
2cf264e9aa75 configitems: enable changegroup3 by default (unless using infinitepush)
Matt Harbison <matt_harbison@yahoo.com>
parents: 49777
diff changeset
   275
       165 (manifests)
2cf264e9aa75 configitems: enable changegroup3 by default (unless using infinitepush)
Matt Harbison <matt_harbison@yahoo.com>
parents: 49777
diff changeset
   276
       137  a
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   277
  adding branch
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   278
  adding changesets
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   279
  adding manifests
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   280
  adding file changes
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   281
  added 1 changesets with 1 changes to 1 files
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   282
  committed changeset 1:64a124ba1b44
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   283
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   284
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
   285
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   286
  $ 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
   287
  $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   288
  amending changeset 64a124ba1b44
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   289
  another precious commit message
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   290
  
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   291
  
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   292
  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
   293
  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
   294
  HG: --
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   295
  HG: user: foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   296
  HG: branch 'default'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   297
  HG: changed a
23749
a387b0390082 localrepo: show headline notes in commitctx before showing filenames
Mads Kiilerich <madski@unity3d.com>
parents: 23748
diff changeset
   298
  committing files:
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   299
  a
23749
a387b0390082 localrepo: show headline notes in commitctx before showing filenames
Mads Kiilerich <madski@unity3d.com>
parents: 23748
diff changeset
   300
  committing manifest
a387b0390082 localrepo: show headline notes in commitctx before showing filenames
Mads Kiilerich <madski@unity3d.com>
parents: 23748
diff changeset
   301
  committing changelog
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   302
  1 changesets found
23748
4ab66de46a96 bundle: when verbose, show what takes up the space in the generated bundle
Mads Kiilerich <madski@unity3d.com>
parents: 23589
diff changeset
   303
  uncompressed size of bundle content:
50381
2cf264e9aa75 configitems: enable changegroup3 by default (unless using infinitepush)
Matt Harbison <matt_harbison@yahoo.com>
parents: 49777
diff changeset
   304
       259 (changelog)
2cf264e9aa75 configitems: enable changegroup3 by default (unless using infinitepush)
Matt Harbison <matt_harbison@yahoo.com>
parents: 49777
diff changeset
   305
       165 (manifests)
2cf264e9aa75 configitems: enable changegroup3 by default (unless using infinitepush)
Matt Harbison <matt_harbison@yahoo.com>
parents: 49777
diff changeset
   306
       137  a
49621
55c6ebd11cb9 tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49252
diff changeset
   307
  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/64a124ba1b44-10374b8f-amend.hg
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   308
  1 changesets found
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   309
  uncompressed size of bundle content:
50381
2cf264e9aa75 configitems: enable changegroup3 by default (unless using infinitepush)
Matt Harbison <matt_harbison@yahoo.com>
parents: 49777
diff changeset
   310
       259 (changelog)
2cf264e9aa75 configitems: enable changegroup3 by default (unless using infinitepush)
Matt Harbison <matt_harbison@yahoo.com>
parents: 49777
diff changeset
   311
       165 (manifests)
2cf264e9aa75 configitems: enable changegroup3 by default (unless using infinitepush)
Matt Harbison <matt_harbison@yahoo.com>
parents: 49777
diff changeset
   312
       139  a
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   313
  adding branch
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   314
  adding changesets
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   315
  adding manifests
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   316
  adding file changes
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   317
  added 1 changesets with 1 changes to 1 files
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   318
  committed changeset 1:7892795b8e38
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   319
16901
5b89700cce30 tests: consistently use a HGEDITOR pattern that works with msys on windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16900
diff changeset
   320
  $ rm editor.sh
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   321
  $ hg log -r .
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   322
  changeset:   1:7892795b8e38
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   323
  tag:         tip
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   324
  user:        foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   325
  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
   326
  summary:     another precious commit message
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   327
  
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   328
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   329
Moving bookmarks, preserve active bookmark:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   330
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   331
  $ hg book book1
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   332
  $ hg book book2
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   333
  $ hg ci --amend -m 'move bookmarks'
49621
55c6ebd11cb9 tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49252
diff changeset
   334
  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/7892795b8e38-3fb46217-amend.hg
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   335
  $ hg book
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   336
     book1                     1:8311f17e2616
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   337
   * book2                     1:8311f17e2616
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   338
  $ echo a >> a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   339
  $ hg ci --amend -m 'move bookmarks'
49621
55c6ebd11cb9 tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49252
diff changeset
   340
  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/8311f17e2616-f0504fe3-amend.hg
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   341
  $ hg book
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   342
     book1                     1:a3b65065808c
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   343
   * book2                     1:a3b65065808c
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   344
18198
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
   345
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
   346
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
   347
  $ 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
   348
  > #!/bin/sh
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
   349
  > echo "" > "$1"
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
   350
  > __EOF__
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
   351
  $ 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
   352
  $ 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
   353
  abort: empty commit message
45827
8d72e29ad1e0 errors: introduce InputError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 42621
diff changeset
   354
  [10]
18198
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
   355
  $ hg book
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   356
     book1                     1:a3b65065808c
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   357
   * book2                     1:a3b65065808c
18198
9b4adaef0db9 amend: prevent loss of bookmark on failed amend
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18197
diff changeset
   358
  $ 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
   359
  $ 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
   360
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   361
  $ echo '[defaults]' >> $HGRCPATH
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   362
  $ echo "commit=-d '0 0'" >> $HGRCPATH
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   363
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   364
Moving branches:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   365
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   366
  $ hg branch foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   367
  marked working directory as branch foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   368
  (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
   369
  $ echo a >> a
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   370
  $ hg ci -m 'branch foo'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   371
  $ hg branch default -f
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   372
  marked working directory as branch default
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   373
  $ hg ci --amend -m 'back to default'
49621
55c6ebd11cb9 tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49252
diff changeset
   374
  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/f8339a38efe1-c18453c9-amend.hg
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   375
  $ hg branches
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   376
  default                        2:9c07515f2650
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   377
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   378
Close branch:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   379
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   380
  $ hg up -q 0
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   381
  $ echo b >> b
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   382
  $ hg branch foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   383
  marked working directory as branch foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   384
  (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
   385
  $ hg ci -Am 'fork'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   386
  adding b
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   387
  $ echo b >> b
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   388
  $ hg ci -mb
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   389
  $ hg ci --amend --close-branch -m 'closing branch foo'
49621
55c6ebd11cb9 tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49252
diff changeset
   390
  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/c962248fa264-54245dc7-amend.hg
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   391
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   392
Same thing, different code path:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   393
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   394
  $ echo b >> b
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   395
  $ hg ci -m 'reopen branch'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   396
  reopening closed branch head 4
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   397
  $ echo b >> b
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   398
  $ hg ci --amend --close-branch
49621
55c6ebd11cb9 tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49252
diff changeset
   399
  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/027371728205-b900d9fa-amend.hg
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   400
  $ hg branches
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   401
  default                        2:9c07515f2650
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   402
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   403
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
   404
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   405
  $ hg up -q default
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   406
  $ hg merge foo
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   407
  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
   408
  (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
   409
  $ hg ci --amend
47019
c4dbbaecaad3 rewriteutil: adapt "cannot %s while merging" to work with "change branch of"
Martin von Zweigbergk <martinvonz@google.com>
parents: 46417
diff changeset
   410
  abort: cannot amend changesets while merging
45853
b4694ef45db5 errors: raise more specific errors from rewriteutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 45827
diff changeset
   411
  [20]
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   412
  $ hg ci -m 'merge'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   413
36844
eeb87b24aea7 amend: abort if unresolved merge conflicts found (issue5805)
Yuya Nishihara <yuya@tcha.org>
parents: 35709
diff changeset
   414
Refuse to amend if there is a merge conflict (issue5805):
eeb87b24aea7 amend: abort if unresolved merge conflicts found (issue5805)
Yuya Nishihara <yuya@tcha.org>
parents: 35709
diff changeset
   415
eeb87b24aea7 amend: abort if unresolved merge conflicts found (issue5805)
Yuya Nishihara <yuya@tcha.org>
parents: 35709
diff changeset
   416
  $ hg up -q foo
eeb87b24aea7 amend: abort if unresolved merge conflicts found (issue5805)
Yuya Nishihara <yuya@tcha.org>
parents: 35709
diff changeset
   417
  $ echo c > a
eeb87b24aea7 amend: abort if unresolved merge conflicts found (issue5805)
Yuya Nishihara <yuya@tcha.org>
parents: 35709
diff changeset
   418
  $ hg up default -t :fail
eeb87b24aea7 amend: abort if unresolved merge conflicts found (issue5805)
Yuya Nishihara <yuya@tcha.org>
parents: 35709
diff changeset
   419
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
eeb87b24aea7 amend: abort if unresolved merge conflicts found (issue5805)
Yuya Nishihara <yuya@tcha.org>
parents: 35709
diff changeset
   420
  use 'hg resolve' to retry unresolved file merges
eeb87b24aea7 amend: abort if unresolved merge conflicts found (issue5805)
Yuya Nishihara <yuya@tcha.org>
parents: 35709
diff changeset
   421
  [1]
eeb87b24aea7 amend: abort if unresolved merge conflicts found (issue5805)
Yuya Nishihara <yuya@tcha.org>
parents: 35709
diff changeset
   422
  $ hg resolve -l
eeb87b24aea7 amend: abort if unresolved merge conflicts found (issue5805)
Yuya Nishihara <yuya@tcha.org>
parents: 35709
diff changeset
   423
  U a
eeb87b24aea7 amend: abort if unresolved merge conflicts found (issue5805)
Yuya Nishihara <yuya@tcha.org>
parents: 35709
diff changeset
   424
eeb87b24aea7 amend: abort if unresolved merge conflicts found (issue5805)
Yuya Nishihara <yuya@tcha.org>
parents: 35709
diff changeset
   425
  $ hg ci --amend
eeb87b24aea7 amend: abort if unresolved merge conflicts found (issue5805)
Yuya Nishihara <yuya@tcha.org>
parents: 35709
diff changeset
   426
  abort: unresolved merge conflicts (see 'hg help resolve')
45916
fa87536d3d70 errors: raise StateError when there are unresolves merge conflicts
Martin von Zweigbergk <martinvonz@google.com>
parents: 45853
diff changeset
   427
  [20]
36844
eeb87b24aea7 amend: abort if unresolved merge conflicts found (issue5805)
Yuya Nishihara <yuya@tcha.org>
parents: 35709
diff changeset
   428
eeb87b24aea7 amend: abort if unresolved merge conflicts found (issue5805)
Yuya Nishihara <yuya@tcha.org>
parents: 35709
diff changeset
   429
  $ hg up -qC .
eeb87b24aea7 amend: abort if unresolved merge conflicts found (issue5805)
Yuya Nishihara <yuya@tcha.org>
parents: 35709
diff changeset
   430
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   431
Follow copies/renames:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   432
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   433
  $ hg mv b c
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   434
  $ hg ci -m 'b -> c'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   435
  $ hg mv c d
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   436
  $ hg ci --amend -m 'b -> d'
49621
55c6ebd11cb9 tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49252
diff changeset
   437
  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/42f3f27a067d-f23cc9f7-amend.hg
16483
3c4910364797 tests: ^ must be quoted when used on solaris sh
Mads Kiilerich <mads@kiilerich.com>
parents: 16458
diff changeset
   438
  $ hg st --rev '.^' --copies d
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   439
  A d
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   440
    b
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   441
  $ hg cp d e
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   442
  $ hg ci -m 'e = d'
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   443
  $ hg cp e f
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   444
  $ hg ci --amend -m 'f = d'
49621
55c6ebd11cb9 tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49252
diff changeset
   445
  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/9198f73182d5-251d584a-amend.hg
16483
3c4910364797 tests: ^ must be quoted when used on solaris sh
Mads Kiilerich <mads@kiilerich.com>
parents: 16458
diff changeset
   446
  $ hg st --rev '.^' --copies f
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   447
  A f
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   448
    d
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   449
16552
90ca344a7c55 test-commit-amend: exhibit an --amend weirdness
Patrick Mezard <patrick@mezard.eu>
parents: 16539
diff changeset
   450
  $ mv f f.orig
90ca344a7c55 test-commit-amend: exhibit an --amend weirdness
Patrick Mezard <patrick@mezard.eu>
parents: 16539
diff changeset
   451
  $ hg rm -A f
90ca344a7c55 test-commit-amend: exhibit an --amend weirdness
Patrick Mezard <patrick@mezard.eu>
parents: 16539
diff changeset
   452
  $ hg ci -m removef
90ca344a7c55 test-commit-amend: exhibit an --amend weirdness
Patrick Mezard <patrick@mezard.eu>
parents: 16539
diff changeset
   453
  $ hg cp a f
90ca344a7c55 test-commit-amend: exhibit an --amend weirdness
Patrick Mezard <patrick@mezard.eu>
parents: 16539
diff changeset
   454
  $ mv f.orig f
90ca344a7c55 test-commit-amend: exhibit an --amend weirdness
Patrick Mezard <patrick@mezard.eu>
parents: 16539
diff changeset
   455
  $ hg ci --amend -m replacef
49621
55c6ebd11cb9 tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49252
diff changeset
   456
  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/f0993ab6b482-eda301bf-amend.hg
16552
90ca344a7c55 test-commit-amend: exhibit an --amend weirdness
Patrick Mezard <patrick@mezard.eu>
parents: 16539
diff changeset
   457
  $ hg st --change . --copies
90ca344a7c55 test-commit-amend: exhibit an --amend weirdness
Patrick Mezard <patrick@mezard.eu>
parents: 16539
diff changeset
   458
  $ hg log -r . --template "{file_copies}\n"
16553
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
   459
  
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
   460
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
   461
Move added file (issue3410):
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
   462
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
   463
  $ echo g >> g
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
   464
  $ hg ci -Am g
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
   465
  adding g
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
   466
  $ hg mv g h
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
   467
  $ hg ci --amend
49621
55c6ebd11cb9 tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49252
diff changeset
   468
  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/58585e3f095c-0f5ebcda-amend.hg
16553
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
   469
  $ hg st --change . --copies h
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
   470
  A h
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
   471
  $ hg log -r . --template "{file_copies}\n"
9224cc2e99cc amend: fix copy records handling (issue3410)
Patrick Mezard <patrick@mezard.eu>
parents: 16552
diff changeset
   472
  
16552
90ca344a7c55 test-commit-amend: exhibit an --amend weirdness
Patrick Mezard <patrick@mezard.eu>
parents: 16539
diff changeset
   473
16458
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   474
Can't rollback an amend:
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   475
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   476
  $ hg rollback
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   477
  no rollback information available
55982f62651f commit: add option to amend the working dir parent
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
   478
  [1]
16630
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   479
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   480
Preserve extra dict (issue3430):
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   481
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   482
  $ hg branch a
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   483
  marked working directory as branch a
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   484
  (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
   485
  $ echo a >> a
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   486
  $ hg ci -ma
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   487
  $ hg ci --amend -m "a'"
49621
55c6ebd11cb9 tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49252
diff changeset
   488
  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/39a162f1d65e-9dfe13d8-amend.hg
16630
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   489
  $ hg log -r . --template "{branch}\n"
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   490
  a
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   491
  $ hg ci --amend -m "a''"
49621
55c6ebd11cb9 tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49252
diff changeset
   492
  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/d5ca7b1ac72b-0b4c1a34-amend.hg
16630
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   493
  $ hg log -r . --template "{branch}\n"
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   494
  a
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   495
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   496
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
   497
first graft something so there's an additional entry:
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   498
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   499
  $ hg up 0 -q
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   500
  $ echo z > z
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   501
  $ hg ci -Am 'fork'
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   502
  adding z
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   503
  created new head
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   504
  $ hg up 11
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   505
  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
   506
  $ hg graft 12
23505
bd5dbb8a05c8 graft: show more useful status information while grafting
Mads Kiilerich <madski@unity3d.com>
parents: 23139
diff changeset
   507
  grafting 12:2647734878ef "fork" (tip)
16630
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   508
  $ hg ci --amend -m 'graft amend'
49621
55c6ebd11cb9 tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49252
diff changeset
   509
  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/fe8c6f7957ca-25638666-amend.hg
16630
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   510
  $ hg log -r . --debug | grep extra
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   511
  extra:       amend_source=fe8c6f7957ca1665ed77496ed7a07657d469ac60
16630
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   512
  extra:       branch=a
f30226b1a46a amend: preserve extra dict (issue3430)
Idan Kamara <idankk86@gmail.com>
parents: 16553
diff changeset
   513
  extra:       source=2647734878ef0236dda712fae9c1651cf694ea8a
17461
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
   514
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
   515
Preserve phase
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
   516
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
   517
  $ hg phase '.^::.'
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
   518
  11: draft
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
   519
  13: draft
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
   520
  $ hg phase --secret --force .
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
   521
  $ hg phase '.^::.'
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
   522
  11: draft
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
   523
  13: secret
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
   524
  $ 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
   525
  $ hg phase '.^::.'
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
   526
  11: draft
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
   527
  13: secret
bacde764fba0 amend: preserve phase of amended revision (issue3602)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17060
diff changeset
   528
17475
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   529
Test amend with obsolete
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
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   532
Enable obsolete
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   533
22956
a0f89c852a0c obsolete: update test-commit-amend to use obsolete option
Durham Goode <durham@fb.com>
parents: 22249
diff changeset
   534
  $ cat >> $HGRCPATH << EOF
a0f89c852a0c obsolete: update test-commit-amend to use obsolete option
Durham Goode <durham@fb.com>
parents: 22249
diff changeset
   535
  > [experimental]
34866
1644623ab096 config: use 'experimental.evolution.create-markers'
Boris Feld <boris.feld@octobus.net>
parents: 34085
diff changeset
   536
  > evolution.createmarkers=True
34867
7f183c643eb6 config: use 'experimental.evolution.allowunstable'
Boris Feld <boris.feld@octobus.net>
parents: 34866
diff changeset
   537
  > evolution.allowunstable=True
17475
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   538
  > EOF
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   539
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   540
Amend with no files changes
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   541
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   542
  $ hg id -n
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   543
  13
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   544
  $ hg ci --amend -m 'babar'
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   545
  $ hg id -n
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   546
  14
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   547
  $ hg log -Gl 3 --style=compact
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   548
  @  14[tip]:11   682950e85999   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
   549
  |    babar
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   550
  |
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   551
  | 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
   552
  | |    fork
28627
d7af9b4ae7dd graphmod: set default edge styles for ascii graphs (BC)
Martijn Pieters <mjpieters@fb.com>
parents: 27597
diff changeset
   553
  | ~
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   554
  o  11   0ddb275cfad1   1970-01-01 00:00 +0000   test
28627
d7af9b4ae7dd graphmod: set default edge styles for ascii graphs (BC)
Martijn Pieters <mjpieters@fb.com>
parents: 27597
diff changeset
   555
  |    a''
d7af9b4ae7dd graphmod: set default edge styles for ascii graphs (BC)
Martijn Pieters <mjpieters@fb.com>
parents: 27597
diff changeset
   556
  ~
17475
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   557
  $ hg log -Gl 4 --hidden --style=compact
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   558
  @  14[tip]:11   682950e85999   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
   559
  |    babar
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   560
  |
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   561
  | x  13:11   5167600b0f7a   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
   562
  |/     amend for phase
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   563
  |
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   564
  | 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
   565
  | |    fork
28627
d7af9b4ae7dd graphmod: set default edge styles for ascii graphs (BC)
Martijn Pieters <mjpieters@fb.com>
parents: 27597
diff changeset
   566
  | ~
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   567
  o  11   0ddb275cfad1   1970-01-01 00:00 +0000   test
28627
d7af9b4ae7dd graphmod: set default edge styles for ascii graphs (BC)
Martijn Pieters <mjpieters@fb.com>
parents: 27597
diff changeset
   568
  |    a''
d7af9b4ae7dd graphmod: set default edge styles for ascii graphs (BC)
Martijn Pieters <mjpieters@fb.com>
parents: 27597
diff changeset
   569
  ~
17475
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   570
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   571
Amend with files changes
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   572
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   573
(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
   574
ride of)
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   575
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   576
  $ echo 'babar' >> a
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   577
  $ hg commit --amend
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   578
  $ hg log -Gl 6 --hidden --style=compact
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   579
  @  15[tip]:11   a5b42b49b0d5   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
   580
  |    babar
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   581
  |
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   582
  | x  14:11   682950e85999   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
   583
  |/     babar
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   584
  |
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   585
  | x  13:11   5167600b0f7a   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
   586
  |/     amend for phase
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   587
  |
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   588
  | 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
   589
  | |    fork
28627
d7af9b4ae7dd graphmod: set default edge styles for ascii graphs (BC)
Martijn Pieters <mjpieters@fb.com>
parents: 27597
diff changeset
   590
  | ~
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   591
  o  11   0ddb275cfad1   1970-01-01 00:00 +0000   test
28627
d7af9b4ae7dd graphmod: set default edge styles for ascii graphs (BC)
Martijn Pieters <mjpieters@fb.com>
parents: 27597
diff changeset
   592
  |    a''
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   593
  |
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   594
  o  10   5fa75032e226   1970-01-01 00:00 +0000   test
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   595
  |    g
28627
d7af9b4ae7dd graphmod: set default edge styles for ascii graphs (BC)
Martijn Pieters <mjpieters@fb.com>
parents: 27597
diff changeset
   596
  ~
17475
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   597
63e45aee46d4 amend: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17473
diff changeset
   598
18399
66cec3c2ee00 tests: more comment cleanup related to obsolescence
Kevin Bullock <kbullock@ringworld.org>
parents: 18398
diff changeset
   599
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
   600
---------------------------------------------------------------------
a8aba2921456 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17475
diff changeset
   601
18267
5bb610f87d1d clfilter: enforce hidden changeset globally
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18206
diff changeset
   602
  $ hg id -r 14 --hidden
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   603
  682950e85999 (a)
18267
5bb610f87d1d clfilter: enforce hidden changeset globally
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18206
diff changeset
   604
  $ 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
   605
  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
   606
  $ 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
   607
  $ hg id
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   608
  37973c7e0b61 (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
   609
18398
1a00c8451640 test: fix in-test comments related to obsolescence
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18267
diff changeset
   610
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
   611
---------------------------------------------------------------------
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
   612
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
   613
  $ 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
   614
  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
   615
  $ 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
   616
  $ hg log --style compact -r 'children(.)'
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   617
  16[tip]:11   37973c7e0b61   1970-01-01 00:00 +0000   test
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
   618
    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
   619
  
c5bd753c5bc6 amend: allow amend of non-head when obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17924
diff changeset
   620
  $ hg commit --amend
35709
1a09dad8b85a evolution: report new unstable changesets
Martin von Zweigbergk <martinvonz@google.com>
parents: 35393
diff changeset
   621
  1 new orphan changesets
33774
9dcc3529e002 revset: rename unstable into orphan
Boris Feld <boris.feld@octobus.net>
parents: 33773
diff changeset
   622
  $ hg log -r 'orphan()'
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   623
  changeset:   16:37973c7e0b61
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
   624
  branch:      a
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   625
  parent:      11:0ddb275cfad1
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
   626
  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
   627
  date:        Thu Jan 01 00:00:00 1970 +0000
33667
03039ff3082b evolution: rename unstable to orphan
Boris Feld <boris.feld@octobus.net>
parents: 33666
diff changeset
   628
  instability: orphan
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
   629
  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
   630
  
18909
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
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
   633
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   634
  $ hg up -q default
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   635
  $ hg branch -q bar
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   636
  $ hg cp a aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   637
  $ hg mv z zz
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   638
  $ echo cc > cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   639
  $ hg add cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   640
  $ hg ci -m aazzcc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   641
  $ hg up -q default
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   642
  $ echo a >> a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   643
  $ echo dd > cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   644
  $ hg add cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   645
  $ hg ci -m aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   646
  $ hg merge -q bar
26614
ef1eb6df7071 simplemerge: move conflict warning message to filemerge
Siddharth Agarwal <sid0@fb.com>
parents: 25393
diff changeset
   647
  warning: conflicts while merging cc! (edit, then use 'hg resolve --mark')
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   648
  [1]
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   649
  $ hg resolve -m cc
21947
b081decd9062 resolve: add parenthesis around "no more unresolved files" message
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21693
diff changeset
   650
  (no more unresolved files)
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   651
  $ hg ci -m 'merge bar'
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   652
  $ hg log --config diff.git=1 -pr .
42621
99ebde4fec99 commit: improve the files field of changelog for merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 42565
diff changeset
   653
  changeset:   20:5aba7f3726e6
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   654
  tag:         tip
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   655
  parent:      19:30d96aeaf27b
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   656
  parent:      18:1aa437659d19
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   657
  user:        test
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   658
  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
   659
  summary:     merge bar
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   660
  
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   661
  diff --git a/a b/aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   662
  copy from a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   663
  copy to aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   664
  diff --git a/cc b/cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   665
  --- a/cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   666
  +++ b/cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   667
  @@ -1,1 +1,5 @@
30062
940c05b25b07 merge: add conflict labels to merge command
Simon Farnsworth <simonfar@fb.com>
parents: 29775
diff changeset
   668
  +<<<<<<< working copy: 30d96aeaf27b - test: aa
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   669
   dd
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   670
  +=======
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   671
  +cc
30460
ce3a133f71b3 conflicts: make spacing consistent in conflict markers
Kostia Balytskyi <ikostia@fb.com>
parents: 30432
diff changeset
   672
  +>>>>>>> merge rev:    1aa437659d19 bar - test: aazzcc
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   673
  diff --git a/z b/zz
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   674
  rename from z
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   675
  rename to zz
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   676
  
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   677
  $ hg debugrename aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   678
  aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   679
  $ hg debugrename zz
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   680
  zz renamed from z:69a1b67522704ec122181c0890bd16e9d3e7516a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   681
  $ hg debugrename cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   682
  cc not renamed
22249
f5ff18f65b73 commit: change "editform" to distinguish merge commits from other (--amend)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21947
diff changeset
   683
  $ HGEDITOR="sh .hg/checkeditform.sh" hg ci --amend -m 'merge bar (amend message)' --edit
f5ff18f65b73 commit: change "editform" to distinguish merge commits from other (--amend)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21947
diff changeset
   684
  HGEDITFORM=commit.amend.merge
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   685
  $ hg log --config diff.git=1 -pr .
42621
99ebde4fec99 commit: improve the files field of changelog for merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 42565
diff changeset
   686
  changeset:   21:4b0631ef043e
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   687
  tag:         tip
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   688
  parent:      19:30d96aeaf27b
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   689
  parent:      18:1aa437659d19
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   690
  user:        test
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   691
  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
   692
  summary:     merge bar (amend message)
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   693
  
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   694
  diff --git a/a b/aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   695
  copy from a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   696
  copy to aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   697
  diff --git a/cc b/cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   698
  --- a/cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   699
  +++ b/cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   700
  @@ -1,1 +1,5 @@
30062
940c05b25b07 merge: add conflict labels to merge command
Simon Farnsworth <simonfar@fb.com>
parents: 29775
diff changeset
   701
  +<<<<<<< working copy: 30d96aeaf27b - test: aa
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   702
   dd
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   703
  +=======
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   704
  +cc
30460
ce3a133f71b3 conflicts: make spacing consistent in conflict markers
Kostia Balytskyi <ikostia@fb.com>
parents: 30432
diff changeset
   705
  +>>>>>>> merge rev:    1aa437659d19 bar - test: aazzcc
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   706
  diff --git a/z b/zz
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   707
  rename from z
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   708
  rename to zz
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   709
  
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   710
  $ hg debugrename aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   711
  aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   712
  $ hg debugrename zz
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   713
  zz renamed from z:69a1b67522704ec122181c0890bd16e9d3e7516a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   714
  $ hg debugrename cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   715
  cc not renamed
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   716
  $ hg mv zz z
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   717
  $ hg ci --amend -m 'merge bar (undo rename)'
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   718
  $ hg log --config diff.git=1 -pr .
42621
99ebde4fec99 commit: improve the files field of changelog for merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 42565
diff changeset
   719
  changeset:   22:06423be42d60
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   720
  tag:         tip
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   721
  parent:      19:30d96aeaf27b
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   722
  parent:      18:1aa437659d19
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   723
  user:        test
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   724
  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
   725
  summary:     merge bar (undo rename)
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   726
  
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   727
  diff --git a/a b/aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   728
  copy from a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   729
  copy to aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   730
  diff --git a/cc b/cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   731
  --- a/cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   732
  +++ b/cc
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   733
  @@ -1,1 +1,5 @@
30062
940c05b25b07 merge: add conflict labels to merge command
Simon Farnsworth <simonfar@fb.com>
parents: 29775
diff changeset
   734
  +<<<<<<< working copy: 30d96aeaf27b - test: aa
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   735
   dd
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   736
  +=======
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   737
  +cc
30460
ce3a133f71b3 conflicts: make spacing consistent in conflict markers
Kostia Balytskyi <ikostia@fb.com>
parents: 30432
diff changeset
   738
  +>>>>>>> merge rev:    1aa437659d19 bar - test: aazzcc
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   739
  
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   740
  $ hg debugrename z
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   741
  z not renamed
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   742
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   743
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
   744
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   745
  $ hg up -q bar
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   746
  $ echo x > x
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   747
  $ hg add x
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   748
  $ hg ci -m x
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   749
  $ hg up -q default
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   750
  $ hg merge -q bar
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   751
  $ hg mv aa aaa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   752
  $ echo aa >> aaa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   753
  $ hg ci -m 'merge bar again'
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   754
  $ hg log --config diff.git=1 -pr .
42621
99ebde4fec99 commit: improve the files field of changelog for merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 42565
diff changeset
   755
  changeset:   24:a89974a20457
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   756
  tag:         tip
42621
99ebde4fec99 commit: improve the files field of changelog for merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 42565
diff changeset
   757
  parent:      22:06423be42d60
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   758
  parent:      23:4c94d5bc65f5
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   759
  user:        test
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   760
  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
   761
  summary:     merge bar again
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   762
  
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   763
  diff --git a/aa b/aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   764
  deleted file mode 100644
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   765
  --- a/aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   766
  +++ /dev/null
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   767
  @@ -1,2 +0,0 @@
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   768
  -a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   769
  -a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   770
  diff --git a/aaa b/aaa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   771
  new file mode 100644
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   772
  --- /dev/null
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   773
  +++ b/aaa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   774
  @@ -0,0 +1,3 @@
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   775
  +a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   776
  +a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   777
  +aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   778
  diff --git a/x b/x
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   779
  new file mode 100644
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   780
  --- /dev/null
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   781
  +++ b/x
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   782
  @@ -0,0 +1,1 @@
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   783
  +x
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   784
  
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   785
  $ hg debugrename aaa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   786
  aaa renamed from aa:37d9b5d994eab34eda9c16b195ace52c7b129980
42213
618b9ffefa87 tests: demonstrate that rename is followed to wrong parent from merge
Martin von Zweigbergk <martinvonz@google.com>
parents: 39285
diff changeset
   787
618b9ffefa87 tests: demonstrate that rename is followed to wrong parent from merge
Martin von Zweigbergk <martinvonz@google.com>
parents: 39285
diff changeset
   788
Update to p1 with 'aaa' modified. 'aaa' was renamed from 'aa' in p2. 'aa' exists
618b9ffefa87 tests: demonstrate that rename is followed to wrong parent from merge
Martin von Zweigbergk <martinvonz@google.com>
parents: 39285
diff changeset
   789
in p1 too, but it was recorded as copied from p2.
618b9ffefa87 tests: demonstrate that rename is followed to wrong parent from merge
Martin von Zweigbergk <martinvonz@google.com>
parents: 39285
diff changeset
   790
  $ echo modified >> aaa
618b9ffefa87 tests: demonstrate that rename is followed to wrong parent from merge
Martin von Zweigbergk <martinvonz@google.com>
parents: 39285
diff changeset
   791
  $ hg co -m '.^' -t :merge3
42222
57203e0210f8 copies: calculate mergecopies() based on pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents: 42213
diff changeset
   792
  file 'aaa' was deleted in other [destination] but was modified in local [working copy].
42565
4764e8436b2a filemerge: make last line of prompts <40 english chars (issue6158)
Kyle Lippincott <spectral@google.com>
parents: 42494
diff changeset
   793
  You can use (c)hanged version, (d)elete, or leave (u)nresolved.
4764e8436b2a filemerge: make last line of prompts <40 english chars (issue6158)
Kyle Lippincott <spectral@google.com>
parents: 42494
diff changeset
   794
  What do you want to do? u
42222
57203e0210f8 copies: calculate mergecopies() based on pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents: 42213
diff changeset
   795
  1 files updated, 0 files merged, 1 files removed, 1 files unresolved
42213
618b9ffefa87 tests: demonstrate that rename is followed to wrong parent from merge
Martin von Zweigbergk <martinvonz@google.com>
parents: 39285
diff changeset
   796
  use 'hg resolve' to retry unresolved file merges
618b9ffefa87 tests: demonstrate that rename is followed to wrong parent from merge
Martin von Zweigbergk <martinvonz@google.com>
parents: 39285
diff changeset
   797
  [1]
618b9ffefa87 tests: demonstrate that rename is followed to wrong parent from merge
Martin von Zweigbergk <martinvonz@google.com>
parents: 39285
diff changeset
   798
  $ hg co -C tip
618b9ffefa87 tests: demonstrate that rename is followed to wrong parent from merge
Martin von Zweigbergk <martinvonz@google.com>
parents: 39285
diff changeset
   799
  2 files updated, 0 files merged, 1 files removed, 0 files unresolved
618b9ffefa87 tests: demonstrate that rename is followed to wrong parent from merge
Martin von Zweigbergk <martinvonz@google.com>
parents: 39285
diff changeset
   800
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   801
  $ hg mv aaa aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   802
  $ 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
   803
  $ hg log --config diff.git=1 -pr .
42621
99ebde4fec99 commit: improve the files field of changelog for merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 42565
diff changeset
   804
  changeset:   25:282080768800
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   805
  tag:         tip
42621
99ebde4fec99 commit: improve the files field of changelog for merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 42565
diff changeset
   806
  parent:      22:06423be42d60
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   807
  parent:      23:4c94d5bc65f5
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   808
  user:        test
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   809
  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
   810
  summary:     merge bar again (undo rename)
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   811
  
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   812
  diff --git a/aa b/aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   813
  --- a/aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   814
  +++ b/aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   815
  @@ -1,2 +1,3 @@
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   816
   a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   817
   a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   818
  +aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   819
  diff --git a/x b/x
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   820
  new file mode 100644
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   821
  --- /dev/null
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   822
  +++ b/x
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   823
  @@ -0,0 +1,1 @@
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   824
  +x
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   825
  
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   826
  $ hg debugrename aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   827
  aa not renamed
18912
4e1ae55e63ef test-commit-amend.t: fix check-code violation from 3a72c89a83ec
Augie Fackler <raf@durin42.com>
parents: 18909
diff changeset
   828
  $ hg debugrename -r '.^' aa
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   829
  aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   830
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   831
Amend a merge changeset (with manifest-level conflicts):
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   832
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   833
  $ hg up -q bar
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   834
  $ hg rm aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   835
  $ hg ci -m 'rm aa'
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   836
  $ hg up -q default
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   837
  $ echo aa >> aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   838
  $ hg ci -m aa
27597
fe150586d9bd tests: explicitly request changed version in c/d conflict in test-commit-amend.t
Siddharth Agarwal <sid0@fb.com>
parents: 27163
diff changeset
   839
  $ hg merge -q bar --config ui.interactive=True << EOF
fe150586d9bd tests: explicitly request changed version in c/d conflict in test-commit-amend.t
Siddharth Agarwal <sid0@fb.com>
parents: 27163
diff changeset
   840
  > c
fe150586d9bd tests: explicitly request changed version in c/d conflict in test-commit-amend.t
Siddharth Agarwal <sid0@fb.com>
parents: 27163
diff changeset
   841
  > EOF
39285
a3fd84f4fb38 filemerge: fix the wrong placements of messages in prompt
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 39284
diff changeset
   842
  file 'aa' was deleted in other [merge rev] but was modified in local [working copy].
42565
4764e8436b2a filemerge: make last line of prompts <40 english chars (issue6158)
Kyle Lippincott <spectral@google.com>
parents: 42494
diff changeset
   843
  You can use (c)hanged version, (d)elete, or leave (u)nresolved.
4764e8436b2a filemerge: make last line of prompts <40 english chars (issue6158)
Kyle Lippincott <spectral@google.com>
parents: 42494
diff changeset
   844
  What do you want to do? c
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   845
  $ hg ci -m 'merge bar (with conflicts)'
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   846
  $ hg log --config diff.git=1 -pr .
42621
99ebde4fec99 commit: improve the files field of changelog for merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 42565
diff changeset
   847
  changeset:   28:ed15db12298d
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   848
  tag:         tip
42621
99ebde4fec99 commit: improve the files field of changelog for merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 42565
diff changeset
   849
  parent:      27:eb5adec0b43b
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   850
  parent:      26:67db8847a540
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   851
  user:        test
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   852
  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
   853
  summary:     merge bar (with conflicts)
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   854
  
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   855
  
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   856
  $ hg rm aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   857
  $ 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
   858
  $ hg log --config diff.git=1 -pr .
42621
99ebde4fec99 commit: improve the files field of changelog for merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 42565
diff changeset
   859
  changeset:   29:0eeafd043f63
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   860
  tag:         tip
42621
99ebde4fec99 commit: improve the files field of changelog for merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 42565
diff changeset
   861
  parent:      27:eb5adec0b43b
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   862
  parent:      26:67db8847a540
18909
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   863
  user:        test
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   864
  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
   865
  summary:     merge bar (with conflicts, amended)
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   866
  
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   867
  diff --git a/aa b/aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   868
  deleted file mode 100644
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   869
  --- a/aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   870
  +++ /dev/null
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   871
  @@ -1,4 +0,0 @@
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   872
  -a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   873
  -a
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   874
  -aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   875
  -aa
3a72c89a83ec amend: support amending merge changesets (issue3778)
Brodie Rao <brodie@sf.io>
parents: 18399
diff changeset
   876
  
19305
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   877
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
   878
This shouldn't be possible:
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   879
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   880
  $ hg up -q default
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   881
  $ hg branch closewithamend
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   882
  marked working directory as branch closewithamend
23588
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   883
  $ echo foo > foo
22956
a0f89c852a0c obsolete: update test-commit-amend to use obsolete option
Durham Goode <durham@fb.com>
parents: 22249
diff changeset
   884
  $ hg add foo
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
   885
  $ hg ci -m..
19305
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   886
  $ hg ci --amend --close-branch -m 'closing'
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   887
  abort: can only close branch heads
45827
8d72e29ad1e0 errors: introduce InputError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 42621
diff changeset
   888
  [10]
19305
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   889
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   890
This silliness fails:
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   891
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   892
  $ hg branch silliness
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   893
  marked working directory as branch silliness
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   894
  $ echo b >> b
b500a663a2c7 commit: amending with --close-branch (issue3445)
Iulian Stana <julian.stana@gmail.com>
parents: 18912
diff changeset
   895
  $ hg ci --close-branch -m'open and close'
42494
abd4783db5a7 commit: make the error message more specific while aborting branch closing
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 42399
diff changeset
   896
  abort: branch "silliness" has no heads to close
45827
8d72e29ad1e0 errors: introduce InputError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 42621
diff changeset
   897
  [10]
20700
b0153cb8b64e commit: create new amend changeset as secret correctly for "--secret" option
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19980
diff changeset
   898
b0153cb8b64e commit: create new amend changeset as secret correctly for "--secret" option
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19980
diff changeset
   899
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
   900
---------------------------------------------------------------------
b0153cb8b64e commit: create new amend changeset as secret correctly for "--secret" option
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19980
diff changeset
   901
b0153cb8b64e commit: create new amend changeset as secret correctly for "--secret" option
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19980
diff changeset
   902
  $ hg phase '.^::.'
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   903
  29: draft
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   904
  30: draft
20700
b0153cb8b64e commit: create new amend changeset as secret correctly for "--secret" option
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19980
diff changeset
   905
  $ 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
   906
  $ hg phase '.^::.'
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   907
  29: draft
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
   908
  31: secret
21036
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
   909
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
   910
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
   911
---------------------------------------------------
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
   912
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
   913
  $ 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
   914
  amend as secret
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
   915
  $ 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
   916
  $ 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
   917
  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
   918
23587
8063901e56cd memctx: calculate exact status being committed from specified files
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23505
diff changeset
   919
  $ hg status --rev '.^1::.'
8063901e56cd memctx: calculate exact status being committed from specified files
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23505
diff changeset
   920
  A foo
21036
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
   921
  $ 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
   922
  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
   923
  
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
   924
  
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
   925
  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
   926
  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
   927
  HG: --
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
   928
  HG: user: test
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
   929
  HG: branch 'silliness'
23587
8063901e56cd memctx: calculate exact status being committed from specified files
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23505
diff changeset
   930
  HG: added foo
21036
a1a1bd09e4f4 amend: invoke editor forcibly when "--edit" option is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20771
diff changeset
   931
  $ 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
   932
  editor should be invoked
23071
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
   933
42398
060ff3396589 commit: add test showing that commit --amend --no-edit still shows editor
Kyle Lippincott <spectral@google.com>
parents: 42222
diff changeset
   934
Test that amend with --no-edit avoids the editor
060ff3396589 commit: add test showing that commit --amend --no-edit still shows editor
Kyle Lippincott <spectral@google.com>
parents: 42222
diff changeset
   935
------------------------------------------------
060ff3396589 commit: add test showing that commit --amend --no-edit still shows editor
Kyle Lippincott <spectral@google.com>
parents: 42222
diff changeset
   936
060ff3396589 commit: add test showing that commit --amend --no-edit still shows editor
Kyle Lippincott <spectral@google.com>
parents: 42222
diff changeset
   937
  $ hg commit --amend -m "before anything happens"
060ff3396589 commit: add test showing that commit --amend --no-edit still shows editor
Kyle Lippincott <spectral@google.com>
parents: 42222
diff changeset
   938
  $ hg parents --template "{desc}\n"
060ff3396589 commit: add test showing that commit --amend --no-edit still shows editor
Kyle Lippincott <spectral@google.com>
parents: 42222
diff changeset
   939
  before anything happens
060ff3396589 commit: add test showing that commit --amend --no-edit still shows editor
Kyle Lippincott <spectral@google.com>
parents: 42222
diff changeset
   940
  $ HGEDITOR=cat hg commit --amend --no-edit -m "editor should be suppressed"
060ff3396589 commit: add test showing that commit --amend --no-edit still shows editor
Kyle Lippincott <spectral@google.com>
parents: 42222
diff changeset
   941
  $ hg parents --template "{desc}\n"
060ff3396589 commit: add test showing that commit --amend --no-edit still shows editor
Kyle Lippincott <spectral@google.com>
parents: 42222
diff changeset
   942
  editor should be suppressed
060ff3396589 commit: add test showing that commit --amend --no-edit still shows editor
Kyle Lippincott <spectral@google.com>
parents: 42222
diff changeset
   943
060ff3396589 commit: add test showing that commit --amend --no-edit still shows editor
Kyle Lippincott <spectral@google.com>
parents: 42222
diff changeset
   944
(We need a file change here since we won't have a message change)
060ff3396589 commit: add test showing that commit --amend --no-edit still shows editor
Kyle Lippincott <spectral@google.com>
parents: 42222
diff changeset
   945
  $ cp foo foo.orig
060ff3396589 commit: add test showing that commit --amend --no-edit still shows editor
Kyle Lippincott <spectral@google.com>
parents: 42222
diff changeset
   946
  $ echo hi >> foo
060ff3396589 commit: add test showing that commit --amend --no-edit still shows editor
Kyle Lippincott <spectral@google.com>
parents: 42222
diff changeset
   947
  $ HGEDITOR=cat hg commit --amend --no-edit
060ff3396589 commit: add test showing that commit --amend --no-edit still shows editor
Kyle Lippincott <spectral@google.com>
parents: 42222
diff changeset
   948
  $ hg parents --template "{desc}\n"
060ff3396589 commit: add test showing that commit --amend --no-edit still shows editor
Kyle Lippincott <spectral@google.com>
parents: 42222
diff changeset
   949
  editor should be suppressed
060ff3396589 commit: add test showing that commit --amend --no-edit still shows editor
Kyle Lippincott <spectral@google.com>
parents: 42222
diff changeset
   950
  $ hg status -mar
060ff3396589 commit: add test showing that commit --amend --no-edit still shows editor
Kyle Lippincott <spectral@google.com>
parents: 42222
diff changeset
   951
(Let's undo adding that "hi" so later tests don't need to be adjusted)
060ff3396589 commit: add test showing that commit --amend --no-edit still shows editor
Kyle Lippincott <spectral@google.com>
parents: 42222
diff changeset
   952
  $ mv foo.orig foo
060ff3396589 commit: add test showing that commit --amend --no-edit still shows editor
Kyle Lippincott <spectral@google.com>
parents: 42222
diff changeset
   953
  $ hg commit --amend --no-edit
060ff3396589 commit: add test showing that commit --amend --no-edit still shows editor
Kyle Lippincott <spectral@google.com>
parents: 42222
diff changeset
   954
23588
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   955
Test that "diff()" in committemplate works correctly for amending
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   956
-----------------------------------------------------------------
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   957
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   958
  $ cat >> .hg/hgrc <<EOF
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   959
  > [committemplate]
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   960
  > changeset.commit.amend = {desc}\n
47191
b338d831d18c templates: fix `revset('parents()') % ...` in amend message template
Martin von Zweigbergk <martinvonz@google.com>
parents: 47069
diff changeset
   961
  >     HG: {revset('parents()') % 'parent: {desc|firstline}\n'}
23588
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   962
  >     HG: M: {file_mods}
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   963
  >     HG: A: {file_adds}
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   964
  >     HG: R: {file_dels}
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   965
  >     {splitlines(diff()) % 'HG: {line}\n'}
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   966
  > EOF
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   967
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   968
  $ hg parents --template "M: {file_mods}\nA: {file_adds}\nR: {file_dels}\n"
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   969
  M: 
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   970
  A: foo
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   971
  R: 
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   972
  $ hg status -amr
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   973
  $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of foo"
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   974
  expecting diff of foo
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   975
  
47191
b338d831d18c templates: fix `revset('parents()') % ...` in amend message template
Martin von Zweigbergk <martinvonz@google.com>
parents: 47069
diff changeset
   976
  HG: parent: editor should be suppressed
b338d831d18c templates: fix `revset('parents()') % ...` in amend message template
Martin von Zweigbergk <martinvonz@google.com>
parents: 47069
diff changeset
   977
  
23588
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   978
  HG: M: 
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   979
  HG: A: foo
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   980
  HG: R: 
42621
99ebde4fec99 commit: improve the files field of changelog for merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 42565
diff changeset
   981
  HG: diff -r 0eeafd043f63 foo
23588
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   982
  HG: --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   983
  HG: +++ b/foo	Thu Jan 01 00:00:00 1970 +0000
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   984
  HG: @@ -0,0 +1,1 @@
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   985
  HG: +foo
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   986
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   987
  $ echo y > y
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   988
  $ hg add y
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   989
  $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of foo and y"
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   990
  expecting diff of foo and y
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   991
  
47191
b338d831d18c templates: fix `revset('parents()') % ...` in amend message template
Martin von Zweigbergk <martinvonz@google.com>
parents: 47069
diff changeset
   992
  HG: parent: expecting diff of foo
b338d831d18c templates: fix `revset('parents()') % ...` in amend message template
Martin von Zweigbergk <martinvonz@google.com>
parents: 47069
diff changeset
   993
  
23588
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   994
  HG: M: 
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   995
  HG: A: foo y
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   996
  HG: R: 
42621
99ebde4fec99 commit: improve the files field of changelog for merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 42565
diff changeset
   997
  HG: diff -r 0eeafd043f63 foo
23588
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   998
  HG: --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
   999
  HG: +++ b/foo	Thu Jan 01 00:00:00 1970 +0000
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
  1000
  HG: @@ -0,0 +1,1 @@
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
  1001
  HG: +foo
42621
99ebde4fec99 commit: improve the files field of changelog for merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 42565
diff changeset
  1002
  HG: diff -r 0eeafd043f63 y
23588
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
  1003
  HG: --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
  1004
  HG: +++ b/y	Thu Jan 01 00:00:00 1970 +0000
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
  1005
  HG: @@ -0,0 +1,1 @@
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
  1006
  HG: +y
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
  1007
23589
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1008
  $ hg rm a
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1009
  $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of a, foo and y"
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1010
  expecting diff of a, foo and y
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1011
  
47191
b338d831d18c templates: fix `revset('parents()') % ...` in amend message template
Martin von Zweigbergk <martinvonz@google.com>
parents: 47069
diff changeset
  1012
  HG: parent: expecting diff of foo and y
b338d831d18c templates: fix `revset('parents()') % ...` in amend message template
Martin von Zweigbergk <martinvonz@google.com>
parents: 47069
diff changeset
  1013
  
23589
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1014
  HG: M: 
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1015
  HG: A: foo y
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1016
  HG: R: a
42621
99ebde4fec99 commit: improve the files field of changelog for merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 42565
diff changeset
  1017
  HG: diff -r 0eeafd043f63 a
23589
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1018
  HG: --- a/a	Thu Jan 01 00:00:00 1970 +0000
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1019
  HG: +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1020
  HG: @@ -1,2 +0,0 @@
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1021
  HG: -a
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1022
  HG: -a
42621
99ebde4fec99 commit: improve the files field of changelog for merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 42565
diff changeset
  1023
  HG: diff -r 0eeafd043f63 foo
23589
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1024
  HG: --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1025
  HG: +++ b/foo	Thu Jan 01 00:00:00 1970 +0000
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1026
  HG: @@ -0,0 +1,1 @@
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1027
  HG: +foo
42621
99ebde4fec99 commit: improve the files field of changelog for merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 42565
diff changeset
  1028
  HG: diff -r 0eeafd043f63 y
23589
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1029
  HG: --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1030
  HG: +++ b/y	Thu Jan 01 00:00:00 1970 +0000
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1031
  HG: @@ -0,0 +1,1 @@
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1032
  HG: +y
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1033
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1034
  $ hg rm x
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1035
  $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of a, foo, x and y"
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1036
  expecting diff of a, foo, x and y
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1037
  
47191
b338d831d18c templates: fix `revset('parents()') % ...` in amend message template
Martin von Zweigbergk <martinvonz@google.com>
parents: 47069
diff changeset
  1038
  HG: parent: expecting diff of a, foo and y
b338d831d18c templates: fix `revset('parents()') % ...` in amend message template
Martin von Zweigbergk <martinvonz@google.com>
parents: 47069
diff changeset
  1039
  
23589
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1040
  HG: M: 
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1041
  HG: A: foo y
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1042
  HG: R: a x
42621
99ebde4fec99 commit: improve the files field of changelog for merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 42565
diff changeset
  1043
  HG: diff -r 0eeafd043f63 a
23589
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1044
  HG: --- a/a	Thu Jan 01 00:00:00 1970 +0000
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1045
  HG: +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1046
  HG: @@ -1,2 +0,0 @@
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1047
  HG: -a
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1048
  HG: -a
42621
99ebde4fec99 commit: improve the files field of changelog for merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 42565
diff changeset
  1049
  HG: diff -r 0eeafd043f63 foo
23589
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1050
  HG: --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1051
  HG: +++ b/foo	Thu Jan 01 00:00:00 1970 +0000
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1052
  HG: @@ -0,0 +1,1 @@
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1053
  HG: +foo
42621
99ebde4fec99 commit: improve the files field of changelog for merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 42565
diff changeset
  1054
  HG: diff -r 0eeafd043f63 x
23589
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1055
  HG: --- a/x	Thu Jan 01 00:00:00 1970 +0000
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1056
  HG: +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1057
  HG: @@ -1,1 +0,0 @@
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1058
  HG: -x
42621
99ebde4fec99 commit: improve the files field of changelog for merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 42565
diff changeset
  1059
  HG: diff -r 0eeafd043f63 y
23589
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1060
  HG: --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1061
  HG: +++ b/y	Thu Jan 01 00:00:00 1970 +0000
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1062
  HG: @@ -0,0 +1,1 @@
200215cdf7aa memctx: calculate manifest correctly with newly-removed files (issue4470)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23588
diff changeset
  1063
  HG: +y
23588
87a76cff7147 memctx: calculate manifest including newly added files correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23587
diff changeset
  1064
25392
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24229
diff changeset
  1065
  $ echo cccc >> cc
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24229
diff changeset
  1066
  $ hg status -amr
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24229
diff changeset
  1067
  M cc
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24229
diff changeset
  1068
  $ HGEDITOR=cat hg commit --amend -e -m "cc should be excluded" -X cc
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24229
diff changeset
  1069
  cc should be excluded
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24229
diff changeset
  1070
  
47191
b338d831d18c templates: fix `revset('parents()') % ...` in amend message template
Martin von Zweigbergk <martinvonz@google.com>
parents: 47069
diff changeset
  1071
  HG: parent: expecting diff of a, foo, x and y
b338d831d18c templates: fix `revset('parents()') % ...` in amend message template
Martin von Zweigbergk <martinvonz@google.com>
parents: 47069
diff changeset
  1072
  
25392
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24229
diff changeset
  1073
  HG: M: 
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24229
diff changeset
  1074
  HG: A: foo y
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24229
diff changeset
  1075
  HG: R: a x
42621
99ebde4fec99 commit: improve the files field of changelog for merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 42565
diff changeset
  1076
  HG: diff -r 0eeafd043f63 a
25392
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24229
diff changeset
  1077
  HG: --- a/a	Thu Jan 01 00:00:00 1970 +0000
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24229
diff changeset
  1078
  HG: +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24229
diff changeset
  1079
  HG: @@ -1,2 +0,0 @@
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24229
diff changeset
  1080
  HG: -a
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24229
diff changeset
  1081
  HG: -a
42621
99ebde4fec99 commit: improve the files field of changelog for merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 42565
diff changeset
  1082
  HG: diff -r 0eeafd043f63 foo
25392
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24229
diff changeset
  1083
  HG: --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24229
diff changeset
  1084
  HG: +++ b/foo	Thu Jan 01 00:00:00 1970 +0000
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24229
diff changeset
  1085
  HG: @@ -0,0 +1,1 @@
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24229
diff changeset
  1086
  HG: +foo
42621
99ebde4fec99 commit: improve the files field of changelog for merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 42565
diff changeset
  1087
  HG: diff -r 0eeafd043f63 x
25392
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24229
diff changeset
  1088
  HG: --- a/x	Thu Jan 01 00:00:00 1970 +0000
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24229
diff changeset
  1089
  HG: +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24229
diff changeset
  1090
  HG: @@ -1,1 +0,0 @@
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24229
diff changeset
  1091
  HG: -x
42621
99ebde4fec99 commit: improve the files field of changelog for merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 42565
diff changeset
  1092
  HG: diff -r 0eeafd043f63 y
25392
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24229
diff changeset
  1093
  HG: --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24229
diff changeset
  1094
  HG: +++ b/y	Thu Jan 01 00:00:00 1970 +0000
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24229
diff changeset
  1095
  HG: @@ -0,0 +1,1 @@
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24229
diff changeset
  1096
  HG: +y
ed18f4acf435 templatekw: compare target context and its parent exactly (issue4690)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24229
diff changeset
  1097
23071
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1098
Check for issue4405
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1099
-------------------
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1100
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1101
Setup the repo with a file that gets moved in a second commit.
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1102
  $ hg init repo
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1103
  $ cd repo
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1104
  $ touch a0
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1105
  $ hg add a0
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1106
  $ hg commit -m a0
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1107
  $ hg mv a0 a1
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1108
  $ hg commit -m a1
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1109
  $ hg up -q 0
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1110
  $ hg log -G --template '{rev} {desc}'
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1111
  o  1 a1
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1112
  |
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1113
  @  0 a0
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1114
  
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1115
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1116
Now we branch the repro, but re-use the file contents, so we have a divergence
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1117
in the file revlog topology and the changelog topology.
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1118
  $ hg revert --rev 1 --all
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1119
  removing a0
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1120
  adding a1
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1121
  $ hg ci -qm 'a1-amend'
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1122
  $ hg log -G --template '{rev} {desc}'
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1123
  @  2 a1-amend
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1124
  |
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1125
  | o  1 a1
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1126
  |/
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1127
  o  0 a0
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1128
  
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1129
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
  1130
The way mercurial does amends is by folding the working copy and old commit
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
  1131
together into another commit (rev 3). During this process, _findlimit is called
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
  1132
to  check how far back to look for the transitive closure of file copy
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
  1133
information, but due to the divergence of the filelog and changelog graph
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
  1134
topologies, before _findlimit was fixed, it returned a rev which was not far
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
  1135
enough back in this case.
23071
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1136
  $ hg mv a1 a2
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1137
  $ hg status --copies --rev 0
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1138
  A a2
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1139
    a0
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1140
  R a0
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1141
  $ hg ci --amend -q
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1142
  $ hg log -G --template '{rev} {desc}'
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
  1143
  @  3 a1-amend
23071
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1144
  |
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1145
  | o  1 a1
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1146
  |/
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1147
  o  0 a0
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1148
  
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1149
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1150
Before the fix, the copy information was lost.
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1151
  $ hg status --copies --rev 0
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1152
  A a2
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1153
    a0
652ab726ba93 amend: fix amending rename commit with diverged topologies (issue4405)
Ryan McElroy <rmcelroy@fb.com>
parents: 22956
diff changeset
  1154
  R a0
24169
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1155
  $ cd ..
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1156
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1157
Check that amend properly preserve rename from directory rename (issue-4516)
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1158
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1159
If a parent of the merge renames a full directory, any files added to the old
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1160
directory in the other parent will be renamed to the new directory. For some
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1161
reason, the rename metadata was when amending such merge. This test ensure we
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1162
do not regress. We have a dedicated repo because it needs a setup with renamed
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1163
directory)
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1164
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1165
  $ hg init issue4516
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1166
  $ cd issue4516
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1167
  $ mkdir olddirname
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1168
  $ echo line1 > olddirname/commonfile.py
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1169
  $ hg add olddirname/commonfile.py
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1170
  $ hg ci -m first
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1171
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1172
  $ hg branch newdirname
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1173
  marked working directory as branch newdirname
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1174
  (branches are permanent and global, did you want a bookmark?)
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1175
  $ hg mv olddirname newdirname
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35244
diff changeset
  1176
  moving olddirname/commonfile.py to newdirname/commonfile.py
24169
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1177
  $ hg ci -m rename
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1178
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1179
  $ hg update default
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1180
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1181
  $ echo line1 > olddirname/newfile.py
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1182
  $ hg add olddirname/newfile.py
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1183
  $ hg ci -m log
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1184
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1185
  $ hg up newdirname
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1186
  1 files updated, 0 files merged, 2 files removed, 0 files unresolved
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1187
  $ # create newdirname/newfile.py
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1188
  $ hg merge default
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1189
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1190
  (branch merge, don't forget to commit)
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1191
  $ hg ci -m add
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1192
  $ 
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1193
  $ hg debugrename newdirname/newfile.py
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35244
diff changeset
  1194
  newdirname/newfile.py renamed from olddirname/newfile.py:690b295714aed510803d3020da9c70fca8336def
24169
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1195
  $ hg status -C --change .
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1196
  A newdirname/newfile.py
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1197
  $ hg status -C --rev 1
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1198
  A newdirname/newfile.py
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1199
  $ hg status -C --rev 2
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1200
  A newdirname/commonfile.py
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1201
    olddirname/commonfile.py
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1202
  A newdirname/newfile.py
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1203
    olddirname/newfile.py
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1204
  R olddirname/commonfile.py
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1205
  R olddirname/newfile.py
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1206
  $ hg debugindex newdirname/newfile.py
49252
4141951dacff debugindex: rename the parent column to mention nodeid
Pierre-Yves DAVID <pierre-yves.david@octobus.net>
parents: 49251
diff changeset
  1207
     rev linkrev       nodeid    p1-nodeid    p2-nodeid
37283
d4e62df1c73d debugcommands: drop offset and length from debugindex by default
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37282
diff changeset
  1208
       0       3 34a4d536c0c0 000000000000 000000000000
24169
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1209
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1210
  $ echo a >> newdirname/commonfile.py
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1211
  $ hg ci --amend -m bug
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1212
  $ hg debugrename newdirname/newfile.py
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35244
diff changeset
  1213
  newdirname/newfile.py renamed from olddirname/newfile.py:690b295714aed510803d3020da9c70fca8336def
24169
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1214
  $ hg debugindex newdirname/newfile.py
49252
4141951dacff debugindex: rename the parent column to mention nodeid
Pierre-Yves DAVID <pierre-yves.david@octobus.net>
parents: 49251
diff changeset
  1215
     rev linkrev       nodeid    p1-nodeid    p2-nodeid
37283
d4e62df1c73d debugcommands: drop offset and length from debugindex by default
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37282
diff changeset
  1216
       0       3 34a4d536c0c0 000000000000 000000000000
24169
ac41aa4a66ab amend: check for directory renames for both merge parents (issue4516)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23835
diff changeset
  1217
30240
8237c3359db5 tests: test preserving execbit changes at amending only on execbit platform
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 30211
diff changeset
  1218
#if execbit
8237c3359db5 tests: test preserving execbit changes at amending only on execbit platform
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 30211
diff changeset
  1219
29181
dae38633eba8 localrepo: prevent executable-bit only changes from being lost on amend
Mateusz Kwapich <mitrandir@fb.com>
parents: 28627
diff changeset
  1220
Test if amend preserves executable bit changes
dae38633eba8 localrepo: prevent executable-bit only changes from being lost on amend
Mateusz Kwapich <mitrandir@fb.com>
parents: 28627
diff changeset
  1221
  $ chmod +x newdirname/commonfile.py
dae38633eba8 localrepo: prevent executable-bit only changes from being lost on amend
Mateusz Kwapich <mitrandir@fb.com>
parents: 28627
diff changeset
  1222
  $ hg ci -m chmod
dae38633eba8 localrepo: prevent executable-bit only changes from being lost on amend
Mateusz Kwapich <mitrandir@fb.com>
parents: 28627
diff changeset
  1223
  $ hg ci --amend -m "chmod amended"
dae38633eba8 localrepo: prevent executable-bit only changes from being lost on amend
Mateusz Kwapich <mitrandir@fb.com>
parents: 28627
diff changeset
  1224
  $ hg ci --amend -m "chmod amended second time"
dae38633eba8 localrepo: prevent executable-bit only changes from being lost on amend
Mateusz Kwapich <mitrandir@fb.com>
parents: 28627
diff changeset
  1225
  $ hg log -p --git -r .
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
  1226
  changeset:   7:b1326f52dddf
29181
dae38633eba8 localrepo: prevent executable-bit only changes from being lost on amend
Mateusz Kwapich <mitrandir@fb.com>
parents: 28627
diff changeset
  1227
  branch:      newdirname
dae38633eba8 localrepo: prevent executable-bit only changes from being lost on amend
Mateusz Kwapich <mitrandir@fb.com>
parents: 28627
diff changeset
  1228
  tag:         tip
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34059
diff changeset
  1229
  parent:      4:7fd235f7cb2f
29181
dae38633eba8 localrepo: prevent executable-bit only changes from being lost on amend
Mateusz Kwapich <mitrandir@fb.com>
parents: 28627
diff changeset
  1230
  user:        test
dae38633eba8 localrepo: prevent executable-bit only changes from being lost on amend
Mateusz Kwapich <mitrandir@fb.com>
parents: 28627
diff changeset
  1231
  date:        Thu Jan 01 00:00:00 1970 +0000
dae38633eba8 localrepo: prevent executable-bit only changes from being lost on amend
Mateusz Kwapich <mitrandir@fb.com>
parents: 28627
diff changeset
  1232
  summary:     chmod amended second time
dae38633eba8 localrepo: prevent executable-bit only changes from being lost on amend
Mateusz Kwapich <mitrandir@fb.com>
parents: 28627
diff changeset
  1233
  
dae38633eba8 localrepo: prevent executable-bit only changes from being lost on amend
Mateusz Kwapich <mitrandir@fb.com>
parents: 28627
diff changeset
  1234
  diff --git a/newdirname/commonfile.py b/newdirname/commonfile.py
dae38633eba8 localrepo: prevent executable-bit only changes from being lost on amend
Mateusz Kwapich <mitrandir@fb.com>
parents: 28627
diff changeset
  1235
  old mode 100644
dae38633eba8 localrepo: prevent executable-bit only changes from being lost on amend
Mateusz Kwapich <mitrandir@fb.com>
parents: 28627
diff changeset
  1236
  new mode 100755
dae38633eba8 localrepo: prevent executable-bit only changes from being lost on amend
Mateusz Kwapich <mitrandir@fb.com>
parents: 28627
diff changeset
  1237
  
30240
8237c3359db5 tests: test preserving execbit changes at amending only on execbit platform
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 30211
diff changeset
  1238
#endif
34059
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1239
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1240
Test amend with file inclusion options
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1241
--------------------------------------
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1242
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1243
These tests ensure that we are always amending some files that were part of the
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1244
pre-amend commit. We want to test that the remaining files in the pre-amend
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1245
commit were not changed in the amended commit. We do so by performing a diff of
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1246
the amended commit against its parent commit.
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1247
  $ cd ..
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1248
  $ hg init testfileinclusions
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1249
  $ cd testfileinclusions
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1250
  $ echo a > a
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1251
  $ echo b > b
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1252
  $ hg commit -Aqm "Adding a and b"
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1253
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1254
Only add changes to a particular file
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1255
  $ echo a >> a
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1256
  $ echo b >> b
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1257
  $ hg commit --amend -I a
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1258
  $ hg diff --git -r null -r .
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1259
  diff --git a/a b/a
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1260
  new file mode 100644
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1261
  --- /dev/null
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1262
  +++ b/a
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1263
  @@ -0,0 +1,2 @@
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1264
  +a
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1265
  +a
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1266
  diff --git a/b b/b
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1267
  new file mode 100644
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1268
  --- /dev/null
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1269
  +++ b/b
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1270
  @@ -0,0 +1,1 @@
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1271
  +b
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1272
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1273
  $ echo a >> a
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1274
  $ hg commit --amend b
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1275
  $ hg diff --git -r null -r .
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1276
  diff --git a/a b/a
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1277
  new file mode 100644
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1278
  --- /dev/null
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1279
  +++ b/a
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1280
  @@ -0,0 +1,2 @@
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1281
  +a
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1282
  +a
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1283
  diff --git a/b b/b
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1284
  new file mode 100644
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1285
  --- /dev/null
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1286
  +++ b/b
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1287
  @@ -0,0 +1,2 @@
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1288
  +b
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1289
  +b
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1290
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1291
Exclude changes to a particular file
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1292
  $ echo b >> b
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1293
  $ hg commit --amend -X a
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1294
  $ hg diff --git -r null -r .
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1295
  diff --git a/a b/a
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1296
  new file mode 100644
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1297
  --- /dev/null
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1298
  +++ b/a
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1299
  @@ -0,0 +1,2 @@
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1300
  +a
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1301
  +a
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1302
  diff --git a/b b/b
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1303
  new file mode 100644
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1304
  --- /dev/null
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1305
  +++ b/b
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1306
  @@ -0,0 +1,3 @@
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1307
  +b
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1308
  +b
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1309
  +b
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1310
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1311
Check the addremove flag
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1312
  $ echo c > c
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1313
  $ rm a
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1314
  $ hg commit --amend -A
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1315
  removing a
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1316
  adding c
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1317
  $ hg diff --git -r null -r .
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1318
  diff --git a/b b/b
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1319
  new file mode 100644
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1320
  --- /dev/null
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1321
  +++ b/b
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1322
  @@ -0,0 +1,3 @@
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1323
  +b
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1324
  +b
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1325
  +b
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1326
  diff --git a/c b/c
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1327
  new file mode 100644
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1328
  --- /dev/null
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1329
  +++ b/c
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1330
  @@ -0,0 +1,1 @@
6fb5a06b92c6 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com>
parents: 33774
diff changeset
  1331
  +c