[PATCH 4 of 4 defaultdest V2] update: also use 'destupdate' for pull and unbundle

Pierre-Yves David pierre-yves.david at ens-lyon.org
Mon Oct 12 12:22:56 CDT 2015


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1444105892 25200
#      Mon Oct 05 21:31:32 2015 -0700
# Node ID 7e9c4ed18558ea9e3f9870d7228a009af3c5c90c
# Parent  330ed5e136273f627695777702a77ab695bc62e2
# EXP-Topic defaultdest
# Available At http://hg.netv6.net/marmoute-wip/mercurial/
#              hg pull http://hg.netv6.net/marmoute-wip/mercurial/ -r 7e9c4ed18558
update: also use 'destupdate' for pull and unbundle

Update can also be performed by 'hg pull --update' and 'hg unbundle'. We use the
destupdate function in these case too.

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -5177,12 +5177,16 @@ def phase(ui, repo, *revs, **opts):
 
 def postincoming(ui, repo, modheads, optupdate, checkout):
     if modheads == 0:
         return
     if optupdate:
-        checkout, movemarkfrom = bookmarks.calculateupdate(ui, repo, checkout)
         try:
+            brev = checkout
+            movemarkfrom = None
+            if not checkout:
+                updata =  destutil.destupdate(repo)
+                checkout, movemarkfrom, brev = updata
             ret = hg.update(repo, checkout)
         except error.Abort as inst:
             ui.warn(_("not updating: %s\n") % str(inst))
             if inst.hint:
                 ui.warn(_("(%s)\n") % inst.hint)


More information about the Mercurial-devel mailing list