Patchwork [2,of,2,V2] update: warn about other topological head in pull and unbundle

login
register
mail settings
Submitter Pierre-Yves David
Date Feb. 7, 2016, 9:25 p.m.
Message ID <d293621b48c9606a7152.1454880310@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/13034/
State Accepted
Headers show

Comments

Pierre-Yves David - Feb. 7, 2016, 9:25 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1454512321 0
#      Wed Feb 03 15:12:01 2016 +0000
# Node ID d293621b48c9606a715268204548a545e73029f5
# Parent  6721afd1a28833cf46bf8498b4222aa51355c751
# EXP-Topic destination
# Available At http://hg.netv6.net/marmoute-wip/mercurial/
#              hg pull http://hg.netv6.net/marmoute-wip/mercurial/ -r d293621b48c9
update: warn about other topological head in pull and unbundle

Other commands have a '--update' triggering a bare update. We now issue the
message introduce into the previous changeset for these too.
timeless - Feb. 8, 2016, 1:36 a.m.
On Sun, Feb 7, 2016 at 4:25 PM, Pierre-Yves David
<pierre-yves.david@ens-lyon.org> wrote:
> introduce

introduced :)

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -5528,17 +5528,21 @@  def phase(ui, repo, *revs, **opts):
 
 def postincoming(ui, repo, modheads, optupdate, checkout):
     if modheads == 0:
         return
     if optupdate:
+        warndest = False
         try:
             brev = checkout
             movemarkfrom = None
             if not checkout:
+                warndest = True
                 updata = destutil.destupdate(repo)
                 checkout, movemarkfrom, brev = updata
             ret = hg.update(repo, checkout)
+            if warndest:
+                destutil.statusotherdests(ui, repo)
         except error.UpdateAbort as inst:
             msg = _("not updating: %s") % str(inst)
             hint = inst.hint
             raise error.UpdateAbort(msg, hint=hint)
         if not ret and movemarkfrom:
diff --git a/tests/test-largefiles-update.t b/tests/test-largefiles-update.t
--- a/tests/test-largefiles-update.t
+++ b/tests/test-largefiles-update.t
@@ -463,10 +463,11 @@  Test that the internal linear merging wo
   largefile large1 has a merge conflict
   ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
   keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
   take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
   2 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  1 other heads for branch "default"
 
   $ hg status -A large1
   M large1
   $ cat large1
   large1 for linear merge (conflict)
@@ -496,10 +497,11 @@  Test that the internal linear merging wo
   largefile large1 has a merge conflict
   ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
   keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
   take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
   2 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  1 other heads for branch "default"
 
   $ hg status -A large1
   M large1
   $ cat large1
   large1 for linear merge (conflict)
diff --git a/tests/test-pull-branch.t b/tests/test-pull-branch.t
--- a/tests/test-pull-branch.t
+++ b/tests/test-pull-branch.t
@@ -131,10 +131,11 @@  Should succeed because there is only one
   adding changesets
   adding manifests
   adding file changes
   added 4 changesets with 4 changes to 1 files (+1 heads)
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  1 other heads for branch "branchA"
 
 Make changes on new branch on tt
 
   $ hg up 6
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved