hgext/fetch.py
changeset 2813 f362222cb8f8
parent 2811 4f7abf341cd4
child 2814 0496cfb05243
--- a/hgext/fetch.py
+++ b/hgext/fetch.py
@@ -24,13 +24,13 @@ def fetch(ui, repo, source='default', **
         if modheads == 0:
             return 0
         if modheads == 1:
-            return commands.doupdate(ui, repo)
+            return hg.update(repo, repo.changelog.tip())
         newheads = repo.heads(parent)
         newchildren = [n for n in repo.heads(parent) if n != parent]
         newparent = parent
         if newchildren:
-            commands.doupdate(ui, repo, node=hex(newchildren[0]))
             newparent = newchildren[0]
+            hg.update(repo, newparent)
         newheads = [n for n in repo.heads() if n != newparent]
         err = False
         if newheads: