Patchwork [01,of,21,RFC] changegroup: inline builddeltaheader, public method only called once

login
register
mail settings
Submitter michaeljedgar@gmail.com
Date Sept. 11, 2014, 12:26 a.m.
Message ID <44e926f8ae03bc1e0822.1410395162@adgar-macbookpro3.roam.corp.google.com>
Download mbox | patch
Permalink /patch/5776/
State Changes Requested
Headers show

Comments

michaeljedgar@gmail.com - Sept. 11, 2014, 12:26 a.m.
# HG changeset patch
# User Mike Edgar <adgar@google.com>
# Date 1409521580 -7200
#      Sun Aug 31 23:46:20 2014 +0200
# Node ID 44e926f8ae03bc1e0822c282a77538a875353ecf
# Parent  f08b657130b9ac7cd2ad27afea6895dfde7d7722
changegroup: inline builddeltaheader, public method only called once

This helper also had an unused argument, possibly left over from an API
migration. This change should be a no-op; I've left in the calculation of the
unused base node as it could raise an exception if the base isn't present.
Pierre-Yves David - Sept. 11, 2014, 12:12 p.m.
On 09/11/2014 02:26 AM, michaeljedgar@gmail.com wrote:
> # HG changeset patch
> # User Mike Edgar <adgar@google.com>
> # Date 1409521580 -7200
> #      Sun Aug 31 23:46:20 2014 +0200
> # Node ID 44e926f8ae03bc1e0822c282a77538a875353ecf
> # Parent  f08b657130b9ac7cd2ad27afea6895dfde7d7722
> changegroup: inline builddeltaheader, public method only called once
>
> This helper also had an unused argument, possibly left over from an API
> migration. This change should be a no-op; I've left in the calculation of the
> unused base node as it could raise an exception if the base isn't present.

Bad pick. The change is not left over from an API migration. The change 
is an unfinished migration. The goal here is to provide a second type of 
changegroup that will support general delta. We are very close to get 
that as Sune Foldager is currently actively working on it.

For your credit, this migration is on going for years… You probably want 
to synchronise with him.

Patch

diff -r f08b657130b9 -r 44e926f8ae03 mercurial/changegroup.py
--- a/mercurial/changegroup.py	Fri Sep 05 11:37:44 2014 -0700
+++ b/mercurial/changegroup.py	Sun Aug 31 23:46:20 2014 +0200
@@ -423,15 +423,12 @@ 
             delta = revlog.revdiff(base, rev)
         p1n, p2n = revlog.parents(node)
         basenode = revlog.node(base)
-        meta = self.builddeltaheader(node, p1n, p2n, basenode, linknode)
+        meta = struct.pack(self.deltaheader, node, p1n, p2n, linknode)
         meta += prefix
         l = len(meta) + len(delta)
         yield chunkheader(l)
         yield meta
         yield delta
-    def builddeltaheader(self, node, p1n, p2n, basenode, linknode):
-        # do nothing with basenode, it is implicitly the previous one in HG10
-        return struct.pack(self.deltaheader, node, p1n, p2n, linknode)
 
 def _changegroupinfo(repo, nodes, source):
     if repo.ui.verbose or source == 'bundle':