Show More
@@ -114,6 +114,8 def rebase(ui, repo, **opts): | |||||
114 | if srcf or basef or destf: |
|
114 | if srcf or basef or destf: | |
115 | raise util.Abort( |
|
115 | raise util.Abort( | |
116 | _('abort and continue do not allow specifying revisions')) |
|
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 | (originalwd, target, state, skipped, collapsef, keepf, |
|
120 | (originalwd, target, state, skipped, collapsef, keepf, | |
119 | keepbranchesf, external) = restorestatus(repo) |
|
121 | keepbranchesf, external) = restorestatus(repo) | |
@@ -167,10 +169,14 def rebase(ui, repo, **opts): | |||||
167 | if len(repo.parents()) == 2: |
|
169 | if len(repo.parents()) == 2: | |
168 | repo.ui.debug('resuming interrupted rebase\n') |
|
170 | repo.ui.debug('resuming interrupted rebase\n') | |
169 | else: |
|
171 | else: | |
|
172 | try: | |||
|
173 | ui.setconfig('ui', 'forcemerge', opts.get('tool', '')) | |||
170 | stats = rebasenode(repo, rev, p1, p2, state) |
|
174 | stats = rebasenode(repo, rev, p1, p2, state) | |
171 | if stats and stats[3] > 0: |
|
175 | if stats and stats[3] > 0: | |
172 | raise util.Abort(_('unresolved conflicts (see hg ' |
|
176 | raise util.Abort(_('unresolved conflicts (see hg ' | |
173 | 'resolve, then hg rebase --continue)')) |
|
177 | 'resolve, then hg rebase --continue)')) | |
|
178 | finally: | |||
|
179 | ui.setconfig('ui', 'forcemerge', '') | |||
174 | updatedirstate(repo, rev, target, p2) |
|
180 | updatedirstate(repo, rev, target, p2) | |
175 | if not collapsef: |
|
181 | if not collapsef: | |
176 | newrev = concludenode(repo, rev, p1, p2, extrafn=extrafn) |
|
182 | newrev = concludenode(repo, rev, p1, p2, extrafn=extrafn) | |
@@ -592,6 +598,7 cmdtable = { | |||||
592 | ('', 'keepbranches', False, _('keep original branch names')), |
|
598 | ('', 'keepbranches', False, _('keep original branch names')), | |
593 | ('', 'detach', False, _('force detaching of source from its original ' |
|
599 | ('', 'detach', False, _('force detaching of source from its original ' | |
594 | 'branch')), |
|
600 | 'branch')), | |
|
601 | ('t', 'tool', '', _('specify merge tool')), | |||
595 | ('c', 'continue', False, _('continue an interrupted rebase')), |
|
602 | ('c', 'continue', False, _('continue an interrupted rebase')), | |
596 | ('a', 'abort', False, _('abort an interrupted rebase'))] + |
|
603 | ('a', 'abort', False, _('abort an interrupted rebase'))] + | |
597 | templateopts, |
|
604 | templateopts, |
@@ -330,3 +330,63 Specify base and dest (from 3 onto 6): | |||||
330 |
|
330 | |||
331 | $ cd .. |
|
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