notify: use changelog API to iterate over revision number (issue5821) stable
authorBoris Feld <boris.feld@octobus.net>
Wed, 18 Apr 2018 15:04:12 +0200
branchstable
changeset 37793 a07fab68621f
parent 37792 33d26f7bd6ca
child 37794 04d648b53e3e
notify: use changelog API to iterate over revision number (issue5821) This will avoid iterating over filtered revision.
hgext/notify.py
--- a/hgext/notify.py	Thu Apr 19 00:55:36 2018 -0400
+++ b/hgext/notify.py	Wed Apr 18 15:04:12 2018 +0200
@@ -469,8 +469,7 @@
     count = 0
     author = ''
     if hooktype == 'changegroup' or hooktype == 'outgoing':
-        start, end = ctx.rev(), len(repo)
-        for rev in xrange(start, end):
+        for rev in repo.changelog.revs(start=ctx.rev()):
             if n.node(repo[rev]):
                 count += 1
                 if not author: