tests/test-amend-patch.t
author Pulkit Goyal <7895pulkit@gmail.com>
Sun, 18 Mar 2018 23:48:06 +0530
changeset 3660 f018656ca3bf
child 3661 61fdd25542a6
permissions -rw-r--r--
amend: add a new flag `--patch` to `hg amend` This patch adds a new flag `--patch` to `hg amend` which pops up an editor with the patch of working directory parent which you can change, and when you exit the editor the patch with changes is applied to current working directory with old changeset being obsoleted in favour of new one created by the applied patch. If supplied filenames, only those filenames are present in the popped editor and rest files stay the same way in the commit as they were. The extension of the file which opens up in editor is '.diff', we cannot have it as '.patch' as there will be develwarns related to that. We need to change to patch core and undo some change to achieve this. The implementation does not use any core API rather it has picked chunks from API which are required. One main reason to not use core import API is that we have to change wdir parent before using patch.patch() which I will like to avoid to make sure we handle merge cases too. While writing this patch I have spend lot of time try to use internal API's to work for this but none of them served the purpose well. If I have time in future and work on similar problem again, I am going to write better high-level API's which uses patchstore to achieve this. A new test file test-amend-patch.t which contains a lot of testing of the feature.
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
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    87
  $ hg obslog -p -r .
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    88
  @  af624b221c0c (1) added a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    89
  |
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    90
  x  f7ad41964313 (0) added a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    91
       rewritten(content) as af624b221c0c using amend by test (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
    92
         diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    93
         --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    94
         +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    95
         @@ -1,1 +1,1 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    96
         -foo
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    97
         +Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    98
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    99
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   100
Diff and status are good too
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   101
  $ hg diff
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   102
  $ hg status
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   103
  ? editor.sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   104
  $ cat a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   105
  Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   106
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   107
Dirstate parents should be correctly set
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   108
  $ hg parents
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   109
  changeset:   1:af624b221c0c
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   110
  tag:         tip
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   111
  parent:      -1:000000000000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   112
  user:        test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   113
  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
   114
  summary:     added a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   115
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   116
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
   117
----------------------------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   118
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   119
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
   120
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   121
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   122
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   123
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   124
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   125
  > # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   126
  > # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   127
  > #      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
   128
  > # Node ID c6ba250efbf73e671f2ca24b79db2c178ccbfff9
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   129
  > # Parent  0000000000000000000000000000000000000000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   130
  > added a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   131
  > diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   132
  > new file mode 100644
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   133
  > --- /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   134
  > +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   135
  > @@ -0,0 +1,1 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   136
  > I was not there before!
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   137
  > +Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   138
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   139
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   140
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   141
  $ 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
   142
  abort: bad hunk #1 @@ -0,0 +1,1 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   143
   (1 0 1 1)
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   144
  [255]
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   145
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   146
Having deletions which dont exists
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   147
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   148
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   149
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   150
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   151
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   152
  > # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   153
  > # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   154
  > #      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
   155
  > # Node ID af624b221c0c0bec5d74e2650180dd3eddcb7c42
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   156
  > # Parent  0000000000000000000000000000000000000000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   157
  > added a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   158
  > diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   159
  > new file mode 100644
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   160
  > --- /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   161
  > +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   162
  > @@ -0,0 +1,1 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   163
  > -I was not deleted before!
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   164
  > +Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   165
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   166
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   167
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   168
  $ 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
   169
  abort: bad hunk #1 @@ -0,0 +1,1 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   170
   (1 0 1 1)
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   171
  [255]
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   172
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   173
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
   174
------------------------------------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   175
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   176
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   177
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   178
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   179
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   180
  > # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   181
  > # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   182
  > #      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
   183
  > # Node ID af624b221c0c0bec5d74e2650180dd3eddcb7c42
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   184
  > # Parent  0000000000000000000000000000000000000000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   185
  > added a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   186
  > diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   187
  > new file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   188
  > --- /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   189
  > +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   190
  > @@ -0,0 +1,1 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   191
  > +Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   192
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   193
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   194
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   195
  $ 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
   196
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   197
  $ hg exp --git
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   198
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   199
  # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   200
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   201
  #      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
   202
  # Node ID 3a99e4b7ac73da799e20ae56914e3dd5b1a22d4d
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   203
  # Parent  0000000000000000000000000000000000000000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   204
  added a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   205
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   206
  diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   207
  new file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   208
  --- /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   209
  +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   210
  @@ -0,0 +1,1 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   211
  +Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   212
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   213
Changing the file using amend --patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   214
-------------------------------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   215
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   216
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   217
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   218
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   219
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   220
  > # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   221
  > # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   222
  > #      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
   223
  > # Node ID 3a99e4b7ac73da799e20ae56914e3dd5b1a22d4d
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   224
  > # Parent  0000000000000000000000000000000000000000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   225
  > added a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   226
  > diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   227
  > new file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   228
  > --- /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   229
  > +++ b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   230
  > @@ -0,0 +1,1 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   231
  > +Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   232
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   233
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   234
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   235
  $ 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
   236
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   237
  $ hg exp
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   238
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   239
  # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   240
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   241
  #      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
   242
  # Node ID fc57c20be380f2878f4db139dad66d6cfb42ec62
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   243
  # Parent  0000000000000000000000000000000000000000
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   244
  added a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   245
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   246
  diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   247
  new file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   248
  --- /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   249
  +++ b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   250
  @@ -0,0 +1,1 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   251
  +Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   252
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   253
  $ hg status
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   254
  ? editor.sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   255
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   256
  $ ls
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   257
  changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   258
  editor.sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   259
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   260
Handling both deletions and additions
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   261
-------------------------------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   262
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   263
  $ echo foobar > changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   264
  $ hg ci -m "foobar to changedfile"
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   265
  $ hg exp
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   266
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   267
  # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   268
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   269
  #      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
   270
  # Node ID 7969f70ffb81c3a6eee2d4f2f7032b694ce05349
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   271
  # Parent  fc57c20be380f2878f4db139dad66d6cfb42ec62
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   272
  foobar to changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   273
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   274
  diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   275
  --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   276
  +++ b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   277
  @@ -1,1 +1,1 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   278
  -Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   279
  +foobar
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
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   282
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   283
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   284
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   285
  > # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   286
  > # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   287
  > #      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
   288
  > # Node ID 7969f70ffb81c3a6eee2d4f2f7032b694ce05349
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   289
  > # Parent  fc57c20be380f2878f4db139dad66d6cfb42ec62
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   290
  > foobar to changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   291
  > diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   292
  > --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   293
  > +++ b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   294
  > @@ -1,1 +1,1 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   295
  > -Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   296
  > +foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   297
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   298
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   299
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   300
  $ 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
   301
  abort: nothing changed
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   302
  [255]
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   303
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   304
Cannot change lines which are deleted
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   305
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   306
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   307
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   308
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   309
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   310
  > # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   311
  > # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   312
  > #      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
   313
  > # Node ID 7969f70ffb81c3a6eee2d4f2f7032b694ce05349
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   314
  > # Parent  fc57c20be380f2878f4db139dad66d6cfb42ec62
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   315
  > foobar to changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   316
  > diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   317
  > --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   318
  > +++ b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   319
  > @@ -1,1 +1,1 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   320
  > -Hello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   321
  > +foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   322
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   323
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   324
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   325
  $ 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
   326
  patching file changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   327
  Hunk #1 FAILED at 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   328
  abort: patch failed to apply
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   329
  [255]
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   330
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   331
Add more addition to the patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   332
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   333
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   334
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   335
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   336
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   337
  > # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   338
  > # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   339
  > #      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
   340
  > # Node ID 7969f70ffb81c3a6eee2d4f2f7032b694ce05349
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   341
  > # Parent  fc57c20be380f2878f4db139dad66d6cfb42ec62
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   342
  > foobar to changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   343
  > diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   344
  > --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   345
  > +++ b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   346
  > @@ -1,1 +1,2 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   347
  > -Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   348
  > +foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   349
  > +babar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   350
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   351
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   352
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   353
  $ 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
   354
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   355
  $ hg exp
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   356
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   357
  # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   358
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   359
  #      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
   360
  # Node ID 5d54400acb70b88f07128a1df497ed794b0b177b
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   361
  # Parent  fc57c20be380f2878f4db139dad66d6cfb42ec62
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   362
  foobar to changedfile
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
  diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   365
  --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   366
  +++ b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   367
  @@ -1,1 +1,2 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   368
  -Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   369
  +foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   370
  +babar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   371
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   372
  $ cat changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   373
  foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   374
  babar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   375
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   376
Introduce files which were not there
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   377
------------------------------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   378
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   379
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   380
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   381
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   382
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   383
  > # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   384
  > # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   385
  > #      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
   386
  > # Node ID 5d54400acb70b88f07128a1df497ed794b0b177b
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   387
  > # Parent  fc57c20be380f2878f4db139dad66d6cfb42ec62
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   388
  > foobar to changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   389
  > diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   390
  > --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   391
  > +++ b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   392
  > @@ -1,1 +1,2 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   393
  > -Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   394
  > +foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   395
  > +babar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   396
  > diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   397
  > new file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   398
  > --- /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   399
  > +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   400
  > @@ -0,0 +1,1 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   401
  > +Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   402
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   403
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   404
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   405
  $ 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
   406
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   407
  $ hg exp
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   408
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   409
  # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   410
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   411
  #      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
   412
  # Node ID c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   413
  # Parent  fc57c20be380f2878f4db139dad66d6cfb42ec62
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   414
  foobar to changedfile
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
  diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   417
  new file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   418
  --- /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   419
  +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   420
  @@ -0,0 +1,1 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   421
  +Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   422
  diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   423
  --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   424
  +++ b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   425
  @@ -1,1 +1,2 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   426
  -Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   427
  +foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   428
  +babar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   429
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   430
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
   431
------------------------------------------------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   432
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   433
  $ echo Hello >> a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   434
  $ hg ci -m "hello to a"
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   435
  $ hg glog
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   436
  @  7:3d62c45a1699 hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   437
  |   () draft
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   438
  o  6:c3e29c061982 foobar to changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   439
  |   () draft
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   440
  o  3:fc57c20be380 added a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   441
      () draft
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   442
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   443
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   444
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   445
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   446
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   447
  > # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   448
  > # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   449
  > #      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
   450
  > # Node ID 3d62c45a1699b11c7ecae573f013601712f2cc5f
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   451
  > # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   452
  > hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   453
  > diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   454
  > --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   455
  > +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   456
  > @@ -1,1 +1,2 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   457
  >  Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   458
  > +Hello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   459
  > diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   460
  > deleted file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   461
  > --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   462
  > +++ /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   463
  > @@ -1,2 +0,0 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   464
  > -foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   465
  > -babar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   466
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   467
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   468
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   469
  $ 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
   470
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   471
  $ hg exp
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   472
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   473
  # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   474
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   475
  #      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
   476
  # Node ID c9875799c53fb862c0dbaf01500459c9397373a4
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   477
  # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   478
  hello to a
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
  diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   481
  --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   482
  +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   483
  @@ -1,1 +1,2 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   484
   Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   485
  +Hello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   486
  diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   487
  deleted file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   488
  --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   489
  +++ /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   490
  @@ -1,2 +0,0 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   491
  -foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   492
  -babar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   493
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   494
  $ hg status
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   495
  ? editor.sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   496
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   497
  $ cat changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   498
  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
   499
  [1]
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   500
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   501
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
   502
------------------------------------------------------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   503
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   504
  $ hg phase -r . --secret --force
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
  $ hg phase -r .
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   507
  8: secret
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   508
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   509
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   510
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   511
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   512
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   513
  > # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   514
  > # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   515
  > #      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
   516
  > # Node ID c9875799c53fb862c0dbaf01500459c9397373a4
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   517
  > # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   518
  > hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   519
  > diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   520
  > --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   521
  > +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   522
  > @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   523
  >  Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   524
  > +Hello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   525
  > +mello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   526
  > diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   527
  > deleted file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   528
  > --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   529
  > +++ /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   530
  > @@ -1,2 +0,0 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   531
  > -foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   532
  > -babar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   533
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   534
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   535
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   536
  $ 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
   537
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   538
  $ hg exp
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   539
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   540
  # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   541
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   542
  #      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
   543
  # Node ID 4414485658e719a1f3d5e58bc8b2412385aa1592
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   544
  # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   545
  hello to a
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
  diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   548
  --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   549
  +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   550
  @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   551
   Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   552
  +Hello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   553
  +mello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   554
  diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   555
  deleted file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   556
  --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   557
  +++ /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   558
  @@ -1,2 +0,0 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   559
  -foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   560
  -babar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   561
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   562
  $ hg phase -r .
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   563
  9: secret
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   564
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   565
Testing bookmark movement on amend --patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   566
------------------------------------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   567
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   568
  $ hg bookmark foo
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   569
  $ hg glog
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   570
  @  9:4414485658e7 hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   571
  |   (foo) secret
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   572
  o  6:c3e29c061982 foobar to changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   573
  |   () draft
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   574
  o  3:fc57c20be380 added a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   575
      () draft
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
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   578
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   579
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   580
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   581
  > # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   582
  > # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   583
  > #      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
   584
  > # Node ID 4414485658e719a1f3d5e58bc8b2412385aa1592
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   585
  > # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   586
  > hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   587
  > diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   588
  > --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   589
  > +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   590
  > @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   591
  >  Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   592
  > +Hello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   593
  > +bello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   594
  > diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   595
  > deleted file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   596
  > --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   597
  > +++ /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   598
  > @@ -1,2 +0,0 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   599
  > -foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   600
  > -babar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   601
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   602
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   603
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   604
  $ 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
   605
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   606
  $ hg exp
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   607
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   608
  # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   609
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   610
  #      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
   611
  # Node ID 36454bda1fdb8e2e4fe07bb084eef378e29cba74
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   612
  # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   613
  hello to a
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
  diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   616
  --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   617
  +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   618
  @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   619
   Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   620
  +Hello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   621
  +bello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   622
  diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   623
  deleted file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   624
  --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   625
  +++ /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   626
  @@ -1,2 +0,0 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   627
  -foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   628
  -babar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   629
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   630
  $ hg glog
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   631
  @  10:36454bda1fdb hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   632
  |   (foo) secret
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   633
  o  6:c3e29c061982 foobar to changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   634
  |   () draft
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   635
  o  3:fc57c20be380 added a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   636
      () draft
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   637
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   638
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
   639
------------------------------------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   640
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   641
  $ hg phase -r . --public
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   642
  $ hg glog
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   643
  @  10:36454bda1fdb hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   644
  |   (foo) public
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   645
  o  6:c3e29c061982 foobar to changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   646
  |   () public
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   647
  o  3:fc57c20be380 added a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   648
      () public
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
  $ HGEDITOR=cat hg amend --patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   651
  abort: cannot amend public changesets: 36454bda1fdb
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   652
  (see 'hg help phases' for details)
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   653
  [255]
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   654
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   655
  $ hg phase -r . --draft --force
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   656
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   657
Trying on a dirty working directory
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
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   660
  $ echo bar > bar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   661
  $ hg add bar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   662
  $ HGEDITOR=cat hg amend --patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   663
  abort: uncommitted changes
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   664
  [255]
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
  $ hg revert --all
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   667
  forgetting bar
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
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
   670
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
   671
--------------------------------------------------------------------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   672
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   673
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
   674
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   675
  $ HGEDITOR=cat hg amend --patch changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   676
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   677
  # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   678
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   679
  #      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
   680
  # Node ID 36454bda1fdb8e2e4fe07bb084eef378e29cba74
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   681
  # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   682
  hello to a
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
  diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   685
  deleted file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   686
  --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   687
  +++ /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   688
  @@ -1,2 +0,0 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   689
  -foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   690
  -babar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   691
  abort: nothing changed
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   692
  [255]
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   693
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   694
  $ HGEDITOR=cat hg amend --patch a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   695
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   696
  # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   697
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   698
  #      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
   699
  # Node ID 36454bda1fdb8e2e4fe07bb084eef378e29cba74
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   700
  # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   701
  hello to a
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
  diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   704
  --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   705
  +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   706
  @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   707
   Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   708
  +Hello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   709
  +bello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   710
  abort: nothing changed
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   711
  [255]
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   712
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   713
  $ 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
   714
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   715
  # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   716
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   717
  #      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
   718
  # Node ID 36454bda1fdb8e2e4fe07bb084eef378e29cba74
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   719
  # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   720
  hello to a
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
  diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   723
  --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   724
  +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   725
  @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   726
   Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   727
  +Hello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   728
  +bello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   729
  diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   730
  deleted file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   731
  --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   732
  +++ /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   733
  @@ -1,2 +0,0 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   734
  -foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   735
  -babar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   736
  abort: nothing changed
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   737
  [255]
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   738
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   739
  $ HGEDITOR=cat hg amend --patch doesnotexists
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   740
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   741
  # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   742
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   743
  #      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
   744
  # Node ID 36454bda1fdb8e2e4fe07bb084eef378e29cba74
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   745
  # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   746
  hello to a
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
  abort: nothing changed
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   749
  [255]
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   750
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   751
Changing only one file
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   752
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   753
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   754
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   755
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   756
  > # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   757
  > # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   758
  > #      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
   759
  > # Node ID 36454bda1fdb8e2e4fe07bb084eef378e29cba74
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   760
  > # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   761
  > hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   762
  > diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   763
  > --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   764
  > +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   765
  > @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   766
  >  Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   767
  > +Hello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   768
  > +betto
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   769
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   770
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   771
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   772
  $ 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
   773
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   774
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
   775
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   776
  $ hg exp
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   777
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   778
  # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   779
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   780
  #      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
   781
  # Node ID ea175dcc4ee38c106db157975e006b4092444c65
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   782
  # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   783
  hello to a
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
  diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   786
  --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   787
  +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   788
  @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   789
   Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   790
  +Hello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   791
  +betto
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   792
  diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   793
  deleted file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   794
  --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   795
  +++ /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   796
  @@ -1,2 +0,0 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   797
  -foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   798
  -babar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   799
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   800
  $ hg status
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   801
  ? bar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   802
  ? editor.sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   803
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   804
  $ hg diff
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   805
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   806
Testing again with file 'changedfile'
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   807
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   808
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   809
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   810
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   811
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   812
  > # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   813
  > # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   814
  > #      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
   815
  > # Node ID ea175dcc4ee38c106db157975e006b4092444c65
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   816
  > # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   817
  > hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   818
  > diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   819
  > --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   820
  > +++ b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   821
  > @@ -1,2 +1,1 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   822
  >  foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   823
  > -babar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   824
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   825
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   826
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   827
  $ 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
   828
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   829
  $ hg exp
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   830
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   831
  # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   832
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   833
  #      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
   834
  # Node ID 0e64d76c3519308c398a28192cb095d48b29aede
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   835
  # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   836
  hello to a
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
  diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   839
  --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   840
  +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   841
  @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   842
   Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   843
  +Hello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   844
  +betto
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   845
  diff --git a/changedfile b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   846
  --- a/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   847
  +++ b/changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   848
  @@ -1,2 +1,1 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   849
   foobar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   850
  -babar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   851
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   852
  $ hg diff
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   853
  $ hg status
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   854
  ? bar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   855
  ? editor.sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   856
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   857
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
   858
------------------------------------------------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   859
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   860
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   861
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   862
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   863
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   864
  > # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   865
  > # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   866
  > #      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
   867
  > # Node ID 0e64d76c3519308c398a28192cb095d48b29aede
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   868
  > # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   869
  > hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   870
  > diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   871
  > --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   872
  > +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   873
  > @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   874
  >  Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   875
  > +Kello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   876
  > +betto
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   877
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   878
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   879
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   880
  $ 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
   881
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   882
  $ hg exp
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   883
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   884
  # User test
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   885
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   886
  #      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
   887
  # Node ID 944e9f65fa55fdb2de98577c9d8ab30de0927d8e
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   888
  # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   889
  hello to a
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
  diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   892
  --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   893
  +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   894
  @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   895
   Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   896
  +Kello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   897
  +betto
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   898
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   899
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
   900
too
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   901
  $ hg diff
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   902
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   903
  $ hg status
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   904
  ? bar
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   905
  ? editor.sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   906
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   907
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
   908
======================================================
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   909
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   910
Changing user
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
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   913
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   914
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   915
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   916
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   917
  > # User RandomUser
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   918
  > # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   919
  > #      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
   920
  > # Node ID 944e9f65fa55fdb2de98577c9d8ab30de0927d8e
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   921
  > # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   922
  > hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   923
  > diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   924
  > --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   925
  > +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   926
  > @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   927
  >  Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   928
  > +Kello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   929
  > +betto
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   930
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   931
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   932
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   933
  $ 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
   934
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   935
  $ hg exp
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   936
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   937
  # User RandomUser
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   938
  # Date 0 0
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   939
  #      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
   940
  # Node ID 5ded18a8c333a55da4b0e051162457cfe5d85558
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   941
  # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   942
  hello to a
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
  diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   945
  --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   946
  +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   947
  @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   948
   Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   949
  +Kello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   950
  +betto
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   951
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   952
Changing Date
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   953
-------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   954
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   955
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   956
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   957
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   958
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   959
  > # User RandomUser
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   960
  > # Date 123456 1200
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   961
  > #      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
   962
  > # Node ID 944e9f65fa55fdb2de98577c9d8ab30de0927d8e
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   963
  > # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   964
  > hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   965
  > diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   966
  > --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   967
  > +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   968
  > @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   969
  >  Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   970
  > +Kello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   971
  > +betto
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   972
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   973
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   974
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   975
  $ 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
   976
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   977
  $ hg exp
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   978
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   979
  # User RandomUser
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   980
  # Date 123456 1200
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   981
  #      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
   982
  # Node ID e2312ddcd8756665075a60bd05431ddca3c45050
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   983
  # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   984
  hello to a
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
  diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   987
  --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   988
  +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   989
  @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   990
   Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   991
  +Kello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   992
  +betto
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   993
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   994
Changing branch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   995
---------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   996
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   997
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   998
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   999
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1000
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1001
  > # User RandomUser
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1002
  > # Date 123456 1200
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1003
  > #      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
  1004
  > # Branch stable
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1005
  > # Node ID 944e9f65fa55fdb2de98577c9d8ab30de0927d8e
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1006
  > # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1007
  > hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1008
  > diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1009
  > --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1010
  > +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1011
  > @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1012
  >  Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1013
  > +Kello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1014
  > +betto
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1015
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1016
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1017
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1018
  $ 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
  1019
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1020
  $ hg exp
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1021
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1022
  # User RandomUser
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1023
  # Date 123456 1200
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1024
  #      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
  1025
  # Branch stable
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1026
  # Node ID ddc61a4058687b2dd4a316f4b5fe7d52a35b702a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1027
  # Parent  c3e29c061982c94418ce141d521434d6da76cd46
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1028
  hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1029
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1030
  diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1031
  --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1032
  +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1033
  @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1034
   Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1035
  +Kello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1036
  +betto
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1037
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1038
Changing parent (this should be fun)
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1039
------------------------------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1040
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1041
  $ hg glog
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1042
  @  16:ddc61a405868 hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1043
  |   (foo) draft
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1044
  o  6:c3e29c061982 foobar to changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1045
  |   () public
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1046
  o  3:fc57c20be380 added a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1047
      () public
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
  $ hg log -r .^^ -T '{node}'
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1050
  fc57c20be380f2878f4db139dad66d6cfb42ec62 (no-eol)
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1051
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1052
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1053
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1054
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1055
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1056
  > # User RandomUser
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1057
  > # Date 123456 1200
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1058
  > #      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
  1059
  > # Branch stable
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1060
  > # Node ID 944e9f65fa55fdb2de98577c9d8ab30de0927d8e
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1061
  > # Parent  fc57c20be380f2878f4db139dad66d6cfb42ec62
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1062
  > hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1063
  > diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1064
  > --- a/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1065
  > +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1066
  > @@ -1,1 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1067
  >  Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1068
  > +Kello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1069
  > +betto
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1070
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1071
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1072
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1073
  $ 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
  1074
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1075
  $ hg exp
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1076
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1077
  # User RandomUser
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1078
  # Date 123456 1200
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1079
  #      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
  1080
  # Branch stable
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1081
  # Node ID b763f7cb2302f2efa1275e2a9202655872c9567f
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1082
  # Parent  fc57c20be380f2878f4db139dad66d6cfb42ec62
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1083
  hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1084
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1085
  diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1086
  new file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1087
  --- /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1088
  +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1089
  @@ -0,0 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1090
  +Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1091
  +Kello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1092
  +betto
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
  $ hg glog
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1095
  @  17:b763f7cb2302 hello to a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1096
  |   (foo) draft
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1097
  | o  6:c3e29c061982 foobar to changedfile
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1098
  |/    () public
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1099
  o  3:fc57c20be380 added a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1100
      () public
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1101
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1102
Changing the commit desciption
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1103
-------------------------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1104
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1105
  $ cat > editor.sh <<EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1106
  > #!/bin/sh
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1107
  > cat > \$1 <<ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1108
  > # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1109
  > # User RandomUser
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1110
  > # Date 123456 1200
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1111
  > #      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
  1112
  > # Branch stable
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1113
  > # Node ID 944e9f65fa55fdb2de98577c9d8ab30de0927d8e
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1114
  > # Parent  fc57c20be380f2878f4db139dad66d6cfb42ec62
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1115
  > 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
  1116
  > diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1117
  > new file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1118
  > --- /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1119
  > +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1120
  > @@ -0,0 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1121
  > +Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1122
  > +Kello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1123
  > +betto
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1124
  > ENDOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1125
  > EOF
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1126
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1127
  $ 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
  1128
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1129
  $ hg exp
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1130
  # HG changeset patch
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1131
  # User RandomUser
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1132
  # Date 123456 1200
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1133
  #      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
  1134
  # Branch stable
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1135
  # Node ID f14ecd7121e63915ac93edbad7f60f605e62dd52
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1136
  # Parent  fc57c20be380f2878f4db139dad66d6cfb42ec62
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1137
  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
  1138
  
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1139
  diff --git a/a b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1140
  new file mode 100755
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1141
  --- /dev/null
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1142
  +++ b/a
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1143
  @@ -0,0 +1,3 @@
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1144
  +Gello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1145
  +Kello
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1146
  +betto
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
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
  1149
---------------------------------
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1150
f018656ca3bf amend: add a new flag `--patch` to `hg amend`
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
  1151
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
  1152
tests to realize I was testing that too.