comparison mercurial/exchange.py @ 26729:16e69e6b357b

exchange: add oparg to push so that extensions can wrap pushop
author Sean Farley <sean@farley.io>
date Tue, 13 Oct 2015 23:04:53 -0700
parents dbc3d945ba36
children 69ac9aebbc55
comparison
equal deleted inserted replaced
26728:e8f1b7285917 26729:16e69e6b357b
258 'delete': (_("deleting remote bookmark %s\n"), 258 'delete': (_("deleting remote bookmark %s\n"),
259 _('deleting remote bookmark %s failed!\n')), 259 _('deleting remote bookmark %s failed!\n')),
260 } 260 }
261 261
262 262
263 def push(repo, remote, force=False, revs=None, newbranch=False, bookmarks=()): 263 def push(repo, remote, force=False, revs=None, newbranch=False, bookmarks=(),
264 opargs=None):
264 '''Push outgoing changesets (limited by revs) from a local 265 '''Push outgoing changesets (limited by revs) from a local
265 repository to remote. Return an integer: 266 repository to remote. Return an integer:
266 - None means nothing to push 267 - None means nothing to push
267 - 0 means HTTP error 268 - 0 means HTTP error
268 - 1 means we pushed and remote head count is unchanged *or* 269 - 1 means we pushed and remote head count is unchanged *or*
269 we have outgoing changesets but refused to push 270 we have outgoing changesets but refused to push
270 - other values as described by addchangegroup() 271 - other values as described by addchangegroup()
271 ''' 272 '''
272 pushop = pushoperation(repo, remote, force, revs, newbranch, bookmarks) 273 if opargs is None:
274 opargs = {}
275 pushop = pushoperation(repo, remote, force, revs, newbranch, bookmarks,
276 **opargs)
273 if pushop.remote.local(): 277 if pushop.remote.local():
274 missing = (set(pushop.repo.requirements) 278 missing = (set(pushop.repo.requirements)
275 - pushop.remote.local().supported) 279 - pushop.remote.local().supported)
276 if missing: 280 if missing:
277 msg = _("required features are not" 281 msg = _("required features are not"