38 '''return if access allowed, raise exception if not.''' |
39 '''return if access allowed, raise exception if not.''' |
39 if not self.allow(ctx): |
40 if not self.allow(ctx): |
40 raise mercurial.util.Abort(_('%s: access denied for changeset %s') % |
41 raise mercurial.util.Abort(_('%s: access denied for changeset %s') % |
41 (__name__, ctx.short())) |
42 (__name__, ctx.short())) |
42 |
43 |
43 |
|
44 def hook(ui, repo, hooktype, node=None, source=None, **kwargs): |
44 def hook(ui, repo, hooktype, node=None, source=None, **kwargs): |
45 if hooktype != 'pretxnchangegroup': |
45 if hooktype != 'pretxnchangegroup': |
46 raise mercurial.util.Abort(_('config error - hook type "%s" cannot stop ' |
46 raise mercurial.util.Abort(_('config error - hook type "%s" cannot stop ' |
47 'incoming changesets') % hooktype) |
47 'incoming changesets') % hooktype) |
48 c = Checker(ui, repo) |
48 c = Checker(ui, repo) |
49 start = repo.changectx(node).rev() |
49 for ctx in changes.changes(repo, node): |
50 end = repo.changelog.count() |
50 c.check(ctx) |
51 for rev in xrange(start, end): |
|
52 c.check(repo.changectx(rev)) |
|
53 |
51 |