##// END OF EJS Templates
mq: factor out push conditions checks...
Patrick Mezard -
r13327:dc11e30b default
parent child Browse files
Show More
@@ -2919,7 +2919,7 b' def reposetup(ui, repo):'
2919 2919 return super(mqrepo, self).commit(text, user, date, match, force,
2920 2920 editor, extra)
2921 2921
2922 def push(self, remote, force=False, revs=None, newbranch=False):
2922 def checkpush(self, force, revs):
2923 2923 if self.mq.applied and not force:
2924 2924 haspatches = True
2925 2925 if revs:
@@ -2930,7 +2930,7 b' def reposetup(ui, repo):'
2930 2930 haspatches = bool([n for n in revs if n in applied])
2931 2931 if haspatches:
2932 2932 raise util.Abort(_('source has mq patches applied'))
2933 return super(mqrepo, self).push(remote, force, revs, newbranch)
2933 super(mqrepo, self).checkpush(force, revs)
2934 2934
2935 2935 def _findtags(self):
2936 2936 '''augment tags from base class with patch tags'''
@@ -1305,6 +1305,13 b' class localrepository(repo.repository):'
1305 1305 finally:
1306 1306 lock.release()
1307 1307
1308 def checkpush(self, force, revs):
1309 """Extensions can override this function if additional checks have
1310 to be performed before pushing, or call it if they override push
1311 command.
1312 """
1313 pass
1314
1308 1315 def push(self, remote, force=False, revs=None, newbranch=False):
1309 1316 '''Push outgoing changesets (limited by revs) from the current
1310 1317 repository to remote. Return an integer:
@@ -1321,6 +1328,7 b' class localrepository(repo.repository):'
1321 1328 # unbundle assumes local user cannot lock remote repo (new ssh
1322 1329 # servers, http servers).
1323 1330
1331 self.checkpush(force, revs)
1324 1332 lock = None
1325 1333 unbundle = remote.capable('unbundle')
1326 1334 if not unbundle:
General Comments 0
You need to be logged in to leave comments. Login now