tests/test-amend.t
author Taapas Agrawal <taapas2897@gmail.com>
Fri, 04 Jan 2019 20:27:17 +0530
changeset 41123 79f8f032c706
parent 39723 5abc47d4ca6b
child 41125 14271b524d76
permissions -rw-r--r--
amend: add config option to update time to current in hg amend (issue5828) The given config option i.e. `rewrite.update-timestamp` updates date to current when //True//. However when only date is to be updated to current with the working directory clean and no other attributes changing then it does not amend as stated in issue 5828. Further when `--date` flag is specified along with the new config option then `--date` is given priority over the config option. Differential Revision: https://phab.mercurial-scm.org/D5491
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
33404
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
     1
#testcases obsstore-off obsstore-on
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
     2
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
     3
  $ cat << EOF >> $HGRCPATH
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
     4
  > [extensions]
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
     5
  > amend=
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
     6
  > debugdrawdag=$TESTDIR/drawdag.py
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
     7
  > [diff]
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
     8
  > git=1
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
     9
  > EOF
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    10
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    11
#if obsstore-on
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    12
  $ cat << EOF >> $HGRCPATH
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    13
  > [experimental]
34866
1644623ab096 config: use 'experimental.evolution.create-markers'
Boris Feld <boris.feld@octobus.net>
parents: 34795
diff changeset
    14
  > evolution.createmarkers=True
33404
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    15
  > EOF
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    16
#endif
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    17
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    18
Basic amend
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    19
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    20
  $ hg init repo1
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    21
  $ cd repo1
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    22
  $ hg debugdrawdag <<'EOS'
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    23
  > B
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    24
  > |
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    25
  > A
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    26
  > EOS
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    27
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    28
  $ hg update B -q
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    29
  $ echo 2 >> B
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    30
34070
24ce7b0edaf9 test-amend: match output using conditional test case name
Jun Wu <quark@fb.com>
parents: 33794
diff changeset
    31
  $ hg amend
35400
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35253
diff changeset
    32
  saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/112478962961-7e959a55-amend.hg (obsstore-off !)
33404
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    33
#if obsstore-off
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    34
  $ hg log -p -G --hidden -T '{rev} {node|short} {desc}\n'
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    35
  @  1 be169c7e8dbe B
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    36
  |  diff --git a/B b/B
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    37
  |  new file mode 100644
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    38
  |  --- /dev/null
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    39
  |  +++ b/B
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    40
  |  @@ -0,0 +1,1 @@
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    41
  |  +B2
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    42
  |
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    43
  o  0 426bada5c675 A
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    44
     diff --git a/A b/A
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    45
     new file mode 100644
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    46
     --- /dev/null
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    47
     +++ b/A
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    48
     @@ -0,0 +1,1 @@
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    49
     +A
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    50
     \ No newline at end of file
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    51
  
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    52
#else
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    53
  $ hg log -p -G --hidden -T '{rev} {node|short} {desc}\n'
34102
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34070
diff changeset
    54
  @  2 be169c7e8dbe B
33404
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    55
  |  diff --git a/B b/B
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    56
  |  new file mode 100644
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    57
  |  --- /dev/null
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    58
  |  +++ b/B
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    59
  |  @@ -0,0 +1,1 @@
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    60
  |  +B2
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    61
  |
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    62
  | x  1 112478962961 B
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    63
  |/   diff --git a/B b/B
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    64
  |    new file mode 100644
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    65
  |    --- /dev/null
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    66
  |    +++ b/B
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    67
  |    @@ -0,0 +1,1 @@
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    68
  |    +B
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    69
  |    \ No newline at end of file
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    70
  |
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    71
  o  0 426bada5c675 A
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    72
     diff --git a/A b/A
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    73
     new file mode 100644
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    74
     --- /dev/null
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    75
     +++ b/A
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    76
     @@ -0,0 +1,1 @@
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    77
     +A
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    78
     \ No newline at end of file
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    79
  
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    80
#endif
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    81
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    82
Nothing changed
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    83
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    84
  $ hg amend
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    85
  nothing changed
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    86
  [1]
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    87
34136
ae95853c250a cmdutil: fix amend when passing a date
Boris Feld <boris.feld@octobus.net>
parents: 34102
diff changeset
    88
  $ hg amend -d "0 0"
