comparison mercurial/destutil.py @ 28234:2c29f157463e

destutil: remove redundant examination Before this patch, "len(heads) != len(otherheads)" is examined to detect whether message should be displayed or not. But if "repo.revs('%ln and parents()', heads)", heads should contain "parents()" and otherheads is always less than heads.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Wed, 24 Feb 2016 23:00:32 +0900
parents 9da2283d0c56
children c2f0a47069ef
comparison
equal deleted inserted replaced
28233:9da2283d0c56 28234:2c29f157463e
355 ui.status(msg % (len(bmheads), repo._activebookmark)) 355 ui.status(msg % (len(bmheads), repo._activebookmark))
356 356
357 def _statusotherbranchheads(ui, repo): 357 def _statusotherbranchheads(ui, repo):
358 currentbranch = repo.dirstate.branch() 358 currentbranch = repo.dirstate.branch()
359 heads = repo.branchheads(currentbranch) 359 heads = repo.branchheads(currentbranch)
360 l = len(heads)
361 if repo.revs('%ln and parents()', heads): 360 if repo.revs('%ln and parents()', heads):
362 # we are on a head 361 # we are on a head
363 otherheads = repo.revs('%ln - parents()', heads) 362 otherheads = repo.revs('%ln - parents()', heads)
364 if otherheads and l != len(otherheads): 363 if otherheads:
365 ui.status(_('%i other heads for branch "%s"\n') % 364 ui.status(_('%i other heads for branch "%s"\n') %
366 (len(otherheads), currentbranch)) 365 (len(otherheads), currentbranch))
367 366
368 def statusotherdests(ui, repo): 367 def statusotherdests(ui, repo):
369 """Print message about other head""" 368 """Print message about other head"""