##// END OF EJS Templates
push: pass a `pushoperation` object to localrepo.checkpush...
Pierre-Yves David -
r20924:e1000036 default
parent child Browse files
Show More
@@ -3289,14 +3289,14 b' def reposetup(ui, repo):'
3289 return super(mqrepo, self).commit(text, user, date, match, force,
3289 return super(mqrepo, self).commit(text, user, date, match, force,
3290 editor, extra)
3290 editor, extra)
3291
3291
3292 def checkpush(self, force, revs):
3292 def checkpush(self, pushop):
3293 if self.mq.applied and self.mq.checkapplied and not force:
3293 if self.mq.applied and self.mq.checkapplied and not pushop.force:
3294 outapplied = [e.node for e in self.mq.applied]
3294 outapplied = [e.node for e in self.mq.applied]
3295 if revs:
3295 if pushop.revs:
3296 # Assume applied patches have no non-patch descendants and
3296 # Assume applied patches have no non-patch descendants and
3297 # are not on remote already. Filtering any changeset not
3297 # are not on remote already. Filtering any changeset not
3298 # pushed.
3298 # pushed.
3299 heads = set(revs)
3299 heads = set(pushop.revs)
3300 for node in reversed(outapplied):
3300 for node in reversed(outapplied):
3301 if node in heads:
3301 if node in heads:
3302 break
3302 break
@@ -3307,7 +3307,7 b' def reposetup(ui, repo):'
3307 if self[node].phase() < phases.secret:
3307 if self[node].phase() < phases.secret:
3308 raise util.Abort(_('source has mq patches applied'))
3308 raise util.Abort(_('source has mq patches applied'))
3309 # no non-secret patches pushed
3309 # no non-secret patches pushed
3310 super(mqrepo, self).checkpush(force, revs)
3310 super(mqrepo, self).checkpush(pushop)
3311
3311
3312 def _findtags(self):
3312 def _findtags(self):
3313 '''augment tags from base class with patch tags'''
3313 '''augment tags from base class with patch tags'''
@@ -95,7 +95,7 b' def push(repo, remote, force=False, revs'
95 msg = 'cannot lock source repository: %s\n' % err
95 msg = 'cannot lock source repository: %s\n' % err
96 pushop.ui.debug(msg)
96 pushop.ui.debug(msg)
97 try:
97 try:
98 pushop.repo.checkpush(pushop.force, pushop.revs)
98 pushop.repo.checkpush(pushop)
99 lock = None
99 lock = None
100 unbundle = pushop.remote.capable('unbundle')
100 unbundle = pushop.remote.capable('unbundle')
101 if not unbundle:
101 if not unbundle:
@@ -1673,7 +1673,7 b' class localrepository(object):'
1673 def pull(self, remote, heads=None, force=False):
1673 def pull(self, remote, heads=None, force=False):
1674 return exchange.pull (self, remote, heads, force)
1674 return exchange.pull (self, remote, heads, force)
1675
1675
1676 def checkpush(self, force, revs):
1676 def checkpush(self, pushop):
1677 """Extensions can override this function if additional checks have
1677 """Extensions can override this function if additional checks have
1678 to be performed before pushing, or call it if they override push
1678 to be performed before pushing, or call it if they override push
1679 command.
1679 command.
General Comments 0
You need to be logged in to leave comments. Login now