tests/test-amend-patch.t
author Anton Shestakov <av6@dwimlabs.net>
Tue, 10 Mar 2020 17:18:09 +0700
changeset 5330 0bc31f853862
parent 5323 417503ef667d
child 5349 e8660b28bfee
permissions -rw-r--r--
templatekw: add obsorigin keyword
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3660
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     1
** Test for the `--patch` flag for `hg amend` command **
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     2
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     3
Setup
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     4
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     5
  $ cat >> $HGRCPATH << EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     6
  > [alias]
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     7
  > glog = log -GT "{rev}:{node|short} {desc}\n ({bookmarks}) {phase}"
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     8
  > [diff]
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     9
  > git = 1
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    10
  > [extensions]
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    11
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    12
  $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    13
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    14
Reposetup
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    15
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    16
  $ hg init repo
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    17
  $ cd repo
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    18
  $ echo foo > a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    19
  $ hg ci -Aqm "added a"
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    20
  $ hg exp
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    21
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    22
  # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    23
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    24
  #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    25
  # Node ID f7ad4196431346de3c33c52e75374fba45e04313
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    26
  # Parent  0000000000000000000000000000000000000000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    27
  added a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    28
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    29
  diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    30
  new file mode 100644
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    31
  --- /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    32
  +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    33
  @@ -0,0 +1,1 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    34
  +foo
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    35
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    36
Testing of just changing the diff, not the patch metadata
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    37
==========================================================
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    38
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    39
Testing the normal case
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    40
-----------------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    41
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    42
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    43
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    44
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    45
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    46
  > # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    47
  > # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    48
  > #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    49
  > # Node ID f7ad4196431346de3c33c52e75374fba45e04313
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    50
  > # Parent  0000000000000000000000000000000000000000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    51
  > added a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    52
  > diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    53
  > new file mode 100644
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    54
  > --- /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    55
  > +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    56
  > @@ -0,0 +1,1 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    57
  > +Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    58
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    59
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    60
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    61
  $ HGEDITOR="sh ./editor.sh" hg amend --patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    62
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    63
Making sure the amended commit is correct
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    64
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    65
  $ hg exp
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    66
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    67
  # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    68
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    69
  #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    70
  # Node ID af624b221c0c0bec5d74e2650180dd3eddcb7c42
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    71
  # Parent  0000000000000000000000000000000000000000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    72
  added a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    73
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    74
  diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    75
  new file mode 100644
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    76
  --- /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    77
  +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    78
  @@ -0,0 +1,1 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    79
  +Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    80
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    81
  $ hg glog
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    82
  @  1:af624b221c0c added a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    83
      () draft
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    84
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    85
Obsolsence history is fine
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    86
5323
417503ef667d tests: add debugobsolete calls before many obslog calls
Martin von Zweigbergk <martinvonz@google.com>
parents: 5317
diff changeset
    87
  $ hg debugobsolete
417503ef667d tests: add debugobsolete calls before many obslog calls
Martin von Zweigbergk <martinvonz@google.com>
parents: 5317
diff changeset
    88
  f7ad4196431346de3c33c52e75374fba45e04313 af624b221c0c0bec5d74e2650180dd3eddcb7c42 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
3660
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    89
  $ hg obslog -p -r .
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    90
  @  af624b221c0c (1) added a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    91
  |
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    92
  x  f7ad41964313 (0) added a
5123
900668a93629 obslog: use _successorsetverb() in regular obslog too
Anton Shestakov <av6@dwimlabs.net>
parents: 3877
diff changeset
    93
       amended(content) as af624b221c0c using amend by test (Thu Jan 01 00:00:00 1970 +0000)
3660
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    94
         diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    95
         --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    96
         +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    97
         @@ -1,1 +1,1 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    98
         -foo
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    99
         +Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   100
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   101
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   102
Diff and status are good too
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   103
  $ hg diff
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   104
  $ hg status
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   105
  ? editor.sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   106
  $ cat a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   107
  Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   108
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   109
Dirstate parents should be correctly set
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   110
  $ hg parents
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   111
  changeset:   1:af624b221c0c
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   112
  tag:         tip
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   113
  parent:      -1:000000000000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   114
  user:        test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   115
  date:        Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   116
  summary:     added a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   117
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   118
Trying to amend with a wrong patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   119
----------------------------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   120
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   121
Having context which was is not present
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   122
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   123
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   124
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   125
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   126
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   127
  > # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   128
  > # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   129
  > #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   130
  > # Node ID c6ba250efbf73e671f2ca24b79db2c178ccbfff9
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   131
  > # Parent  0000000000000000000000000000000000000000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   132
  > added a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   133
  > diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   134
  > new file mode 100644
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   135
  > --- /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   136
  > +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   137
  > @@ -0,0 +1,1 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   138
  > I was not there before!
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   139
  > +Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   140
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   141
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   142
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   143
  $ HGEDITOR="sh ./editor.sh" hg amend --patch
