diff hgext/mq.py @ 13327:dc11e30b48a3

mq: factor out push conditions checks Some extensions (e.g. hgsubversion) completely override push command. Because extensions load order is unspecified, if hgsubversion loads before mq, mq checks about not pushing applied patches will be bypassed. Short of finding a way to fix load order, extracting the checking logic will allow hgsubversion-like extensions to run the check themselves.
author Patrick Mezard <pmezard@gmail.com>
date Mon, 31 Jan 2011 22:16:33 +0100
parents 996b95985c2f
children 900a92862a7b
line wrap: on
line diff
--- a/hgext/mq.py	Thu Jan 27 15:51:26 2011 -0600
+++ b/hgext/mq.py	Mon Jan 31 22:16:33 2011 +0100
@@ -2919,7 +2919,7 @@
             return super(mqrepo, self).commit(text, user, date, match, force,
                                               editor, extra)
 
-        def push(self, remote, force=False, revs=None, newbranch=False):
+        def checkpush(self, force, revs):
             if self.mq.applied and not force:
                 haspatches = True
                 if revs:
@@ -2930,7 +2930,7 @@
                     haspatches = bool([n for n in revs if n in applied])
                 if haspatches:
                     raise util.Abort(_('source has mq patches applied'))
-            return super(mqrepo, self).push(remote, force, revs, newbranch)
+            super(mqrepo, self).checkpush(force, revs)
 
         def _findtags(self):
             '''augment tags from base class with patch tags'''