Mercurial > hg-stable
changeset 22623:cd7e17aa6040
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).
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 25 Sep 2014 01:49:20 -0700 |
parents | ce6b9edee725 |
children | eef31f9a4c0f |
files | mercurial/commands.py mercurial/exchange.py |
diffstat | 2 files changed, 8 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/commands.py Thu Sep 25 15:26:09 2014 -0700 +++ b/mercurial/commands.py Thu Sep 25 01:49:20 2014 -0700 @@ -5069,7 +5069,8 @@ 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
--- a/mercurial/exchange.py Thu Sep 25 15:26:09 2014 -0700 +++ b/mercurial/exchange.py Thu Sep 25 01:49:20 2014 -0700 @@ -61,7 +61,8 @@ 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 @@ 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 @@ 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 @@ 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)