# HG changeset patch # User Pierre-Yves David # Date 2014-09-25 09:53:29 # Node ID 62ab9ca90b367845075c3e68806c6e8588c69fc4 # Parent eef31f9a4c0f9f58cd5e6006e503367a974f4451 push: perform bookmark export in the push function This part is responsible for adding new bookmarks on the remote. Before that, it was done on its own in `commands.push`. The export is still not integrated with the rest of the push process, but at least it now dwells in the right function. diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -5074,11 +5074,10 @@ def push(ui, repo, dest=None, **opts): result = not pushop.cgresult - if opts.get('bookmark'): - bresult = bookmarks.pushtoremote(ui, repo, other, opts['bookmark']) - if bresult == 2: + if pushop.bkresult is not None: + if pushop.bkresult == 2: result = 2 - elif not result and bresult: + elif not result and pushop.bkresult: result = 2 return result diff --git a/mercurial/exchange.py b/mercurial/exchange.py --- a/mercurial/exchange.py +++ b/mercurial/exchange.py @@ -216,6 +216,10 @@ def push(repo, remote, force=False, revs if locallock is not None: locallock.release() + if pushop.bookmarks: + pushop.bkresult = bookmod.pushtoremote(repo.ui, repo, remote, + pushop.bookmarks) + return pushop # list of steps to perform discovery before push