ae95853c250a cmdutil: fix amend when passing a date
Boris Feld <boris.feld@octobus.net>
parents: 34102
diff changeset
    89
  nothing changed
ae95853c250a cmdutil: fix amend when passing a date
Boris Feld <boris.feld@octobus.net>
parents: 34102
diff changeset
    90
  [1]
ae95853c250a cmdutil: fix amend when passing a date
Boris Feld <boris.feld@octobus.net>
parents: 34102
diff changeset
    91
ae95853c250a cmdutil: fix amend when passing a date
Boris Feld <boris.feld@octobus.net>
parents: 34102
diff changeset
    92
  $ hg amend -d "Thu Jan 01 00:00:00 1970 UTC"
ae95853c250a cmdutil: fix amend when passing a date
Boris Feld <boris.feld@octobus.net>
parents: 34102
diff changeset
    93
  nothing changed
ae95853c250a cmdutil: fix amend when passing a date
Boris Feld <boris.feld@octobus.net>
parents: 34102
diff changeset
    94
  [1]
ae95853c250a cmdutil: fix amend when passing a date
Boris Feld <boris.feld@octobus.net>
parents: 34102
diff changeset
    95
33404
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    96
Matcher and metadata options
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    97
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    98
  $ echo 3 > C
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
    99
  $ echo 4 > D
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   100
  $ hg add C D
34070
24ce7b0edaf9 test-amend: match output using conditional test case name
Jun Wu <quark@fb.com>
parents: 33794
diff changeset
   101
  $ hg amend -m NEWMESSAGE -I C
35400
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35253
diff changeset
   102
  saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/be169c7e8dbe-7684ddc5-amend.hg (obsstore-off !)
33404
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   103
  $ hg log -r . -T '{node|short} {desc} {files}\n'
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   104
  c7ba14d9075b NEWMESSAGE B C
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   105
  $ echo 5 > E
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   106
  $ rm C
34070
24ce7b0edaf9 test-amend: match output using conditional test case name
Jun Wu <quark@fb.com>
parents: 33794
diff changeset
   107
  $ hg amend -d '2000 1000' -u 'Foo <foo@example.com>' -A C D
35400
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35253
diff changeset
   108
  saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/c7ba14d9075b-b3e76daa-amend.hg (obsstore-off !)
33404
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   109
  $ hg log -r . -T '{node|short} {desc} {files} {author} {date}\n'
38310
88e7105b5cd9 templater: restore the original string format of {date}
Yuya Nishihara <yuya@tcha.org>
parents: 38297
diff changeset
   110
  14f6c4bcc865 NEWMESSAGE B D Foo <foo@example.com> 2000.01000
33404
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   111
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   112
Amend with editor
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   113
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   114
  $ cat > $TESTTMP/prefix.sh <<'EOF'
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   115
  > printf 'EDITED: ' > $TESTTMP/msg
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   116
  > cat "$1" >> $TESTTMP/msg
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   117
  > mv $TESTTMP/msg "$1"
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   118
  > EOF
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   119
  $ chmod +x $TESTTMP/prefix.sh
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   120
34070
24ce7b0edaf9 test-amend: match output using conditional test case name
Jun Wu <quark@fb.com>
parents: 33794
diff changeset
   121
  $ HGEDITOR="sh $TESTTMP/prefix.sh" hg amend --edit
35400
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35253
diff changeset
   122
  saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/14f6c4bcc865-6591f15d-amend.hg (obsstore-off !)
33404
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   123
  $ hg log -r . -T '{node|short} {desc}\n'
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   124
  298f085230c3 EDITED: NEWMESSAGE
