Show More
@@ -90,6 +90,7 def rebase(ui, repo, **opts): | |||||
90 | contf = opts.get('continue') |
|
90 | contf = opts.get('continue') | |
91 | abortf = opts.get('abort') |
|
91 | abortf = opts.get('abort') | |
92 | collapsef = opts.get('collapse', False) |
|
92 | collapsef = opts.get('collapse', False) | |
|
93 | collapsemsg = cmdutil.logmessage(opts) | |||
93 | extrafn = opts.get('extrafn') # internal, used by e.g. hgsubversion |
|
94 | extrafn = opts.get('extrafn') # internal, used by e.g. hgsubversion | |
94 | keepf = opts.get('keep', False) |
|
95 | keepf = opts.get('keep', False) | |
95 | keepbranchesf = opts.get('keepbranches', False) |
|
96 | keepbranchesf = opts.get('keepbranches', False) | |
@@ -98,6 +99,10 def rebase(ui, repo, **opts): | |||||
98 | # other extensions |
|
99 | # other extensions | |
99 | keepopen = opts.get('keepopen', False) |
|
100 | keepopen = opts.get('keepopen', False) | |
100 |
|
101 | |||
|
102 | if collapsemsg and not collapsef: | |||
|
103 | raise util.Abort( | |||
|
104 | _('message can only be specified with collapse')) | |||
|
105 | ||||
101 | if contf or abortf: |
|
106 | if contf or abortf: | |
102 | if contf and abortf: |
|
107 | if contf and abortf: | |
103 | raise util.Abort(_('cannot use both abort and continue')) |
|
108 | raise util.Abort(_('cannot use both abort and continue')) | |
@@ -189,6 +194,9 def rebase(ui, repo, **opts): | |||||
189 | if collapsef and not keepopen: |
|
194 | if collapsef and not keepopen: | |
190 | p1, p2 = defineparents(repo, min(state), target, |
|
195 | p1, p2 = defineparents(repo, min(state), target, | |
191 | state, targetancestors) |
|
196 | state, targetancestors) | |
|
197 | if collapsemsg: | |||
|
198 | commitmsg = collapsemsg | |||
|
199 | else: | |||
192 | commitmsg = 'Collapsed revision' |
|
200 | commitmsg = 'Collapsed revision' | |
193 | for rebased in state: |
|
201 | for rebased in state: | |
194 | if rebased not in skipped and state[rebased] != nullmerge: |
|
202 | if rebased not in skipped and state[rebased] != nullmerge: | |
@@ -564,6 +572,10 cmdtable = { | |||||
564 | ('d', 'dest', '', |
|
572 | ('d', 'dest', '', | |
565 | _('rebase onto the specified changeset'), _('REV')), |
|
573 | _('rebase onto the specified changeset'), _('REV')), | |
566 | ('', 'collapse', False, _('collapse the rebased changesets')), |
|
574 | ('', 'collapse', False, _('collapse the rebased changesets')), | |
|
575 | ('m', 'message', '', | |||
|
576 | _('use text as collapse commit message'), _('TEXT')), | |||
|
577 | ('l', 'logfile', '', | |||
|
578 | _('read collapse commit message from file'), _('FILE')), | |||
567 | ('', 'keep', False, _('keep original changesets')), |
|
579 | ('', 'keep', False, _('keep original changesets')), | |
568 | ('', 'keepbranches', False, _('keep original branch names')), |
|
580 | ('', 'keepbranches', False, _('keep original branch names')), | |
569 | ('', 'detach', False, _('force detaching of source from its original ' |
|
581 | ('', 'detach', False, _('force detaching of source from its original ' |
@@ -137,6 +137,40 Rebasing G onto H: | |||||
137 |
|
137 | |||
138 | $ cd .. |
|
138 | $ cd .. | |
139 |
|
139 | |||
|
140 | Rebasing G onto H with custom message: | |||
|
141 | ||||
|
142 | $ hg clone -q -u . a a3 | |||
|
143 | $ cd a3 | |||
|
144 | ||||
|
145 | $ hg rebase --base 6 -m 'custom message' | |||
|
146 | abort: message can only be specified with collapse | |||
|
147 | [255] | |||
|
148 | ||||
|
149 | $ hg rebase --base 6 --collapse -m 'custom message' | |||
|
150 | saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob) | |||
|
151 | ||||
|
152 | $ hg tglog | |||
|
153 | @ 6: 'custom message' | |||
|
154 | | | |||
|
155 | o 5: 'H' | |||
|
156 | | | |||
|
157 | o 4: 'F' | |||
|
158 | | | |||
|
159 | | o 3: 'D' | |||
|
160 | | | | |||
|
161 | | o 2: 'C' | |||
|
162 | | | | |||
|
163 | | o 1: 'B' | |||
|
164 | |/ | |||
|
165 | o 0: 'A' | |||
|
166 | ||||
|
167 | $ hg manifest | |||
|
168 | A | |||
|
169 | E | |||
|
170 | F | |||
|
171 | H | |||
|
172 | ||||
|
173 | $ cd .. | |||
140 |
|
174 | |||
141 | Create repo b: |
|
175 | Create repo b: | |
142 |
|
176 |
General Comments 0
You need to be logged in to leave comments.
Login now