annotate tests/test-split.t @ 1478:9603aa1ecdfd

evolve: add a command to split commits Before this patch, to split commit one had to use prune. This patch adds a new command called split that prompts the user interactively to split a given changeset with record/crecord.
author Laurent Charignon <lcharignon@fb.com>
date Thu, 18 Jun 2015 16:48:53 -0700
parents
children c7726b19c7a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1478
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
1 test of the split command
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
2 -----------------------
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
3
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
4 $ cat >> $HGRCPATH <<EOF
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
5 > [defaults]
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
6 > amend=-d "0 0"
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
7 > fold=-d "0 0"
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
8 > split=-d "0 0"
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
9 > amend=-d "0 0"
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
10 > [web]
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
11 > push_ssl = false
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
12 > allow_push = *
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
13 > [phases]
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
14 > publish = False
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
15 > [diff]
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
16 > git = 1
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
17 > unified = 0
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
18 > [ui]
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
19 > interactive = true
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
20 > [extensions]
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
21 > hgext.graphlog=
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
22 > EOF
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
23 $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext/evolve.py" >> $HGRCPATH
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
24 $ mkcommit() {
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
25 > echo "$1" > "$1"
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
26 > hg add "$1"
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
27 > hg ci -m "add $1"
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
28 > }
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
29
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
30
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
31 Basic case, split a head
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
32 $ hg init testsplit
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
33 $ cd testsplit
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
34 $ mkcommit _a
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
35 $ mkcommit _b
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
36 $ mkcommit _c
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
37 $ mkcommit _d
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
38 $ echo "change to a" >> _a
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
39 $ hg amend
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
40 $ hg debugobsolete
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
41 9e84a109b8eb081ad754681ee4b1380d17a3741f aa8f656bb307022172d2648be6fb65322f801225 0 (*) {'user': 'test'} (glob)
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
42 f002b57772d7f09b180c407213ae16d92996a988 0 {9e84a109b8eb081ad754681ee4b1380d17a3741f} (*) {'user': 'test'} (glob)
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
43
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
44 To create commits with the number of split
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
45 $ export NUM=0
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
46 $ export HGEDITOR="NUM=$((NUM+1)); echo split$NUM > $1"
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
47 $ hg split << EOF
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
48 > y
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
49 > y
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
50 > y
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
51 > n
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
52 > N
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
53 > y
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
54 > y
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
55 > EOF
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
56 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
57 reverting _a
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
58 adding _d
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
59 diff --git a/_a b/_a
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
60 1 hunks, 1 lines changed
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
61 examine changes to '_a'? [Ynesfdaq?] y
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
62
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
63 @@ -1,0 +2,1 @@
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
64 +change to a
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
65 record change 1/2 to '_a'? [Ynesfdaq?] y
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
66
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
67 diff --git a/_d b/_d
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
68 new file mode 100644
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
69 examine changes to '_d'? [Ynesfdaq?] y
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
70
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
71 @@ -0,0 +1,1 @@
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
72 +_d
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
73 record change 2/2 to '_d'? [Ynesfdaq?] n
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
74
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
75 created new head
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
76 Done splitting? [yN] N
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
77 diff --git a/_d b/_d
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
78 new file mode 100644
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
79 examine changes to '_d'? [Ynesfdaq?] y
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
80
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
81 @@ -0,0 +1,1 @@
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
82 +_d
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
83 record this change to '_d'? [Ynesfdaq?] y
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
84
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
85 no more change to split
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
86
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
87 $ hg debugobsolete
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
88 9e84a109b8eb081ad754681ee4b1380d17a3741f aa8f656bb307022172d2648be6fb65322f801225 0 (*) {'user': 'test'} (glob)
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
89 f002b57772d7f09b180c407213ae16d92996a988 0 {9e84a109b8eb081ad754681ee4b1380d17a3741f} (*) {'user': 'test'} (glob)
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
90 aa8f656bb307022172d2648be6fb65322f801225 8a76f55839e6badd47ed8338803d8bc16f578d68 1e105584671a463974ee2122f95979ce5e507f1a 0 (*) {'user': 'test'} (glob)
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
91
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
92 Cannot split a commit with uncommited changes
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
93 $ hg up "desc(_c)"
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
94 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
95 $ echo "_cd" > _c
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
96 $ hg split
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
97 abort: uncommitted changes
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
98 [255]
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
99
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
100 Split a revision specified with -r
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
101 $ hg up "desc(_c)" -C
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
102 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
103 $ echo "change to b" >> _b
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
104 $ hg amend -m "_cprim"
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
105 2 new unstable changesets
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
106 $ hg evolve --all
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
107 move:[6] split0
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
108 atop:[9] _cprim
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
109 move:[7] split0
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
110 atop:[10] split0
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
111 working directory is now at * (glob)
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
112 $ hg log -r "desc(_cprim)" -v -p
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
113 changeset: 9:719157b217ac
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
114 parent: 1:37445b16603b
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
115 user: test
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
116 date: Thu Jan 01 00:00:00 1970 +0000
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
117 files: _b _c
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
118 description:
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
119 _cprim
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
120
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
121
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
122 diff --git a/_b b/_b
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
123 --- a/_b
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
124 +++ b/_b
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
125 @@ -1,0 +2,1 @@
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
126 +change to b
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
127 diff --git a/_c b/_c
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
128 new file mode 100644
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
129 --- /dev/null
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
130 +++ b/_c
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
131 @@ -0,0 +1,1 @@
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
132 +_c
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
133
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
134 $ hg split -r "desc(_cprim)" <<EOF
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
135 > y
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
136 > y
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
137 > y
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
138 > n
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
139 > y
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
140 > EOF
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
141 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
142 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
143 reverting _b
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
144 adding _c
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
145 diff --git a/_b b/_b
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
146 1 hunks, 1 lines changed
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
147 examine changes to '_b'? [Ynesfdaq?] y
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
148
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
149 @@ -1,0 +2,1 @@
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
150 +change to b
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
151 record change 1/2 to '_b'? [Ynesfdaq?] y
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
152
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
153 diff --git a/_c b/_c
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
154 new file mode 100644
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
155 examine changes to '_c'? [Ynesfdaq?] y
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
156
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
157 @@ -0,0 +1,1 @@
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
158 +_c
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
159 record change 2/2 to '_c'? [Ynesfdaq?] n
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
160
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
161 created new head
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
162 Done splitting? [yN] y
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
163
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
164 Stop before splitting the commit completely creates a commit with all the
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
165 remaining changes
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
166
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
167 $ hg debugobsolete
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
168 9e84a109b8eb081ad754681ee4b1380d17a3741f aa8f656bb307022172d2648be6fb65322f801225 0 (*) {'user': 'test'} (glob)
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
169 f002b57772d7f09b180c407213ae16d92996a988 0 {9e84a109b8eb081ad754681ee4b1380d17a3741f} (*) {'user': 'test'} (glob)
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
170 aa8f656bb307022172d2648be6fb65322f801225 8a76f55839e6badd47ed8338803d8bc16f578d68 1e105584671a463974ee2122f95979ce5e507f1a 0 (*) {'user': 'test'} (glob)
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
171 10200229058723ce8d67f6612c1f6b4f73b1fe73 719157b217acc43d397369a448824ed4c7a302f2 0 (*) {'user': 'test'} (glob)
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
172 5d0c8b0f2d3e5e1ff95f93d7da2ba06650605ab5 0 {10200229058723ce8d67f6612c1f6b4f73b1fe73} (*) {'user': 'test'} (glob)
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
173 8a76f55839e6badd47ed8338803d8bc16f578d68 0ea1d0d23e674ea8a6affe760741c82bb8e380f7 0 (*) {'user': 'test'} (glob)
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
174 1e105584671a463974ee2122f95979ce5e507f1a b6099ccb49cae181af7c59ed5603a1dfca632445 0 (*) {'user': 'test'} (glob)
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
175 719157b217acc43d397369a448824ed4c7a302f2 8eb71353cb2c70fc1154be3af79c0ce98898ae88 ead904640c8543606f72490c6ae10955fb11fff0 0 (*) {'user': 'test'} (glob)
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
176
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
177 Cannot specify multiple revisions with -r
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
178 $ hg split -r "desc(_a)::"
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
179 abort: you can only specify one revision to split
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
180 [255]
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
181
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
182 Cannot split a commit that is not a head if instability is not allowed
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
183 $ cat >> $HGRCPATH <<EOF
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
184 > [experimental]
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
185 > evolution=createmarkers
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
186 > evolutioncommands=split
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
187 > EOF
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
188 $ hg split -r "desc(_c)"
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
189 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
190 abort: cannot split commit: 719157b217ac not a head
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
191 [255]
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
192
9603aa1ecdfd evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
193