34070
24ce7b0edaf9 test-amend: match output using conditional test case name
Jun Wu <quark@fb.com>
parents: 33794
diff changeset
   125
  $ HGEDITOR="sh $TESTTMP/prefix.sh" hg amend -e -m MSG
35400
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35253
diff changeset
   126
  saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/298f085230c3-d81a6ad3-amend.hg (obsstore-off !)
33404
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   127
  $ hg log -r . -T '{node|short} {desc}\n'
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   128
  974f07f28537 EDITED: MSG
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   129
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   130
  $ echo FOO > $TESTTMP/msg
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   131
  $ hg amend -l $TESTTMP/msg -m BAR
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   132
  abort: options --message and --logfile are mutually exclusive
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   133
  [255]
34070
24ce7b0edaf9 test-amend: match output using conditional test case name
Jun Wu <quark@fb.com>
parents: 33794
diff changeset
   134
  $ hg amend -l $TESTTMP/msg
35400
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35253
diff changeset
   135
  saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/974f07f28537-edb6470a-amend.hg (obsstore-off !)
33404
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   136
  $ hg log -r . -T '{node|short} {desc}\n'
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   137
  507be9bdac71 FOO
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   138
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   139
Interactive mode
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   140
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   141
  $ touch F G
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   142
  $ hg add F G
34070
24ce7b0edaf9 test-amend: match output using conditional test case name
Jun Wu <quark@fb.com>
parents: 33794
diff changeset
   143
  $ cat <<EOS | hg amend -i --config ui.interactive=1
33404
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   144
  > y
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   145
  > n
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   146
  > EOS
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   147
  diff --git a/F b/F
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   148
  new file mode 100644
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   149
  examine changes to 'F'? [Ynesfdaq?] y
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   150
  
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   151
  diff --git a/G b/G
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   152
  new file mode 100644
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   153
  examine changes to 'G'? [Ynesfdaq?] n
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   154
  
35400
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35253
diff changeset
   155
  saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/507be9bdac71-c8077452-amend.hg (obsstore-off !)
33404
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   156
  $ hg log -r . -T '{files}\n'
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   157
  B D F
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   158
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   159
Amend in the middle of a stack
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   160
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   161
  $ hg init $TESTTMP/repo2
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   162
  $ cd $TESTTMP/repo2
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   163
  $ hg debugdrawdag <<'EOS'
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   164
  > C
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   165
  > |
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   166
  > B
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   167
  > |
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   168
  > A
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   169
  > EOS
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   170
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   171
  $ hg update -q B
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   172
  $ echo 2 >> B
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   173
  $ hg amend
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   174
  abort: cannot amend changeset with children
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   175
  [255]
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   176
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   177
#if obsstore-on
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   178
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   179
With allowunstable, amend could work in the middle of a stack
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   180
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   181
  $ cat >> $HGRCPATH <<EOF
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   182
  > [experimental]
34866
1644623ab096 config: use 'experimental.evolution.create-markers'
Boris Feld <boris.feld@octobus.net>
parents: 34795
diff changeset
   183
  > evolution.createmarkers=True
34867
7f183c643eb6 config: use 'experimental.evolution.allowunstable'
Boris Feld <boris.feld@octobus.net>
parents: 34866
diff changeset
   184
  > evolution.allowunstable=True
33404
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   185
  > EOF
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   186
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   187
  $ hg amend
35709
1a09dad8b85a evolution: report new unstable changesets
Martin von Zweigbergk <martinvonz@google.com>
parents: 35512
diff changeset
   188
  1 new orphan changesets
33404
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   189
  $ hg log -T '{rev} {node|short} {desc}\n' -G
34102
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34070
diff changeset
   190
  @  3 be169c7e8dbe B
33404
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   191
  |
35512
9b3f95d9783d graphlog: add another graph node type, unstable, using character "*" (BC)
Anton Shestakov <av6@dwimlabs.net>
parents: 35400
diff changeset
   192
  | *  2 26805aba1e60 C
