[PATCH 02 of 10] localrepo: introduce "checkoutgoing()" to extend outgoing revision check easily
FUJIWARA Katsunori
foozy at lares.dti.ne.jp
Wed Mar 5 12:12:07 UTC 2014
# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1394019743 -32400
# Wed Mar 05 20:42:23 2014 +0900
# Node ID 202d835ca3a173f808262677fccc796257945268
# Parent 655cacfc3311c174c995e4bab13755b498cb43dc
localrepo: introduce "checkoutgoing()" to extend outgoing revision check easily
diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -103,6 +103,7 @@
try:
_pushdiscovery(pushop)
if _pushcheckoutgoing(pushop):
+ pushop.repo.checkoutgoing(pushop.remote, pushop.outgoing)
_pushchangeset(pushop)
_pushcomputecommonheads(pushop)
_pushsyncphase(pushop)
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1677,6 +1677,15 @@
"""
pass
+ def checkoutgoing(self, remote, outgoing):
+ """Extensions can override this function if additional checks have
+ to be performed on outgoing revisions before pushing, or call it
+ if they override push command.
+
+ 'outgoing' argument is the result of 'discovery.findcommonoutgoing()'.
+ """
+ pass
+
def push(self, remote, force=False, revs=None, newbranch=False):
return exchange.push(self, remote, force, revs, newbranch)
More information about the Mercurial-devel
mailing list