diff mercurial/commands.py @ 22645:6e431e1635b6

pull: move bookmark movements inside the `exchange.pull` There is no reason for bookmarks to get a special treatment. As a first step we move the code as is in the `exchange.pull` function. Integration with the rest of the flow will come later. Adding bookmarks to pull means that most clone paths are now pulling bookmarks through pull. We ensure that bookmark-update messages are properly suppressed in that case. In test-pull-http.t the 'requesting all changes' message disappear because we now get the authentication error on the `listkeys`command before such message is printed.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Fri, 26 Sep 2014 17:44:00 -0700
parents ffd0f6b1c29d
children cbb4414a5603
line wrap: on
line diff
--- a/mercurial/commands.py	Thu Oct 02 12:16:07 2014 -0500
+++ b/mercurial/commands.py	Fri Sep 26 17:44:00 2014 -0700
@@ -4960,16 +4960,8 @@
                         "so a rev cannot be specified.")
                 raise util.Abort(err)
 
-        modheads = repo.pull(other, heads=revs, force=opts.get('force'))
-        bookmarks.updatefromremote(ui, repo, remotebookmarks, other.url())
-        # update specified bookmarks
-        if opts.get('bookmark'):
-            marks = repo._bookmarks
-            for b in opts['bookmark']:
-                # explicit pull overrides local bookmark if any
-                ui.status(_("importing bookmark %s\n") % b)
-                marks[b] = repo[remotebookmarks[b]].node()
-            marks.write()
+        modheads = repo.pull(other, heads=revs, force=opts.get('force'),
+                             bookmarks=opts.get('bookmark', ()))
         if checkout:
             checkout = str(repo.changelog.rev(other.lookup(checkout)))
         repo._subtoppath = source