comparison hgext/rebase.py @ 31733:ae6bab095c66

rebase: abort hg pull --rebase if rebase.requiredest is set (issue5514) Previously, the pull would succeed, but the subsequent rebase would fail due to the rebase.requiredest flag. Now abort earlier with a more useful error message.
author Ryan McElroy <rmcelroy@fb.com>
date Thu, 30 Mar 2017 03:50:10 -0700
parents b5afec71c1f9
children 1c911adebf48
comparison
equal deleted inserted replaced
31732:9ddf875183b0 31733:ae6bab095c66
1360 1360
1361 def pullrebase(orig, ui, repo, *args, **opts): 1361 def pullrebase(orig, ui, repo, *args, **opts):
1362 'Call rebase after pull if the latter has been invoked with --rebase' 1362 'Call rebase after pull if the latter has been invoked with --rebase'
1363 ret = None 1363 ret = None
1364 if opts.get('rebase'): 1364 if opts.get('rebase'):
1365 if ui.configbool('commands', 'rebase.requiredest'):
1366 msg = _('rebase destination required by configuration')
1367 hint = _('use hg pull followed by hg rebase -d DEST')
1368 raise error.Abort(msg, hint=hint)
1369
1365 wlock = lock = None 1370 wlock = lock = None
1366 try: 1371 try:
1367 wlock = repo.wlock() 1372 wlock = repo.wlock()
1368 lock = repo.lock() 1373 lock = repo.lock()
1369 if opts.get('update'): 1374 if opts.get('update'):