##// END OF EJS Templates
rebase: add --tool argument for specifying merge tool
Stefano Tortarolo -
r13856:0995eee8 default
parent child Browse files
Show More
@@ -114,6 +114,8 def rebase(ui, repo, **opts):
114 114 if srcf or basef or destf:
115 115 raise util.Abort(
116 116 _('abort and continue do not allow specifying revisions'))
117 if opts.get('tool', False):
118 ui.warn(_('tool option will be ignored\n'))
117 119
118 120 (originalwd, target, state, skipped, collapsef, keepf,
119 121 keepbranchesf, external) = restorestatus(repo)
@@ -167,10 +169,14 def rebase(ui, repo, **opts):
167 169 if len(repo.parents()) == 2:
168 170 repo.ui.debug('resuming interrupted rebase\n')
169 171 else:
172 try:
173 ui.setconfig('ui', 'forcemerge', opts.get('tool', ''))
170 174 stats = rebasenode(repo, rev, p1, p2, state)
171 175 if stats and stats[3] > 0:
172 176 raise util.Abort(_('unresolved conflicts (see hg '
173 177 'resolve, then hg rebase --continue)'))
178 finally:
179 ui.setconfig('ui', 'forcemerge', '')
174 180 updatedirstate(repo, rev, target, p2)
175 181 if not collapsef:
176 182 newrev = concludenode(repo, rev, p1, p2, extrafn=extrafn)
@@ -592,6 +598,7 cmdtable = {
592 598 ('', 'keepbranches', False, _('keep original branch names')),
593 599 ('', 'detach', False, _('force detaching of source from its original '
594 600 'branch')),
601 ('t', 'tool', '', _('specify merge tool')),
595 602 ('c', 'continue', False, _('continue an interrupted rebase')),
596 603 ('a', 'abort', False, _('abort an interrupted rebase'))] +
597 604 templateopts,
@@ -330,3 +330,63 Specify base and dest (from 3 onto 6):
330 330
331 331 $ cd ..
332 332
333 Test --tool parameter:
334
335 $ hg init b
336 $ cd b
337
338 $ echo c1 > c1
339 $ hg ci -Am c1
340 adding c1
341
342 $ echo c2 > c2
343 $ hg ci -Am c2
344 adding c2
345
346 $ hg up -q 0
347 $ echo c2b > c2
348 $ hg ci -Am c2b
349 adding c2
350 created new head
351
352 $ cd ..
353
354 $ hg clone -q -u . b b1
355 $ cd b1
356
357 $ hg rebase -s 2 -d 1 --tool internal:local
358 saved backup bundle to $TESTTMP/b1/.hg/strip-backup/*-backup.hg (glob)
359
360 $ hg cat c2
361 c2
362
363 $ cd ..
364
365
366 $ hg clone -q -u . b b2
367 $ cd b2
368
369 $ hg rebase -s 2 -d 1 --tool internal:other
370 saved backup bundle to $TESTTMP/b2/.hg/strip-backup/*-backup.hg (glob)
371
372 $ hg cat c2
373 c2b
374
375 $ cd ..
376
377
378 $ hg clone -q -u . b b3
379 $ cd b3
380
381 $ hg rebase -s 2 -d 1 --tool internal:fail
382 abort: unresolved conflicts (see hg resolve, then hg rebase --continue)
383 [255]
384
385 $ hg resolve -l
386 U c2
387
388 $ hg resolve -m c2
389 $ hg rebase -c --tool internal:fail
390 tool option will be ignored
391 saved backup bundle to $TESTTMP/b3/.hg/strip-backup/*-backup.hg (glob)
392
General Comments 0
You need to be logged in to leave comments. Login now