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