equal
deleted
inserted
replaced
572 of another revision. |
572 of another revision. |
573 |
573 |
574 Returns 0 on success, 1 if nothing to backout or there are unresolved |
574 Returns 0 on success, 1 if nothing to backout or there are unresolved |
575 files. |
575 files. |
576 ''' |
576 ''' |
|
577 wlock = lock = None |
|
578 try: |
|
579 wlock = repo.wlock() |
|
580 lock = repo.lock() |
|
581 return _dobackout(ui, repo, node, rev, commit, **opts) |
|
582 finally: |
|
583 release(lock, wlock) |
|
584 |
|
585 def _dobackout(ui, repo, node=None, rev=None, commit=False, **opts): |
577 if rev and node: |
586 if rev and node: |
578 raise error.Abort(_("please specify just one revision")) |
587 raise error.Abort(_("please specify just one revision")) |
579 |
588 |
580 if not rev: |
589 if not rev: |
581 rev = node |
590 rev = node |
610 if opts.get('parent'): |
619 if opts.get('parent'): |
611 raise error.Abort(_('cannot use --parent on non-merge changeset')) |
620 raise error.Abort(_('cannot use --parent on non-merge changeset')) |
612 parent = p1 |
621 parent = p1 |
613 |
622 |
614 # the backout should appear on the same branch |
623 # the backout should appear on the same branch |
615 wlock = repo.wlock() |
|
616 try: |
624 try: |
617 branch = repo.dirstate.branch() |
625 branch = repo.dirstate.branch() |
618 bheads = repo.branchheads(branch) |
626 bheads = repo.branchheads(branch) |
619 rctx = scmutil.revsingle(repo, hex(parent)) |
627 rctx = scmutil.revsingle(repo, hex(parent)) |
620 if not opts.get('merge') and op1 != node: |
628 if not opts.get('merge') and op1 != node: |
673 'backout') |
681 'backout') |
674 return hg.merge(repo, hex(repo.changelog.tip())) |
682 return hg.merge(repo, hex(repo.changelog.tip())) |
675 finally: |
683 finally: |
676 ui.setconfig('ui', 'forcemerge', '', '') |
684 ui.setconfig('ui', 'forcemerge', '', '') |
677 finally: |
685 finally: |
678 wlock.release() |
686 # TODO: get rid of this meaningless try/finally enclosing. |
|
687 # this is kept only to reduce changes in a patch. |
|
688 pass |
679 return 0 |
689 return 0 |
680 |
690 |
681 @command('bisect', |
691 @command('bisect', |
682 [('r', 'reset', False, _('reset bisect state')), |
692 [('r', 'reset', False, _('reset bisect state')), |
683 ('g', 'good', False, _('mark changeset good')), |
693 ('g', 'good', False, _('mark changeset good')), |