Patchwork [3,of,7] push: more robust check for bundle fast path

mail settings
Submitter Pierre-Yves David
Date Nov. 17, 2013, 8:31 p.m.
Message ID <f4ba2c3b6d5d25ac6af8.1384720302@vulgaris>
Download mbox | patch
Permalink /patch/3031/
State Accepted
Commit 7401bb54fe7635422c11658bba40e639ca767792
Headers show


Pierre-Yves David - Nov. 17, 2013, 8:31 p.m.
# HG changeset patch
# User Pierre-Yves David <>
# Date 1383673064 -3600
#      Tue Nov 05 18:37:44 2013 +0100
# Node ID f4ba2c3b6d5d25ac6af8e2e226b38b43596950ca
# Parent  51cf4e4a5eb7a5609a50378a98ce6f7fa0fa721c
push: more robust check for bundle fast path

When all changesets in the local repo are either being pushed or remotly known,
we can take a fast path when bundling changeset because we are certain all local
deltas are computed againts base known remotely.

So we have a check to detect this situation, when we did a bare push and nothing
was excluded.

In a coming refactoring, the discovery will run on filtered view and the content
of `outgoing.excluded` will just include unserved (secret) changeset not filtered by the
repoview used to call push (usually "visible"). So we need to check if there is
both no excluded changeset and nothing filtered by the current repoview.


diff --git a/mercurial/ b/mercurial/
--- a/mercurial/
+++ b/mercurial/
@@ -1862,11 +1862,12 @@  class localrepository(object):
                     # TODO: get bundlecaps from remote
                     bundlecaps = None
                     # create a changegroup from local
-                    if revs is None and not outgoing.excluded:
+                    if revs is None and not (outgoing.excluded
+                                             or self.changelog.filteredrevs):
                         # push everything,
                         # use the fast path, no race possible on push
                         bundler = changegroup.bundle10(self, bundlecaps)
                         cg = self._changegroupsubset(outgoing,