Mercurial > public > mercurial-scm > hg
diff mercurial/exchange.py @ 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 |
line wrap: on
line diff
--- 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)