33404
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   193
  | |
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   194
  | x  1 112478962961 B
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   195
  |/
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   196
  o  0 426bada5c675 A
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   197
  
34795
530b7361e3a9 amend: add a flag `-n/--note` to store note with amend
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34136
diff changeset
   198
Checking the note stored in the obsmarker
530b7361e3a9 amend: add a flag `-n/--note` to store note with amend
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34136
diff changeset
   199
530b7361e3a9 amend: add a flag `-n/--note` to store note with amend
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34136
diff changeset
   200
  $ echo foo > bar
530b7361e3a9 amend: add a flag `-n/--note` to store note with amend
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34136
diff changeset
   201
  $ hg add bar
34889
554885e10868 amend: error out if the note is greater than 255bytes
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34867
diff changeset
   202
  $ hg amend --note 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'
554885e10868 amend: error out if the note is greater than 255bytes
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34867
diff changeset
   203
  abort: cannot store a note of more than 255 bytes
554885e10868 amend: error out if the note is greater than 255bytes
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34867
diff changeset
   204
  [255]
34795
530b7361e3a9 amend: add a flag `-n/--note` to store note with amend
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34136
diff changeset
   205
  $ hg amend --note "adding bar"
530b7361e3a9 amend: add a flag `-n/--note` to store note with amend
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34136
diff changeset
   206
  $ hg debugobsolete -r .
35017
a7e49a5b3e6f obsolete: activate effect-flag by default
Boris Feld <boris.feld@octobus.net>
parents: 34889
diff changeset
   207
  112478962961147124edd43549aedd1a335e44bf be169c7e8dbe21cd10b3d79691cbe7f241e3c21c 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
a7e49a5b3e6f obsolete: activate effect-flag by default
Boris Feld <boris.feld@octobus.net>
parents: 34889
diff changeset
   208
  be169c7e8dbe21cd10b3d79691cbe7f241e3c21c 16084da537dd8f84cfdb3055c633772269d62e1b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'note': 'adding bar', 'operation': 'amend', 'user': 'test'}
33404
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   209
#endif
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   210
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   211
Cannot amend public changeset
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   212
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   213
  $ hg phase -r A --public
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   214
  $ hg update -C -q A
34070
24ce7b0edaf9 test-amend: match output using conditional test case name
Jun Wu <quark@fb.com>
parents: 33794
diff changeset
   215
  $ hg amend -m AMEND
33404
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   216
  abort: cannot amend public changesets
35253
98f97eb20597 rewriteutil: use precheck() in uncommit and amend commands
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35184
diff changeset
   217
  (see 'hg help phases' for details)
33404
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   218
  [255]
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   219
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   220
Amend a merge changeset
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   221
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   222
  $ hg init $TESTTMP/repo3
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   223
  $ cd $TESTTMP/repo3
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   224
  $ hg debugdrawdag <<'EOS'
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   225
  >   C
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   226
  >  /|
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   227
  > A B
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   228
  > EOS
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   229
  $ hg update -q C
34070
24ce7b0edaf9 test-amend: match output using conditional test case name
Jun Wu <quark@fb.com>
parents: 33794
diff changeset
   230
  $ hg amend -m FOO
35400
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35253
diff changeset
   231
  saved backup bundle to $TESTTMP/repo3/.hg/strip-backup/a35c07e8a2a4-15ff4612-amend.hg (obsstore-off !)
33404
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   232
  $ rm .hg/localtags
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   233
  $ hg log -G -T '{desc}\n'
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   234
  @    FOO
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   235
  |\
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   236
  | o  B
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   237
  |
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   238
  o  A
0d5afd360e9e amend: new extension providing the amend command
Jun Wu <quark@fb.com>
parents:
diff changeset
   239
  
