comparison mercurial/revset.py @ 32438:14482f8e6ce6

revset: remove redundant condition and change to else from elif Before going to this piece of code, we already check whether n is in [0, 1, 2], so dropping the redundant condition.
author Pulkit Goyal <7895pulkit@gmail.com>
date Mon, 22 May 2017 01:38:00 +0530
parents f064e2f72c49
children e72c5263ccaf
comparison
equal deleted inserted replaced
32437:f03dcb3f95a5 32438:14482f8e6ce6
1504 elif n == 1: 1504 elif n == 1:
1505 try: 1505 try:
1506 ps.add(cl.parentrevs(r)[0]) 1506 ps.add(cl.parentrevs(r)[0])
1507 except error.WdirUnsupported: 1507 except error.WdirUnsupported:
1508 ps.add(repo[r].parents()[0].rev()) 1508 ps.add(repo[r].parents()[0].rev())
1509 elif n == 2: 1509 else:
1510 try: 1510 try:
1511 parents = cl.parentrevs(r) 1511 parents = cl.parentrevs(r)
1512 if parents[1] != node.nullrev: 1512 if parents[1] != node.nullrev:
1513 ps.add(parents[1]) 1513 ps.add(parents[1])
1514 except error.WdirUnsupported: 1514 except error.WdirUnsupported: