comparison mercurial/cmdutil.py @ 20756:e7833e63bb42

cmdutil: changed code in _makegraphlogrevset not to use getitem __getitem__ is a method that is not implemented lazily on many of the new classes and it can be easily replaced with a structure that takes advantage of the new lazy implementations instead.
author Lucas Moscovicz <lmoscovicz@fb.com>
date Fri, 14 Mar 2014 11:35:17 -0700
parents cfd03c069e08
children 3813a1dd9eb9
comparison
equal deleted inserted replaced
20755:cfd03c069e08 20756:e7833e63bb42
1513 opts = dict(opts) 1513 opts = dict(opts)
1514 # follow or not follow? 1514 # follow or not follow?
1515 follow = opts.get('follow') or opts.get('follow_first') 1515 follow = opts.get('follow') or opts.get('follow_first')
1516 followfirst = opts.get('follow_first') and 1 or 0 1516 followfirst = opts.get('follow_first') and 1 or 0
1517 # --follow with FILE behaviour depends on revs... 1517 # --follow with FILE behaviour depends on revs...
1518 startrev = revs[0] 1518 it = iter(revs)
1519 followdescendants = (len(revs) > 1 and revs[0] < revs[1]) and 1 or 0 1519 startrev = it.next()
1520 try:
1521 followdescendants = startrev < it.next()
1522 except (StopIteration):
1523 followdescendants = False
1520 1524
1521 # branch and only_branch are really aliases and must be handled at 1525 # branch and only_branch are really aliases and must be handled at
1522 # the same time 1526 # the same time
1523 opts['branch'] = opts.get('branch', []) + opts.get('only_branch', []) 1527 opts['branch'] = opts.get('branch', []) + opts.get('only_branch', [])
1524 opts['branch'] = [repo.lookupbranch(b) for b in opts['branch']] 1528 opts['branch'] = [repo.lookupbranch(b) for b in opts['branch']]