comparison hgext/rebase.py @ 31558:13dc00c233b7

rebase: add flag to require destination In some mercurial workflows, the default destination for rebase does not always work well and can lead to confusing behavior. With this flag enabled, every rebase command will require passing an explicit destination, eliminating this confusion.
author Ryan McElroy <rmcelroy@fb.com>
date Tue, 14 Mar 2017 17:43:44 -0700
parents 2519994d25ca
children 37a0ad669051
comparison
equal deleted inserted replaced
31557:79d98e1b21a7 31558:13dc00c233b7
660 660
661 - move a named branch while preserving its name:: 661 - move a named branch while preserving its name::
662 662
663 hg rebase -r "branch(featureX)" -d 1.3 --keepbranches 663 hg rebase -r "branch(featureX)" -d 1.3 --keepbranches
664 664
665 Configuration Options:
666
667 You can make rebase require a destination if you set the following config
668 option:
669
670 [commands]
671 rebase.requiredest = False
672
673 Return Values:
674
665 Returns 0 on success, 1 if nothing to rebase or there are 675 Returns 0 on success, 1 if nothing to rebase or there are
666 unresolved conflicts. 676 unresolved conflicts.
667 677
668 """ 678 """
669 rbsrt = rebaseruntime(repo, ui, opts) 679 rbsrt = rebaseruntime(repo, ui, opts)
673 wlock = repo.wlock() 683 wlock = repo.wlock()
674 lock = repo.lock() 684 lock = repo.lock()
675 685
676 # Validate input and define rebasing points 686 # Validate input and define rebasing points
677 destf = opts.get('dest', None) 687 destf = opts.get('dest', None)
688
689 if ui.config('commands', 'rebase.requiredest', False):
690 if not destf:
691 raise error.Abort(_('you must specify a destination'),
692 hint=_('use: hg rebase -d REV'))
693
678 srcf = opts.get('source', None) 694 srcf = opts.get('source', None)
679 basef = opts.get('base', None) 695 basef = opts.get('base', None)
680 revf = opts.get('rev', []) 696 revf = opts.get('rev', [])
681 # search default destination in this space 697 # search default destination in this space
682 # used in the 'hg pull --rebase' case, see issue 5214. 698 # used in the 'hg pull --rebase' case, see issue 5214.