changeset 381:3a161a89d65d

obsolete: rely on core to filter extinct changeset out
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Wed, 25 Jul 2012 19:08:45 +0200
parents b36b07ae21bc
children 58fdb2180064
files hgext/obsolete.py tests/test-obsolete-push.t tests/test-obsolete.t
diffstat 3 files changed, 2 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/obsolete.py	Thu Jul 26 11:44:05 2012 +0200
+++ b/hgext/obsolete.py	Wed Jul 25 19:08:45 2012 +0200
@@ -436,26 +436,6 @@
 ### Discovery wrapping
 #############################
 
-class blist(list, object):
-    """silly class to have non False but empty list"""
-
-    def __nonzero__(self):
-        return bool(len(self.orig))
-
-def wrapfindcommonoutgoing(orig, repo, *args, **kwargs):
-    """wrap mercurial.discovery.findcommonoutgoing to remove extinct changeset
-
-    Such excluded changeset are removed from excluded  and will *not* appear
-    are excluded secret changeset.
-    """
-    outgoing = orig(repo, *args, **kwargs)
-    orig = outgoing.excluded
-    outgoing.excluded = blist(n for n in orig if not repo[n].extinct())
-    # when no revision is specified (push everything) a shortcut is taken when
-    # nothign was exclude. taking this code path when extinct changeset have
-    # been excluded leads to repository corruption.
-    outgoing.excluded.orig = orig
-    return outgoing
 
 def wrapcheckheads(orig, repo, remote, outgoing, *args, **kwargs):
     """wrap mercurial.discovery.checkheads
@@ -728,7 +708,6 @@
     extensions.wrapcommand(commands.table, "debugobsolete", wrapmaycreateobsmarker)
     if util.safehasattr(cmdutil, 'amend'):
         extensions.wrapfunction(cmdutil, 'amend', wrapcmdutilamend)
-    extensions.wrapfunction(discovery, 'findcommonoutgoing', wrapfindcommonoutgoing)
     extensions.wrapfunction(discovery, 'checkheads', wrapcheckheads)
     extensions.wrapfunction(discovery, 'visibleheads', noextinctsvisibleheads)
     extensions.wrapfunction(phases, 'advanceboundary', wrapclearcache)
--- a/tests/test-obsolete-push.t	Thu Jul 26 11:44:05 2012 +0200
+++ b/tests/test-obsolete-push.t	Wed Jul 25 19:08:45 2012 +0200
@@ -44,5 +44,5 @@
   $ hg outgoing ../clone --template "$template"
   comparing with ../clone
   searching for changes
-  no changes found (ignored 2 secret changesets)
+  no changes found (ignored 3 secret changesets)
   [1]
--- a/tests/test-obsolete.t	Thu Jul 26 11:44:05 2012 +0200
+++ b/tests/test-obsolete.t	Wed Jul 25 19:08:45 2012 +0200
@@ -240,7 +240,7 @@
   $ hg push ../other-new
   pushing to ../other-new
   searching for changes
-  no changes found (ignored 0 secret changesets)
+  no changes found (ignored 2 secret changesets)
   [1]
 
   $ hg up -q .^ # 3