author | Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de> |
Thu, 27 May 2010 17:47:40 +0200 | |
changeset 11230 | 5116a077c3da |
parent 11205 | d26f662bfbf5 |
child 11285 | f118029e534c |
permissions | -rw-r--r-- |
6906
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
1 |
% These fail |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
2 |
|
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
3 |
% Use continue and abort |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
4 |
hg rebase: cannot use both abort and continue |
10636 | 5 |
hg rebase [-s REV | -b REV] [-d REV] [options] |
6 |
hg rebase {-a|-c} |
|
6906
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
7 |
|
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
8 |
move changeset (and descendants) to a different branch |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
9 |
|
9073
ec1cd3176625
rebase: wrapped docstrings at 78 characters
Martin Geisler <mg@lazybytes.net>
parents:
8076
diff
changeset
|
10 |
Rebase uses repeated merging to graft changesets from one part of history |
10636 | 11 |
(the source) onto another (the destination). This can be useful for |
11188
b5c0f6a11430
rebase: stress that only local changesets should be rebased
Martin Geisler <mg@lazybytes.net>
parents:
10636
diff
changeset
|
12 |
linearizing *local* changes relative to a master development tree. |
b5c0f6a11430
rebase: stress that only local changesets should be rebased
Martin Geisler <mg@lazybytes.net>
parents:
10636
diff
changeset
|
13 |
|
b5c0f6a11430
rebase: stress that only local changesets should be rebased
Martin Geisler <mg@lazybytes.net>
parents:
10636
diff
changeset
|
14 |
You should not rebase changesets that have already been shared with |
b5c0f6a11430
rebase: stress that only local changesets should be rebased
Martin Geisler <mg@lazybytes.net>
parents:
10636
diff
changeset
|
15 |
others. Doing so will force everybody else to perform the same rebase or |
b5c0f6a11430
rebase: stress that only local changesets should be rebased
Martin Geisler <mg@lazybytes.net>
parents:
10636
diff
changeset
|
16 |
they will end up with duplicated changesets after pulling in your rebased |
b5c0f6a11430
rebase: stress that only local changesets should be rebased
Martin Geisler <mg@lazybytes.net>
parents:
10636
diff
changeset
|
17 |
changesets. |
10636 | 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). |
|
6906
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
46 |
|
7999
b25110140573
rebase: word-wrap help texts at 70 characters
Martin Geisler <mg@daimi.au.dk>
parents:
7951
diff
changeset
|
47 |
If a rebase is interrupted to manually resolve a merge, it can be |
8076
5ec526c1a32f
help texts: write command line switches as -a/--abc
Martin Geisler <mg@lazybytes.net>
parents:
8031
diff
changeset
|
48 |
continued with --continue/-c or aborted with --abort/-a. |
6906
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
49 |
|
11205 | 50 |
Returns 0 on success, 1 if nothing to rebase. |
51 |
||
6906
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
52 |
options: |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
53 |
|
10636 | 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 |
|
9589
fdf0c375cdbf
rebase: change rebase help to talk about changesets and branch names
timeless@mozdev.org
parents:
8076
diff
changeset
|
58 |
--collapse collapse the rebased changesets |
fdf0c375cdbf
rebase: change rebase help to talk about changesets and branch names
timeless@mozdev.org
parents:
8076
diff
changeset
|
59 |
--keep keep original changesets |
fdf0c375cdbf
rebase: change rebase help to talk about changesets and branch names
timeless@mozdev.org
parents:
8076
diff
changeset
|
60 |
--keepbranches keep original branch names |
10352
66d954e76ffb
rebase: add --detach option to detach intermediate revisions (issue1950)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
9599
diff
changeset
|
61 |
--detach force detaching of source from its original branch |
7468
3e5db4228f8f
rebase: add support to keep branch names
Augie Fackler <durin42@gmail.com>
parents:
7130
diff
changeset
|
62 |
-c --continue continue an interrupted rebase |
3e5db4228f8f
rebase: add support to keep branch names
Augie Fackler <durin42@gmail.com>
parents:
7130
diff
changeset
|
63 |
-a --abort abort an interrupted rebase |
3e5db4228f8f
rebase: add support to keep branch names
Augie Fackler <durin42@gmail.com>
parents:
7130
diff
changeset
|
64 |
--style display using template map file |
3e5db4228f8f
rebase: add support to keep branch names
Augie Fackler <durin42@gmail.com>
parents:
7130
diff
changeset
|
65 |
--template display with template |
6906
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
66 |
|
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
67 |
use "hg -v help rebase" to show global options |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
68 |
|
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
69 |
% Use continue and collapse |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
70 |
hg rebase: cannot use collapse with continue or abort |
10636 | 71 |
hg rebase [-s REV | -b REV] [-d REV] [options] |
72 |
hg rebase {-a|-c} |
|
6906
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
73 |
|
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
74 |
move changeset (and descendants) to a different branch |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
75 |
|
9073
ec1cd3176625
rebase: wrapped docstrings at 78 characters
Martin Geisler <mg@lazybytes.net>
parents:
8076
diff
changeset
|
76 |
Rebase uses repeated merging to graft changesets from one part of history |
10636 | 77 |
(the source) onto another (the destination). This can be useful for |
11188
b5c0f6a11430
rebase: stress that only local changesets should be rebased
Martin Geisler <mg@lazybytes.net>
parents:
10636
diff
changeset
|
78 |
linearizing *local* changes relative to a master development tree. |
b5c0f6a11430
rebase: stress that only local changesets should be rebased
Martin Geisler <mg@lazybytes.net>
parents:
10636
diff
changeset
|
79 |
|
b5c0f6a11430
rebase: stress that only local changesets should be rebased
Martin Geisler <mg@lazybytes.net>
parents:
10636
diff
changeset
|
80 |
You should not rebase changesets that have already been shared with |
b5c0f6a11430
rebase: stress that only local changesets should be rebased
Martin Geisler <mg@lazybytes.net>
parents:
10636
diff
changeset
|
81 |
others. Doing so will force everybody else to perform the same rebase or |
b5c0f6a11430
rebase: stress that only local changesets should be rebased
Martin Geisler <mg@lazybytes.net>
parents:
10636
diff
changeset
|
82 |
they will end up with duplicated changesets after pulling in your rebased |
b5c0f6a11430
rebase: stress that only local changesets should be rebased
Martin Geisler <mg@lazybytes.net>
parents:
10636
diff
changeset
|
83 |
changesets. |
10636 | 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). |
|
6906
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
112 |
|
7999
b25110140573
rebase: word-wrap help texts at 70 characters
Martin Geisler <mg@daimi.au.dk>
parents:
7951
diff
changeset
|
113 |
If a rebase is interrupted to manually resolve a merge, it can be |
8076
5ec526c1a32f
help texts: write command line switches as -a/--abc
Martin Geisler <mg@lazybytes.net>
parents:
8031
diff
changeset
|
114 |
continued with --continue/-c or aborted with --abort/-a. |
6906
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
115 |
|
11205 | 116 |
Returns 0 on success, 1 if nothing to rebase. |
117 |
||
6906
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
118 |
options: |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
119 |
|
10636 | 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 |
|
9589
fdf0c375cdbf
rebase: change rebase help to talk about changesets and branch names
timeless@mozdev.org
parents:
8076
diff
changeset
|
124 |
--collapse collapse the rebased changesets |
fdf0c375cdbf
rebase: change rebase help to talk about changesets and branch names
timeless@mozdev.org
parents:
8076
diff
changeset
|
125 |
--keep keep original changesets |
fdf0c375cdbf
rebase: change rebase help to talk about changesets and branch names
timeless@mozdev.org
parents:
8076
diff
changeset
|
126 |
--keepbranches keep original branch names |
10352
66d954e76ffb
rebase: add --detach option to detach intermediate revisions (issue1950)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
9599
diff
changeset
|
127 |
--detach force detaching of source from its original branch |
7468
3e5db4228f8f
rebase: add support to keep branch names
Augie Fackler <durin42@gmail.com>
parents:
7130
diff
changeset
|
128 |
-c --continue continue an interrupted rebase |
3e5db4228f8f
rebase: add support to keep branch names
Augie Fackler <durin42@gmail.com>
parents:
7130
diff
changeset
|
129 |
-a --abort abort an interrupted rebase |
3e5db4228f8f
rebase: add support to keep branch names
Augie Fackler <durin42@gmail.com>
parents:
7130
diff
changeset
|
130 |
--style display using template map file |
3e5db4228f8f
rebase: add support to keep branch names
Augie Fackler <durin42@gmail.com>
parents:
7130
diff
changeset
|
131 |
--template display with template |
6906
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
132 |
|
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
133 |
use "hg -v help rebase" to show global options |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
134 |
|
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
135 |
% Use continue/abort and dest/source |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
136 |
hg rebase: abort and continue do not allow specifying revisions |
10636 | 137 |
hg rebase [-s REV | -b REV] [-d REV] [options] |
138 |
hg rebase {-a|-c} |
|
6906
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
139 |
|
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
140 |
move changeset (and descendants) to a different branch |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
141 |
|
9073
ec1cd3176625
rebase: wrapped docstrings at 78 characters
Martin Geisler <mg@lazybytes.net>
parents:
8076
diff
changeset
|
142 |
Rebase uses repeated merging to graft changesets from one part of history |
10636 | 143 |
(the source) onto another (the destination). This can be useful for |
11188
b5c0f6a11430
rebase: stress that only local changesets should be rebased
Martin Geisler <mg@lazybytes.net>
parents:
10636
diff
changeset
|
144 |
linearizing *local* changes relative to a master development tree. |
b5c0f6a11430
rebase: stress that only local changesets should be rebased
Martin Geisler <mg@lazybytes.net>
parents:
10636
diff
changeset
|
145 |
|
b5c0f6a11430
rebase: stress that only local changesets should be rebased
Martin Geisler <mg@lazybytes.net>
parents:
10636
diff
changeset
|
146 |
You should not rebase changesets that have already been shared with |
b5c0f6a11430
rebase: stress that only local changesets should be rebased
Martin Geisler <mg@lazybytes.net>
parents:
10636
diff
changeset
|
147 |
others. Doing so will force everybody else to perform the same rebase or |
b5c0f6a11430
rebase: stress that only local changesets should be rebased
Martin Geisler <mg@lazybytes.net>
parents:
10636
diff
changeset
|
148 |
they will end up with duplicated changesets after pulling in your rebased |
b5c0f6a11430
rebase: stress that only local changesets should be rebased
Martin Geisler <mg@lazybytes.net>
parents:
10636
diff
changeset
|
149 |
changesets. |
10636 | 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). |
|
6906
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
178 |
|
7999
b25110140573
rebase: word-wrap help texts at 70 characters
Martin Geisler <mg@daimi.au.dk>
parents:
7951
diff
changeset
|
179 |
If a rebase is interrupted to manually resolve a merge, it can be |
8076
5ec526c1a32f
help texts: write command line switches as -a/--abc
Martin Geisler <mg@lazybytes.net>
parents:
8031
diff
changeset
|
180 |
continued with --continue/-c or aborted with --abort/-a. |
6906
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
181 |
|
11205 | 182 |
Returns 0 on success, 1 if nothing to rebase. |
183 |
||
6906
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
184 |
options: |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
185 |
|
10636 | 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 |
|
9589
fdf0c375cdbf
rebase: change rebase help to talk about changesets and branch names
timeless@mozdev.org
parents:
8076
diff
changeset
|
190 |
--collapse collapse the rebased changesets |
fdf0c375cdbf
rebase: change rebase help to talk about changesets and branch names
timeless@mozdev.org
parents:
8076
diff
changeset
|
191 |
--keep keep original changesets |
fdf0c375cdbf
rebase: change rebase help to talk about changesets and branch names
timeless@mozdev.org
parents:
8076
diff
changeset
|
192 |
--keepbranches keep original branch names |
10352
66d954e76ffb
rebase: add --detach option to detach intermediate revisions (issue1950)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
9599
diff
changeset
|
193 |
--detach force detaching of source from its original branch |
7468
3e5db4228f8f
rebase: add support to keep branch names
Augie Fackler <durin42@gmail.com>
parents:
7130
diff
changeset
|
194 |
-c --continue continue an interrupted rebase |
3e5db4228f8f
rebase: add support to keep branch names
Augie Fackler <durin42@gmail.com>
parents:
7130
diff
changeset
|
195 |
-a --abort abort an interrupted rebase |
3e5db4228f8f
rebase: add support to keep branch names
Augie Fackler <durin42@gmail.com>
parents:
7130
diff
changeset
|
196 |
--style display using template map file |
3e5db4228f8f
rebase: add support to keep branch names
Augie Fackler <durin42@gmail.com>
parents:
7130
diff
changeset
|
197 |
--template display with template |
6906
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
198 |
|
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
199 |
use "hg -v help rebase" to show global options |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
200 |
|
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
201 |
% Use source and base |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
202 |
hg rebase: cannot specify both a revision and a base |
10636 | 203 |
hg rebase [-s REV | -b REV] [-d REV] [options] |
204 |
hg rebase {-a|-c} |
|
6906
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
205 |
|
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
206 |
move changeset (and descendants) to a different branch |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
207 |
|
9073
ec1cd3176625
rebase: wrapped docstrings at 78 characters
Martin Geisler <mg@lazybytes.net>
parents:
8076
diff
changeset
|
208 |
Rebase uses repeated merging to graft changesets from one part of history |
10636 | 209 |
(the source) onto another (the destination). This can be useful for |
11188
b5c0f6a11430
rebase: stress that only local changesets should be rebased
Martin Geisler <mg@lazybytes.net>
parents:
10636
diff
changeset
|
210 |
linearizing *local* changes relative to a master development tree. |
b5c0f6a11430
rebase: stress that only local changesets should be rebased
Martin Geisler <mg@lazybytes.net>
parents:
10636
diff
changeset
|
211 |
|
b5c0f6a11430
rebase: stress that only local changesets should be rebased
Martin Geisler <mg@lazybytes.net>
parents:
10636
diff
changeset
|
212 |
You should not rebase changesets that have already been shared with |
b5c0f6a11430
rebase: stress that only local changesets should be rebased
Martin Geisler <mg@lazybytes.net>
parents:
10636
diff
changeset
|
213 |
others. Doing so will force everybody else to perform the same rebase or |
b5c0f6a11430
rebase: stress that only local changesets should be rebased
Martin Geisler <mg@lazybytes.net>
parents:
10636
diff
changeset
|
214 |
they will end up with duplicated changesets after pulling in your rebased |
b5c0f6a11430
rebase: stress that only local changesets should be rebased
Martin Geisler <mg@lazybytes.net>
parents:
10636
diff
changeset
|
215 |
changesets. |
10636 | 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). |
|
6906
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
244 |
|
7999
b25110140573
rebase: word-wrap help texts at 70 characters
Martin Geisler <mg@daimi.au.dk>
parents:
7951
diff
changeset
|
245 |
If a rebase is interrupted to manually resolve a merge, it can be |
8076
5ec526c1a32f
help texts: write command line switches as -a/--abc
Martin Geisler <mg@lazybytes.net>
parents:
8031
diff
changeset
|
246 |
continued with --continue/-c or aborted with --abort/-a. |
6906
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
247 |
|
11205 | 248 |
Returns 0 on success, 1 if nothing to rebase. |
249 |
||
6906
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
250 |
options: |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
251 |
|
10636 | 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 |
|
9589
fdf0c375cdbf
rebase: change rebase help to talk about changesets and branch names
timeless@mozdev.org
parents:
8076
diff
changeset
|
256 |
--collapse collapse the rebased changesets |
fdf0c375cdbf
rebase: change rebase help to talk about changesets and branch names
timeless@mozdev.org
parents:
8076
diff
changeset
|
257 |
--keep keep original changesets |
fdf0c375cdbf
rebase: change rebase help to talk about changesets and branch names
timeless@mozdev.org
parents:
8076
diff
changeset
|
258 |
--keepbranches keep original branch names |
10352
66d954e76ffb
rebase: add --detach option to detach intermediate revisions (issue1950)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
9599
diff
changeset
|
259 |
--detach force detaching of source from its original branch |
7468
3e5db4228f8f
rebase: add support to keep branch names
Augie Fackler <durin42@gmail.com>
parents:
7130
diff
changeset
|
260 |
-c --continue continue an interrupted rebase |
3e5db4228f8f
rebase: add support to keep branch names
Augie Fackler <durin42@gmail.com>
parents:
7130
diff
changeset
|
261 |
-a --abort abort an interrupted rebase |
3e5db4228f8f
rebase: add support to keep branch names
Augie Fackler <durin42@gmail.com>
parents:
7130
diff
changeset
|
262 |
--style display using template map file |
3e5db4228f8f
rebase: add support to keep branch names
Augie Fackler <durin42@gmail.com>
parents:
7130
diff
changeset
|
263 |
--template display with template |
6906
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
264 |
|
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
265 |
use "hg -v help rebase" to show global options |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
266 |
|
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
267 |
% Rebase with no arguments - from current |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
268 |
nothing to rebase |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
269 |
|
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
270 |
% Rebase with no arguments - from the current branch |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
271 |
0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
272 |
nothing to rebase |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
273 |
% ---------- |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
274 |
% These work |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
275 |
|
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
276 |
% Rebase with no arguments (from 3 onto 7) |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
277 |
3 files updated, 0 files merged, 2 files removed, 0 files unresolved |
11201
34023f2ca305
Fix up rebase's handling of strip backups
Matt Mackall <mpm@selenic.com>
parents:
11197
diff
changeset
|
278 |
saved backup bundle to |
7130
204c7850c158
rebase: disable rollback after rebasing
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
6906
diff
changeset
|
279 |
% Try to rollback after a rebase (fail) |
204c7850c158
rebase: disable rollback after rebasing
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
6906
diff
changeset
|
280 |
no rollback information available |
6906
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
281 |
|
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
282 |
% Rebase with base == '.' => same as no arguments (from 3 onto 7) |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
283 |
3 files updated, 0 files merged, 3 files removed, 0 files unresolved |
11201
34023f2ca305
Fix up rebase's handling of strip backups
Matt Mackall <mpm@selenic.com>
parents:
11197
diff
changeset
|
284 |
saved backup bundle to |
6906
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
285 |
|
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
286 |
% Rebase with dest == default => same as no arguments (from 3 onto 7) |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
287 |
3 files updated, 0 files merged, 3 files removed, 0 files unresolved |
11201
34023f2ca305
Fix up rebase's handling of strip backups
Matt Mackall <mpm@selenic.com>
parents:
11197
diff
changeset
|
288 |
saved backup bundle to |
6906
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
289 |
|
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
290 |
% Specify only source (from 4 onto 7) |
11201
34023f2ca305
Fix up rebase's handling of strip backups
Matt Mackall <mpm@selenic.com>
parents:
11197
diff
changeset
|
291 |
saved backup bundle to |
6906
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
292 |
|
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
293 |
% Specify only dest (from 3 onto 6) |
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
294 |
3 files updated, 0 files merged, 3 files removed, 0 files unresolved |
11201
34023f2ca305
Fix up rebase's handling of strip backups
Matt Mackall <mpm@selenic.com>
parents:
11197
diff
changeset
|
295 |
saved backup bundle to |
6906
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
296 |
|
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
297 |
% Specify only base (from 3 onto 7) |
11201
34023f2ca305
Fix up rebase's handling of strip backups
Matt Mackall <mpm@selenic.com>
parents:
11197
diff
changeset
|
298 |
saved backup bundle to |
6906
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
299 |
|
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
300 |
% Specify source and dest (from 4 onto 6) |
11201
34023f2ca305
Fix up rebase's handling of strip backups
Matt Mackall <mpm@selenic.com>
parents:
11197
diff
changeset
|
301 |
saved backup bundle to |
6906
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
302 |
|
808f03f61ebe
Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff
changeset
|
303 |
% Specify base and dest (from 3 onto 6) |
11201
34023f2ca305
Fix up rebase's handling of strip backups
Matt Mackall <mpm@selenic.com>
parents:
11197
diff
changeset
|
304 |
saved backup bundle to |