comparison mercurial/destutil.py @ 28684:1ace17e1e160

destutil: show message and hint at updating to the closed head as warning
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Tue, 29 Mar 2016 23:59:32 +0900
parents d0210a35c81a
children e1dd0de26557
comparison
equal deleted inserted replaced
28683:d0210a35c81a 28684:1ace17e1e160
395 # x 0 there is only one non-closed branch head 395 # x 0 there is only one non-closed branch head
396 # N there are some non-closed branch heads 396 # N there are some non-closed branch heads
397 # ========= ========== 397 # ========= ==========
398 otherheads = repo.revs('%ln - parents()', heads) 398 otherheads = repo.revs('%ln - parents()', heads)
399 if repo['.'].closesbranch(): 399 if repo['.'].closesbranch():
400 ui.status(_('no open descendant heads on branch "%s", ' 400 ui.warn(_('no open descendant heads on branch "%s", '
401 'updating to a closed head\n') % 401 'updating to a closed head\n') %
402 (currentbranch)) 402 (currentbranch))
403 if otherheads: 403 if otherheads:
404 ui.status(_('(committing will reopen the head, ' 404 ui.warn(_('(committing will reopen the head, '
405 'use `hg heads .` to see %i other heads)\n') % 405 'use `hg heads .` to see %i other heads)\n') %
406 (len(otherheads))) 406 (len(otherheads)))
407 else: 407 else:
408 ui.status(_('(committing will reopen branch "%s")\n') % 408 ui.warn(_('(committing will reopen branch "%s")\n') %
409 (currentbranch)) 409 (currentbranch))
410 elif otherheads: 410 elif otherheads:
411 ui.status(_('%i other heads for branch "%s"\n') % 411 ui.status(_('%i other heads for branch "%s"\n') %
412 (len(otherheads), currentbranch)) 412 (len(otherheads), currentbranch))
413 413