3661
61fdd25542a6 patch: offer the user a chance to fix the patch if it fails to apply
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3660
diff changeset
   144
  failed to apply edited patch: bad hunk #1 @@ -0,0 +1,1 @@
3660
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   145
   (1 0 1 1)
3661
61fdd25542a6 patch: offer the user a chance to fix the patch if it fails to apply
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3660
diff changeset
   146
  try to fix the patch (yn)? y
61fdd25542a6 patch: offer the user a chance to fix the patch if it fails to apply
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3660
diff changeset
   147
  abort: patch unchanged
3660
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   148
  [255]
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   149
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   150
Having deletions which dont exists
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   151
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   152
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   153
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   154
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   155
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   156
  > # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   157
  > # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   158
  > #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   159
  > # Node ID af624b221c0c0bec5d74e2650180dd3eddcb7c42
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   160
  > # Parent  0000000000000000000000000000000000000000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   161
  > added a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   162
  > diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   163
  > new file mode 100644
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   164
  > --- /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   165
  > +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   166
  > @@ -0,0 +1,1 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   167
  > -I was not deleted before!
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   168
  > +Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   169
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   170
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   171
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   172
  $ HGEDITOR="sh ./editor.sh" hg amend --patch
3661
61fdd25542a6 patch: offer the user a chance to fix the patch if it fails to apply
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3660
diff changeset
   173
  failed to apply edited patch: bad hunk #1 @@ -0,0 +1,1 @@
3660
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   174
   (1 0 1 1)
3661
61fdd25542a6 patch: offer the user a chance to fix the patch if it fails to apply
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3660
diff changeset
   175
  try to fix the patch (yn)? y
61fdd25542a6 patch: offer the user a chance to fix the patch if it fails to apply
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3660
diff changeset
   176
  abort: patch unchanged
3660
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   177
  [255]
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   178
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   179
Changing the file mode using amend --patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   180
------------------------------------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   181
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   182
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   183
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   184
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   185
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   186
  > # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   187
  > # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   188
  > #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   189
  > # Node ID af624b221c0c0bec5d74e2650180dd3eddcb7c42
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   190
  > # Parent  0000000000000000000000000000000000000000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   191
  > added a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   192
  > diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   193
  > new file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   194
  > --- /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   195
  > +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   196
  > @@ -0,0 +1,1 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   197
  > +Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   198
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   199
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   200
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   201
  $ HGEDITOR="sh ./editor.sh" hg amend --patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   202
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   203
  $ hg exp --git
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   204
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   205
  # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   206
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   207
  #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   208
  # Node ID 3a99e4b7ac73da799e20ae56914e3dd5b1a22d4d
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   209
  # Parent  0000000000000000000000000000000000000000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   210
  added a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   211
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   212
  diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   213
  new file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   214
  --- /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   215
  +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   216
  @@ -0,0 +1,1 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   217
  +Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   218
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   219
Changing the file using amend --patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   220
-------------------------------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   221
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   222
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   223
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   224
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   225
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   226
  > # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   227
  > # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   228
  > #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   229
  > # Node ID 3a99e4b7ac73da799e20ae56914e3dd5b1a22d4d
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   230
  > # Parent  0000000000000000000000000000000000000000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   231
  > added a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   232
  > diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   233
  > new file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   234
  > --- /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   235
  > +++ b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   236
  > @@ -0,0 +1,1 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   237
  > +Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   238
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   239
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   240
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   241
  $ HGEDITOR="sh ./editor.sh" hg amend --patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   242
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   243
  $ hg exp
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   244
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   245
  # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   246
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   247
  #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   248
  # Node ID fc57c20be380f2878f4db139dad66d6cfb42ec62
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   249
  # Parent  0000000000000000000000000000000000000000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   250
  added a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   251
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   252
  diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   253
  new file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   254
  --- /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   255
  +++ b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   256
  @@ -0,0 +1,1 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   257
  +Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   258
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   259
  $ hg status
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   260
  ? editor.sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   261
5317
baa0b481eec5 tests: deal with "ls" vs "ls -A" difference on 2BSD derived systems
Joerg Sonnenberger <joerg@bec.de>
parents: 5123
diff changeset
   262
  $ ls -A
baa0b481eec5 tests: deal with "ls" vs "ls -A" difference on 2BSD derived systems
Joerg Sonnenberger <joerg@bec.de>
parents: 5123
diff changeset
   263
  .hg
