changeset 17549:be0fcbb1c92f

checkheads: don't warn about unsynced changes that we ill obsolete We won't be able to pull them after this push.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Sun, 26 Aug 2012 00:27:44 +0200
parents eaa5fcc5bd20
children fc530080013b
files mercurial/discovery.py tests/test-obsolete-checkheads.t
diffstat 2 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/discovery.py	Sun Aug 26 00:25:33 2012 +0200
+++ b/mercurial/discovery.py	Sun Aug 26 00:27:44 2012 +0200
@@ -271,19 +271,19 @@
             # Maybe we should abort if we push more that one head
             # for new branches ?
             continue
-        if heads[2]:
-            unsynced = True
-        oldhs = set(heads[0])
         candidate_newhs = set(heads[1])
         # add unsynced data
+        oldhs = set(heads[0])
         oldhs.update(heads[2])
         candidate_newhs.update(heads[2])
         dhs = None
+        discardedheads = set()
         if repo.obsstore:
             # remove future heads which are actually obsolete by another
             # pushed element:
             #
-            # XXX There is several case this case does not handle properly
+            # XXX as above, There are several cases this case does not handle
+            # XXX properly
             #
             # (1) if <nh> is public, it won't be affected by obsolete marker
             #     and a new is created
@@ -300,11 +300,14 @@
                 else:
                     for suc in obsolete.anysuccessors(repo.obsstore, nh):
                         if suc != nh and suc in allfuturecommon:
+                            discardedheads.add(nh)
                             break
                     else:
                         newhs.add(nh)
         else:
             newhs = candidate_newhs
+        if [h for h in heads[2] if h not in discardedheads]:
+            unsynced = True
         if len(newhs) > len(oldhs):
             # strip updates to existing remote heads from the new heads list
             dhs = list(newhs - bookmarkedheads - oldhs)
--- a/tests/test-obsolete-checkheads.t	Sun Aug 26 00:25:33 2012 +0200
+++ b/tests/test-obsolete-checkheads.t	Sun Aug 26 00:27:44 2012 +0200
@@ -266,7 +266,6 @@
   $ hg push --traceback
   pushing to $TESTTMP/remote
   searching for changes
-  note: unsynced remote changes!
   adding changesets
   adding manifests
   adding file changes