D4686: changegroup: reintroduce some comments that have gotten lost over the years

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Thu Sep 20 15:44:56 EDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG5adc5fe41a7d: changegroup: reintroduce some comments that have gotten lost over the years (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4686?vs=11226&id=11237

REVISION DETAIL
  https://phab.mercurial-scm.org/D4686

AFFECTED FILES
  mercurial/changegroup.py

CHANGE DETAILS

diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -1071,8 +1071,14 @@
             store = mfl.getstorage(tree)
 
             if not self._filematcher.visitdir(store.tree[:-1] or '.'):
+                # No nodes to send because this directory is out of
+                # the client's view of the repository (probably
+                # because of narrow clones).
                 prunednodes = []
             else:
+                # Avoid sending any manifest nodes we can prove the
+                # client already has by checking linkrevs. See the
+                # related comment in generatefiles().
                 prunednodes = self._prunemanifests(store, nodes, commonrevs)
             if tree and not prunednodes:
                 continue
@@ -1164,6 +1170,10 @@
                 return linkrevnodes[x]
 
             frev, flr = filerevlog.rev, filerevlog.linkrev
+            # Skip sending any filenode we know the client already
+            # has. This avoids over-sending files relatively
+            # inexpensively, so it's not a problem if we under-filter
+            # here.
             filenodes = [n for n in linkrevnodes
                          if flr(frev(n)) not in commonrevs]
 



To: durin42, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list