3660
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   264
  changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   265
  editor.sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   266
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   267
Handling both deletions and additions
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   268
-------------------------------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   269
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   270
  $ echo foobar > changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   271
  $ hg ci -m "foobar to changedfile"
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   272
  $ hg exp
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   273
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   274
  # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   275
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   276
  #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   277
  # Node ID 7969f70ffb81c3a6eee2d4f2f7032b694ce05349
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   278
  # Parent  fc57c20be380f2878f4db139dad66d6cfb42ec62
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   279
  foobar to changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   280
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   281
  diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   282
  --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   283
  +++ b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   284
  @@ -1,1 +1,1 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   285
  -Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   286
  +foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   287
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   288
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   289
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   290
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   291
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   292
  > # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   293
  > # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   294
  > #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   295
  > # Node ID 7969f70ffb81c3a6eee2d4f2f7032b694ce05349
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   296
  > # Parent  fc57c20be380f2878f4db139dad66d6cfb42ec62
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   297
  > foobar to changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   298
  > diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   299
  > --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   300
  > +++ b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   301
  > @@ -1,1 +1,1 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   302
  > -Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   303
  > +foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   304
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   305
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   306
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   307
  $ HGEDITOR="sh ./editor.sh" hg amend --patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   308
  abort: nothing changed
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   309
  [255]
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   310
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   311
Cannot change lines which are deleted
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   312
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   313
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   314
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   315
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   316
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   317
  > # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   318
  > # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   319
  > #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   320
  > # Node ID 7969f70ffb81c3a6eee2d4f2f7032b694ce05349
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   321
  > # Parent  fc57c20be380f2878f4db139dad66d6cfb42ec62
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   322
  > foobar to changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   323
  > diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   324
  > --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   325
  > +++ b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   326
  > @@ -1,1 +1,1 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   327
  > -Hello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   328
  > +foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   329
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   330
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   331
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   332
  $ HGEDITOR="sh ./editor.sh" hg amend --patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   333
  patching file changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   334
  Hunk #1 FAILED at 0
3661
61fdd25542a6 patch: offer the user a chance to fix the patch if it fails to apply
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3660
diff changeset
   335
  failed to apply edited patch: patch failed to apply
61fdd25542a6 patch: offer the user a chance to fix the patch if it fails to apply
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3660
diff changeset
   336
  try to fix the patch (yn)? y
61fdd25542a6 patch: offer the user a chance to fix the patch if it fails to apply
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3660
diff changeset
   337
  abort: patch unchanged
