Show More
@@ -15,7 +15,7 b' http://mercurial.selenic.com/wiki/Rebase' | |||||
15 | ''' |
|
15 | ''' | |
16 |
|
16 | |||
17 | from mercurial import hg, util, repair, merge, cmdutil, commands, bookmarks |
|
17 | from mercurial import hg, util, repair, merge, cmdutil, commands, bookmarks | |
18 | from mercurial import extensions, patch, scmutil |
|
18 | from mercurial import extensions, patch, scmutil, phases | |
19 | from mercurial.commands import templateopts |
|
19 | from mercurial.commands import templateopts | |
20 | from mercurial.node import nullrev |
|
20 | from mercurial.node import nullrev | |
21 | from mercurial.lock import release |
|
21 | from mercurial.lock import release | |
@@ -372,6 +372,10 b' def concludenode(repo, rev, p1, p2, comm' | |||||
372 | newrev = repo.commit(text=commitmsg, user=ctx.user(), |
|
372 | newrev = repo.commit(text=commitmsg, user=ctx.user(), | |
373 | date=ctx.date(), extra=extra, editor=editor) |
|
373 | date=ctx.date(), extra=extra, editor=editor) | |
374 | repo.dirstate.setbranch(repo[newrev].branch()) |
|
374 | repo.dirstate.setbranch(repo[newrev].branch()) | |
|
375 | targetphase = max(ctx.phase(), phases.draft) | |||
|
376 | # retractboundary doesn't overwrite upper phase inherited from parent | |||
|
377 | newnode = repo[newrev].node() | |||
|
378 | phases.retractboundary(repo, targetphase, [newnode]) | |||
375 | return newrev |
|
379 | return newrev | |
376 | except util.Abort: |
|
380 | except util.Abort: | |
377 | # Invalidate the previous setparents |
|
381 | # Invalidate the previous setparents | |
@@ -552,7 +556,13 b' def restorestatus(repo):' | |||||
552 |
|
556 | |||
553 | def abort(repo, originalwd, target, state): |
|
557 | def abort(repo, originalwd, target, state): | |
554 | 'Restore the repository to its original state' |
|
558 | 'Restore the repository to its original state' | |
555 | if set(repo.changelog.descendants(target)) - set(state.values()): |
|
559 | descendants = repo.changelog.descendants | |
|
560 | ispublic = lambda r: repo._phaserev[r] == phases.public | |||
|
561 | if filter(ispublic, descendants(target)): | |||
|
562 | repo.ui.warn(_("warning: immutable rebased changeset detected, " | |||
|
563 | "can't abort\n")) | |||
|
564 | return -1 | |||
|
565 | elif set(descendants(target)) - set(state.values()): | |||
556 | repo.ui.warn(_("warning: new changesets detected on target branch, " |
|
566 | repo.ui.warn(_("warning: new changesets detected on target branch, " | |
557 | "can't abort\n")) |
|
567 | "can't abort\n")) | |
558 | return -1 |
|
568 | return -1 |
@@ -7,7 +7,7 b'' | |||||
7 | > publish=False |
|
7 | > publish=False | |
8 | > |
|
8 | > | |
9 | > [alias] |
|
9 | > [alias] | |
10 | > tglog = log -G --template "{rev}: '{desc}' {branches}\n" |
|
10 | > tglog = log -G --template "{rev}:{phase} '{desc}' {branches}\n" | |
11 | > EOF |
|
11 | > EOF | |
12 |
|
12 | |||
13 |
|
13 | |||
@@ -35,16 +35,18 b'' | |||||
35 | $ mv common.new common |
|
35 | $ mv common.new common | |
36 | $ hg ci -m L2 |
|
36 | $ hg ci -m L2 | |
37 |
|
37 | |||
|
38 | $ hg phase --force --secret 2 | |||
|
39 | ||||
38 | $ hg tglog |
|
40 | $ hg tglog | |
39 | @ 4: 'L2' |
|
41 | @ 4:draft 'L2' | |
40 | | |
|
|||
41 | o 3: 'L1' |
|
|||
42 | | |
|
42 | | | |
43 | | o 2: 'C3' |
|
43 | o 3:draft 'L1' | |
|
44 | | | |||
|
45 | | o 2:secret 'C3' | |||
44 | |/ |
|
46 | |/ | |
45 | o 1: 'C2' |
|
47 | o 1:draft 'C2' | |
46 | | |
|
48 | | | |
47 | o 0: 'C1' |
|
49 | o 0:draft 'C1' | |
48 |
|
50 | |||
49 |
|
51 | |||
50 | Conflicting rebase: |
|
52 | Conflicting rebase: | |
@@ -63,15 +65,15 b' Abort:' | |||||
63 | rebase aborted |
|
65 | rebase aborted | |
64 |
|
66 | |||
65 | $ hg tglog |
|
67 | $ hg tglog | |
66 | @ 4: 'L2' |
|
68 | @ 4:draft 'L2' | |
67 | | |
|
69 | | | |
68 | o 3: 'L1' |
|
70 | o 3:draft 'L1' | |
69 | | |
|
71 | | | |
70 | | o 2: 'C3' |
|
72 | | o 2:secret 'C3' | |
71 | |/ |
|
73 | |/ | |
72 | o 1: 'C2' |
|
74 | o 1:draft 'C2' | |
73 | | |
|
75 | | | |
74 | o 0: 'C1' |
|
76 | o 0:draft 'C1' | |
75 |
|
77 | |||
76 | $ cd .. |
|
78 | $ cd .. | |
77 |
|
79 | |||
@@ -104,18 +106,21 b' Constrcut new repo:' | |||||
104 | $ hg ci -Am C1 |
|
106 | $ hg ci -Am C1 | |
105 | adding c |
|
107 | adding c | |
106 |
|
108 | |||
|
109 | $ hg phase --force --secret 1 | |||
|
110 | $ hg phase --public 1 | |||
|
111 | ||||
107 | Rebase and abort without generating new changesets: |
|
112 | Rebase and abort without generating new changesets: | |
108 |
|
113 | |||
109 | $ hg tglog |
|
114 | $ hg tglog | |
110 | @ 4: 'C1' |
|
115 | @ 4:draft 'C1' | |
111 | | |
|
116 | | | |
112 | o 3: 'B bis' |
|
117 | o 3:draft 'B bis' | |
113 | | |
|
118 | | | |
114 | | o 2: 'C' |
|
119 | | o 2:secret 'C' | |
115 | | | |
|
120 | | | | |
116 | | o 1: 'B' |
|
121 | | o 1:public 'B' | |
117 | |/ |
|
122 | |/ | |
118 | o 0: 'A' |
|
123 | o 0:public 'A' | |
119 |
|
124 | |||
120 | $ hg rebase -b 4 -d 2 |
|
125 | $ hg rebase -b 4 -d 2 | |
121 | merging c |
|
126 | merging c | |
@@ -125,27 +130,27 b' Rebase and abort without generating new ' | |||||
125 | [255] |
|
130 | [255] | |
126 |
|
131 | |||
127 | $ hg tglog |
|
132 | $ hg tglog | |
128 | @ 4: 'C1' |
|
133 | @ 4:draft 'C1' | |
129 | | |
|
134 | | | |
130 | o 3: 'B bis' |
|
135 | o 3:draft 'B bis' | |
131 | | |
|
136 | | | |
132 | | @ 2: 'C' |
|
137 | | @ 2:secret 'C' | |
133 | | | |
|
138 | | | | |
134 | | o 1: 'B' |
|
139 | | o 1:public 'B' | |
135 | |/ |
|
140 | |/ | |
136 | o 0: 'A' |
|
141 | o 0:public 'A' | |
137 |
|
142 | |||
138 | $ hg rebase -a |
|
143 | $ hg rebase -a | |
139 | rebase aborted |
|
144 | rebase aborted | |
140 |
|
145 | |||
141 | $ hg tglog |
|
146 | $ hg tglog | |
142 | @ 4: 'C1' |
|
147 | @ 4:draft 'C1' | |
143 | | |
|
148 | | | |
144 | o 3: 'B bis' |
|
149 | o 3:draft 'B bis' | |
145 | | |
|
150 | | | |
146 | | o 2: 'C' |
|
151 | | o 2:secret 'C' | |
147 | | | |
|
152 | | | | |
148 | | o 1: 'B' |
|
153 | | o 1:public 'B' | |
149 | |/ |
|
154 | |/ | |
150 | o 0: 'A' |
|
155 | o 0:public 'A' | |
151 |
|
156 |
@@ -7,7 +7,7 b'' | |||||
7 | > publish=False |
|
7 | > publish=False | |
8 | > |
|
8 | > | |
9 | > [alias] |
|
9 | > [alias] | |
10 | > tglog = log -G --template "{rev}: '{desc}' {branches}\n" |
|
10 | > tglog = log -G --template "{rev}:{phase} '{desc}' {branches}\n" | |
11 | > EOF |
|
11 | > EOF | |
12 |
|
12 | |||
13 |
|
13 | |||
@@ -46,23 +46,24 b'' | |||||
46 | $ cd .. |
|
46 | $ cd .. | |
47 |
|
47 | |||
48 |
|
48 | |||
49 | Rebasing B onto E - check keep: |
|
49 | Rebasing B onto E - check keep: and phases | |
50 |
|
50 | |||
51 | $ hg clone -q -u . a a1 |
|
51 | $ hg clone -q -u . a a1 | |
52 | $ cd a1 |
|
52 | $ cd a1 | |
|
53 | $ hg phase --force --secret 2 | |||
53 |
|
54 | |||
54 | $ hg tglog |
|
55 | $ hg tglog | |
55 | @ 5: 'F' notdefault |
|
56 | @ 5:draft 'F' notdefault | |
56 | | |
|
57 | | | |
57 | | o 4: 'E' |
|
58 | | o 4:draft 'E' | |
58 | | | |
|
59 | | | | |
59 | | o 3: 'D' |
|
60 | | o 3:draft 'D' | |
60 | |/ |
|
61 | |/ | |
61 | | o 2: 'C' |
|
62 | | o 2:secret 'C' | |
62 | | | |
|
63 | | | | |
63 | | o 1: 'B' |
|
64 | | o 1:draft 'B' | |
64 | |/ |
|
65 | |/ | |
65 | o 0: 'A' |
|
66 | o 0:draft 'A' | |
66 |
|
67 | |||
67 | $ hg rebase -s 1 -d 4 --keep |
|
68 | $ hg rebase -s 1 -d 4 --keep | |
68 | merging A |
|
69 | merging A | |
@@ -79,21 +80,21 b' Solve the conflict and go on:' | |||||
79 | $ hg rebase --continue |
|
80 | $ hg rebase --continue | |
80 |
|
81 | |||
81 | $ hg tglog |
|
82 | $ hg tglog | |
82 | @ 7: 'C' |
|
83 | @ 7:secret 'C' | |
83 | | |
|
84 | | | |
84 | o 6: 'B' |
|
85 | o 6:draft 'B' | |
85 | | |
|
86 | | | |
86 | | o 5: 'F' notdefault |
|
87 | | o 5:draft 'F' notdefault | |
87 | | | |
|
88 | | | | |
88 | o | 4: 'E' |
|
89 | o | 4:draft 'E' | |
89 | | | |
|
90 | | | | |
90 | o | 3: 'D' |
|
91 | o | 3:draft 'D' | |
91 | |/ |
|
92 | |/ | |
92 | | o 2: 'C' |
|
93 | | o 2:secret 'C' | |
93 | | | |
|
94 | | | | |
94 | | o 1: 'B' |
|
95 | | o 1:draft 'B' | |
95 | |/ |
|
96 | |/ | |
96 | o 0: 'A' |
|
97 | o 0:draft 'A' | |
97 |
|
98 | |||
98 | $ cd .. |
|
99 | $ cd .. | |
99 |
|
100 | |||
@@ -102,19 +103,20 b' Rebase F onto E - check keepbranches:' | |||||
102 |
|
103 | |||
103 | $ hg clone -q -u . a a2 |
|
104 | $ hg clone -q -u . a a2 | |
104 | $ cd a2 |
|
105 | $ cd a2 | |
|
106 | $ hg phase --force --secret 2 | |||
105 |
|
107 | |||
106 | $ hg tglog |
|
108 | $ hg tglog | |
107 | @ 5: 'F' notdefault |
|
109 | @ 5:draft 'F' notdefault | |
108 | | |
|
110 | | | |
109 | | o 4: 'E' |
|
111 | | o 4:draft 'E' | |
110 | | | |
|
112 | | | | |
111 | | o 3: 'D' |
|
113 | | o 3:draft 'D' | |
112 | |/ |
|
114 | |/ | |
113 | | o 2: 'C' |
|
115 | | o 2:secret 'C' | |
114 | | | |
|
116 | | | | |
115 | | o 1: 'B' |
|
117 | | o 1:draft 'B' | |
116 | |/ |
|
118 | |/ | |
117 | o 0: 'A' |
|
119 | o 0:draft 'A' | |
118 |
|
120 | |||
119 | $ hg rebase -s 5 -d 4 --keepbranches |
|
121 | $ hg rebase -s 5 -d 4 --keepbranches | |
120 | merging A |
|
122 | merging A | |
@@ -132,15 +134,15 b' Solve the conflict and go on:' | |||||
132 | saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob) |
|
134 | saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob) | |
133 |
|
135 | |||
134 | $ hg tglog |
|
136 | $ hg tglog | |
135 | @ 5: 'F' notdefault |
|
137 | @ 5:draft 'F' notdefault | |
136 | | |
|
138 | | | |
137 | o 4: 'E' |
|
139 | o 4:draft 'E' | |
138 | | |
|
140 | | | |
139 | o 3: 'D' |
|
141 | o 3:draft 'D' | |
140 | | |
|
142 | | | |
141 | | o 2: 'C' |
|
143 | | o 2:secret 'C' | |
142 | | | |
|
144 | | | | |
143 | | o 1: 'B' |
|
145 | | o 1:draft 'B' | |
144 | |/ |
|
146 | |/ | |
145 | o 0: 'A' |
|
147 | o 0:draft 'A' | |
146 |
|
148 |
@@ -8,6 +8,7 b'' | |||||
8 | > |
|
8 | > | |
9 | > [alias] |
|
9 | > [alias] | |
10 | > tglog = log -G --template "{rev}: '{desc}' {branches}\n" |
|
10 | > tglog = log -G --template "{rev}: '{desc}' {branches}\n" | |
|
11 | > tglogp = log -G --template "{rev}:{phase} '{desc}' {branches}\n" | |||
11 | > EOF |
|
12 | > EOF | |
12 |
|
13 | |||
13 | Create repo a: |
|
14 | Create repo a: | |
@@ -43,28 +44,31 b' Create repo a:' | |||||
43 | $ cd .. |
|
44 | $ cd .. | |
44 |
|
45 | |||
45 |
|
46 | |||
46 | Rebasing B onto H: |
|
47 | Rebasing B onto H and collapsing changesets with different phases: | |
|
48 | ||||
47 |
|
49 | |||
48 | $ hg clone -q -u 3 a a1 |
|
50 | $ hg clone -q -u 3 a a1 | |
49 | $ cd a1 |
|
51 | $ cd a1 | |
50 |
|
52 | |||
|
53 | $ hg phase --force --secret 3 | |||
|
54 | ||||
51 | $ hg rebase --collapse --keepbranches |
|
55 | $ hg rebase --collapse --keepbranches | |
52 | saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob) |
|
56 | saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob) | |
53 |
|
57 | |||
54 | $ hg tglog |
|
58 | $ hg tglogp | |
55 | @ 5: 'Collapsed revision |
|
59 | @ 5:secret 'Collapsed revision | |
56 | | * B |
|
60 | | * B | |
57 | | * C |
|
61 | | * C | |
58 | | * D' |
|
62 | | * D' | |
59 | o 4: 'H' |
|
63 | o 4:draft 'H' | |
60 | | |
|
64 | | | |
61 | | o 3: 'G' |
|
65 | | o 3:draft 'G' | |
62 | |/| |
|
66 | |/| | |
63 | o | 2: 'F' |
|
67 | o | 2:draft 'F' | |
64 | | | |
|
68 | | | | |
65 | | o 1: 'E' |
|
69 | | o 1:draft 'E' | |
66 | |/ |
|
70 | |/ | |
67 | o 0: 'A' |
|
71 | o 0:draft 'A' | |
68 |
|
72 | |||
69 | $ hg manifest |
|
73 | $ hg manifest | |
70 | A |
|
74 | A | |
@@ -82,6 +86,7 b' Rebasing E onto H:' | |||||
82 | $ hg clone -q -u . a a2 |
|
86 | $ hg clone -q -u . a a2 | |
83 | $ cd a2 |
|
87 | $ cd a2 | |
84 |
|
88 | |||
|
89 | $ hg phase --force --secret 6 | |||
85 | $ hg rebase --source 4 --collapse |
|
90 | $ hg rebase --source 4 --collapse | |
86 | saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob) |
|
91 | saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob) | |
87 |
|
92 |
@@ -7,7 +7,7 b'' | |||||
7 | > publish=False |
|
7 | > publish=False | |
8 | > |
|
8 | > | |
9 | > [alias] |
|
9 | > [alias] | |
10 | > tglog = log -G --template "{rev}: '{desc}' {branches}\n" |
|
10 | > tglog = log -G --template "{rev}:{phase} '{desc}' {branches}\n" | |
11 | > EOF |
|
11 | > EOF | |
12 |
|
12 | |||
13 | $ hg init a |
|
13 | $ hg init a | |
@@ -37,18 +37,20 b'' | |||||
37 | $ hg add extra2 |
|
37 | $ hg add extra2 | |
38 | $ hg ci -m L3 |
|
38 | $ hg ci -m L3 | |
39 |
|
39 | |||
|
40 | $ hg phase --force --secret 4 | |||
|
41 | ||||
40 | $ hg tglog |
|
42 | $ hg tglog | |
41 | @ 5: 'L3' |
|
43 | @ 5:secret 'L3' | |
42 | | |
|
44 | | | |
43 | o 4: 'L2' |
|
45 | o 4:secret 'L2' | |
44 | | |
|
46 | | | |
45 | o 3: 'L1' |
|
47 | o 3:draft 'L1' | |
46 | | |
|
48 | | | |
47 | | o 2: 'C3' |
|
49 | | o 2:draft 'C3' | |
48 | |/ |
|
50 | |/ | |
49 | o 1: 'C2' |
|
51 | o 1:draft 'C2' | |
50 | | |
|
52 | | | |
51 | o 0: 'C1' |
|
53 | o 0:draft 'C1' | |
52 |
|
54 | |||
53 | Try to call --continue: |
|
55 | Try to call --continue: | |
54 |
|
56 | |||
@@ -79,17 +81,17 b' Conclude rebase:' | |||||
79 | saved backup bundle to $TESTTMP/a/.hg/strip-backup/*-backup.hg (glob) |
|
81 | saved backup bundle to $TESTTMP/a/.hg/strip-backup/*-backup.hg (glob) | |
80 |
|
82 | |||
81 | $ hg tglog |
|
83 | $ hg tglog | |
82 | @ 5: 'L3' |
|
84 | @ 5:secret 'L3' | |
83 | | |
|
85 | | | |
84 | o 4: 'L2' |
|
86 | o 4:secret 'L2' | |
85 | | |
|
87 | | | |
86 | o 3: 'L1' |
|
88 | o 3:draft 'L1' | |
87 | | |
|
89 | | | |
88 | o 2: 'C3' |
|
90 | o 2:draft 'C3' | |
89 | | |
|
91 | | | |
90 | o 1: 'C2' |
|
92 | o 1:draft 'C2' | |
91 | | |
|
93 | | | |
92 | o 0: 'C1' |
|
94 | o 0:draft 'C1' | |
93 |
|
95 | |||
94 | Check correctness: |
|
96 | Check correctness: | |
95 |
|
97 |
@@ -47,25 +47,26 b' Rebasing D onto H detaching from C:' | |||||
47 | |/ |
|
47 | |/ | |
48 | o 0: 'A' |
|
48 | o 0: 'A' | |
49 |
|
49 | |||
|
50 | $ hg phase --force --secret 3 | |||
50 | $ hg rebase --detach -s 3 -d 7 |
|
51 | $ hg rebase --detach -s 3 -d 7 | |
51 | saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob) |
|
52 | saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob) | |
52 |
|
53 | |||
53 | $ hg tglog |
|
54 | $ hg log -G --template "{rev}:{phase} '{desc}' {branches}\n" | |
54 | @ 7: 'D' |
|
55 | @ 7:secret 'D' | |
55 | | |
|
56 | | | |
56 | o 6: 'H' |
|
57 | o 6:draft 'H' | |
57 | | |
|
58 | | | |
58 | | o 5: 'G' |
|
59 | | o 5:draft 'G' | |
59 | |/| |
|
60 | |/| | |
60 | o | 4: 'F' |
|
61 | o | 4:draft 'F' | |
61 | | | |
|
62 | | | | |
62 | | o 3: 'E' |
|
63 | | o 3:draft 'E' | |
63 | |/ |
|
64 | |/ | |
64 | | o 2: 'C' |
|
65 | | o 2:draft 'C' | |
65 | | | |
|
66 | | | | |
66 | | o 1: 'B' |
|
67 | | o 1:draft 'B' | |
67 | |/ |
|
68 | |/ | |
68 | o 0: 'A' |
|
69 | o 0:draft 'A' | |
69 |
|
70 | |||
70 | $ hg manifest |
|
71 | $ hg manifest | |
71 | A |
|
72 | A | |
@@ -185,6 +186,7 b' Rebasing C onto H detaching from B and c' | |||||
185 |
|
186 | |||
186 | $ hg clone -q -u . a a4 |
|
187 | $ hg clone -q -u . a a4 | |
187 | $ cd a4 |
|
188 | $ cd a4 | |
|
189 | $ hg phase --force --secret 3 | |||
188 |
|
190 | |||
189 | $ hg tglog |
|
191 | $ hg tglog | |
190 | @ 7: 'H' |
|
192 | @ 7: 'H' | |
@@ -206,21 +208,21 b' Rebasing C onto H detaching from B and c' | |||||
206 | $ hg rebase --detach --collapse -s 2 -d 7 |
|
208 | $ hg rebase --detach --collapse -s 2 -d 7 | |
207 | saved backup bundle to $TESTTMP/a4/.hg/strip-backup/*-backup.hg (glob) |
|
209 | saved backup bundle to $TESTTMP/a4/.hg/strip-backup/*-backup.hg (glob) | |
208 |
|
210 | |||
209 | $ hg tglog |
|
211 | $ hg log -G --template "{rev}:{phase} '{desc}' {branches}\n" | |
210 | @ 6: 'Collapsed revision |
|
212 | @ 6:secret 'Collapsed revision | |
211 | | * C |
|
213 | | * C | |
212 | | * D' |
|
214 | | * D' | |
213 | o 5: 'H' |
|
215 | o 5:draft 'H' | |
214 | | |
|
216 | | | |
215 | | o 4: 'G' |
|
217 | | o 4:draft 'G' | |
216 | |/| |
|
218 | |/| | |
217 | o | 3: 'F' |
|
219 | o | 3:draft 'F' | |
218 | | | |
|
220 | | | | |
219 | | o 2: 'E' |
|
221 | | o 2:draft 'E' | |
220 | |/ |
|
222 | |/ | |
221 | | o 1: 'B' |
|
223 | | o 1:draft 'B' | |
222 | |/ |
|
224 | |/ | |
223 | o 0: 'A' |
|
225 | o 0:draft 'A' | |
224 |
|
226 | |||
225 | $ hg manifest |
|
227 | $ hg manifest | |
226 | A |
|
228 | A | |
@@ -360,13 +362,14 b' Verify that target is not selected as ex' | |||||
360 |
|
362 | |||
361 | $ cd .. |
|
363 | $ cd .. | |
362 |
|
364 | |||
363 | Ensure --continue restores a correct state (issue3046): |
|
365 | Ensure --continue restores a correct state (issue3046) and phase: | |
364 | $ hg clone -q a a7 |
|
366 | $ hg clone -q a a7 | |
365 | $ cd a7 |
|
367 | $ cd a7 | |
366 | $ hg up -q 3 |
|
368 | $ hg up -q 3 | |
367 | $ echo 'H2' > H |
|
369 | $ echo 'H2' > H | |
368 | $ hg ci -A -m 'H2' |
|
370 | $ hg ci -A -m 'H2' | |
369 | adding H |
|
371 | adding H | |
|
372 | $ hg phase --force --secret 8 | |||
370 | $ hg rebase -s 8 -d 7 --detach --config ui.merge=internal:fail |
|
373 | $ hg rebase -s 8 -d 7 --detach --config ui.merge=internal:fail | |
371 | merging H |
|
374 | merging H | |
372 | warning: conflicts during merge. |
|
375 | warning: conflicts during merge. | |
@@ -376,23 +379,23 b' Ensure --continue restores a correct sta' | |||||
376 | $ hg resolve --all -t internal:local |
|
379 | $ hg resolve --all -t internal:local | |
377 | $ hg rebase -c |
|
380 | $ hg rebase -c | |
378 | saved backup bundle to $TESTTMP/a7/.hg/strip-backup/6215fafa5447-backup.hg (glob) |
|
381 | saved backup bundle to $TESTTMP/a7/.hg/strip-backup/6215fafa5447-backup.hg (glob) | |
379 | $ hg tglog |
|
382 | $ hg log -G --template "{rev}:{phase} '{desc}' {branches}\n" | |
380 | @ 8: 'H2' |
|
383 | @ 8:secret 'H2' | |
381 | | |
|
384 | | | |
382 | o 7: 'H' |
|
385 | o 7:draft 'H' | |
383 | | |
|
386 | | | |
384 | | o 6: 'G' |
|
387 | | o 6:draft 'G' | |
385 | |/| |
|
388 | |/| | |
386 | o | 5: 'F' |
|
389 | o | 5:draft 'F' | |
387 | | | |
|
390 | | | | |
388 | | o 4: 'E' |
|
391 | | o 4:draft 'E' | |
389 | |/ |
|
392 | |/ | |
390 | | o 3: 'D' |
|
393 | | o 3:draft 'D' | |
391 | | | |
|
394 | | | | |
392 | | o 2: 'C' |
|
395 | | o 2:draft 'C' | |
393 | | | |
|
396 | | | | |
394 | | o 1: 'B' |
|
397 | | o 1:draft 'B' | |
395 | |/ |
|
398 | |/ | |
396 | o 0: 'A' |
|
399 | o 0:draft 'A' | |
397 |
|
400 | |||
398 |
|
401 |
@@ -8,6 +8,7 b'' | |||||
8 | > |
|
8 | > | |
9 | > [alias] |
|
9 | > [alias] | |
10 | > tglog = log -G --template "{rev}: '{desc}' {branches}\n" |
|
10 | > tglog = log -G --template "{rev}: '{desc}' {branches}\n" | |
|
11 | > tglogp = log -G --template "{rev}:{phase} '{desc}' {branches}\n" | |||
11 | > EOF |
|
12 | > EOF | |
12 |
|
13 | |||
13 |
|
14 | |||
@@ -71,20 +72,24 b' Force a commit on C during the interrupt' | |||||
71 | $ hg add Extra |
|
72 | $ hg add Extra | |
72 | $ hg ci -m 'Extra' |
|
73 | $ hg ci -m 'Extra' | |
73 |
|
74 | |||
74 | $ hg tglog |
|
75 | Force this commit onto secret phase | |
75 | @ 6: 'Extra' |
|
76 | ||
|
77 | $ hg phase --force --secret 6 | |||
|
78 | ||||
|
79 | $ hg tglogp | |||
|
80 | @ 6:secret 'Extra' | |||
76 | | |
|
81 | | | |
77 | | o 5: 'B' |
|
82 | | o 5:draft 'B' | |
78 | | | |
|
|||
79 | | o 4: 'E' |
|
|||
80 | | | |
|
83 | | | | |
81 |
| o |
|
84 | | o 4:draft 'E' | |
82 | | | |
|
85 | | | | |
83 | o | 2: 'C' |
|
86 | | o 3:draft 'D' | |
84 | | | |
|
87 | | | | |
85 |
o | |
|
88 | o | 2:draft 'C' | |
|
89 | | | | |||
|
90 | o | 1:draft 'B' | |||
86 | |/ |
|
91 | |/ | |
87 | o 0: 'A' |
|
92 | o 0:draft 'A' | |
88 |
|
93 | |||
89 | Resume the rebasing: |
|
94 | Resume the rebasing: | |
90 |
|
95 | |||
@@ -104,22 +109,22 b' Solve the conflict and go on:' | |||||
104 | $ hg rebase --continue |
|
109 | $ hg rebase --continue | |
105 | warning: new changesets detected on source branch, not stripping |
|
110 | warning: new changesets detected on source branch, not stripping | |
106 |
|
111 | |||
107 | $ hg tglog |
|
112 | $ hg tglogp | |
108 | @ 7: 'C' |
|
113 | @ 7:draft 'C' | |
109 | | |
|
114 | | | |
110 | | o 6: 'Extra' |
|
115 | | o 6:secret 'Extra' | |
111 | | | |
|
116 | | | | |
112 | o | 5: 'B' |
|
117 | o | 5:draft 'B' | |
113 | | | |
|
118 | | | | |
114 | o | 4: 'E' |
|
119 | o | 4:draft 'E' | |
115 | | | |
|
120 | | | | |
116 | o | 3: 'D' |
|
121 | o | 3:draft 'D' | |
117 | | | |
|
122 | | | | |
118 | | o 2: 'C' |
|
123 | | o 2:draft 'C' | |
119 | | | |
|
124 | | | | |
120 | | o 1: 'B' |
|
125 | | o 1:draft 'B' | |
121 | |/ |
|
126 | |/ | |
122 | o 0: 'A' |
|
127 | o 0:draft 'A' | |
123 |
|
128 | |||
124 | $ cd .. |
|
129 | $ cd .. | |
125 |
|
130 | |||
@@ -195,3 +200,68 b' Abort the rebasing:' | |||||
195 |
|
200 | |||
196 | $ cd .. |
|
201 | $ cd .. | |
197 |
|
202 | |||
|
203 | Changes during an interruption - abort (again): | |||
|
204 | ||||
|
205 | $ hg clone -q -u . a a3 | |||
|
206 | $ cd a3 | |||
|
207 | ||||
|
208 | $ hg tglogp | |||
|
209 | @ 4:draft 'E' | |||
|
210 | | | |||
|
211 | o 3:draft 'D' | |||
|
212 | | | |||
|
213 | | o 2:draft 'C' | |||
|
214 | | | | |||
|
215 | | o 1:draft 'B' | |||
|
216 | |/ | |||
|
217 | o 0:draft 'A' | |||
|
218 | ||||
|
219 | Rebasing B onto E: | |||
|
220 | ||||
|
221 | $ hg rebase -s 1 -d 4 | |||
|
222 | merging A | |||
|
223 | warning: conflicts during merge. | |||
|
224 | merging A incomplete! (edit conflicts, then use 'hg resolve --mark') | |||
|
225 | abort: unresolved conflicts (see hg resolve, then hg rebase --continue) | |||
|
226 | [255] | |||
|
227 | ||||
|
228 | Change phase on B and B' | |||
|
229 | ||||
|
230 | $ hg up -q -C 5 | |||
|
231 | $ hg phase --public 1 | |||
|
232 | $ hg phase --public 5 | |||
|
233 | $ hg phase --secret -f 2 | |||
|
234 | ||||
|
235 | $ hg tglogp | |||
|
236 | @ 5:public 'B' | |||
|
237 | | | |||
|
238 | o 4:public 'E' | |||
|
239 | | | |||
|
240 | o 3:public 'D' | |||
|
241 | | | |||
|
242 | | o 2:secret 'C' | |||
|
243 | | | | |||
|
244 | | o 1:public 'B' | |||
|
245 | |/ | |||
|
246 | o 0:public 'A' | |||
|
247 | ||||
|
248 | Abort the rebasing: | |||
|
249 | ||||
|
250 | $ hg rebase --abort | |||
|
251 | warning: immutable rebased changeset detected, can't abort | |||
|
252 | [255] | |||
|
253 | ||||
|
254 | $ hg tglogp | |||
|
255 | @ 5:public 'B' | |||
|
256 | | | |||
|
257 | o 4:public 'E' | |||
|
258 | | | |||
|
259 | o 3:public 'D' | |||
|
260 | | | |||
|
261 | | o 2:secret 'C' | |||
|
262 | | | | |||
|
263 | | o 1:public 'B' | |||
|
264 | |/ | |||
|
265 | o 0:public 'A' | |||
|
266 | ||||
|
267 | $ cd .. |
@@ -282,6 +282,32 b' Check rebasing public changeset' | |||||
282 | [255] |
|
282 | [255] | |
283 |
|
283 | |||
284 | $ hg rebase -d 5 -b 6 --keep |
|
284 | $ hg rebase -d 5 -b 6 --keep | |
|
285 | ||||
|
286 | Check rebasing mutable changeset | |||
|
287 | Source phase greater or equal to destination phase: new changeset get the phase of source: | |||
|
288 | $ hg rebase -s9 -d0 | |||
|
289 | saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2b23e52411f4-backup.hg | |||
|
290 | $ hg log --template "{phase}\n" -r 9 | |||
|
291 | draft | |||
|
292 | $ hg rebase -s9 -d1 | |||
|
293 | saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2cb10d0cfc6c-backup.hg | |||
|
294 | $ hg log --template "{phase}\n" -r 9 | |||
|
295 | draft | |||
|
296 | $ hg phase --force --secret 9 | |||
|
297 | $ hg rebase -s9 -d0 | |||
|
298 | saved backup bundle to $TESTTMP/a7/.hg/strip-backup/c5b12b67163a-backup.hg | |||
|
299 | $ hg log --template "{phase}\n" -r 9 | |||
|
300 | secret | |||
|
301 | $ hg rebase -s9 -d1 | |||
|
302 | saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2a0524f868ac-backup.hg | |||
|
303 | $ hg log --template "{phase}\n" -r 9 | |||
|
304 | secret | |||
|
305 | Source phase lower than destination phase: new changeset get the phase of destination: | |||
|
306 | $ hg rebase -s7 -d9 | |||
|
307 | saved backup bundle to $TESTTMP/a7/.hg/strip-backup/c9659aac0000-backup.hg | |||
|
308 | $ hg log --template "{phase}\n" -r 9 | |||
|
309 | secret | |||
|
310 | ||||
285 | $ cd .. |
|
311 | $ cd .. | |
286 |
|
312 | |||
287 | Test for revset |
|
313 | Test for revset |
General Comments 0
You need to be logged in to leave comments.
Login now