Mercurial > hg-stable
comparison mercurial/exchange.py @ 21043:6c383c871fdb
localrepo: introduce "prepushoutgoinghooks" to extend outgoing check easily
This patch introduces "prepushoutgoinghooks" to extend outgoing check
before pushing changesets to remote easily.
This chooses the function returning "util.hooks" instead of the one to
be overridden.
The latter may cause problems silently, if one of overriders forgets
(or fails) to execute a kind of "super(xxx, self).overridden(...)". In
the other hand, the former can ensure that all registered functions
are invoked, unless one of them raises an exception.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Wed, 16 Apr 2014 00:37:24 +0900 |
parents | 7731a2281cf0 |
children | 62d35f251c60 |
comparison
equal
deleted
inserted
replaced
21042:32b3331f18eb | 21043:6c383c871fdb |
---|---|
101 if not unbundle: | 101 if not unbundle: |
102 lock = pushop.remote.lock() | 102 lock = pushop.remote.lock() |
103 try: | 103 try: |
104 _pushdiscovery(pushop) | 104 _pushdiscovery(pushop) |
105 if _pushcheckoutgoing(pushop): | 105 if _pushcheckoutgoing(pushop): |
106 pushop.repo.prepushoutgoinghooks(pushop.repo, | |
107 pushop.remote, | |
108 pushop.outgoing) | |
106 _pushchangeset(pushop) | 109 _pushchangeset(pushop) |
107 _pushcomputecommonheads(pushop) | 110 _pushcomputecommonheads(pushop) |
108 _pushsyncphase(pushop) | 111 _pushsyncphase(pushop) |
109 _pushobsolete(pushop) | 112 _pushobsolete(pushop) |
110 finally: | 113 finally: |