Show More
@@ -100,18 +100,14 b' def rebase(ui, repo, **opts):' | |||||
100 |
|
100 | |||
101 | if contf or abortf: |
|
101 | if contf or abortf: | |
102 | if contf and abortf: |
|
102 | if contf and abortf: | |
103 | raise error.ParseError('rebase', |
|
103 | raise util.Abort(_('cannot use both abort and continue')) | |
104 | _('cannot use both abort and continue')) |
|
|||
105 | if collapsef: |
|
104 | if collapsef: | |
106 |
raise |
|
105 | raise util.Abort( | |
107 |
|
|
106 | _('cannot use collapse with continue or abort')) | |
108 |
|
||||
109 | if detachf: |
|
107 | if detachf: | |
110 | raise error.ParseError( |
|
108 | raise util.Abort(_('cannot use detach with continue or abort')) | |
111 | 'rebase', _('cannot use detach with continue or abort')) |
|
|||
112 |
|
||||
113 | if srcf or basef or destf: |
|
109 | if srcf or basef or destf: | |
114 |
raise |
|
110 | raise util.Abort( | |
115 | _('abort and continue do not allow specifying revisions')) |
|
111 | _('abort and continue do not allow specifying revisions')) | |
116 |
|
112 | |||
117 | (originalwd, target, state, collapsef, keepf, |
|
113 | (originalwd, target, state, collapsef, keepf, | |
@@ -120,15 +116,14 b' def rebase(ui, repo, **opts):' | |||||
120 | return abort(repo, originalwd, target, state) |
|
116 | return abort(repo, originalwd, target, state) | |
121 | else: |
|
117 | else: | |
122 | if srcf and basef: |
|
118 | if srcf and basef: | |
123 |
raise |
|
119 | raise util.Abort(_('cannot specify both a ' | |
124 |
|
|
120 | 'revision and a base')) | |
125 | if detachf: |
|
121 | if detachf: | |
126 | if not srcf: |
|
122 | if not srcf: | |
127 |
raise |
|
123 | raise util.Abort( | |
128 |
|
|
124 | _('detach requires a revision to be specified')) | |
129 | if basef: |
|
125 | if basef: | |
130 | raise error.ParseError( |
|
126 | raise util.Abort(_('cannot specify a base with detach')) | |
131 | 'rebase', _('cannot specify a base with detach')) |
|
|||
132 |
|
127 | |||
133 | cmdutil.bail_if_changed(repo) |
|
128 | cmdutil.bail_if_changed(repo) | |
134 | result = buildstate(repo, destf, srcf, basef, detachf) |
|
129 | result = buildstate(repo, destf, srcf, basef, detachf) | |
@@ -144,8 +139,7 b' def rebase(ui, repo, **opts):' | |||||
144 |
|
139 | |||
145 | if keepbranchesf: |
|
140 | if keepbranchesf: | |
146 | if extrafn: |
|
141 | if extrafn: | |
147 | raise error.ParseError( |
|
142 | raise util.Abort(_('cannot use both keepbranches and extrafn')) | |
148 | 'rebase', _('cannot use both keepbranches and extrafn')) |
|
|||
149 | def extrafn(ctx, extra): |
|
143 | def extrafn(ctx, extra): | |
150 | extra['branch'] = ctx.branch() |
|
144 | extra['branch'] = ctx.branch() | |
151 |
|
145 |
@@ -1,268 +1,16 b'' | |||||
1 | % These fail |
|
1 | % These fail | |
2 |
|
2 | |||
3 | % Use continue and abort |
|
3 | % Use continue and abort | |
4 |
|
|
4 | abort: cannot use both abort and continue | |
5 | hg rebase [-s REV | -b REV] [-d REV] [options] |
|
|||
6 | hg rebase {-a|-c} |
|
|||
7 |
|
||||
8 | move changeset (and descendants) to a different branch |
|
|||
9 |
|
||||
10 | Rebase uses repeated merging to graft changesets from one part of history |
|
|||
11 | (the source) onto another (the destination). This can be useful for |
|
|||
12 | linearizing *local* changes relative to a master development tree. |
|
|||
13 |
|
||||
14 | You should not rebase changesets that have already been shared with |
|
|||
15 | others. Doing so will force everybody else to perform the same rebase or |
|
|||
16 | they will end up with duplicated changesets after pulling in your rebased |
|
|||
17 | changesets. |
|
|||
18 |
|
||||
19 | If you don't specify a destination changeset ("-d/--dest"), rebase uses |
|
|||
20 | the tipmost head of the current named branch as the destination. (The |
|
|||
21 | destination changeset is not modified by rebasing, but new changesets are |
|
|||
22 | added as its descendants.) |
|
|||
23 |
|
||||
24 | You can specify which changesets to rebase in two ways: as a "source" |
|
|||
25 | changeset or as a "base" changeset. Both are shorthand for a topologically |
|
|||
26 | related set of changesets (the "source branch"). If you specify source |
|
|||
27 | ("-s/--source"), rebase will rebase that changeset and all of its |
|
|||
28 | descendants onto dest. If you specify base ("-b/--base"), rebase will |
|
|||
29 | select ancestors of base back to but not including the common ancestor |
|
|||
30 | with dest. Thus, "-b" is less precise but more convenient than "-s": you |
|
|||
31 | can specify any changeset in the source branch, and rebase will select the |
|
|||
32 | whole branch. If you specify neither "-s" nor "-b", rebase uses the parent |
|
|||
33 | of the working directory as the base. |
|
|||
34 |
|
||||
35 | By default, rebase recreates the changesets in the source branch as |
|
|||
36 | descendants of dest and then destroys the originals. Use "--keep" to |
|
|||
37 | preserve the original source changesets. Some changesets in the source |
|
|||
38 | branch (e.g. merges from the destination branch) may be dropped if they no |
|
|||
39 | longer contribute any change. |
|
|||
40 |
|
||||
41 | One result of the rules for selecting the destination changeset and source |
|
|||
42 | branch is that, unlike "merge", rebase will do nothing if you are at the |
|
|||
43 | latest (tipmost) head of a named branch with two heads. You need to |
|
|||
44 | explicitly specify source and/or destination (or "update" to the other |
|
|||
45 | head, if it's the head of the intended source branch). |
|
|||
46 |
|
||||
47 | If a rebase is interrupted to manually resolve a merge, it can be |
|
|||
48 | continued with --continue/-c or aborted with --abort/-a. |
|
|||
49 |
|
||||
50 | Returns 0 on success, 1 if nothing to rebase. |
|
|||
51 |
|
||||
52 | options: |
|
|||
53 |
|
||||
54 | -s --source rebase from the specified changeset |
|
|||
55 | -b --base rebase from the base of the specified changeset (up to |
|
|||
56 | greatest common ancestor of base and dest) |
|
|||
57 | -d --dest rebase onto the specified changeset |
|
|||
58 | --collapse collapse the rebased changesets |
|
|||
59 | --keep keep original changesets |
|
|||
60 | --keepbranches keep original branch names |
|
|||
61 | --detach force detaching of source from its original branch |
|
|||
62 | -c --continue continue an interrupted rebase |
|
|||
63 | -a --abort abort an interrupted rebase |
|
|||
64 | --style display using template map file |
|
|||
65 | --template display with template |
|
|||
66 |
|
||||
67 | use "hg -v help rebase" to show global options |
|
|||
68 |
|
5 | |||
69 | % Use continue and collapse |
|
6 | % Use continue and collapse | |
70 |
|
|
7 | abort: cannot use collapse with continue or abort | |
71 | hg rebase [-s REV | -b REV] [-d REV] [options] |
|
|||
72 | hg rebase {-a|-c} |
|
|||
73 |
|
||||
74 | move changeset (and descendants) to a different branch |
|
|||
75 |
|
||||
76 | Rebase uses repeated merging to graft changesets from one part of history |
|
|||
77 | (the source) onto another (the destination). This can be useful for |
|
|||
78 | linearizing *local* changes relative to a master development tree. |
|
|||
79 |
|
||||
80 | You should not rebase changesets that have already been shared with |
|
|||
81 | others. Doing so will force everybody else to perform the same rebase or |
|
|||
82 | they will end up with duplicated changesets after pulling in your rebased |
|
|||
83 | changesets. |
|
|||
84 |
|
||||
85 | If you don't specify a destination changeset ("-d/--dest"), rebase uses |
|
|||
86 | the tipmost head of the current named branch as the destination. (The |
|
|||
87 | destination changeset is not modified by rebasing, but new changesets are |
|
|||
88 | added as its descendants.) |
|
|||
89 |
|
||||
90 | You can specify which changesets to rebase in two ways: as a "source" |
|
|||
91 | changeset or as a "base" changeset. Both are shorthand for a topologically |
|
|||
92 | related set of changesets (the "source branch"). If you specify source |
|
|||
93 | ("-s/--source"), rebase will rebase that changeset and all of its |
|
|||
94 | descendants onto dest. If you specify base ("-b/--base"), rebase will |
|
|||
95 | select ancestors of base back to but not including the common ancestor |
|
|||
96 | with dest. Thus, "-b" is less precise but more convenient than "-s": you |
|
|||
97 | can specify any changeset in the source branch, and rebase will select the |
|
|||
98 | whole branch. If you specify neither "-s" nor "-b", rebase uses the parent |
|
|||
99 | of the working directory as the base. |
|
|||
100 |
|
||||
101 | By default, rebase recreates the changesets in the source branch as |
|
|||
102 | descendants of dest and then destroys the originals. Use "--keep" to |
|
|||
103 | preserve the original source changesets. Some changesets in the source |
|
|||
104 | branch (e.g. merges from the destination branch) may be dropped if they no |
|
|||
105 | longer contribute any change. |
|
|||
106 |
|
||||
107 | One result of the rules for selecting the destination changeset and source |
|
|||
108 | branch is that, unlike "merge", rebase will do nothing if you are at the |
|
|||
109 | latest (tipmost) head of a named branch with two heads. You need to |
|
|||
110 | explicitly specify source and/or destination (or "update" to the other |
|
|||
111 | head, if it's the head of the intended source branch). |
|
|||
112 |
|
||||
113 | If a rebase is interrupted to manually resolve a merge, it can be |
|
|||
114 | continued with --continue/-c or aborted with --abort/-a. |
|
|||
115 |
|
||||
116 | Returns 0 on success, 1 if nothing to rebase. |
|
|||
117 |
|
||||
118 | options: |
|
|||
119 |
|
||||
120 | -s --source rebase from the specified changeset |
|
|||
121 | -b --base rebase from the base of the specified changeset (up to |
|
|||
122 | greatest common ancestor of base and dest) |
|
|||
123 | -d --dest rebase onto the specified changeset |
|
|||
124 | --collapse collapse the rebased changesets |
|
|||
125 | --keep keep original changesets |
|
|||
126 | --keepbranches keep original branch names |
|
|||
127 | --detach force detaching of source from its original branch |
|
|||
128 | -c --continue continue an interrupted rebase |
|
|||
129 | -a --abort abort an interrupted rebase |
|
|||
130 | --style display using template map file |
|
|||
131 | --template display with template |
|
|||
132 |
|
||||
133 | use "hg -v help rebase" to show global options |
|
|||
134 |
|
8 | |||
135 | % Use continue/abort and dest/source |
|
9 | % Use continue/abort and dest/source | |
136 |
|
|
10 | abort: abort and continue do not allow specifying revisions | |
137 | hg rebase [-s REV | -b REV] [-d REV] [options] |
|
|||
138 | hg rebase {-a|-c} |
|
|||
139 |
|
||||
140 | move changeset (and descendants) to a different branch |
|
|||
141 |
|
||||
142 | Rebase uses repeated merging to graft changesets from one part of history |
|
|||
143 | (the source) onto another (the destination). This can be useful for |
|
|||
144 | linearizing *local* changes relative to a master development tree. |
|
|||
145 |
|
||||
146 | You should not rebase changesets that have already been shared with |
|
|||
147 | others. Doing so will force everybody else to perform the same rebase or |
|
|||
148 | they will end up with duplicated changesets after pulling in your rebased |
|
|||
149 | changesets. |
|
|||
150 |
|
||||
151 | If you don't specify a destination changeset ("-d/--dest"), rebase uses |
|
|||
152 | the tipmost head of the current named branch as the destination. (The |
|
|||
153 | destination changeset is not modified by rebasing, but new changesets are |
|
|||
154 | added as its descendants.) |
|
|||
155 |
|
||||
156 | You can specify which changesets to rebase in two ways: as a "source" |
|
|||
157 | changeset or as a "base" changeset. Both are shorthand for a topologically |
|
|||
158 | related set of changesets (the "source branch"). If you specify source |
|
|||
159 | ("-s/--source"), rebase will rebase that changeset and all of its |
|
|||
160 | descendants onto dest. If you specify base ("-b/--base"), rebase will |
|
|||
161 | select ancestors of base back to but not including the common ancestor |
|
|||
162 | with dest. Thus, "-b" is less precise but more convenient than "-s": you |
|
|||
163 | can specify any changeset in the source branch, and rebase will select the |
|
|||
164 | whole branch. If you specify neither "-s" nor "-b", rebase uses the parent |
|
|||
165 | of the working directory as the base. |
|
|||
166 |
|
||||
167 | By default, rebase recreates the changesets in the source branch as |
|
|||
168 | descendants of dest and then destroys the originals. Use "--keep" to |
|
|||
169 | preserve the original source changesets. Some changesets in the source |
|
|||
170 | branch (e.g. merges from the destination branch) may be dropped if they no |
|
|||
171 | longer contribute any change. |
|
|||
172 |
|
||||
173 | One result of the rules for selecting the destination changeset and source |
|
|||
174 | branch is that, unlike "merge", rebase will do nothing if you are at the |
|
|||
175 | latest (tipmost) head of a named branch with two heads. You need to |
|
|||
176 | explicitly specify source and/or destination (or "update" to the other |
|
|||
177 | head, if it's the head of the intended source branch). |
|
|||
178 |
|
||||
179 | If a rebase is interrupted to manually resolve a merge, it can be |
|
|||
180 | continued with --continue/-c or aborted with --abort/-a. |
|
|||
181 |
|
||||
182 | Returns 0 on success, 1 if nothing to rebase. |
|
|||
183 |
|
||||
184 | options: |
|
|||
185 |
|
||||
186 | -s --source rebase from the specified changeset |
|
|||
187 | -b --base rebase from the base of the specified changeset (up to |
|
|||
188 | greatest common ancestor of base and dest) |
|
|||
189 | -d --dest rebase onto the specified changeset |
|
|||
190 | --collapse collapse the rebased changesets |
|
|||
191 | --keep keep original changesets |
|
|||
192 | --keepbranches keep original branch names |
|
|||
193 | --detach force detaching of source from its original branch |
|
|||
194 | -c --continue continue an interrupted rebase |
|
|||
195 | -a --abort abort an interrupted rebase |
|
|||
196 | --style display using template map file |
|
|||
197 | --template display with template |
|
|||
198 |
|
||||
199 | use "hg -v help rebase" to show global options |
|
|||
200 |
|
11 | |||
201 | % Use source and base |
|
12 | % Use source and base | |
202 |
|
|
13 | abort: cannot specify both a revision and a base | |
203 | hg rebase [-s REV | -b REV] [-d REV] [options] |
|
|||
204 | hg rebase {-a|-c} |
|
|||
205 |
|
||||
206 | move changeset (and descendants) to a different branch |
|
|||
207 |
|
||||
208 | Rebase uses repeated merging to graft changesets from one part of history |
|
|||
209 | (the source) onto another (the destination). This can be useful for |
|
|||
210 | linearizing *local* changes relative to a master development tree. |
|
|||
211 |
|
||||
212 | You should not rebase changesets that have already been shared with |
|
|||
213 | others. Doing so will force everybody else to perform the same rebase or |
|
|||
214 | they will end up with duplicated changesets after pulling in your rebased |
|
|||
215 | changesets. |
|
|||
216 |
|
||||
217 | If you don't specify a destination changeset ("-d/--dest"), rebase uses |
|
|||
218 | the tipmost head of the current named branch as the destination. (The |
|
|||
219 | destination changeset is not modified by rebasing, but new changesets are |
|
|||
220 | added as its descendants.) |
|
|||
221 |
|
||||
222 | You can specify which changesets to rebase in two ways: as a "source" |
|
|||
223 | changeset or as a "base" changeset. Both are shorthand for a topologically |
|
|||
224 | related set of changesets (the "source branch"). If you specify source |
|
|||
225 | ("-s/--source"), rebase will rebase that changeset and all of its |
|
|||
226 | descendants onto dest. If you specify base ("-b/--base"), rebase will |
|
|||
227 | select ancestors of base back to but not including the common ancestor |
|
|||
228 | with dest. Thus, "-b" is less precise but more convenient than "-s": you |
|
|||
229 | can specify any changeset in the source branch, and rebase will select the |
|
|||
230 | whole branch. If you specify neither "-s" nor "-b", rebase uses the parent |
|
|||
231 | of the working directory as the base. |
|
|||
232 |
|
||||
233 | By default, rebase recreates the changesets in the source branch as |
|
|||
234 | descendants of dest and then destroys the originals. Use "--keep" to |
|
|||
235 | preserve the original source changesets. Some changesets in the source |
|
|||
236 | branch (e.g. merges from the destination branch) may be dropped if they no |
|
|||
237 | longer contribute any change. |
|
|||
238 |
|
||||
239 | One result of the rules for selecting the destination changeset and source |
|
|||
240 | branch is that, unlike "merge", rebase will do nothing if you are at the |
|
|||
241 | latest (tipmost) head of a named branch with two heads. You need to |
|
|||
242 | explicitly specify source and/or destination (or "update" to the other |
|
|||
243 | head, if it's the head of the intended source branch). |
|
|||
244 |
|
||||
245 | If a rebase is interrupted to manually resolve a merge, it can be |
|
|||
246 | continued with --continue/-c or aborted with --abort/-a. |
|
|||
247 |
|
||||
248 | Returns 0 on success, 1 if nothing to rebase. |
|
|||
249 |
|
||||
250 | options: |
|
|||
251 |
|
||||
252 | -s --source rebase from the specified changeset |
|
|||
253 | -b --base rebase from the base of the specified changeset (up to |
|
|||
254 | greatest common ancestor of base and dest) |
|
|||
255 | -d --dest rebase onto the specified changeset |
|
|||
256 | --collapse collapse the rebased changesets |
|
|||
257 | --keep keep original changesets |
|
|||
258 | --keepbranches keep original branch names |
|
|||
259 | --detach force detaching of source from its original branch |
|
|||
260 | -c --continue continue an interrupted rebase |
|
|||
261 | -a --abort abort an interrupted rebase |
|
|||
262 | --style display using template map file |
|
|||
263 | --template display with template |
|
|||
264 |
|
||||
265 | use "hg -v help rebase" to show global options |
|
|||
266 |
|
14 | |||
267 | % Rebase with no arguments - from current |
|
15 | % Rebase with no arguments - from current | |
268 | nothing to rebase |
|
16 | nothing to rebase |
General Comments 0
You need to be logged in to leave comments.
Login now