author | Laurent Charignon <lcharignon@fb.com> |
Sat, 08 Aug 2015 12:12:16 -0700 | |
changeset 1482 | c7726b19c7a0 |
parent 1478 | 9603aa1ecdfd |
child 1483 | dc1467a629ca |
permissions | -rw-r--r-- |
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 |
1482
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
45 |
$ echo 0 > num |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
46 |
$ cat > editor.sh << '__EOF__' |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
47 |
> NUM=$(cat num) |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
48 |
> NUM=`expr "$NUM" + 1` |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
49 |
> echo "$NUM" > num |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
50 |
> echo "split$NUM" > "$1" |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
51 |
> __EOF__ |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
52 |
$ export HGEDITOR="\"sh\" \"editor.sh\"" |
1478
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
53 |
$ hg split << EOF |
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 |
> y |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
56 |
> y |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
57 |
> n |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
58 |
> N |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
59 |
> y |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
60 |
> y |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
61 |
> EOF |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
62 |
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
|
63 |
reverting _a |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
64 |
adding _d |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
65 |
diff --git a/_a b/_a |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
66 |
1 hunks, 1 lines changed |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
67 |
examine changes to '_a'? [Ynesfdaq?] y |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
68 |
|
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
69 |
@@ -1,0 +2,1 @@ |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
70 |
+change to a |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
71 |
record change 1/2 to '_a'? [Ynesfdaq?] y |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
72 |
|
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
73 |
diff --git a/_d b/_d |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
74 |
new file mode 100644 |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
75 |
examine changes to '_d'? [Ynesfdaq?] y |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
76 |
|
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
77 |
@@ -0,0 +1,1 @@ |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
78 |
+_d |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
79 |
record change 2/2 to '_d'? [Ynesfdaq?] n |
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 |
created new head |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
82 |
Done splitting? [yN] N |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
83 |
diff --git a/_d b/_d |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
84 |
new file mode 100644 |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
85 |
examine changes to '_d'? [Ynesfdaq?] y |
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 |
@@ -0,0 +1,1 @@ |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
88 |
+_d |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
89 |
record this change to '_d'? [Ynesfdaq?] y |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
90 |
|
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
91 |
no more change to split |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
92 |
|
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
93 |
$ hg debugobsolete |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
94 |
9e84a109b8eb081ad754681ee4b1380d17a3741f aa8f656bb307022172d2648be6fb65322f801225 0 (*) {'user': 'test'} (glob) |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
95 |
f002b57772d7f09b180c407213ae16d92996a988 0 {9e84a109b8eb081ad754681ee4b1380d17a3741f} (*) {'user': 'test'} (glob) |
1482
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
96 |
aa8f656bb307022172d2648be6fb65322f801225 a98b35e86cae589b61892127c5ec1c868e41d910 5410a2352fa3114883327beee89e3085eefac25c 0 (*) {'user': 'test'} (glob) |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
97 |
$ hg glog |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
98 |
@ changeset: 7:5410a2352fa3 |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
99 |
| tag: tip |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
100 |
| user: test |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
101 |
| date: Thu Jan 01 00:00:00 1970 +0000 |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
102 |
| summary: split2 |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
103 |
| |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
104 |
o changeset: 6:a98b35e86cae |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
105 |
| parent: 2:102002290587 |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
106 |
| user: test |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
107 |
| date: Thu Jan 01 00:00:00 1970 +0000 |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
108 |
| summary: split1 |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
109 |
| |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
110 |
o changeset: 2:102002290587 |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
111 |
| user: test |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
112 |
| date: Thu Jan 01 00:00:00 1970 +0000 |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
113 |
| summary: add _c |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
114 |
| |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
115 |
o changeset: 1:37445b16603b |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
116 |
| user: test |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
117 |
| date: Thu Jan 01 00:00:00 1970 +0000 |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
118 |
| summary: add _b |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
119 |
| |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
120 |
o changeset: 0:135f39f4bd78 |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
121 |
user: test |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
122 |
date: Thu Jan 01 00:00:00 1970 +0000 |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
123 |
summary: add _a |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
124 |
|
1478
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
125 |
|
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
126 |
Cannot split a commit with uncommited changes |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
127 |
$ hg up "desc(_c)" |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
128 |
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
|
129 |
$ echo "_cd" > _c |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
130 |
$ hg split |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
131 |
abort: uncommitted changes |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
132 |
[255] |
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 |
Split a revision specified with -r |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
135 |
$ hg up "desc(_c)" -C |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
136 |
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
|
137 |
$ echo "change to b" >> _b |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
138 |
$ hg amend -m "_cprim" |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
139 |
2 new unstable changesets |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
140 |
$ hg evolve --all |
1482
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
141 |
move:[6] split1 |
1478
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
142 |
atop:[9] _cprim |
1482
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
143 |
move:[7] split2 |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
144 |
atop:[10] split1 |
1478
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
145 |
working directory is now at * (glob) |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
146 |
$ hg log -r "desc(_cprim)" -v -p |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
147 |
changeset: 9:719157b217ac |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
148 |
parent: 1:37445b16603b |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
149 |
user: test |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
150 |
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
|
151 |
files: _b _c |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
152 |
description: |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
153 |
_cprim |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
154 |
|
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
155 |
|
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
156 |
diff --git a/_b b/_b |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
157 |
--- a/_b |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
158 |
+++ b/_b |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
159 |
@@ -1,0 +2,1 @@ |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
160 |
+change to b |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
161 |
diff --git a/_c b/_c |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
162 |
new file mode 100644 |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
163 |
--- /dev/null |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
164 |
+++ b/_c |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
165 |
@@ -0,0 +1,1 @@ |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
166 |
+_c |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
167 |
|
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
168 |
$ hg split -r "desc(_cprim)" <<EOF |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
169 |
> y |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
170 |
> y |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
171 |
> y |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
172 |
> n |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
173 |
> y |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
174 |
> EOF |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
175 |
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
|
176 |
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
|
177 |
reverting _b |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
178 |
adding _c |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
179 |
diff --git a/_b b/_b |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
180 |
1 hunks, 1 lines changed |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
181 |
examine changes to '_b'? [Ynesfdaq?] y |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
182 |
|
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
183 |
@@ -1,0 +2,1 @@ |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
184 |
+change to b |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
185 |
record change 1/2 to '_b'? [Ynesfdaq?] y |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
186 |
|
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
187 |
diff --git a/_c b/_c |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
188 |
new file mode 100644 |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
189 |
examine changes to '_c'? [Ynesfdaq?] y |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
190 |
|
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
191 |
@@ -0,0 +1,1 @@ |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
192 |
+_c |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
193 |
record change 2/2 to '_c'? [Ynesfdaq?] n |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
194 |
|
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
195 |
created new head |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
196 |
Done splitting? [yN] y |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
197 |
|
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
198 |
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
|
199 |
remaining changes |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
200 |
|
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
201 |
$ hg debugobsolete |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
202 |
9e84a109b8eb081ad754681ee4b1380d17a3741f aa8f656bb307022172d2648be6fb65322f801225 0 (*) {'user': 'test'} (glob) |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
203 |
f002b57772d7f09b180c407213ae16d92996a988 0 {9e84a109b8eb081ad754681ee4b1380d17a3741f} (*) {'user': 'test'} (glob) |
1482
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
204 |
aa8f656bb307022172d2648be6fb65322f801225 a98b35e86cae589b61892127c5ec1c868e41d910 5410a2352fa3114883327beee89e3085eefac25c 0 (*) {'user': 'test'} (glob) |
1478
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
205 |
10200229058723ce8d67f6612c1f6b4f73b1fe73 719157b217acc43d397369a448824ed4c7a302f2 0 (*) {'user': 'test'} (glob) |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
206 |
5d0c8b0f2d3e5e1ff95f93d7da2ba06650605ab5 0 {10200229058723ce8d67f6612c1f6b4f73b1fe73} (*) {'user': 'test'} (glob) |
1482
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
207 |
a98b35e86cae589b61892127c5ec1c868e41d910 286887947725085e03455d79649197feaef1eb9d 0 (*) {'user': 'test'} (glob) |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
208 |
5410a2352fa3114883327beee89e3085eefac25c 0b67cee46a7f2ad664f994027e7af95b36ae25fe 0 (*) {'user': 'test'} (glob) |
c7726b19c7a0
split: fix commit message numbering error in the test
Laurent Charignon <lcharignon@fb.com>
parents:
1478
diff
changeset
|
209 |
719157b217acc43d397369a448824ed4c7a302f2 ced8fbcce3a7cd33f0e454d2cd63882ce1b6006b 73309fb98db840ba4ec5ad528346dc6ee0b39dcb 0 (*) {'user': 'test'} (glob) |
1478
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
210 |
|
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
211 |
Cannot specify multiple revisions with -r |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
212 |
$ hg split -r "desc(_a)::" |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
213 |
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
|
214 |
[255] |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
215 |
|
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
216 |
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
|
217 |
$ cat >> $HGRCPATH <<EOF |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
218 |
> [experimental] |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
219 |
> evolution=createmarkers |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
220 |
> evolutioncommands=split |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
221 |
> EOF |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
222 |
$ hg split -r "desc(_c)" |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
223 |
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
|
224 |
abort: cannot split commit: 719157b217ac not a head |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
225 |
[255] |
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
226 |
|
9603aa1ecdfd
evolve: add a command to split commits
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
227 |