3660
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   338
  [255]
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   339
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   340
Add more addition to the patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   341
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   342
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   343
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   344
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   345
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   346
  > # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   347
  > # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   348
  > #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   349
  > # Node ID 7969f70ffb81c3a6eee2d4f2f7032b694ce05349
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   350
  > # Parent  fc57c20be380f2878f4db139dad66d6cfb42ec62
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   351
  > foobar to changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   352
  > diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   353
  > --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   354
  > +++ b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   355
  > @@ -1,1 +1,2 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   356
  > -Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   357
  > +foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   358
  > +babar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   359
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   360
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   361
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   362
  $ HGEDITOR="sh ./editor.sh" hg amend --patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   363
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   364
  $ hg exp
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   365
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   366
  # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   367
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   368
  #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   369
  # Node ID 5d54400acb70b88f07128a1df497ed794b0b177b
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   370
  # Parent  fc57c20be380f2878f4db139dad66d6cfb42ec62
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   371
  foobar to changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   372
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   373
  diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   374
  --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   375
  +++ b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   376
  @@ -1,1 +1,2 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   377
  -Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   378
  +foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   379
  +babar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   380
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   381
  $ cat changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   382
  foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   383
  babar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   384
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   385
Introduce files which were not there
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   386
------------------------------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   387
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   388
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   389
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   390
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   391
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   392
  > # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   393
  > # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   394
  > #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   395
  > # Node ID 5d54400acb70b88f07128a1df497ed794b0b177b
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   396
  > # Parent  fc57c20be380f2878f4db139dad66d6cfb42ec62
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   397
  > foobar to changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   398
  > diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   399
  > --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   400
  > +++ b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   401
  > @@ -1,1 +1,2 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   402
  > -Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   403
  > +foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   404
  > +babar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   405
  > diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   406
  > new file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   407
  > --- /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   408
  > +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   409
  > @@ -0,0 +1,1 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   410
  > +Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   411
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   412
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   413
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   414
  $ HGEDITOR="sh ./editor.sh" hg amend --patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   415
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   416
  $ hg exp
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   417
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   418
  # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   419
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   420
  #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   421
  # Node ID c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   422
  # Parent  fc57c20be380f2878f4db139dad66d6cfb42ec62
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   423
  foobar to changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   424
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   425
  diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   426
  new file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   427
  --- /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   428
  +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   429
  @@ -0,0 +1,1 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   430
  +Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   431
  diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   432
  --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   433
  +++ b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   434
  @@ -1,1 +1,2 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   435
  -Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   436
  +foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   437
  +babar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   438
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   439
Delete files which were not deleted in the first place
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   440
------------------------------------------------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   441
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   442
  $ echo Hello >> a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   443
  $ hg ci -m "hello to a"
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   444
  $ hg glog
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   445
  @  7:3d62c45a1699 hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   446
  |   () draft
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   447
  o  6:c3e29c061982 foobar to changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   448
  |   () draft
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   449
  o  3:fc57c20be380 added a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   450
      () draft
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   451
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   452
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   453
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   454
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   455
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   456
  > # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   457
  > # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   458
  > #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   459
  > # Node ID 3d62c45a1699b11c7ecae573f013601712f2cc5f
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   460
  > # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   461
  > hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   462
  > diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   463
  > --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   464
  > +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   465
  > @@ -1,1 +1,2 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   466
  >  Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   467
  > +Hello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   468
  > diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   469
  > deleted file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   470
  > --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   471
  > +++ /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   472
  > @@ -1,2 +0,0 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   473
  > -foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   474
  > -babar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   475
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   476
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   477
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   478
  $ HGEDITOR="sh ./editor.sh" hg amend --patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   479
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   480
  $ hg exp
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   481
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   482
  # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   483
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   484
  #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   485
  # Node ID c9875799c53fb862c0dbaf01500459c9397373a4
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   486
  # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   487
  hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   488
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   489
  diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   490
  --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   491
  +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   492
  @@ -1,1 +1,2 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   493
   Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   494
  +Hello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   495
  diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   496
  deleted file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   497
  --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   498
  +++ /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   499
  @@ -1,2 +0,0 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   500
  -foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   501
  -babar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   502
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   503
  $ hg status
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   504
  ? editor.sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   505
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   506
  $ cat changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   507
  cat: changedfile: No such file or directory
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   508
  [1]
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   509
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   510
Testing sercret phase preservation during `hg amend --patch`
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   511
------------------------------------------------------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   512
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   513
  $ hg phase -r . --secret --force
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   514
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   515
  $ hg phase -r .
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   516
  8: secret
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   517
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   518
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   519
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   520
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   521
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   522
  > # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   523
  > # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   524
  > #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   525
  > # Node ID c9875799c53fb862c0dbaf01500459c9397373a4
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   526
  > # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   527
  > hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   528
  > diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   529
  > --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   530
  > +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   531
  > @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   532
  >  Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   533
  > +Hello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   534
  > +mello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   535
  > diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   536
  > deleted file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   537
  > --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   538
  > +++ /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   539
  > @@ -1,2 +0,0 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   540
  > -foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   541
  > -babar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   542
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   543
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   544
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   545
  $ HGEDITOR="sh ./editor.sh" hg amend --patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   546
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   547
  $ hg exp
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   548
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   549
  # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   550
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   551
  #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   552
  # Node ID 4414485658e719a1f3d5e58bc8b2412385aa1592
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   553
  # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   554
  hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   555
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   556
  diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   557
  --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   558
  +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   559
  @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   560
   Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   561
  +Hello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   562
  +mello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   563
  diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   564
  deleted file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   565
  --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   566
  +++ /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   567
  @@ -1,2 +0,0 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   568
  -foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   569
  -babar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   570
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   571
  $ hg phase -r .
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   572
  9: secret
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   573
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   574
Testing bookmark movement on amend --patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   575
------------------------------------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   576
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   577
  $ hg bookmark foo
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   578
  $ hg glog
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   579
  @  9:4414485658e7 hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   580
  |   (foo) secret
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   581
  o  6:c3e29c061982 foobar to changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   582
  |   () draft
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   583
  o  3:fc57c20be380 added a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   584
      () draft
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   585
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   586
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   587
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   588
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   589
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   590
  > # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   591
  > # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   592
  > #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   593
  > # Node ID 4414485658e719a1f3d5e58bc8b2412385aa1592
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   594
  > # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   595
  > hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   596
  > diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   597
  > --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   598
  > +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   599
  > @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   600
  >  Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   601
  > +Hello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   602
  > +bello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   603
  > diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   604
  > deleted file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   605
  > --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   606
  > +++ /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   607
  > @@ -1,2 +0,0 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   608
  > -foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   609
  > -babar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   610
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   611
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   612
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   613
  $ HGEDITOR="sh ./editor.sh" hg amend --patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   614
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   615
  $ hg exp
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   616
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   617
  # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   618
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   619
  #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   620
  # Node ID 36454bda1fdb8e2e4fe07bb084eef378e29cba74
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   621
  # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   622
  hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   623
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   624
  diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   625
  --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   626
  +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   627
  @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   628
   Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   629
  +Hello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   630
  +bello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   631
  diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   632
  deleted file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   633
  --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   634
  +++ /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   635
  @@ -1,2 +0,0 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   636
  -foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   637
  -babar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   638
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   639
  $ hg glog
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   640
  @  10:36454bda1fdb hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   641
  |   (foo) secret
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   642
  o  6:c3e29c061982 foobar to changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   643
  |   () draft
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   644
  o  3:fc57c20be380 added a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   645
      () draft
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   646
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   647
Trying to amend --patch a public changeset
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   648
------------------------------------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   649
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   650
  $ hg phase -r . --public
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   651
  $ hg glog
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   652
  @  10:36454bda1fdb hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   653
  |   (foo) public
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   654
  o  6:c3e29c061982 foobar to changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   655
  |   () public
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   656
  o  3:fc57c20be380 added a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   657
      () public
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   658
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   659
  $ HGEDITOR=cat hg amend --patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   660
  abort: cannot amend public changesets: 36454bda1fdb
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   661
  (see 'hg help phases' for details)
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   662
  [255]
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   663
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   664
  $ hg phase -r . --draft --force
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   665
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   666
Trying on a dirty working directory
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   667
-------------------------------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   668
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   669
  $ echo bar > bar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   670
  $ hg add bar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   671
  $ HGEDITOR=cat hg amend --patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   672
  abort: uncommitted changes
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   673
  [255]
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   674
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   675
  $ hg revert --all
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   676
  forgetting bar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   677
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   678
Trying to pass filenames, only mentioned file names should be popped up in
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   679
editor and rest should stay in the commit as they were
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   680
--------------------------------------------------------------------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   681
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   682
Checking the we pop-up with the files which were mentioned
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   683
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   684
  $ HGEDITOR=cat hg amend --patch changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   685
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   686
  # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   687
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   688
  #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   689
  # Node ID 36454bda1fdb8e2e4fe07bb084eef378e29cba74
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   690
  # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   691
  hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   692
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   693
  diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   694
  deleted file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   695
  --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   696
  +++ /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   697
  @@ -1,2 +0,0 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   698
  -foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   699
  -babar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   700
  abort: nothing changed
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   701
  [255]
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   702
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   703
  $ HGEDITOR=cat hg amend --patch a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   704
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   705
  # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   706
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   707
  #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   708
  # Node ID 36454bda1fdb8e2e4fe07bb084eef378e29cba74
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   709
  # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   710
  hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   711
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   712
  diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   713
  --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   714
  +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   715
  @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   716
   Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   717
  +Hello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   718
  +bello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   719
  abort: nothing changed
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   720
  [255]
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   721
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   722
  $ HGEDITOR=cat hg amend --patch changedfile a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   723
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   724
  # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   725
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   726
  #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   727
  # Node ID 36454bda1fdb8e2e4fe07bb084eef378e29cba74
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   728
  # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   729
  hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   730
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   731
  diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   732
  --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   733
  +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   734
  @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   735
   Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   736
  +Hello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   737
  +bello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   738
  diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   739
  deleted file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   740
  --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   741
  +++ /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   742
  @@ -1,2 +0,0 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   743
  -foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   744
  -babar
