##// END OF EJS Templates
split: use rewriteutil.precheck() instead of reimplementing it...
Martin von Zweigbergk -
r44387:2349a60f default
parent child Browse files
Show More
@@ -1,206 +1,186 b''
1 # split.py - split a changeset into smaller ones
1 # split.py - split a changeset into smaller ones
2 #
2 #
3 # Copyright 2015 Laurent Charignon <lcharignon@fb.com>
3 # Copyright 2015 Laurent Charignon <lcharignon@fb.com>
4 # Copyright 2017 Facebook, Inc.
4 # Copyright 2017 Facebook, Inc.
5 #
5 #
6 # This software may be used and distributed according to the terms of the
6 # This software may be used and distributed according to the terms of the
7 # GNU General Public License version 2 or any later version.
7 # GNU General Public License version 2 or any later version.
8 """command to split a changeset into smaller ones (EXPERIMENTAL)"""
8 """command to split a changeset into smaller ones (EXPERIMENTAL)"""
9
9
10 from __future__ import absolute_import
10 from __future__ import absolute_import
11
11
12 from mercurial.i18n import _
12 from mercurial.i18n import _
13
13
14 from mercurial.node import (
14 from mercurial.node import (
15 nullid,
15 nullid,
16 short,
16 short,
17 )
17 )
18
18
19 from mercurial import (
19 from mercurial import (
20 bookmarks,
20 bookmarks,
21 cmdutil,
21 cmdutil,
22 commands,
22 commands,
23 error,
23 error,
24 hg,
24 hg,
25 obsolete,
26 phases,
27 pycompat,
25 pycompat,
28 registrar,
26 registrar,
29 revsetlang,
27 revsetlang,
28 rewriteutil,
30 scmutil,
29 scmutil,
31 )
30 )
32
31
33 # allow people to use split without explicitly enabling rebase extension
32 # allow people to use split without explicitly enabling rebase extension
34 from . import rebase
33 from . import rebase
35
34
36 cmdtable = {}
35 cmdtable = {}
37 command = registrar.command(cmdtable)
36 command = registrar.command(cmdtable)
38
37
39 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
38 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
40 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
39 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
41 # be specifying the version(s) of Mercurial they are tested with, or
40 # be specifying the version(s) of Mercurial they are tested with, or
42 # leave the attribute unspecified.
41 # leave the attribute unspecified.
43 testedwith = b'ships-with-hg-core'
42 testedwith = b'ships-with-hg-core'
44
43
45
44
46 @command(
45 @command(
47 b'split',
46 b'split',
48 [
47 [
49 (b'r', b'rev', b'', _(b"revision to split"), _(b'REV')),
48 (b'r', b'rev', b'', _(b"revision to split"), _(b'REV')),
50 (b'', b'rebase', True, _(b'rebase descendants after split')),
49 (b'', b'rebase', True, _(b'rebase descendants after split')),
51 ]
50 ]
52 + cmdutil.commitopts2,
51 + cmdutil.commitopts2,
53 _(b'hg split [--no-rebase] [[-r] REV]'),
52 _(b'hg split [--no-rebase] [[-r] REV]'),
54 helpcategory=command.CATEGORY_CHANGE_MANAGEMENT,
53 helpcategory=command.CATEGORY_CHANGE_MANAGEMENT,
55 helpbasic=True,
54 helpbasic=True,
56 )
55 )
57 def split(ui, repo, *revs, **opts):
56 def split(ui, repo, *revs, **opts):
58 """split a changeset into smaller ones
57 """split a changeset into smaller ones
59
58
60 Repeatedly prompt changes and commit message for new changesets until there
59 Repeatedly prompt changes and commit message for new changesets until there
61 is nothing left in the original changeset.
60 is nothing left in the original changeset.
62
61
63 If --rev was not given, split the working directory parent.
62 If --rev was not given, split the working directory parent.
64
63
65 By default, rebase connected non-obsoleted descendants onto the new
64 By default, rebase connected non-obsoleted descendants onto the new
66 changeset. Use --no-rebase to avoid the rebase.
65 changeset. Use --no-rebase to avoid the rebase.
67 """
66 """
68 opts = pycompat.byteskwargs(opts)
67 opts = pycompat.byteskwargs(opts)
69 revlist = []
68 revlist = []
70 if opts.get(b'rev'):
69 if opts.get(b'rev'):
71 revlist.append(opts.get(b'rev'))
70 revlist.append(opts.get(b'rev'))
72 revlist.extend(revs)
71 revlist.extend(revs)
73 with repo.wlock(), repo.lock(), repo.transaction(b'split') as tr:
72 with repo.wlock(), repo.lock(), repo.transaction(b'split') as tr:
74 revs = scmutil.revrange(repo, revlist or [b'.'])
73 revs = scmutil.revrange(repo, revlist or [b'.'])
75 if len(revs) > 1:
74 if len(revs) > 1:
76 raise error.Abort(_(b'cannot split multiple revisions'))
75 raise error.Abort(_(b'cannot split multiple revisions'))
77
76
78 rev = revs.first()
77 rev = revs.first()
79 ctx = repo[rev]
78 ctx = repo[rev]
79 # Handle nullid specially here (instead of leaving for precheck()
80 # below) so we get a nicer message and error code.
80 if rev is None or ctx.node() == nullid:
81 if rev is None or ctx.node() == nullid:
81 ui.status(_(b'nothing to split\n'))
82 ui.status(_(b'nothing to split\n'))
82 return 1
83 return 1
83 if ctx.node() is None:
84 if ctx.node() is None:
84 raise error.Abort(_(b'cannot split working directory'))
85 raise error.Abort(_(b'cannot split working directory'))
85
86
86 # rewriteutil.precheck is not very useful here because:
87 # 1. null check is done above and it's more friendly to return 1
88 # instead of abort
89 # 2. mergestate check is done below by cmdutil.bailifchanged
90 # 3. unstable check is more complex here because of --rebase
91 #
92 # So only "public" check is useful and it's checked directly here.
93 if ctx.phase() == phases.public:
94 raise error.Abort(
95 _(b'cannot split public changeset'),
96 hint=_(b"see 'hg help phases' for details"),
97 )
98
99 descendants = list(repo.revs(b'(%d::) - (%d)', rev, rev))
100 alloworphaned = obsolete.isenabled(repo, obsolete.allowunstableopt)
101 if opts.get(b'rebase'):
87 if opts.get(b'rebase'):
102 # Skip obsoleted descendants and their descendants so the rebase
88 # Skip obsoleted descendants and their descendants so the rebase
103 # won't cause conflicts for sure.
89 # won't cause conflicts for sure.
90 descendants = list(repo.revs(b'(%d::) - (%d)', rev, rev))
104 torebase = list(
91 torebase = list(
105 repo.revs(
92 repo.revs(
106 b'%ld - (%ld & obsolete())::', descendants, descendants
93 b'%ld - (%ld & obsolete())::', descendants, descendants
107 )
94 )
108 )
95 )
109 if not alloworphaned and len(torebase) != len(descendants):
110 raise error.Abort(
111 _(b'split would leave orphaned changesets behind')
112 )
113 else:
96 else:
114 if not alloworphaned and descendants:
97 torebase = []
115 raise error.Abort(
98 rewriteutil.precheck(repo, [rev] + torebase, b'split')
116 _(b'cannot split changeset with children without rebase')
117 )
118 torebase = ()
119
99
120 if len(ctx.parents()) > 1:
100 if len(ctx.parents()) > 1:
121 raise error.Abort(_(b'cannot split a merge changeset'))
101 raise error.Abort(_(b'cannot split a merge changeset'))
122
102
123 cmdutil.bailifchanged(repo)
103 cmdutil.bailifchanged(repo)
124
104
125 # Deactivate bookmark temporarily so it won't get moved unintentionally
105 # Deactivate bookmark temporarily so it won't get moved unintentionally
126 bname = repo._activebookmark
106 bname = repo._activebookmark
127 if bname and repo._bookmarks[bname] != ctx.node():
107 if bname and repo._bookmarks[bname] != ctx.node():
128 bookmarks.deactivate(repo)
108 bookmarks.deactivate(repo)
129
109
130 wnode = repo[b'.'].node()
110 wnode = repo[b'.'].node()
131 top = None
111 top = None
132 try:
112 try:
133 top = dosplit(ui, repo, tr, ctx, opts)
113 top = dosplit(ui, repo, tr, ctx, opts)
134 finally:
114 finally:
135 # top is None: split failed, need update --clean recovery.
115 # top is None: split failed, need update --clean recovery.
136 # wnode == ctx.node(): wnode split, no need to update.
116 # wnode == ctx.node(): wnode split, no need to update.
137 if top is None or wnode != ctx.node():
117 if top is None or wnode != ctx.node():
138 hg.clean(repo, wnode, show_stats=False)
118 hg.clean(repo, wnode, show_stats=False)
139 if bname:
119 if bname:
140 bookmarks.activate(repo, bname)
120 bookmarks.activate(repo, bname)
141 if torebase and top:
121 if torebase and top:
142 dorebase(ui, repo, torebase, top)
122 dorebase(ui, repo, torebase, top)
143
123
144
124
145 def dosplit(ui, repo, tr, ctx, opts):
125 def dosplit(ui, repo, tr, ctx, opts):
146 committed = [] # [ctx]
126 committed = [] # [ctx]
147
127
148 # Set working parent to ctx.p1(), and keep working copy as ctx's content
128 # Set working parent to ctx.p1(), and keep working copy as ctx's content
149 if ctx.node() != repo.dirstate.p1():
129 if ctx.node() != repo.dirstate.p1():
150 hg.clean(repo, ctx.node(), show_stats=False)
130 hg.clean(repo, ctx.node(), show_stats=False)
151 with repo.dirstate.parentchange():
131 with repo.dirstate.parentchange():
152 scmutil.movedirstate(repo, ctx.p1())
132 scmutil.movedirstate(repo, ctx.p1())
153
133
154 # Any modified, added, removed, deleted result means split is incomplete
134 # Any modified, added, removed, deleted result means split is incomplete
155 def incomplete(repo):
135 def incomplete(repo):
156 st = repo.status()
136 st = repo.status()
157 return any((st.modified, st.added, st.removed, st.deleted))
137 return any((st.modified, st.added, st.removed, st.deleted))
158
138
159 # Main split loop
139 # Main split loop
160 while incomplete(repo):
140 while incomplete(repo):
161 if committed:
141 if committed:
162 header = _(
142 header = _(
163 b'HG: Splitting %s. So far it has been split into:\n'
143 b'HG: Splitting %s. So far it has been split into:\n'
164 ) % short(ctx.node())
144 ) % short(ctx.node())
165 for c in committed:
145 for c in committed:
166 firstline = c.description().split(b'\n', 1)[0]
146 firstline = c.description().split(b'\n', 1)[0]
167 header += _(b'HG: - %s: %s\n') % (short(c.node()), firstline)
147 header += _(b'HG: - %s: %s\n') % (short(c.node()), firstline)
168 header += _(
148 header += _(
169 b'HG: Write commit message for the next split changeset.\n'
149 b'HG: Write commit message for the next split changeset.\n'
170 )
150 )
171 else:
151 else:
172 header = _(
152 header = _(
173 b'HG: Splitting %s. Write commit message for the '
153 b'HG: Splitting %s. Write commit message for the '
174 b'first split changeset.\n'
154 b'first split changeset.\n'
175 ) % short(ctx.node())
155 ) % short(ctx.node())
176 opts.update(
156 opts.update(
177 {
157 {
178 b'edit': True,
158 b'edit': True,
179 b'interactive': True,
159 b'interactive': True,
180 b'message': header + ctx.description(),
160 b'message': header + ctx.description(),
181 }
161 }
182 )
162 )
183 commands.commit(ui, repo, **pycompat.strkwargs(opts))
163 commands.commit(ui, repo, **pycompat.strkwargs(opts))
184 newctx = repo[b'.']
164 newctx = repo[b'.']
185 committed.append(newctx)
165 committed.append(newctx)
186
166
187 if not committed:
167 if not committed:
188 raise error.Abort(_(b'cannot split an empty revision'))
168 raise error.Abort(_(b'cannot split an empty revision'))
189
169
190 scmutil.cleanupnodes(
170 scmutil.cleanupnodes(
191 repo,
171 repo,
192 {ctx.node(): [c.node() for c in committed]},
172 {ctx.node(): [c.node() for c in committed]},
193 operation=b'split',
173 operation=b'split',
194 fixphase=True,
174 fixphase=True,
195 )
175 )
196
176
197 return committed[-1]
177 return committed[-1]
198
178
199
179
200 def dorebase(ui, repo, src, destctx):
180 def dorebase(ui, repo, src, destctx):
201 rebase.rebase(
181 rebase.rebase(
202 ui,
182 ui,
203 repo,
183 repo,
204 rev=[revsetlang.formatspec(b'%ld', src)],
184 rev=[revsetlang.formatspec(b'%ld', src)],
205 dest=revsetlang.formatspec(b'%d', destctx.rev()),
185 dest=revsetlang.formatspec(b'%d', destctx.rev()),
206 )
186 )
@@ -1,978 +1,978 b''
1 #testcases obsstore-on obsstore-off
1 #testcases obsstore-on obsstore-off
2
2
3 $ cat > $TESTTMP/editor.py <<EOF
3 $ cat > $TESTTMP/editor.py <<EOF
4 > #!"$PYTHON"
4 > #!"$PYTHON"
5 > import os
5 > import os
6 > import sys
6 > import sys
7 > path = os.path.join(os.environ['TESTTMP'], 'messages')
7 > path = os.path.join(os.environ['TESTTMP'], 'messages')
8 > messages = open(path).read().split('--\n')
8 > messages = open(path).read().split('--\n')
9 > prompt = open(sys.argv[1]).read()
9 > prompt = open(sys.argv[1]).read()
10 > sys.stdout.write(''.join('EDITOR: %s' % l for l in prompt.splitlines(True)))
10 > sys.stdout.write(''.join('EDITOR: %s' % l for l in prompt.splitlines(True)))
11 > sys.stdout.flush()
11 > sys.stdout.flush()
12 > with open(sys.argv[1], 'w') as f:
12 > with open(sys.argv[1], 'w') as f:
13 > f.write(messages[0])
13 > f.write(messages[0])
14 > with open(path, 'w') as f:
14 > with open(path, 'w') as f:
15 > f.write('--\n'.join(messages[1:]))
15 > f.write('--\n'.join(messages[1:]))
16 > EOF
16 > EOF
17
17
18 $ cat >> $HGRCPATH <<EOF
18 $ cat >> $HGRCPATH <<EOF
19 > [extensions]
19 > [extensions]
20 > drawdag=$TESTDIR/drawdag.py
20 > drawdag=$TESTDIR/drawdag.py
21 > split=
21 > split=
22 > [ui]
22 > [ui]
23 > interactive=1
23 > interactive=1
24 > color=no
24 > color=no
25 > paginate=never
25 > paginate=never
26 > [diff]
26 > [diff]
27 > git=1
27 > git=1
28 > unified=0
28 > unified=0
29 > [commands]
29 > [commands]
30 > commit.interactive.unified=0
30 > commit.interactive.unified=0
31 > [alias]
31 > [alias]
32 > glog=log -G -T '{rev}:{node|short} {desc} {bookmarks}\n'
32 > glog=log -G -T '{rev}:{node|short} {desc} {bookmarks}\n'
33 > EOF
33 > EOF
34
34
35 #if obsstore-on
35 #if obsstore-on
36 $ cat >> $HGRCPATH <<EOF
36 $ cat >> $HGRCPATH <<EOF
37 > [experimental]
37 > [experimental]
38 > evolution=all
38 > evolution=all
39 > EOF
39 > EOF
40 #endif
40 #endif
41
41
42 $ hg init a
42 $ hg init a
43 $ cd a
43 $ cd a
44
44
45 Nothing to split
45 Nothing to split
46
46
47 $ hg split
47 $ hg split
48 nothing to split
48 nothing to split
49 [1]
49 [1]
50
50
51 $ hg commit -m empty --config ui.allowemptycommit=1
51 $ hg commit -m empty --config ui.allowemptycommit=1
52 $ hg split
52 $ hg split
53 abort: cannot split an empty revision
53 abort: cannot split an empty revision
54 [255]
54 [255]
55
55
56 $ rm -rf .hg
56 $ rm -rf .hg
57 $ hg init
57 $ hg init
58
58
59 Cannot split working directory
59 Cannot split working directory
60
60
61 $ hg split -r 'wdir()'
61 $ hg split -r 'wdir()'
62 abort: cannot split working directory
62 abort: cannot split working directory
63 [255]
63 [255]
64
64
65 Generate some content. The sed filter drop CR on Windows, which is dropped in
65 Generate some content. The sed filter drop CR on Windows, which is dropped in
66 the a > b line.
66 the a > b line.
67
67
68 $ $TESTDIR/seq.py 1 5 | sed 's/\r$//' >> a
68 $ $TESTDIR/seq.py 1 5 | sed 's/\r$//' >> a
69 $ hg ci -m a1 -A a -q
69 $ hg ci -m a1 -A a -q
70 $ hg bookmark -i r1
70 $ hg bookmark -i r1
71 $ sed 's/1/11/;s/3/33/;s/5/55/' a > b
71 $ sed 's/1/11/;s/3/33/;s/5/55/' a > b
72 $ mv b a
72 $ mv b a
73 $ hg ci -m a2 -q
73 $ hg ci -m a2 -q
74 $ hg bookmark -i r2
74 $ hg bookmark -i r2
75
75
76 Cannot split a public changeset
76 Cannot split a public changeset
77
77
78 $ hg phase --public -r 'all()'
78 $ hg phase --public -r 'all()'
79 $ hg split .
79 $ hg split .
80 abort: cannot split public changeset
80 abort: cannot split public changesets
81 (see 'hg help phases' for details)
81 (see 'hg help phases' for details)
82 [255]
82 [255]
83
83
84 $ hg phase --draft -f -r 'all()'
84 $ hg phase --draft -f -r 'all()'
85
85
86 Cannot split while working directory is dirty
86 Cannot split while working directory is dirty
87
87
88 $ touch dirty
88 $ touch dirty
89 $ hg add dirty
89 $ hg add dirty
90 $ hg split .
90 $ hg split .
91 abort: uncommitted changes
91 abort: uncommitted changes
92 [255]
92 [255]
93 $ hg forget dirty
93 $ hg forget dirty
94 $ rm dirty
94 $ rm dirty
95
95
96 Make a clean directory for future tests to build off of
96 Make a clean directory for future tests to build off of
97
97
98 $ cp -R . ../clean
98 $ cp -R . ../clean
99
99
100 Split a head
100 Split a head
101
101
102 $ hg bookmark r3
102 $ hg bookmark r3
103
103
104 $ hg split 'all()'
104 $ hg split 'all()'
105 abort: cannot split multiple revisions
105 abort: cannot split multiple revisions
106 [255]
106 [255]
107
107
108 This function splits a bit strangely primarily to avoid changing the behavior of
108 This function splits a bit strangely primarily to avoid changing the behavior of
109 the test after a bug was fixed with how split/commit --interactive handled
109 the test after a bug was fixed with how split/commit --interactive handled
110 `commands.commit.interactive.unified=0`: when there were no context lines,
110 `commands.commit.interactive.unified=0`: when there were no context lines,
111 it kept only the last diff hunk. When running split, this meant that runsplit
111 it kept only the last diff hunk. When running split, this meant that runsplit
112 was always recording three commits, one for each diff hunk, in reverse order
112 was always recording three commits, one for each diff hunk, in reverse order
113 (the base commit was the last diff hunk in the file).
113 (the base commit was the last diff hunk in the file).
114 $ runsplit() {
114 $ runsplit() {
115 > cat > $TESTTMP/messages <<EOF
115 > cat > $TESTTMP/messages <<EOF
116 > split 1
116 > split 1
117 > --
117 > --
118 > split 2
118 > split 2
119 > --
119 > --
120 > split 3
120 > split 3
121 > EOF
121 > EOF
122 > cat <<EOF | hg split "$@"
122 > cat <<EOF | hg split "$@"
123 > y
123 > y
124 > n
124 > n
125 > n
125 > n
126 > y
126 > y
127 > y
127 > y
128 > n
128 > n
129 > y
129 > y
130 > y
130 > y
131 > y
131 > y
132 > EOF
132 > EOF
133 > }
133 > }
134
134
135 $ HGEDITOR=false runsplit
135 $ HGEDITOR=false runsplit
136 diff --git a/a b/a
136 diff --git a/a b/a
137 3 hunks, 3 lines changed
137 3 hunks, 3 lines changed
138 examine changes to 'a'?
138 examine changes to 'a'?
139 (enter ? for help) [Ynesfdaq?] y
139 (enter ? for help) [Ynesfdaq?] y
140
140
141 @@ -1,1 +1,1 @@
141 @@ -1,1 +1,1 @@
142 -1
142 -1
143 +11
143 +11
144 record change 1/3 to 'a'?
144 record change 1/3 to 'a'?
145 (enter ? for help) [Ynesfdaq?] n
145 (enter ? for help) [Ynesfdaq?] n
146
146
147 @@ -3,1 +3,1 @@ 2
147 @@ -3,1 +3,1 @@ 2
148 -3
148 -3
149 +33
149 +33
150 record change 2/3 to 'a'?
150 record change 2/3 to 'a'?
151 (enter ? for help) [Ynesfdaq?] n
151 (enter ? for help) [Ynesfdaq?] n
152
152
153 @@ -5,1 +5,1 @@ 4
153 @@ -5,1 +5,1 @@ 4
154 -5
154 -5
155 +55
155 +55
156 record change 3/3 to 'a'?
156 record change 3/3 to 'a'?
157 (enter ? for help) [Ynesfdaq?] y
157 (enter ? for help) [Ynesfdaq?] y
158
158
159 transaction abort!
159 transaction abort!
160 rollback completed
160 rollback completed
161 abort: edit failed: false exited with status 1
161 abort: edit failed: false exited with status 1
162 [255]
162 [255]
163 $ hg status
163 $ hg status
164
164
165 $ HGEDITOR="\"$PYTHON\" $TESTTMP/editor.py"
165 $ HGEDITOR="\"$PYTHON\" $TESTTMP/editor.py"
166 $ runsplit
166 $ runsplit
167 diff --git a/a b/a
167 diff --git a/a b/a
168 3 hunks, 3 lines changed
168 3 hunks, 3 lines changed
169 examine changes to 'a'?
169 examine changes to 'a'?
170 (enter ? for help) [Ynesfdaq?] y
170 (enter ? for help) [Ynesfdaq?] y
171
171
172 @@ -1,1 +1,1 @@
172 @@ -1,1 +1,1 @@
173 -1
173 -1
174 +11
174 +11
175 record change 1/3 to 'a'?
175 record change 1/3 to 'a'?
176 (enter ? for help) [Ynesfdaq?] n
176 (enter ? for help) [Ynesfdaq?] n
177
177
178 @@ -3,1 +3,1 @@ 2
178 @@ -3,1 +3,1 @@ 2
179 -3
179 -3
180 +33
180 +33
181 record change 2/3 to 'a'?
181 record change 2/3 to 'a'?
182 (enter ? for help) [Ynesfdaq?] n
182 (enter ? for help) [Ynesfdaq?] n
183
183
184 @@ -5,1 +5,1 @@ 4
184 @@ -5,1 +5,1 @@ 4
185 -5
185 -5
186 +55
186 +55
187 record change 3/3 to 'a'?
187 record change 3/3 to 'a'?
188 (enter ? for help) [Ynesfdaq?] y
188 (enter ? for help) [Ynesfdaq?] y
189
189
190 EDITOR: HG: Splitting 1df0d5c5a3ab. Write commit message for the first split changeset.
190 EDITOR: HG: Splitting 1df0d5c5a3ab. Write commit message for the first split changeset.
191 EDITOR: a2
191 EDITOR: a2
192 EDITOR:
192 EDITOR:
193 EDITOR:
193 EDITOR:
194 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
194 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
195 EDITOR: HG: Leave message empty to abort commit.
195 EDITOR: HG: Leave message empty to abort commit.
196 EDITOR: HG: --
196 EDITOR: HG: --
197 EDITOR: HG: user: test
197 EDITOR: HG: user: test
198 EDITOR: HG: branch 'default'
198 EDITOR: HG: branch 'default'
199 EDITOR: HG: changed a
199 EDITOR: HG: changed a
200 created new head
200 created new head
201 diff --git a/a b/a
201 diff --git a/a b/a
202 2 hunks, 2 lines changed
202 2 hunks, 2 lines changed
203 examine changes to 'a'?
203 examine changes to 'a'?
204 (enter ? for help) [Ynesfdaq?] y
204 (enter ? for help) [Ynesfdaq?] y
205
205
206 @@ -1,1 +1,1 @@
206 @@ -1,1 +1,1 @@
207 -1
207 -1
208 +11
208 +11
209 record change 1/2 to 'a'?
209 record change 1/2 to 'a'?
210 (enter ? for help) [Ynesfdaq?] n
210 (enter ? for help) [Ynesfdaq?] n
211
211
212 @@ -3,1 +3,1 @@ 2
212 @@ -3,1 +3,1 @@ 2
213 -3
213 -3
214 +33
214 +33
215 record change 2/2 to 'a'?
215 record change 2/2 to 'a'?
216 (enter ? for help) [Ynesfdaq?] y
216 (enter ? for help) [Ynesfdaq?] y
217
217
218 EDITOR: HG: Splitting 1df0d5c5a3ab. So far it has been split into:
218 EDITOR: HG: Splitting 1df0d5c5a3ab. So far it has been split into:
219 EDITOR: HG: - e704349bd21b: split 1
219 EDITOR: HG: - e704349bd21b: split 1
220 EDITOR: HG: Write commit message for the next split changeset.
220 EDITOR: HG: Write commit message for the next split changeset.
221 EDITOR: a2
221 EDITOR: a2
222 EDITOR:
222 EDITOR:
223 EDITOR:
223 EDITOR:
224 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
224 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
225 EDITOR: HG: Leave message empty to abort commit.
225 EDITOR: HG: Leave message empty to abort commit.
226 EDITOR: HG: --
226 EDITOR: HG: --
227 EDITOR: HG: user: test
227 EDITOR: HG: user: test
228 EDITOR: HG: branch 'default'
228 EDITOR: HG: branch 'default'
229 EDITOR: HG: changed a
229 EDITOR: HG: changed a
230 diff --git a/a b/a
230 diff --git a/a b/a
231 1 hunks, 1 lines changed
231 1 hunks, 1 lines changed
232 examine changes to 'a'?
232 examine changes to 'a'?
233 (enter ? for help) [Ynesfdaq?] y
233 (enter ? for help) [Ynesfdaq?] y
234
234
235 @@ -1,1 +1,1 @@
235 @@ -1,1 +1,1 @@
236 -1
236 -1
237 +11
237 +11
238 record this change to 'a'?
238 record this change to 'a'?
239 (enter ? for help) [Ynesfdaq?] y
239 (enter ? for help) [Ynesfdaq?] y
240
240
241 EDITOR: HG: Splitting 1df0d5c5a3ab. So far it has been split into:
241 EDITOR: HG: Splitting 1df0d5c5a3ab. So far it has been split into:
242 EDITOR: HG: - e704349bd21b: split 1
242 EDITOR: HG: - e704349bd21b: split 1
243 EDITOR: HG: - a09ad58faae3: split 2
243 EDITOR: HG: - a09ad58faae3: split 2
244 EDITOR: HG: Write commit message for the next split changeset.
244 EDITOR: HG: Write commit message for the next split changeset.
245 EDITOR: a2
245 EDITOR: a2
246 EDITOR:
246 EDITOR:
247 EDITOR:
247 EDITOR:
248 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
248 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
249 EDITOR: HG: Leave message empty to abort commit.
249 EDITOR: HG: Leave message empty to abort commit.
250 EDITOR: HG: --
250 EDITOR: HG: --
251 EDITOR: HG: user: test
251 EDITOR: HG: user: test
252 EDITOR: HG: branch 'default'
252 EDITOR: HG: branch 'default'
253 EDITOR: HG: changed a
253 EDITOR: HG: changed a
254 saved backup bundle to $TESTTMP/a/.hg/strip-backup/1df0d5c5a3ab-8341b760-split.hg (obsstore-off !)
254 saved backup bundle to $TESTTMP/a/.hg/strip-backup/1df0d5c5a3ab-8341b760-split.hg (obsstore-off !)
255
255
256 #if obsstore-off
256 #if obsstore-off
257 $ hg bookmark
257 $ hg bookmark
258 r1 0:a61bcde8c529
258 r1 0:a61bcde8c529
259 r2 3:00eebaf8d2e2
259 r2 3:00eebaf8d2e2
260 * r3 3:00eebaf8d2e2
260 * r3 3:00eebaf8d2e2
261 $ hg glog -p
261 $ hg glog -p
262 @ 3:00eebaf8d2e2 split 3 r2 r3
262 @ 3:00eebaf8d2e2 split 3 r2 r3
263 | diff --git a/a b/a
263 | diff --git a/a b/a
264 | --- a/a
264 | --- a/a
265 | +++ b/a
265 | +++ b/a
266 | @@ -1,1 +1,1 @@
266 | @@ -1,1 +1,1 @@
267 | -1
267 | -1
268 | +11
268 | +11
269 |
269 |
270 o 2:a09ad58faae3 split 2
270 o 2:a09ad58faae3 split 2
271 | diff --git a/a b/a
271 | diff --git a/a b/a
272 | --- a/a
272 | --- a/a
273 | +++ b/a
273 | +++ b/a
274 | @@ -3,1 +3,1 @@
274 | @@ -3,1 +3,1 @@
275 | -3
275 | -3
276 | +33
276 | +33
277 |
277 |
278 o 1:e704349bd21b split 1
278 o 1:e704349bd21b split 1
279 | diff --git a/a b/a
279 | diff --git a/a b/a
280 | --- a/a
280 | --- a/a
281 | +++ b/a
281 | +++ b/a
282 | @@ -5,1 +5,1 @@
282 | @@ -5,1 +5,1 @@
283 | -5
283 | -5
284 | +55
284 | +55
285 |
285 |
286 o 0:a61bcde8c529 a1 r1
286 o 0:a61bcde8c529 a1 r1
287 diff --git a/a b/a
287 diff --git a/a b/a
288 new file mode 100644
288 new file mode 100644
289 --- /dev/null
289 --- /dev/null
290 +++ b/a
290 +++ b/a
291 @@ -0,0 +1,5 @@
291 @@ -0,0 +1,5 @@
292 +1
292 +1
293 +2
293 +2
294 +3
294 +3
295 +4
295 +4
296 +5
296 +5
297
297
298 #else
298 #else
299 $ hg bookmark
299 $ hg bookmark
300 r1 0:a61bcde8c529
300 r1 0:a61bcde8c529
301 r2 4:00eebaf8d2e2
301 r2 4:00eebaf8d2e2
302 * r3 4:00eebaf8d2e2
302 * r3 4:00eebaf8d2e2
303 $ hg glog
303 $ hg glog
304 @ 4:00eebaf8d2e2 split 3 r2 r3
304 @ 4:00eebaf8d2e2 split 3 r2 r3
305 |
305 |
306 o 3:a09ad58faae3 split 2
306 o 3:a09ad58faae3 split 2
307 |
307 |
308 o 2:e704349bd21b split 1
308 o 2:e704349bd21b split 1
309 |
309 |
310 o 0:a61bcde8c529 a1 r1
310 o 0:a61bcde8c529 a1 r1
311
311
312 #endif
312 #endif
313
313
314 Split a head while working parent is not that head
314 Split a head while working parent is not that head
315
315
316 $ cp -R $TESTTMP/clean $TESTTMP/b
316 $ cp -R $TESTTMP/clean $TESTTMP/b
317 $ cd $TESTTMP/b
317 $ cd $TESTTMP/b
318
318
319 $ hg up 0 -q
319 $ hg up 0 -q
320 $ hg bookmark r3
320 $ hg bookmark r3
321
321
322 $ runsplit tip >/dev/null
322 $ runsplit tip >/dev/null
323
323
324 #if obsstore-off
324 #if obsstore-off
325 $ hg bookmark
325 $ hg bookmark
326 r1 0:a61bcde8c529
326 r1 0:a61bcde8c529
327 r2 3:00eebaf8d2e2
327 r2 3:00eebaf8d2e2
328 * r3 0:a61bcde8c529
328 * r3 0:a61bcde8c529
329 $ hg glog
329 $ hg glog
330 o 3:00eebaf8d2e2 split 3 r2
330 o 3:00eebaf8d2e2 split 3 r2
331 |
331 |
332 o 2:a09ad58faae3 split 2
332 o 2:a09ad58faae3 split 2
333 |
333 |
334 o 1:e704349bd21b split 1
334 o 1:e704349bd21b split 1
335 |
335 |
336 @ 0:a61bcde8c529 a1 r1 r3
336 @ 0:a61bcde8c529 a1 r1 r3
337
337
338 #else
338 #else
339 $ hg bookmark
339 $ hg bookmark
340 r1 0:a61bcde8c529
340 r1 0:a61bcde8c529
341 r2 4:00eebaf8d2e2
341 r2 4:00eebaf8d2e2
342 * r3 0:a61bcde8c529
342 * r3 0:a61bcde8c529
343 $ hg glog
343 $ hg glog
344 o 4:00eebaf8d2e2 split 3 r2
344 o 4:00eebaf8d2e2 split 3 r2
345 |
345 |
346 o 3:a09ad58faae3 split 2
346 o 3:a09ad58faae3 split 2
347 |
347 |
348 o 2:e704349bd21b split 1
348 o 2:e704349bd21b split 1
349 |
349 |
350 @ 0:a61bcde8c529 a1 r1 r3
350 @ 0:a61bcde8c529 a1 r1 r3
351
351
352 #endif
352 #endif
353
353
354 Split a non-head
354 Split a non-head
355
355
356 $ cp -R $TESTTMP/clean $TESTTMP/c
356 $ cp -R $TESTTMP/clean $TESTTMP/c
357 $ cd $TESTTMP/c
357 $ cd $TESTTMP/c
358 $ echo d > d
358 $ echo d > d
359 $ hg ci -m d1 -A d
359 $ hg ci -m d1 -A d
360 $ hg bookmark -i d1
360 $ hg bookmark -i d1
361 $ echo 2 >> d
361 $ echo 2 >> d
362 $ hg ci -m d2
362 $ hg ci -m d2
363 $ echo 3 >> d
363 $ echo 3 >> d
364 $ hg ci -m d3
364 $ hg ci -m d3
365 $ hg bookmark -i d3
365 $ hg bookmark -i d3
366 $ hg up '.^' -q
366 $ hg up '.^' -q
367 $ hg bookmark d2
367 $ hg bookmark d2
368 $ cp -R . ../d
368 $ cp -R . ../d
369
369
370 $ runsplit -r 1 | grep rebasing
370 $ runsplit -r 1 | grep rebasing
371 rebasing 2:b5c5ea414030 "d1" (d1)
371 rebasing 2:b5c5ea414030 "d1" (d1)
372 rebasing 3:f4a0a8d004cc "d2" (d2)
372 rebasing 3:f4a0a8d004cc "d2" (d2)
373 rebasing 4:777940761eba "d3" (d3)
373 rebasing 4:777940761eba "d3" (d3)
374 #if obsstore-off
374 #if obsstore-off
375 $ hg bookmark
375 $ hg bookmark
376 d1 4:c4b449ef030e
376 d1 4:c4b449ef030e
377 * d2 5:c9dd00ab36a3
377 * d2 5:c9dd00ab36a3
378 d3 6:19f476bc865c
378 d3 6:19f476bc865c
379 r1 0:a61bcde8c529
379 r1 0:a61bcde8c529
380 r2 3:00eebaf8d2e2
380 r2 3:00eebaf8d2e2
381 $ hg glog -p
381 $ hg glog -p
382 o 6:19f476bc865c d3 d3
382 o 6:19f476bc865c d3 d3
383 | diff --git a/d b/d
383 | diff --git a/d b/d
384 | --- a/d
384 | --- a/d
385 | +++ b/d
385 | +++ b/d
386 | @@ -2,0 +3,1 @@
386 | @@ -2,0 +3,1 @@
387 | +3
387 | +3
388 |
388 |
389 @ 5:c9dd00ab36a3 d2 d2
389 @ 5:c9dd00ab36a3 d2 d2
390 | diff --git a/d b/d
390 | diff --git a/d b/d
391 | --- a/d
391 | --- a/d
392 | +++ b/d
392 | +++ b/d
393 | @@ -1,0 +2,1 @@
393 | @@ -1,0 +2,1 @@
394 | +2
394 | +2
395 |
395 |
396 o 4:c4b449ef030e d1 d1
396 o 4:c4b449ef030e d1 d1
397 | diff --git a/d b/d
397 | diff --git a/d b/d
398 | new file mode 100644
398 | new file mode 100644
399 | --- /dev/null
399 | --- /dev/null
400 | +++ b/d
400 | +++ b/d
401 | @@ -0,0 +1,1 @@
401 | @@ -0,0 +1,1 @@
402 | +d
402 | +d
403 |
403 |
404 o 3:00eebaf8d2e2 split 3 r2
404 o 3:00eebaf8d2e2 split 3 r2
405 | diff --git a/a b/a
405 | diff --git a/a b/a
406 | --- a/a
406 | --- a/a
407 | +++ b/a
407 | +++ b/a
408 | @@ -1,1 +1,1 @@
408 | @@ -1,1 +1,1 @@
409 | -1
409 | -1
410 | +11
410 | +11
411 |
411 |
412 o 2:a09ad58faae3 split 2
412 o 2:a09ad58faae3 split 2
413 | diff --git a/a b/a
413 | diff --git a/a b/a
414 | --- a/a
414 | --- a/a
415 | +++ b/a
415 | +++ b/a
416 | @@ -3,1 +3,1 @@
416 | @@ -3,1 +3,1 @@
417 | -3
417 | -3
418 | +33
418 | +33
419 |
419 |
420 o 1:e704349bd21b split 1
420 o 1:e704349bd21b split 1
421 | diff --git a/a b/a
421 | diff --git a/a b/a
422 | --- a/a
422 | --- a/a
423 | +++ b/a
423 | +++ b/a
424 | @@ -5,1 +5,1 @@
424 | @@ -5,1 +5,1 @@
425 | -5
425 | -5
426 | +55
426 | +55
427 |
427 |
428 o 0:a61bcde8c529 a1 r1
428 o 0:a61bcde8c529 a1 r1
429 diff --git a/a b/a
429 diff --git a/a b/a
430 new file mode 100644
430 new file mode 100644
431 --- /dev/null
431 --- /dev/null
432 +++ b/a
432 +++ b/a
433 @@ -0,0 +1,5 @@
433 @@ -0,0 +1,5 @@
434 +1
434 +1
435 +2
435 +2
436 +3
436 +3
437 +4
437 +4
438 +5
438 +5
439
439
440 #else
440 #else
441 $ hg bookmark
441 $ hg bookmark
442 d1 8:c4b449ef030e
442 d1 8:c4b449ef030e
443 * d2 9:c9dd00ab36a3
443 * d2 9:c9dd00ab36a3
444 d3 10:19f476bc865c
444 d3 10:19f476bc865c
445 r1 0:a61bcde8c529
445 r1 0:a61bcde8c529
446 r2 7:00eebaf8d2e2
446 r2 7:00eebaf8d2e2
447 $ hg glog
447 $ hg glog
448 o 10:19f476bc865c d3 d3
448 o 10:19f476bc865c d3 d3
449 |
449 |
450 @ 9:c9dd00ab36a3 d2 d2
450 @ 9:c9dd00ab36a3 d2 d2
451 |
451 |
452 o 8:c4b449ef030e d1 d1
452 o 8:c4b449ef030e d1 d1
453 |
453 |
454 o 7:00eebaf8d2e2 split 3 r2
454 o 7:00eebaf8d2e2 split 3 r2
455 |
455 |
456 o 6:a09ad58faae3 split 2
456 o 6:a09ad58faae3 split 2
457 |
457 |
458 o 5:e704349bd21b split 1
458 o 5:e704349bd21b split 1
459 |
459 |
460 o 0:a61bcde8c529 a1 r1
460 o 0:a61bcde8c529 a1 r1
461
461
462 #endif
462 #endif
463
463
464 Split a non-head without rebase
464 Split a non-head without rebase
465
465
466 $ cd $TESTTMP/d
466 $ cd $TESTTMP/d
467 #if obsstore-off
467 #if obsstore-off
468 $ runsplit -r 1 --no-rebase
468 $ runsplit -r 1 --no-rebase
469 abort: cannot split changeset with children without rebase
469 abort: cannot split changeset with children
470 [255]
470 [255]
471 #else
471 #else
472 $ runsplit -r 1 --no-rebase >/dev/null
472 $ runsplit -r 1 --no-rebase >/dev/null
473 3 new orphan changesets
473 3 new orphan changesets
474 $ hg bookmark
474 $ hg bookmark
475 d1 2:b5c5ea414030
475 d1 2:b5c5ea414030
476 * d2 3:f4a0a8d004cc
476 * d2 3:f4a0a8d004cc
477 d3 4:777940761eba
477 d3 4:777940761eba
478 r1 0:a61bcde8c529
478 r1 0:a61bcde8c529
479 r2 7:00eebaf8d2e2
479 r2 7:00eebaf8d2e2
480
480
481 $ hg glog
481 $ hg glog
482 o 7:00eebaf8d2e2 split 3 r2
482 o 7:00eebaf8d2e2 split 3 r2
483 |
483 |
484 o 6:a09ad58faae3 split 2
484 o 6:a09ad58faae3 split 2
485 |
485 |
486 o 5:e704349bd21b split 1
486 o 5:e704349bd21b split 1
487 |
487 |
488 | * 4:777940761eba d3 d3
488 | * 4:777940761eba d3 d3
489 | |
489 | |
490 | @ 3:f4a0a8d004cc d2 d2
490 | @ 3:f4a0a8d004cc d2 d2
491 | |
491 | |
492 | * 2:b5c5ea414030 d1 d1
492 | * 2:b5c5ea414030 d1 d1
493 | |
493 | |
494 | x 1:1df0d5c5a3ab a2
494 | x 1:1df0d5c5a3ab a2
495 |/
495 |/
496 o 0:a61bcde8c529 a1 r1
496 o 0:a61bcde8c529 a1 r1
497
497
498 #endif
498 #endif
499
499
500 Split a non-head with obsoleted descendants
500 Split a non-head with obsoleted descendants
501
501
502 #if obsstore-on
502 #if obsstore-on
503 $ hg init $TESTTMP/e
503 $ hg init $TESTTMP/e
504 $ cd $TESTTMP/e
504 $ cd $TESTTMP/e
505 $ hg debugdrawdag <<'EOS'
505 $ hg debugdrawdag <<'EOS'
506 > H I J
506 > H I J
507 > | | |
507 > | | |
508 > F G1 G2 # amend: G1 -> G2
508 > F G1 G2 # amend: G1 -> G2
509 > | | / # prune: F
509 > | | / # prune: F
510 > C D E
510 > C D E
511 > \|/
511 > \|/
512 > B
512 > B
513 > |
513 > |
514 > A
514 > A
515 > EOS
515 > EOS
516 2 new orphan changesets
516 2 new orphan changesets
517 $ eval `hg tags -T '{tag}={node}\n'`
517 $ eval `hg tags -T '{tag}={node}\n'`
518 $ rm .hg/localtags
518 $ rm .hg/localtags
519 $ hg split $B --config experimental.evolution=createmarkers
519 $ hg split $B --config experimental.evolution=createmarkers
520 abort: split would leave orphaned changesets behind
520 abort: cannot split changeset with children
521 [255]
521 [255]
522 $ cat > $TESTTMP/messages <<EOF
522 $ cat > $TESTTMP/messages <<EOF
523 > Split B
523 > Split B
524 > EOF
524 > EOF
525 $ cat <<EOF | hg split $B
525 $ cat <<EOF | hg split $B
526 > y
526 > y
527 > y
527 > y
528 > EOF
528 > EOF
529 diff --git a/B b/B
529 diff --git a/B b/B
530 new file mode 100644
530 new file mode 100644
531 examine changes to 'B'?
531 examine changes to 'B'?
532 (enter ? for help) [Ynesfdaq?] y
532 (enter ? for help) [Ynesfdaq?] y
533
533
534 @@ -0,0 +1,1 @@
534 @@ -0,0 +1,1 @@
535 +B
535 +B
536 \ No newline at end of file
536 \ No newline at end of file
537 record this change to 'B'?
537 record this change to 'B'?
538 (enter ? for help) [Ynesfdaq?] y
538 (enter ? for help) [Ynesfdaq?] y
539
539
540 EDITOR: HG: Splitting 112478962961. Write commit message for the first split changeset.
540 EDITOR: HG: Splitting 112478962961. Write commit message for the first split changeset.
541 EDITOR: B
541 EDITOR: B
542 EDITOR:
542 EDITOR:
543 EDITOR:
543 EDITOR:
544 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
544 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
545 EDITOR: HG: Leave message empty to abort commit.
545 EDITOR: HG: Leave message empty to abort commit.
546 EDITOR: HG: --
546 EDITOR: HG: --
547 EDITOR: HG: user: test
547 EDITOR: HG: user: test
548 EDITOR: HG: branch 'default'
548 EDITOR: HG: branch 'default'
549 EDITOR: HG: added B
549 EDITOR: HG: added B
550 created new head
550 created new head
551 rebasing 2:26805aba1e60 "C"
551 rebasing 2:26805aba1e60 "C"
552 rebasing 3:be0ef73c17ad "D"
552 rebasing 3:be0ef73c17ad "D"
553 rebasing 4:49cb92066bfd "E"
553 rebasing 4:49cb92066bfd "E"
554 rebasing 7:97a6268cc7ef "G2"
554 rebasing 7:97a6268cc7ef "G2"
555 rebasing 10:e2f1e425c0db "J"
555 rebasing 10:e2f1e425c0db "J"
556 $ hg glog -r 'sort(all(), topo)'
556 $ hg glog -r 'sort(all(), topo)'
557 o 16:556c085f8b52 J
557 o 16:556c085f8b52 J
558 |
558 |
559 o 15:8761f6c9123f G2
559 o 15:8761f6c9123f G2
560 |
560 |
561 o 14:a7aeffe59b65 E
561 o 14:a7aeffe59b65 E
562 |
562 |
563 | o 13:e1e914ede9ab D
563 | o 13:e1e914ede9ab D
564 |/
564 |/
565 | o 12:01947e9b98aa C
565 | o 12:01947e9b98aa C
566 |/
566 |/
567 o 11:0947baa74d47 Split B
567 o 11:0947baa74d47 Split B
568 |
568 |
569 | * 9:88ede1d5ee13 I
569 | * 9:88ede1d5ee13 I
570 | |
570 | |
571 | x 6:af8cbf225b7b G1
571 | x 6:af8cbf225b7b G1
572 | |
572 | |
573 | x 3:be0ef73c17ad D
573 | x 3:be0ef73c17ad D
574 | |
574 | |
575 | | * 8:74863e5b5074 H
575 | | * 8:74863e5b5074 H
576 | | |
576 | | |
577 | | x 5:ee481a2a1e69 F
577 | | x 5:ee481a2a1e69 F
578 | | |
578 | | |
579 | | x 2:26805aba1e60 C
579 | | x 2:26805aba1e60 C
580 | |/
580 | |/
581 | x 1:112478962961 B
581 | x 1:112478962961 B
582 |/
582 |/
583 o 0:426bada5c675 A
583 o 0:426bada5c675 A
584
584
585 #endif
585 #endif
586
586
587 Preserve secret phase in split
587 Preserve secret phase in split
588
588
589 $ cp -R $TESTTMP/clean $TESTTMP/phases1
589 $ cp -R $TESTTMP/clean $TESTTMP/phases1
590 $ cd $TESTTMP/phases1
590 $ cd $TESTTMP/phases1
591 $ hg phase --secret -fr tip
591 $ hg phase --secret -fr tip
592 $ hg log -T '{short(node)} {phase}\n'
592 $ hg log -T '{short(node)} {phase}\n'
593 1df0d5c5a3ab secret
593 1df0d5c5a3ab secret
594 a61bcde8c529 draft
594 a61bcde8c529 draft
595 $ runsplit tip >/dev/null
595 $ runsplit tip >/dev/null
596 $ hg log -T '{short(node)} {phase}\n'
596 $ hg log -T '{short(node)} {phase}\n'
597 00eebaf8d2e2 secret
597 00eebaf8d2e2 secret
598 a09ad58faae3 secret
598 a09ad58faae3 secret
599 e704349bd21b secret
599 e704349bd21b secret
600 a61bcde8c529 draft
600 a61bcde8c529 draft
601
601
602 Do not move things to secret even if phases.new-commit=secret
602 Do not move things to secret even if phases.new-commit=secret
603
603
604 $ cp -R $TESTTMP/clean $TESTTMP/phases2
604 $ cp -R $TESTTMP/clean $TESTTMP/phases2
605 $ cd $TESTTMP/phases2
605 $ cd $TESTTMP/phases2
606 $ cat >> .hg/hgrc <<EOF
606 $ cat >> .hg/hgrc <<EOF
607 > [phases]
607 > [phases]
608 > new-commit=secret
608 > new-commit=secret
609 > EOF
609 > EOF
610 $ hg log -T '{short(node)} {phase}\n'
610 $ hg log -T '{short(node)} {phase}\n'
611 1df0d5c5a3ab draft
611 1df0d5c5a3ab draft
612 a61bcde8c529 draft
612 a61bcde8c529 draft
613 $ runsplit tip >/dev/null
613 $ runsplit tip >/dev/null
614 $ hg log -T '{short(node)} {phase}\n'
614 $ hg log -T '{short(node)} {phase}\n'
615 00eebaf8d2e2 draft
615 00eebaf8d2e2 draft
616 a09ad58faae3 draft
616 a09ad58faae3 draft
617 e704349bd21b draft
617 e704349bd21b draft
618 a61bcde8c529 draft
618 a61bcde8c529 draft
619
619
620 `hg split` with ignoreblanklines=1 does not infinite loop
620 `hg split` with ignoreblanklines=1 does not infinite loop
621
621
622 $ mkdir $TESTTMP/f
622 $ mkdir $TESTTMP/f
623 $ hg init $TESTTMP/f/a
623 $ hg init $TESTTMP/f/a
624 $ cd $TESTTMP/f/a
624 $ cd $TESTTMP/f/a
625 $ printf '1\n2\n3\n4\n5\n' > foo
625 $ printf '1\n2\n3\n4\n5\n' > foo
626 $ cp foo bar
626 $ cp foo bar
627 $ hg ci -qAm initial
627 $ hg ci -qAm initial
628 $ printf '1\n\n2\n3\ntest\n4\n5\n' > bar
628 $ printf '1\n\n2\n3\ntest\n4\n5\n' > bar
629 $ printf '1\n2\n3\ntest\n4\n5\n' > foo
629 $ printf '1\n2\n3\ntest\n4\n5\n' > foo
630 $ hg ci -qm splitme
630 $ hg ci -qm splitme
631 $ cat > $TESTTMP/messages <<EOF
631 $ cat > $TESTTMP/messages <<EOF
632 > split 1
632 > split 1
633 > --
633 > --
634 > split 2
634 > split 2
635 > EOF
635 > EOF
636 $ printf 'f\nn\nf\n' | hg --config extensions.split= --config diff.ignoreblanklines=1 split
636 $ printf 'f\nn\nf\n' | hg --config extensions.split= --config diff.ignoreblanklines=1 split
637 diff --git a/bar b/bar
637 diff --git a/bar b/bar
638 2 hunks, 2 lines changed
638 2 hunks, 2 lines changed
639 examine changes to 'bar'?
639 examine changes to 'bar'?
640 (enter ? for help) [Ynesfdaq?] f
640 (enter ? for help) [Ynesfdaq?] f
641
641
642 diff --git a/foo b/foo
642 diff --git a/foo b/foo
643 1 hunks, 1 lines changed
643 1 hunks, 1 lines changed
644 examine changes to 'foo'?
644 examine changes to 'foo'?
645 (enter ? for help) [Ynesfdaq?] n
645 (enter ? for help) [Ynesfdaq?] n
646
646
647 EDITOR: HG: Splitting dd3c45017cbf. Write commit message for the first split changeset.
647 EDITOR: HG: Splitting dd3c45017cbf. Write commit message for the first split changeset.
648 EDITOR: splitme
648 EDITOR: splitme
649 EDITOR:
649 EDITOR:
650 EDITOR:
650 EDITOR:
651 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
651 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
652 EDITOR: HG: Leave message empty to abort commit.
652 EDITOR: HG: Leave message empty to abort commit.
653 EDITOR: HG: --
653 EDITOR: HG: --
654 EDITOR: HG: user: test
654 EDITOR: HG: user: test
655 EDITOR: HG: branch 'default'
655 EDITOR: HG: branch 'default'
656 EDITOR: HG: changed bar
656 EDITOR: HG: changed bar
657 created new head
657 created new head
658 diff --git a/foo b/foo
658 diff --git a/foo b/foo
659 1 hunks, 1 lines changed
659 1 hunks, 1 lines changed
660 examine changes to 'foo'?
660 examine changes to 'foo'?
661 (enter ? for help) [Ynesfdaq?] f
661 (enter ? for help) [Ynesfdaq?] f
662
662
663 EDITOR: HG: Splitting dd3c45017cbf. So far it has been split into:
663 EDITOR: HG: Splitting dd3c45017cbf. So far it has been split into:
664 EDITOR: HG: - f205aea1c624: split 1
664 EDITOR: HG: - f205aea1c624: split 1
665 EDITOR: HG: Write commit message for the next split changeset.
665 EDITOR: HG: Write commit message for the next split changeset.
666 EDITOR: splitme
666 EDITOR: splitme
667 EDITOR:
667 EDITOR:
668 EDITOR:
668 EDITOR:
669 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
669 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
670 EDITOR: HG: Leave message empty to abort commit.
670 EDITOR: HG: Leave message empty to abort commit.
671 EDITOR: HG: --
671 EDITOR: HG: --
672 EDITOR: HG: user: test
672 EDITOR: HG: user: test
673 EDITOR: HG: branch 'default'
673 EDITOR: HG: branch 'default'
674 EDITOR: HG: changed foo
674 EDITOR: HG: changed foo
675 saved backup bundle to $TESTTMP/f/a/.hg/strip-backup/dd3c45017cbf-463441b5-split.hg (obsstore-off !)
675 saved backup bundle to $TESTTMP/f/a/.hg/strip-backup/dd3c45017cbf-463441b5-split.hg (obsstore-off !)
676
676
677 Let's try that again, with a slightly different set of patches, to ensure that
677 Let's try that again, with a slightly different set of patches, to ensure that
678 the ignoreblanklines thing isn't somehow position dependent.
678 the ignoreblanklines thing isn't somehow position dependent.
679
679
680 $ hg init $TESTTMP/f/b
680 $ hg init $TESTTMP/f/b
681 $ cd $TESTTMP/f/b
681 $ cd $TESTTMP/f/b
682 $ printf '1\n2\n3\n4\n5\n' > foo
682 $ printf '1\n2\n3\n4\n5\n' > foo
683 $ cp foo bar
683 $ cp foo bar
684 $ hg ci -qAm initial
684 $ hg ci -qAm initial
685 $ printf '1\n2\n3\ntest\n4\n5\n' > bar
685 $ printf '1\n2\n3\ntest\n4\n5\n' > bar
686 $ printf '1\n2\n3\ntest\n4\n\n5\n' > foo
686 $ printf '1\n2\n3\ntest\n4\n\n5\n' > foo
687 $ hg ci -qm splitme
687 $ hg ci -qm splitme
688 $ cat > $TESTTMP/messages <<EOF
688 $ cat > $TESTTMP/messages <<EOF
689 > split 1
689 > split 1
690 > --
690 > --
691 > split 2
691 > split 2
692 > EOF
692 > EOF
693 $ printf 'f\nn\nf\n' | hg --config extensions.split= --config diff.ignoreblanklines=1 split
693 $ printf 'f\nn\nf\n' | hg --config extensions.split= --config diff.ignoreblanklines=1 split
694 diff --git a/bar b/bar
694 diff --git a/bar b/bar
695 1 hunks, 1 lines changed
695 1 hunks, 1 lines changed
696 examine changes to 'bar'?
696 examine changes to 'bar'?
697 (enter ? for help) [Ynesfdaq?] f
697 (enter ? for help) [Ynesfdaq?] f
698
698
699 diff --git a/foo b/foo
699 diff --git a/foo b/foo
700 2 hunks, 2 lines changed
700 2 hunks, 2 lines changed
701 examine changes to 'foo'?
701 examine changes to 'foo'?
702 (enter ? for help) [Ynesfdaq?] n
702 (enter ? for help) [Ynesfdaq?] n
703
703
704 EDITOR: HG: Splitting 904c80b40a4a. Write commit message for the first split changeset.
704 EDITOR: HG: Splitting 904c80b40a4a. Write commit message for the first split changeset.
705 EDITOR: splitme
705 EDITOR: splitme
706 EDITOR:
706 EDITOR:
707 EDITOR:
707 EDITOR:
708 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
708 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
709 EDITOR: HG: Leave message empty to abort commit.
709 EDITOR: HG: Leave message empty to abort commit.
710 EDITOR: HG: --
710 EDITOR: HG: --
711 EDITOR: HG: user: test
711 EDITOR: HG: user: test
712 EDITOR: HG: branch 'default'
712 EDITOR: HG: branch 'default'
713 EDITOR: HG: changed bar
713 EDITOR: HG: changed bar
714 created new head
714 created new head
715 diff --git a/foo b/foo
715 diff --git a/foo b/foo
716 2 hunks, 2 lines changed
716 2 hunks, 2 lines changed
717 examine changes to 'foo'?
717 examine changes to 'foo'?
718 (enter ? for help) [Ynesfdaq?] f
718 (enter ? for help) [Ynesfdaq?] f
719
719
720 EDITOR: HG: Splitting 904c80b40a4a. So far it has been split into:
720 EDITOR: HG: Splitting 904c80b40a4a. So far it has been split into:
721 EDITOR: HG: - ffecf40fa954: split 1
721 EDITOR: HG: - ffecf40fa954: split 1
722 EDITOR: HG: Write commit message for the next split changeset.
722 EDITOR: HG: Write commit message for the next split changeset.
723 EDITOR: splitme
723 EDITOR: splitme
724 EDITOR:
724 EDITOR:
725 EDITOR:
725 EDITOR:
726 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
726 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
727 EDITOR: HG: Leave message empty to abort commit.
727 EDITOR: HG: Leave message empty to abort commit.
728 EDITOR: HG: --
728 EDITOR: HG: --
729 EDITOR: HG: user: test
729 EDITOR: HG: user: test
730 EDITOR: HG: branch 'default'
730 EDITOR: HG: branch 'default'
731 EDITOR: HG: changed foo
731 EDITOR: HG: changed foo
732 saved backup bundle to $TESTTMP/f/b/.hg/strip-backup/904c80b40a4a-47fb907f-split.hg (obsstore-off !)
732 saved backup bundle to $TESTTMP/f/b/.hg/strip-backup/904c80b40a4a-47fb907f-split.hg (obsstore-off !)
733
733
734
734
735 Testing the case in split when commiting flag-only file changes (issue5864)
735 Testing the case in split when commiting flag-only file changes (issue5864)
736 ---------------------------------------------------------------------------
736 ---------------------------------------------------------------------------
737 $ hg init $TESTTMP/issue5864
737 $ hg init $TESTTMP/issue5864
738 $ cd $TESTTMP/issue5864
738 $ cd $TESTTMP/issue5864
739 $ echo foo > foo
739 $ echo foo > foo
740 $ hg add foo
740 $ hg add foo
741 $ hg ci -m "initial"
741 $ hg ci -m "initial"
742 $ hg import -q --bypass -m "make executable" - <<EOF
742 $ hg import -q --bypass -m "make executable" - <<EOF
743 > diff --git a/foo b/foo
743 > diff --git a/foo b/foo
744 > old mode 100644
744 > old mode 100644
745 > new mode 100755
745 > new mode 100755
746 > EOF
746 > EOF
747 $ hg up -q
747 $ hg up -q
748
748
749 $ hg glog
749 $ hg glog
750 @ 1:3a2125f0f4cb make executable
750 @ 1:3a2125f0f4cb make executable
751 |
751 |
752 o 0:51f273a58d82 initial
752 o 0:51f273a58d82 initial
753
753
754
754
755 #if no-windows
755 #if no-windows
756 $ cat > $TESTTMP/messages <<EOF
756 $ cat > $TESTTMP/messages <<EOF
757 > split 1
757 > split 1
758 > EOF
758 > EOF
759 $ printf 'y\n' | hg split
759 $ printf 'y\n' | hg split
760 diff --git a/foo b/foo
760 diff --git a/foo b/foo
761 old mode 100644
761 old mode 100644
762 new mode 100755
762 new mode 100755
763 examine changes to 'foo'?
763 examine changes to 'foo'?
764 (enter ? for help) [Ynesfdaq?] y
764 (enter ? for help) [Ynesfdaq?] y
765
765
766 EDITOR: HG: Splitting 3a2125f0f4cb. Write commit message for the first split changeset.
766 EDITOR: HG: Splitting 3a2125f0f4cb. Write commit message for the first split changeset.
767 EDITOR: make executable
767 EDITOR: make executable
768 EDITOR:
768 EDITOR:
769 EDITOR:
769 EDITOR:
770 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
770 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
771 EDITOR: HG: Leave message empty to abort commit.
771 EDITOR: HG: Leave message empty to abort commit.
772 EDITOR: HG: --
772 EDITOR: HG: --
773 EDITOR: HG: user: test
773 EDITOR: HG: user: test
774 EDITOR: HG: branch 'default'
774 EDITOR: HG: branch 'default'
775 EDITOR: HG: changed foo
775 EDITOR: HG: changed foo
776 created new head
776 created new head
777 saved backup bundle to $TESTTMP/issue5864/.hg/strip-backup/3a2125f0f4cb-629e4432-split.hg (obsstore-off !)
777 saved backup bundle to $TESTTMP/issue5864/.hg/strip-backup/3a2125f0f4cb-629e4432-split.hg (obsstore-off !)
778
778
779 $ hg log -G -T "{node|short} {desc}\n"
779 $ hg log -G -T "{node|short} {desc}\n"
780 @ b154670c87da split 1
780 @ b154670c87da split 1
781 |
781 |
782 o 51f273a58d82 initial
782 o 51f273a58d82 initial
783
783
784 #else
784 #else
785
785
786 TODO: Fix this on Windows. See issue 2020 and 5883
786 TODO: Fix this on Windows. See issue 2020 and 5883
787
787
788 $ printf 'y\ny\ny\n' | hg split
788 $ printf 'y\ny\ny\n' | hg split
789 abort: cannot split an empty revision
789 abort: cannot split an empty revision
790 [255]
790 [255]
791 #endif
791 #endif
792
792
793 Test that splitting moves works properly (issue5723)
793 Test that splitting moves works properly (issue5723)
794 ----------------------------------------------------
794 ----------------------------------------------------
795
795
796 $ hg init $TESTTMP/issue5723-mv
796 $ hg init $TESTTMP/issue5723-mv
797 $ cd $TESTTMP/issue5723-mv
797 $ cd $TESTTMP/issue5723-mv
798 $ printf '1\n2\n' > file
798 $ printf '1\n2\n' > file
799 $ hg ci -qAm initial
799 $ hg ci -qAm initial
800 $ hg mv file file2
800 $ hg mv file file2
801 $ printf 'a\nb\n1\n2\n3\n4\n' > file2
801 $ printf 'a\nb\n1\n2\n3\n4\n' > file2
802 $ cat > $TESTTMP/messages <<EOF
802 $ cat > $TESTTMP/messages <<EOF
803 > split1, keeping only the numbered lines
803 > split1, keeping only the numbered lines
804 > --
804 > --
805 > split2, keeping the lettered lines
805 > split2, keeping the lettered lines
806 > EOF
806 > EOF
807 $ hg ci -m 'move and modify'
807 $ hg ci -m 'move and modify'
808 $ printf 'y\nn\na\na\n' | hg split
808 $ printf 'y\nn\na\na\n' | hg split
809 diff --git a/file b/file2
809 diff --git a/file b/file2
810 rename from file
810 rename from file
811 rename to file2
811 rename to file2
812 2 hunks, 4 lines changed
812 2 hunks, 4 lines changed
813 examine changes to 'file' and 'file2'?
813 examine changes to 'file' and 'file2'?
814 (enter ? for help) [Ynesfdaq?] y
814 (enter ? for help) [Ynesfdaq?] y
815
815
816 @@ -0,0 +1,2 @@
816 @@ -0,0 +1,2 @@
817 +a
817 +a
818 +b
818 +b
819 record change 1/2 to 'file2'?
819 record change 1/2 to 'file2'?
820 (enter ? for help) [Ynesfdaq?] n
820 (enter ? for help) [Ynesfdaq?] n
821
821
822 @@ -2,0 +5,2 @@ 2
822 @@ -2,0 +5,2 @@ 2
823 +3
823 +3
824 +4
824 +4
825 record change 2/2 to 'file2'?
825 record change 2/2 to 'file2'?
826 (enter ? for help) [Ynesfdaq?] a
826 (enter ? for help) [Ynesfdaq?] a
827
827
828 EDITOR: HG: Splitting 8c42fa635116. Write commit message for the first split changeset.
828 EDITOR: HG: Splitting 8c42fa635116. Write commit message for the first split changeset.
829 EDITOR: move and modify
829 EDITOR: move and modify
830 EDITOR:
830 EDITOR:
831 EDITOR:
831 EDITOR:
832 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
832 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
833 EDITOR: HG: Leave message empty to abort commit.
833 EDITOR: HG: Leave message empty to abort commit.
834 EDITOR: HG: --
834 EDITOR: HG: --
835 EDITOR: HG: user: test
835 EDITOR: HG: user: test
836 EDITOR: HG: branch 'default'
836 EDITOR: HG: branch 'default'
837 EDITOR: HG: added file2
837 EDITOR: HG: added file2
838 EDITOR: HG: removed file
838 EDITOR: HG: removed file
839 created new head
839 created new head
840 diff --git a/file2 b/file2
840 diff --git a/file2 b/file2
841 1 hunks, 2 lines changed
841 1 hunks, 2 lines changed
842 examine changes to 'file2'?
842 examine changes to 'file2'?
843 (enter ? for help) [Ynesfdaq?] a
843 (enter ? for help) [Ynesfdaq?] a
844
844
845 EDITOR: HG: Splitting 8c42fa635116. So far it has been split into:
845 EDITOR: HG: Splitting 8c42fa635116. So far it has been split into:
846 EDITOR: HG: - 478be2a70c27: split1, keeping only the numbered lines
846 EDITOR: HG: - 478be2a70c27: split1, keeping only the numbered lines
847 EDITOR: HG: Write commit message for the next split changeset.
847 EDITOR: HG: Write commit message for the next split changeset.
848 EDITOR: move and modify
848 EDITOR: move and modify
849 EDITOR:
849 EDITOR:
850 EDITOR:
850 EDITOR:
851 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
851 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
852 EDITOR: HG: Leave message empty to abort commit.
852 EDITOR: HG: Leave message empty to abort commit.
853 EDITOR: HG: --
853 EDITOR: HG: --
854 EDITOR: HG: user: test
854 EDITOR: HG: user: test
855 EDITOR: HG: branch 'default'
855 EDITOR: HG: branch 'default'
856 EDITOR: HG: changed file2
856 EDITOR: HG: changed file2
857 saved backup bundle to $TESTTMP/issue5723-mv/.hg/strip-backup/8c42fa635116-a38044d4-split.hg (obsstore-off !)
857 saved backup bundle to $TESTTMP/issue5723-mv/.hg/strip-backup/8c42fa635116-a38044d4-split.hg (obsstore-off !)
858 $ hg log -T '{desc}: {files%"{file} "}\n'
858 $ hg log -T '{desc}: {files%"{file} "}\n'
859 split2, keeping the lettered lines: file2
859 split2, keeping the lettered lines: file2
860 split1, keeping only the numbered lines: file file2
860 split1, keeping only the numbered lines: file file2
861 initial: file
861 initial: file
862 $ cat file2
862 $ cat file2
863 a
863 a
864 b
864 b
865 1
865 1
866 2
866 2
867 3
867 3
868 4
868 4
869 $ hg cat -r ".^" file2
869 $ hg cat -r ".^" file2
870 1
870 1
871 2
871 2
872 3
872 3
873 4
873 4
874 $ hg cat -r . file2
874 $ hg cat -r . file2
875 a
875 a
876 b
876 b
877 1
877 1
878 2
878 2
879 3
879 3
880 4
880 4
881
881
882
882
883 Test that splitting copies works properly (issue5723)
883 Test that splitting copies works properly (issue5723)
884 ----------------------------------------------------
884 ----------------------------------------------------
885
885
886 $ hg init $TESTTMP/issue5723-cp
886 $ hg init $TESTTMP/issue5723-cp
887 $ cd $TESTTMP/issue5723-cp
887 $ cd $TESTTMP/issue5723-cp
888 $ printf '1\n2\n' > file
888 $ printf '1\n2\n' > file
889 $ hg ci -qAm initial
889 $ hg ci -qAm initial
890 $ hg cp file file2
890 $ hg cp file file2
891 $ printf 'a\nb\n1\n2\n3\n4\n' > file2
891 $ printf 'a\nb\n1\n2\n3\n4\n' > file2
892 Also modify 'file' to prove that the changes aren't being pulled in
892 Also modify 'file' to prove that the changes aren't being pulled in
893 accidentally.
893 accidentally.
894 $ printf 'this is the new contents of "file"' > file
894 $ printf 'this is the new contents of "file"' > file
895 $ cat > $TESTTMP/messages <<EOF
895 $ cat > $TESTTMP/messages <<EOF
896 > split1, keeping "file" and only the numbered lines in file2
896 > split1, keeping "file" and only the numbered lines in file2
897 > --
897 > --
898 > split2, keeping the lettered lines in file2
898 > split2, keeping the lettered lines in file2
899 > EOF
899 > EOF
900 $ hg ci -m 'copy file->file2, modify both'
900 $ hg ci -m 'copy file->file2, modify both'
901 $ printf 'f\ny\nn\na\na\n' | hg split
901 $ printf 'f\ny\nn\na\na\n' | hg split
902 diff --git a/file b/file
902 diff --git a/file b/file
903 1 hunks, 2 lines changed
903 1 hunks, 2 lines changed
904 examine changes to 'file'?
904 examine changes to 'file'?
905 (enter ? for help) [Ynesfdaq?] f
905 (enter ? for help) [Ynesfdaq?] f
906
906
907 diff --git a/file b/file2
907 diff --git a/file b/file2
908 copy from file
908 copy from file
909 copy to file2
909 copy to file2
910 2 hunks, 4 lines changed
910 2 hunks, 4 lines changed
911 examine changes to 'file' and 'file2'?
911 examine changes to 'file' and 'file2'?
912 (enter ? for help) [Ynesfdaq?] y
912 (enter ? for help) [Ynesfdaq?] y
913
913
914 @@ -0,0 +1,2 @@
914 @@ -0,0 +1,2 @@
915 +a
915 +a
916 +b
916 +b
917 record change 2/3 to 'file2'?
917 record change 2/3 to 'file2'?
918 (enter ? for help) [Ynesfdaq?] n
918 (enter ? for help) [Ynesfdaq?] n
919
919
920 @@ -2,0 +5,2 @@ 2
920 @@ -2,0 +5,2 @@ 2
921 +3
921 +3
922 +4
922 +4
923 record change 3/3 to 'file2'?
923 record change 3/3 to 'file2'?
924 (enter ? for help) [Ynesfdaq?] a
924 (enter ? for help) [Ynesfdaq?] a
925
925
926 EDITOR: HG: Splitting 41c861dfa61e. Write commit message for the first split changeset.
926 EDITOR: HG: Splitting 41c861dfa61e. Write commit message for the first split changeset.
927 EDITOR: copy file->file2, modify both
927 EDITOR: copy file->file2, modify both
928 EDITOR:
928 EDITOR:
929 EDITOR:
929 EDITOR:
930 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
930 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
931 EDITOR: HG: Leave message empty to abort commit.
931 EDITOR: HG: Leave message empty to abort commit.
932 EDITOR: HG: --
932 EDITOR: HG: --
933 EDITOR: HG: user: test
933 EDITOR: HG: user: test
934 EDITOR: HG: branch 'default'
934 EDITOR: HG: branch 'default'
935 EDITOR: HG: added file2
935 EDITOR: HG: added file2
936 EDITOR: HG: changed file
936 EDITOR: HG: changed file
937 created new head
937 created new head
938 diff --git a/file2 b/file2
938 diff --git a/file2 b/file2
939 1 hunks, 2 lines changed
939 1 hunks, 2 lines changed
940 examine changes to 'file2'?
940 examine changes to 'file2'?
941 (enter ? for help) [Ynesfdaq?] a
941 (enter ? for help) [Ynesfdaq?] a
942
942
943 EDITOR: HG: Splitting 41c861dfa61e. So far it has been split into:
943 EDITOR: HG: Splitting 41c861dfa61e. So far it has been split into:
944 EDITOR: HG: - 4b19e06610eb: split1, keeping "file" and only the numbered lines in file2
944 EDITOR: HG: - 4b19e06610eb: split1, keeping "file" and only the numbered lines in file2
945 EDITOR: HG: Write commit message for the next split changeset.
945 EDITOR: HG: Write commit message for the next split changeset.
946 EDITOR: copy file->file2, modify both
946 EDITOR: copy file->file2, modify both
947 EDITOR:
947 EDITOR:
948 EDITOR:
948 EDITOR:
949 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
949 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
950 EDITOR: HG: Leave message empty to abort commit.
950 EDITOR: HG: Leave message empty to abort commit.
951 EDITOR: HG: --
951 EDITOR: HG: --
952 EDITOR: HG: user: test
952 EDITOR: HG: user: test
953 EDITOR: HG: branch 'default'
953 EDITOR: HG: branch 'default'
954 EDITOR: HG: changed file2
954 EDITOR: HG: changed file2
955 saved backup bundle to $TESTTMP/issue5723-cp/.hg/strip-backup/41c861dfa61e-467e8d3c-split.hg (obsstore-off !)
955 saved backup bundle to $TESTTMP/issue5723-cp/.hg/strip-backup/41c861dfa61e-467e8d3c-split.hg (obsstore-off !)
956 $ hg log -T '{desc}: {files%"{file} "}\n'
956 $ hg log -T '{desc}: {files%"{file} "}\n'
957 split2, keeping the lettered lines in file2: file2
957 split2, keeping the lettered lines in file2: file2
958 split1, keeping "file" and only the numbered lines in file2: file file2
958 split1, keeping "file" and only the numbered lines in file2: file file2
959 initial: file
959 initial: file
960 $ cat file2
960 $ cat file2
961 a
961 a
962 b
962 b
963 1
963 1
964 2
964 2
965 3
965 3
966 4
966 4
967 $ hg cat -r ".^" file2
967 $ hg cat -r ".^" file2
968 1
968 1
969 2
969 2
970 3
970 3
971 4
971 4
972 $ hg cat -r . file2
972 $ hg cat -r . file2
973 a
973 a
974 b
974 b
975 1
975 1
976 2
976 2
977 3
977 3
978 4
978 4
General Comments 0
You need to be logged in to leave comments. Login now