annotate tests/test-amend-patch.t @ 6426:25e910a0136b mercurial-5.6

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