3661
61fdd25542a6 patch: offer the user a chance to fix the patch if it fails to apply
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3660
diff changeset
   745
  abort: patch unchanged
3660
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   746
  [255]
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   747
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   748
  $ HGEDITOR=cat hg amend --patch doesnotexists
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   749
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   750
  # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   751
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   752
  #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   753
  # Node ID 36454bda1fdb8e2e4fe07bb084eef378e29cba74
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   754
  # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   755
  hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   756
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   757
  abort: nothing changed
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   758
  [255]
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   759
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   760
Changing only one file
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   761
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   762
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   763
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   764
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   765
  > # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   766
  > # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   767
  > #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   768
  > # Node ID 36454bda1fdb8e2e4fe07bb084eef378e29cba74
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   769
  > # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   770
  > hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   771
  > diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   772
  > --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   773
  > +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   774
  > @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   775
  >  Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   776
  > +Hello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   777
  > +betto
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   778
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   779
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   780
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   781
  $ HGEDITOR="sh ./editor.sh" hg amend --patch a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   782
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   783
file 'a' should be amended, rest of them should remain unchanged
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   784
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   785
  $ hg exp
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   786
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   787
  # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   788
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   789
  #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   790
  # Node ID ea175dcc4ee38c106db157975e006b4092444c65
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   791
  # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   792
  hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   793
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   794
  diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   795
  --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   796
  +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   797
  @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   798
   Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   799
  +Hello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   800
  +betto
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   801
  diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   802
  deleted file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   803
  --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   804
  +++ /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   805
  @@ -1,2 +0,0 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   806
  -foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   807
  -babar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   808
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   809
  $ hg status
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   810
  ? bar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   811
  ? editor.sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   812
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   813
  $ hg diff
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   814
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   815
Testing again with file 'changedfile'
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   816
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   817
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   818
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   819
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   820
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   821
  > # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   822
  > # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   823
  > #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   824
  > # Node ID ea175dcc4ee38c106db157975e006b4092444c65
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   825
  > # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   826
  > hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   827
  > diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   828
  > --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   829
  > +++ b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   830
  > @@ -1,2 +1,1 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   831
  >  foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   832
  > -babar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   833
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   834
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   835
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   836
  $ HGEDITOR="sh ./editor.sh" hg amend --patch changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   837
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   838
  $ hg exp
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   839
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   840
  # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   841
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   842
  #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   843
  # Node ID 0e64d76c3519308c398a28192cb095d48b29aede
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   844
  # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   845
  hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   846
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   847
  diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   848
  --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   849
  +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   850
  @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   851
   Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   852
  +Hello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   853
  +betto
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   854
  diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   855
  --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   856
  +++ b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   857
  @@ -1,2 +1,1 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   858
   foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   859
  -babar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   860
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   861
  $ hg diff
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   862
  $ hg status
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   863
  ? bar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   864
  ? editor.sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   865
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   866
Dropping a file from commit by removing related hunks
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   867
------------------------------------------------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   868
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   869
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   870
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   871
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   872
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   873
  > # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   874
  > # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   875
  > #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   876
  > # Node ID 0e64d76c3519308c398a28192cb095d48b29aede
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   877
  > # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   878
  > hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   879
  > diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   880
  > --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   881
  > +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   882
  > @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   883
  >  Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   884
  > +Kello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   885
  > +betto
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   886
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   887
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   888
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   889
  $ HGEDITOR="sh ./editor.sh" hg amend --patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   890
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   891
  $ hg exp
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   892
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   893
  # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   894
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   895
  #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   896
  # Node ID 944e9f65fa55fdb2de98577c9d8ab30de0927d8e
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   897
  # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   898
  hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   899
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   900
  diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   901
  --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   902
  +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   903
  @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   904
   Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   905
  +Kello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   906
  +betto
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   907
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   908
The part which was dropped from the patch will not be there in working directory
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   909
too
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   910
  $ hg diff
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   911
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   912
  $ hg status
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   913
  ? bar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   914
  ? editor.sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   915
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   916
Changing metadata of a patch by editing patch content
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   917
======================================================
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   918
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   919
Changing user
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   920
-------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   921
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   922
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   923
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   924
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   925
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   926
  > # User RandomUser
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   927
  > # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   928
  > #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   929
  > # Node ID 944e9f65fa55fdb2de98577c9d8ab30de0927d8e
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   930
  > # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   931
  > hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   932
  > diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   933
  > --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   934
  > +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   935
  > @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   936
  >  Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   937
  > +Kello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   938
  > +betto
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   939
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   940
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   941
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   942
  $ HGEDITOR="sh ./editor.sh" hg amend --patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   943
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   944
  $ hg exp
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   945
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   946
  # User RandomUser
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   947
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   948
  #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   949
  # Node ID 5ded18a8c333a55da4b0e051162457cfe5d85558
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   950
  # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   951
  hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   952
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   953
  diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   954
  --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   955
  +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   956
  @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   957
   Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   958
  +Kello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   959
  +betto
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   960
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   961
Changing Date
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   962
-------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   963
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   964
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   965
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   966
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   967
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   968
  > # User RandomUser
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   969
  > # Date 123456 1200
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   970
  > #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   971
  > # Node ID 944e9f65fa55fdb2de98577c9d8ab30de0927d8e
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   972
  > # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   973
  > hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   974
  > diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   975
  > --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   976
  > +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   977
  > @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   978
  >  Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   979
  > +Kello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   980
  > +betto
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   981
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   982
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   983
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   984
  $ HGEDITOR="sh ./editor.sh" hg amend --patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   985
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   986
  $ hg exp
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   987
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   988
  # User RandomUser
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   989
  # Date 123456 1200
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   990
  #      Fri Jan 02 09:57:36 1970 -0020
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   991
  # Node ID e2312ddcd8756665075a60bd05431ddca3c45050
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   992
  # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   993
  hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   994
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   995
  diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   996
  --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   997
  +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   998
  @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   999
   Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1000
  +Kello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1001
  +betto
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1002
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1003
Changing branch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1004
---------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1005
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1006
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1007
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1008
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1009
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1010
  > # User RandomUser
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1011
  > # Date 123456 1200
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1012
  > #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1013
  > # Branch stable
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1014
  > # Node ID 944e9f65fa55fdb2de98577c9d8ab30de0927d8e
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1015
  > # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1016
  > hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1017
  > diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1018
  > --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1019
  > +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1020
  > @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1021
  >  Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1022
  > +Kello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1023
  > +betto
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1024
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1025
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1026
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1027
  $ HGEDITOR="sh ./editor.sh" hg amend --patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1028
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1029
  $ hg exp
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1030
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1031
  # User RandomUser
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1032
  # Date 123456 1200
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1033
  #      Fri Jan 02 09:57:36 1970 -0020
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1034
  # Branch stable
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1035
  # Node ID ddc61a4058687b2dd4a316f4b5fe7d52a35b702a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1036
  # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1037
  hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1038
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1039
  diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1040
  --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1041
  +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1042
  @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1043
   Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1044
  +Kello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1045
  +betto
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1046
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1047
Changing parent (this should be fun)
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1048
------------------------------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1049
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1050
  $ hg glog
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1051
  @  16:ddc61a405868 hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1052
  |   (foo) draft
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1053
  o  6:c3e29c061982 foobar to changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1054
  |   () public
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1055
  o  3:fc57c20be380 added a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1056
      () public
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1057
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1058
  $ hg log -r .^^ -T '{node}'
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1059
  fc57c20be380f2878f4db139dad66d6cfb42ec62 (no-eol)
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1060
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1061
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1062
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1063
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1064
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1065
  > # User RandomUser
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1066
  > # Date 123456 1200
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1067
  > #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1068
  > # Branch stable
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1069
  > # Node ID 944e9f65fa55fdb2de98577c9d8ab30de0927d8e
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1070
  > # Parent  fc57c20be380f2878f4db139dad66d6cfb42ec62
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1071
  > hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1072
  > diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1073
  > --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1074
  > +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1075
  > @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1076
  >  Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1077
  > +Kello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1078
  > +betto
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1079
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1080
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1081
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1082
  $ HGEDITOR="sh ./editor.sh" hg amend --patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1083
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1084
  $ hg exp
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1085
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1086
  # User RandomUser
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1087
  # Date 123456 1200
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1088
  #      Fri Jan 02 09:57:36 1970 -0020
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1089
  # Branch stable
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1090
  # Node ID b763f7cb2302f2efa1275e2a9202655872c9567f
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1091
  # Parent  fc57c20be380f2878f4db139dad66d6cfb42ec62
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1092
  hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1093
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1094
  diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1095
  new file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1096
  --- /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1097
  +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1098
  @@ -0,0 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1099
  +Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1100
  +Kello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1101
  +betto
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1102
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1103
  $ hg glog
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1104
  @  17:b763f7cb2302 hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1105
  |   (foo) draft
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1106
  | o  6:c3e29c061982 foobar to changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1107
  |/    () public
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1108
  o  3:fc57c20be380 added a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1109
      () public
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1110
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1111
Changing the commit desciption
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1112
-------------------------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1113
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1114
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1115
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1116
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1117
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1118
  > # User RandomUser
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1119
  > # Date 123456 1200
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1120
  > #      Thu Jan 01 00:00:00 1970 +0000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1121
  > # Branch stable
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1122
  > # Node ID 944e9f65fa55fdb2de98577c9d8ab30de0927d8e
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1123
  > # Parent  fc57c20be380f2878f4db139dad66d6cfb42ec62
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1124
  > I am a message which is testing change of message
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1125
  > diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1126
  > new file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1127
  > --- /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1128
  > +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1129
  > @@ -0,0 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1130
  > +Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1131
  > +Kello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1132
  > +betto
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1133
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1134
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1135
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1136
  $ HGEDITOR="sh ./editor.sh" hg amend --patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1137
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1138
  $ hg exp
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1139
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1140
  # User RandomUser
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1141
  # Date 123456 1200
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1142
  #      Fri Jan 02 09:57:36 1970 -0020
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1143
  # Branch stable
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1144
  # Node ID f14ecd7121e63915ac93edbad7f60f605e62dd52
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1145
  # Parent  fc57c20be380f2878f4db139dad66d6cfb42ec62
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1146
  I am a message which is testing change of message
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1147
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1148
  diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1149
  new file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1150
  --- /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1151
  +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1152
  @@ -0,0 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1153
  +Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1154
  +Kello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1155
  +betto
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1156
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1157
Changing the Node ID of the patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1158
---------------------------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1159
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1160
Nothing happens in that case we dont care about the node ID. Look the above 3-4
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1161
tests to realize I was testing that too.
3876
c464abfd7f9d tests: add a test to demonstrate issue5925
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3661
diff changeset
  1162
