##// END OF EJS Templates
graft: extract meta information computation in a function...
marmoute -
r53401:de168009 default
parent child Browse files
Show More
@@ -231,6 +231,22 def _build_progress(ui, repo, ctx):
231 231 return _(b'grafting %s\n') % rev_sum
232 232
233 233
234 def _build_meta(ui, repo, ctx, statedata):
235 source = ctx.extra().get(b'source')
236 extra = {}
237 if source:
238 extra[b'source'] = source
239 extra[b'intermediate-source'] = ctx.hex()
240 else:
241 extra[b'source'] = ctx.hex()
242 user = statedata.get(b'user', ctx.user())
243 date = statedata.get(b'date', ctx.date())
244 message = ctx.description()
245 if statedata.get(b'log'):
246 message += b'\n(grafted from %s)' % ctx.hex()
247 return (user, date, message, extra)
248
249
234 250 def _graft_revisions(
235 251 ui,
236 252 repo,
@@ -248,18 +264,7 def _graft_revisions(
248 264 if dry_run:
249 265 continue
250 266
251 source = ctx.extra().get(b'source')
252 extra = {}
253 if source:
254 extra[b'source'] = source
255 extra[b'intermediate-source'] = ctx.hex()
256 else:
257 extra[b'source'] = ctx.hex()
258 user = statedata.get(b'user', ctx.user())
259 date = statedata.get(b'date', ctx.date())
260 message = ctx.description()
261 if statedata.get(b'log'):
262 message += b'\n(grafted from %s)' % ctx.hex()
267 (user, date, message, extra) = _build_meta(ui, repo, ctx, statedata)
263 268
264 269 # we don't merge the first commit when continuing
265 270 if not cont:
General Comments 0
You need to be logged in to leave comments. Login now