##// END OF EJS Templates
rebase: add -m/--message to rebase --collapse (issue2389)...
Radomir Dopieralski -
r13661:ee349e22 default
parent child Browse files
Show More
@@ -90,6 +90,7 b' def rebase(ui, repo, **opts):'
90 90 contf = opts.get('continue')
91 91 abortf = opts.get('abort')
92 92 collapsef = opts.get('collapse', False)
93 collapsemsg = cmdutil.logmessage(opts)
93 94 extrafn = opts.get('extrafn') # internal, used by e.g. hgsubversion
94 95 keepf = opts.get('keep', False)
95 96 keepbranchesf = opts.get('keepbranches', False)
@@ -98,6 +99,10 b' def rebase(ui, repo, **opts):'
98 99 # other extensions
99 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 106 if contf or abortf:
102 107 if contf and abortf:
103 108 raise util.Abort(_('cannot use both abort and continue'))
@@ -189,11 +194,14 b' def rebase(ui, repo, **opts):'
189 194 if collapsef and not keepopen:
190 195 p1, p2 = defineparents(repo, min(state), target,
191 196 state, targetancestors)
192 commitmsg = 'Collapsed revision'
193 for rebased in state:
194 if rebased not in skipped and state[rebased] != nullmerge:
195 commitmsg += '\n* %s' % repo[rebased].description()
196 commitmsg = ui.edit(commitmsg, repo.ui.username())
197 if collapsemsg:
198 commitmsg = collapsemsg
199 else:
200 commitmsg = 'Collapsed revision'
201 for rebased in state:
202 if rebased not in skipped and state[rebased] != nullmerge:
203 commitmsg += '\n* %s' % repo[rebased].description()
204 commitmsg = ui.edit(commitmsg, repo.ui.username())
197 205 newrev = concludenode(repo, rev, p1, external, commitmsg=commitmsg,
198 206 extrafn=extrafn)
199 207
@@ -564,6 +572,10 b' cmdtable = {'
564 572 ('d', 'dest', '',
565 573 _('rebase onto the specified changeset'), _('REV')),
566 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 579 ('', 'keep', False, _('keep original changesets')),
568 580 ('', 'keepbranches', False, _('keep original branch names')),
569 581 ('', 'detach', False, _('force detaching of source from its original '
@@ -137,6 +137,40 b' Rebasing G onto H:'
137 137
138 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 175 Create repo b:
142 176
General Comments 0
You need to be logged in to leave comments. Login now