hgext/fetch.py
changeset 2822 30f59f4a327e
parent 2819 90a4181ca9ed
child 2830 49988d9f0758
--- a/hgext/fetch.py
+++ b/hgext/fetch.py
@@ -24,19 +24,19 @@ 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]))
+            hg.update(repo, newchildren[0])
             newparent = newchildren[0]
         newheads = [n for n in repo.heads() if n != newparent]
         err = False
         if newheads:
             ui.status(_('merging with new head %d:%s\n') %
                       (repo.changelog.rev(newheads[0]), short(newheads[0])))
-            err = hg.update(repo, newheads[0], allow=True, remind=False)
+            err = hg.merge(repo, newheads[0], remind=False)
         if not err and len(newheads) > 1:
             ui.status(_('not merging with %d other new heads '
                         '(use "hg heads" and "hg merge" to merge them)') %