clfilter: unfilter some parts of the push logic
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Mon, 08 Oct 2012 17:41:07 +0200
changeset 18007 2e30972d859d
parent 18005 aba3c161bcc6
child 18008 cf91b36f368c
clfilter: unfilter some parts of the push logic Computation of common changesets during push needs to be done on the widest set possible. An unfiltered version of the repo is kept for discovery and various revset calls. The discovery code itself enforces the filtering of unserved outgoing changeset.
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Mon Oct 08 17:15:08 2012 +0200
+++ b/mercurial/localrepo.py	Mon Oct 08 17:41:07 2012 +0200
@@ -1869,25 +1869,26 @@
             if not unbundle:
                 lock = remote.lock()
             try:
+                unfi = self.unfiltered()
                 # discovery
                 fci = discovery.findcommonincoming
-                commoninc = fci(self, remote, force=force)
+                commoninc = fci(unfi, remote, force=force)
                 common, inc, remoteheads = commoninc
                 fco = discovery.findcommonoutgoing
-                outgoing = fco(self, remote, onlyheads=revs,
+                outgoing = fco(unfi, remote, onlyheads=revs,
                                commoninc=commoninc, force=force)
 
 
                 if not outgoing.missing:
                     # nothing to push
-                    scmutil.nochangesfound(self.ui, self, outgoing.excluded)
+                    scmutil.nochangesfound(unfi.ui, unfi, outgoing.excluded)
                     ret = None
                 else:
                     # something to push
                     if not force:
                         # if self.obsstore == False --> no obsolete
                         # then, save the iteration
-                        if self.obsstore:
+                        if unfi.obsstore:
                             # this message are here for 80 char limit reason
                             mso = _("push includes obsolete changeset: %s!")
                             msu = _("push includes unstable changeset: %s!")
@@ -1897,14 +1898,14 @@
                             # least one of the missinghead will be obsolete or
                             # unstable. So checking heads only is ok
                             for node in outgoing.missingheads:
-                                ctx = self[node]
+                                ctx = unfi[node]
                                 if ctx.obsolete():
                                     raise util.Abort(mso % ctx)
                                 elif ctx.unstable():
                                     raise util.Abort(msu % ctx)
                                 elif ctx.bumped():
                                     raise util.Abort(msb % ctx)
-                        discovery.checkheads(self, remote, outgoing,
+                        discovery.checkheads(unfi, remote, outgoing,
                                              remoteheads, newbranch,
                                              bool(inc))
 
@@ -1957,7 +1958,7 @@
                     cheads = [node for node in revs if node in common]
                     # and
                     # * commonheads parents on missing
-                    revset = self.set('%ln and parents(roots(%ln))',
+                    revset = unfi.set('%ln and parents(roots(%ln))',
                                      outgoing.commonheads,
                                      outgoing.missing)
                     cheads.extend(c.node() for c in revset)
@@ -1980,7 +1981,7 @@
                     # Get the list of all revs draft on remote by public here.
                     # XXX Beware that revset break if droots is not strictly
                     # XXX root we may want to ensure it is but it is costly
-                    outdated =  self.set('heads((%ln::%ln) and public())',
+                    outdated =  unfi.set('heads((%ln::%ln) and public())',
                                          droots, cheads)
                     for newremotehead in outdated:
                         r = remote.pushkey('phases',