c464abfd7f9d tests: add a test to demonstrate issue5925
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3661
diff changeset
  1163
Aborting by passing an empty patch file (issue5925)
c464abfd7f9d tests: add a test to demonstrate issue5925
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3661
diff changeset
  1164
---------------------------------------------------
c464abfd7f9d tests: add a test to demonstrate issue5925
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3661
diff changeset
  1165
c464abfd7f9d tests: add a test to demonstrate issue5925
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3661
diff changeset
  1166
  $ cat > editor.sh <<EOF
c464abfd7f9d tests: add a test to demonstrate issue5925
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3661
diff changeset
  1167
  > #!/bin/sh
c464abfd7f9d tests: add a test to demonstrate issue5925
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3661
diff changeset
  1168
  > cat > \$1 <<ENDOF
c464abfd7f9d tests: add a test to demonstrate issue5925
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3661
diff changeset
  1169
  > ENDOF
c464abfd7f9d tests: add a test to demonstrate issue5925
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3661
diff changeset
  1170
  > EOF
c464abfd7f9d tests: add a test to demonstrate issue5925
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3661
diff changeset
  1171
c464abfd7f9d tests: add a test to demonstrate issue5925
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3661
diff changeset
  1172
  $ HGEDITOR="sh ./editor.sh" hg amend --patch