34973
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   240
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   241
More complete test for status changes (issue5732)
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   242
-------------------------------------------------
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   243
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   244
Generates history of files having 3 states, r0_r1_wc:
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   245
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   246
 r0: ground (content/missing)
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   247
 r1: old state to be amended (content/missing, where missing means removed)
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   248
 wc: changes to be included in r1 (content/missing-tracked/untracked)
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   249
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   250
  $ hg init $TESTTMP/wcstates
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   251
  $ cd $TESTTMP/wcstates
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   252
39723
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 38857
diff changeset
   253
  $ "$PYTHON" $TESTDIR/generate-working-copy-states.py state 2 1
34973
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   254
  $ hg addremove -q --similarity 0
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   255
  $ hg commit -m0
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   256
39723
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 38857
diff changeset
   257
  $ "$PYTHON" $TESTDIR/generate-working-copy-states.py state 2 2
34973
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   258
  $ hg addremove -q --similarity 0
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   259
  $ hg commit -m1
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   260
39723
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 38857
diff changeset
   261
  $ "$PYTHON" $TESTDIR/generate-working-copy-states.py state 2 wc
34973
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   262
  $ hg addremove -q --similarity 0
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   263
  $ hg forget *_*_*-untracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   264
  $ rm *_*_missing-*
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   265
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   266
amend r1 to include wc changes
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   267
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   268
  $ hg amend
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   269
  saved backup bundle to * (glob) (obsstore-off !)
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   270
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   271
clean/modified/removed/added states of the amended revision
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   272
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   273
  $ hg status --all --change . 'glob:content1_*_content1-tracked'
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   274
  C content1_content1_content1-tracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   275
  C content1_content2_content1-tracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   276
  C content1_missing_content1-tracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   277
  $ hg status --all --change . 'glob:content1_*_content[23]-tracked'
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   278
  M content1_content1_content3-tracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   279
  M content1_content2_content2-tracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   280
  M content1_content2_content3-tracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   281
  M content1_missing_content3-tracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   282
  $ hg status --all --change . 'glob:content1_*_missing-tracked'
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   283
  M content1_content2_missing-tracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   284
  R content1_missing_missing-tracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   285
  C content1_content1_missing-tracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   286
  $ hg status --all --change . 'glob:content1_*_*-untracked'
34974
0ba3b928f9a9 amend: do not take untracked files as modified or clean (issue5732)
Yuya Nishihara <yuya@tcha.org>
parents: 34973
diff changeset
   287
  R content1_content1_content1-untracked
0ba3b928f9a9 amend: do not take untracked files as modified or clean (issue5732)
Yuya Nishihara <yuya@tcha.org>
parents: 34973
diff changeset
   288
  R content1_content1_content3-untracked
34973
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   289
  R content1_content1_missing-untracked
34974
0ba3b928f9a9 amend: do not take untracked files as modified or clean (issue5732)
Yuya Nishihara <yuya@tcha.org>
parents: 34973
diff changeset
   290
  R content1_content2_content1-untracked
0ba3b928f9a9 amend: do not take untracked files as modified or clean (issue5732)
Yuya Nishihara <yuya@tcha.org>
parents: 34973
diff changeset
   291
  R content1_content2_content2-untracked
0ba3b928f9a9 amend: do not take untracked files as modified or clean (issue5732)
Yuya Nishihara <yuya@tcha.org>
parents: 34973
diff changeset
   292
  R content1_content2_content3-untracked
34973
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   293
  R content1_content2_missing-untracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   294
  R content1_missing_content1-untracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   295
  R content1_missing_content3-untracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   296
  R content1_missing_missing-untracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   297
  $ hg status --all --change . 'glob:missing_content2_*'
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   298
  A missing_content2_content2-tracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   299
  A missing_content2_content3-tracked
34975
5f40efa472db amend: do not drop missing files (issue5732)
Yuya Nishihara <yuya@tcha.org>
parents: 34974
diff changeset
   300
  A missing_content2_missing-tracked
