diff hgext/fetch.py @ 2822:30f59f4a327e

Introduce update helper functions: update, merge, clean, and revert
author Matt Mackall <mpm@selenic.com>
date Mon, 07 Aug 2006 22:54:33 -0500
parents 90a4181ca9ed
children 49988d9f0758
line wrap: on
line diff
--- 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)') %