3877
96bbea985b25 amend: allow aborting an `amend --patch` by saving an empty file (issue5925)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3876
diff changeset
  1173
  abort: empty patch file, amend aborted
96bbea985b25 amend: allow aborting an `amend --patch` by saving an empty file (issue5925)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3876
diff changeset
  1174
  [255]
3876
c464abfd7f9d tests: add a test to demonstrate issue5925
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3661
diff changeset
  1175
c464abfd7f9d tests: add a test to demonstrate issue5925
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3661
diff changeset
  1176
  $ hg exp
c464abfd7f9d tests: add a test to demonstrate issue5925
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3661
diff changeset
  1177
  # HG changeset patch
c464abfd7f9d tests: add a test to demonstrate issue5925
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3661
diff changeset
  1178
  # User RandomUser
c464abfd7f9d tests: add a test to demonstrate issue5925
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3661
diff changeset
  1179
  # Date 123456 1200
c464abfd7f9d tests: add a test to demonstrate issue5925
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3661
diff changeset
  1180
  #      Fri Jan 02 09:57:36 1970 -0020
c464abfd7f9d tests: add a test to demonstrate issue5925
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3661
diff changeset
  1181
  # Branch stable
3877
96bbea985b25 amend: allow aborting an `amend --patch` by saving an empty file (issue5925)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3876
diff changeset
  1182
  # Node ID f14ecd7121e63915ac93edbad7f60f605e62dd52
