# HG changeset patch # User Pierre-Yves David # Date 2014-09-25 08:49:20 # Node ID cd7e17aa604032ddffbdc6a819ee9ef53705cdef # Parent ce6b9edee725c580f05543a5d0e8ea5af38eaaf9 push: pass list of bookmark to `exchange.push` Currently stored but not unused. This parameter will control bookmarks explicitly pushed (added to the server if missing). diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -5069,7 +5069,8 @@ def push(ui, repo, dest=None, **opts): finally: del repo._subtoppath pushop = exchange.push(repo, other, opts.get('force'), revs=revs, - newbranch=opts.get('new_branch')) + newbranch=opts.get('new_branch'), + bookmarks=opts.get('bookmark', ())) result = not pushop.cgresult diff --git a/mercurial/exchange.py b/mercurial/exchange.py --- a/mercurial/exchange.py +++ b/mercurial/exchange.py @@ -61,7 +61,8 @@ class pushoperation(object): afterward. """ - def __init__(self, repo, remote, force=False, revs=None, newbranch=False): + def __init__(self, repo, remote, force=False, revs=None, newbranch=False, + bookmarks=()): # repo we push from self.repo = repo self.ui = repo.ui @@ -71,6 +72,8 @@ class pushoperation(object): self.force = force # revs to be pushed (None is "all") self.revs = revs + # bookmark explicitly pushed + self.bookmarks = bookmarks # allow push of new branch self.newbranch = newbranch # did a local lock get acquired? @@ -145,7 +148,7 @@ class pushoperation(object): else: return self.fallbackheads -def push(repo, remote, force=False, revs=None, newbranch=False): +def push(repo, remote, force=False, revs=None, newbranch=False, bookmarks=()): '''Push outgoing changesets (limited by revs) from a local repository to remote. Return an integer: - None means nothing to push @@ -154,7 +157,7 @@ def push(repo, remote, force=False, revs we have outgoing changesets but refused to push - other values as described by addchangegroup() ''' - pushop = pushoperation(repo, remote, force, revs, newbranch) + pushop = pushoperation(repo, remote, force, revs, newbranch, bookmarks) if pushop.remote.local(): missing = (set(pushop.repo.requirements) - pushop.remote.local().supported)