src/access.py
changeset 52 f9eb98bb0791
parent 51 d87eeeae29a5
child 53 853444c5d393
--- a/src/access.py	Fri Feb 20 14:29:48 2009 +0000
+++ b/src/access.py	Fri Feb 20 15:08:50 2009 +0000
@@ -13,6 +13,7 @@
 
 import os
 import ruleset
+import changes
 
 class Checker(object):
     '''acl checker.'''
@@ -40,14 +41,11 @@
             raise mercurial.util.Abort(_('%s: access denied for changeset %s') %
                 (__name__, ctx.short()))
 
-        
 def hook(ui, repo, hooktype, node=None, source=None, **kwargs):
     if hooktype != 'pretxnchangegroup':
         raise mercurial.util.Abort(_('config error - hook type "%s" cannot stop '
                            'incoming changesets') % hooktype)
     c = Checker(ui, repo)
-    start = repo.changectx(node).rev()
-    end = repo.changelog.count()
-    for rev in xrange(start, end):
-        c.check(repo.changectx(rev))
+    for ctx in changes.changes(repo, node):
+        c.check(ctx)