96bbea985b25 amend: allow aborting an `amend --patch` by saving an empty file (issue5925)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3876
diff changeset
  1183
  # Parent  fc57c20be380f2878f4db139dad66d6cfb42ec62
96bbea985b25 amend: allow aborting an `amend --patch` by saving an empty file (issue5925)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3876
diff changeset
  1184
  I am a message which is testing change of message
3876
c464abfd7f9d tests: add a test to demonstrate issue5925
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3661
diff changeset
  1185
  
3877
96bbea985b25 amend: allow aborting an `amend --patch` by saving an empty file (issue5925)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3876
diff changeset
  1186
  diff --git a/a b/a
96bbea985b25 amend: allow aborting an `amend --patch` by saving an empty file (issue5925)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3876
diff changeset
  1187
  new file mode 100755
96bbea985b25 amend: allow aborting an `amend --patch` by saving an empty file (issue5925)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3876
diff changeset
  1188
  --- /dev/null
96bbea985b25 amend: allow aborting an `amend --patch` by saving an empty file (issue5925)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3876
diff changeset
  1189
  +++ b/a
96bbea985b25 amend: allow aborting an `amend --patch` by saving an empty file (issue5925)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3876
diff changeset
  1190
  @@ -0,0 +1,3 @@
96bbea985b25 amend: allow aborting an `amend --patch` by saving an empty file (issue5925)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3876
diff changeset
  1191
  +Gello
96bbea985b25 amend: allow aborting an `amend --patch` by saving an empty file (issue5925)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3876
diff changeset
  1192
  +Kello
96bbea985b25 amend: allow aborting an `amend --patch` by saving an empty file (issue5925)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3876
diff changeset
  1193
  +betto
3876
c464abfd7f9d tests: add a test to demonstrate issue5925
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3661
diff changeset
  1194
c464abfd7f9d tests: add a test to demonstrate issue5925
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3661
diff changeset
  1195
  $ hg parents
3877
96bbea985b25 amend: allow aborting an `amend --patch` by saving an empty file (issue5925)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3876
diff changeset
  1196
  changeset:   18:f14ecd7121e6
3876
c464abfd7f9d tests: add a test to demonstrate issue5925
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3661
diff changeset
  1197
  branch:      stable
c464abfd7f9d tests: add a test to demonstrate issue5925
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3661
diff changeset
  1198
  bookmark:    foo
c464abfd7f9d tests: add a test to demonstrate issue5925
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3661
diff changeset
  1199
  tag:         tip
3877
96bbea985b25 amend: allow aborting an `amend --patch` by saving an empty file (issue5925)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3876
diff changeset
  1200
  parent:      3:fc57c20be380
3876
c464abfd7f9d tests: add a test to demonstrate issue5925
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3661
diff changeset
  1201
  user:        RandomUser
c464abfd7f9d tests: add a test to demonstrate issue5925
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3661
diff changeset
  1202
  date:        Fri Jan 02 09:57:36 1970 -0020
3877
96bbea985b25 amend: allow aborting an `amend --patch` by saving an empty file (issue5925)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3876
diff changeset
  1203
  summary:     I am a message which is testing change of message
3876
c464abfd7f9d tests: add a test to demonstrate issue5925
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3661
diff changeset
  1204