34973
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   301
  $ hg status --all --change . 'glob:missing_missing_*'
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   302
  A missing_missing_content3-tracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   303
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   304
working directory should be all clean (with some missing/untracked files)
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   305
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   306
  $ hg status --all 'glob:*_content?-tracked'
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   307
  C content1_content1_content1-tracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   308
  C content1_content1_content3-tracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   309
  C content1_content2_content1-tracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   310
  C content1_content2_content2-tracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   311
  C content1_content2_content3-tracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   312
  C content1_missing_content1-tracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   313
  C content1_missing_content3-tracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   314
  C missing_content2_content2-tracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   315
  C missing_content2_content3-tracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   316
  C missing_missing_content3-tracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   317
  $ hg status --all 'glob:*_missing-tracked'
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   318
  ! content1_content1_missing-tracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   319
  ! content1_content2_missing-tracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   320
  ! content1_missing_missing-tracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   321
  ! missing_content2_missing-tracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   322
  ! missing_missing_missing-tracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   323
  $ hg status --all 'glob:*-untracked'
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   324
  ? content1_content1_content1-untracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   325
  ? content1_content1_content3-untracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   326
  ? content1_content2_content1-untracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   327
  ? content1_content2_content2-untracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   328
  ? content1_content2_content3-untracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   329
  ? content1_missing_content1-untracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   330
  ? content1_missing_content3-untracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   331
  ? missing_content2_content2-untracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   332
  ? missing_content2_content3-untracked
b69c700b6de6 tests: add more complete test for status changes on amend
Yuya Nishihara <yuya@tcha.org>
parents: 34889
diff changeset
   333
  ? missing_missing_content3-untracked
38857
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   334
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   335
==========================================
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   336
Test history-editing-backup config option|
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   337
==========================================
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   338
  $ hg init $TESTTMP/repo4
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   339
  $ cd $TESTTMP/repo4
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   340
  $ echo a>a
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   341
  $ hg ci -Aqma
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   342
  $ echo oops>b
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   343
  $ hg ci -Aqm "b"
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   344
  $ echo partiallyfixed > b
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   345
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   346
#if obsstore-off
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   347
  $ hg amend
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   348
  saved backup bundle to $TESTTMP/repo4/.hg/strip-backup/95e899acf2ce-f11cb050-amend.hg
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   349
When history-editing-backup config option is set:
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   350
  $ cat << EOF >> $HGRCPATH
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   351
  > [ui]
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   352
  > history-editing-backup = False
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   353
  > EOF
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   354
  $ echo fixed > b
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   355
  $ hg amend
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   356
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   357
#else
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   358
  $ hg amend
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   359
When history-editing-backup config option is set:
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   360
  $ cat << EOF >> $HGRCPATH
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   361
  > [ui]
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   362
  > history-editing-backup = False
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   363
  > EOF
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   364
  $ echo fixed > b
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   365
  $ hg amend
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   366
32ece991955c amend: support "history-editing-backup" config option
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38310
diff changeset
   367
