diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -859,8 +859,8 @@ def pull(repo, remote, heads=None, force
             _pullbundle2(pullop)
         _pullchangeset(pullop)
         _pullphase(pullop)
+        _pullbookmarks(pullop)
         _pullobsolete(pullop)
-        _pullbookmarks(pullop)
         pullop.closetransaction()
     finally:
         pullop.releasetransaction()