comparison mercurial/scmutil.py @ 39897:a477679f6323

pullreport: skip filtered revs instead of obsolete ones Obsolescence is closely related to visibility but still a distinct concept. We can receive changesets that are obsolete but visible (eg: when pulling orphans). Such changeset should be reported too. In addition, the filtering level can be anything, we should respect it.
author Boris Feld <boris.feld@octobus.net>
date Thu, 27 Sep 2018 16:35:10 +0200
parents d739f423bf06
children b5e12039e6e0
comparison
equal deleted inserted replaced
39896:642cbc228bad 39897:a477679f6323
37 phases, 37 phases,
38 policy, 38 policy,
39 pycompat, 39 pycompat,
40 revsetlang, 40 revsetlang,
41 similar, 41 similar,
42 smartset,
42 url, 43 url,
43 util, 44 util,
44 vfs, 45 vfs,
45 ) 46 )
46 47
1620 """Report the range of new revisions pulled/unbundled.""" 1621 """Report the range of new revisions pulled/unbundled."""
1621 origrepolen = tr.changes.get('origrepolen', len(repo)) 1622 origrepolen = tr.changes.get('origrepolen', len(repo))
1622 if origrepolen >= len(repo): 1623 if origrepolen >= len(repo):
1623 return 1624 return
1624 1625
1625 # Compute the bounds of new revisions' range, excluding obsoletes. 1626 # Compute the bounds of new visible revisions' range.
1626 unfi = repo.unfiltered() 1627 revs = smartset.spanset(repo, start=origrepolen)
1627 revs = unfi.revs('%d: and not obsolete()', origrepolen)
1628 if not revs: 1628 if not revs:
1629 # Got only obsoletes.
1630 return 1629 return
1631 minrev, maxrev = repo[revs.min()], repo[revs.max()] 1630 minrev, maxrev = repo[revs.min()], repo[revs.max()]
1632 1631
1633 if minrev == maxrev: 1632 if minrev == maxrev:
1634 revrange = minrev 1633 revrange = minrev