#endif
41123
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   368
==========================================
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   369
Test update-timestamp config option|
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   370
==========================================
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   371
  $ cat >> testmocks.py << EOF
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   372
  > # mock out util.makedate() to supply testable values
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   373
  > import os
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   374
  > from mercurial import pycompat, util
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   375
  > from mercurial.utils import dateutil
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   376
  > 
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   377
  > def mockmakedate():
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   378
  >     filename = os.path.join(os.environ['TESTTMP'], 'testtime')
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   379
  >     try:
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   380
  >         with open(filename, 'rb') as timef:
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   381
  >             time = float(timef.read()) + 1
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   382
  >     except IOError:
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   383
  >         time = 0.0
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   384
  >     with open(filename, 'wb') as timef:
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   385
  >         timef.write(pycompat.bytestr(time))
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   386
  >     return (time, 0)
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   387
  > 
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   388
  > dateutil.makedate = mockmakedate
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   389
  > EOF
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   390
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   391
  $ cat >> $HGRCPATH << EOF
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   392
  > [extensions]
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   393
  > amend=
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   394
  > testmocks=`pwd`/testmocks.py
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   395
  > EOF
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   396
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   397
  $ hg init $TESTTMP/repo5
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   398
  $ cd $TESTTMP/repo5
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   399
  $ echo a>a
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   400
  $ hg ci -Am 'commit 1'
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   401
  adding a
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   402
#if obsstore-on
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   403
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   404
When updatetimestamp is False
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   405
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   406
  $ hg amend --date '1997-1-1 0:1'
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   407
  $ hg log --limit 1
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   408
  changeset:   1:036a159be19d
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   409
  tag:         tip
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   410
  parent:      -1:000000000000
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   411
  user:        test
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   412
  date:        Wed Jan 01 00:01:00 1997 +0000
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   413
  summary:     commit 1
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   414
  
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   415
 When update-timestamp is True and no other change than the date
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   416
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   417
  $ hg amend --config rewrite.update-timestamp=True
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   418
  nothing changed
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   419
  [1]
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   420
  $ hg log --limit 1
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   421
  changeset:   1:036a159be19d
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   422
  tag:         tip
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   423
  parent:      -1:000000000000
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   424
  user:        test
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   425
  date:        Wed Jan 01 00:01:00 1997 +0000
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   426
  summary:     commit 1
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   427
  
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   428
When update-timestamp is True and there is other change than the date
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   429
  $ hg amend --user foobar --config rewrite.update-timestamp=True
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   430
  $ hg log --limit 1
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   431
  changeset:   2:3ba48b892280
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   432
  tag:         tip
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   433
  parent:      -1:000000000000
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   434
  user:        foobar
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   435
  date:        Thu Jan 01 00:00:02 1970 +0000
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   436
  summary:     commit 1
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   437
  
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   438
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   439
When date option is applicable and update-timestamp is True
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   440
  $ hg amend  --date '1998-1-1 0:1' --config rewrite.update-timestamp=True
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   441
  $ hg log --limit 1
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   442
  changeset:   3:626aee031885
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   443
  tag:         tip
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   444
  parent:      -1:000000000000
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   445
  user:        foobar
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   446
  date:        Thu Jan 01 00:01:00 1998 +0000
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   447
  summary:     commit 1
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   448
  
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   449
#else
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   450
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   451
When updatetimestamp is False
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   452
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   453
  $ hg amend --date '1997-1-1 0:1'
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   454
  $ hg log --limit 1
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   455
  changeset:   0:036a159be19d
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   456
  tag:         tip
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   457
  user:        test
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   458
  date:        Wed Jan 01 00:01:00 1997 +0000
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   459
  summary:     commit 1
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   460
  
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   461
 When update-timestamp is True and no other change than the date
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   462
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   463
  $ hg amend --config rewrite.update-timestamp=True
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   464
  nothing changed
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   465
  [1]
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   466
  $ hg log --limit 1
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   467
  changeset:   0:036a159be19d
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   468
  tag:         tip
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   469
  user:        test
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   470
  date:        Wed Jan 01 00:01:00 1997 +0000
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   471
  summary:     commit 1
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   472
  
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   473
When update-timestamp is True and there is other change than the date
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   474
  $ hg amend --user foobar --config rewrite.update-timestamp=True
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   475
  $ hg log --limit 1
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   476
  changeset:   0:3ba48b892280
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   477
  tag:         tip
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   478
  user:        foobar
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   479
  date:        Thu Jan 01 00:00:02 1970 +0000
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   480
  summary:     commit 1
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   481
  
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   482
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   483
When date option is applicable and update-timestamp is True
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   484
  $ hg amend  --date '1998-1-1 0:1' --config rewrite.update-timestamp=True
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   485
  $ hg log --limit 1
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   486
  changeset:   0:626aee031885
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   487
  tag:         tip
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   488
  user:        foobar
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   489
  date:        Thu Jan 01 00:01:00 1998 +0000
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   490
  summary:     commit 1
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   491
  
79f8f032c706 amend: add config option to update time to current in hg amend (issue5828)
Taapas Agrawal <taapas2897@gmail.com>
parents: 39723
diff changeset
   492
#endif