Patchwork D668: changegroup: replace changegroup with makechangegroup

login
register
mail settings
Submitter phabricator
Date Sept. 11, 2017, 10:27 p.m.
Message ID <3cd32393b457fe38a0cc00963b494650@localhost.localdomain>
Download mbox | patch
Permalink /patch/23801/
State Not Applicable
Headers show

Comments

phabricator - Sept. 11, 2017, 10:27 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG1632999d4bed: changegroup: replace changegroup with makechangegroup (authored by durham).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D668?vs=1695&id=1737

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

AFFECTED FILES
  mercurial/changegroup.py
  mercurial/localrepo.py
  mercurial/wireproto.py

CHANGE DETAILS




To: durham, #hg-reviewers, indygreg
Cc: mercurial-devel

Patch

diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -795,7 +795,9 @@ 
 @wireprotocommand('changegroup', 'roots')
 def changegroup(repo, proto, roots):
     nodes = decodelist(roots)
-    cg = changegroupmod.changegroup(repo, nodes, 'serve')
+    outgoing = discovery.outgoing(repo, missingroots=nodes,
+                                  missingheads=repo.heads())
+    cg = changegroupmod.makechangegroup(repo, outgoing, '01', 'serve')
     return streamres(reader=cg, v1compressible=True)
 
 @wireprotocommand('changegroupsubset', 'bases heads')
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -287,7 +287,9 @@ 
         return self._repo.branches(nodes)
 
     def changegroup(self, basenodes, source):
-        return changegroup.changegroup(self._repo, basenodes, source)
+        outgoing = discovery.outgoing(self._repo, missingroots=basenodes,
+                                      missingheads=self._repo.heads())
+        return changegroup.makechangegroup(self._repo, outgoing, '01', source)
 
     def changegroupsubset(self, bases, heads, source):
         outgoing = discovery.outgoing(self._repo, missingroots=bases,
diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -21,7 +21,6 @@ 
 
 from . import (
     dagutil,
-    discovery,
     error,
     mdiff,
     phases,
@@ -951,12 +950,6 @@ 
     return makechangegroup(repo, outgoing, version, source,
                            bundlecaps=bundlecaps)
 
-def changegroup(repo, basenodes, source):
-    # to avoid a race we use changegroupsubset() (issue1320)
-    outgoing = discovery.outgoing(repo, missingroots=basenodes,
-                                  missingheads=repo.heads())
-    return makechangegroup(repo, outgoing, '01', source)
-
 def _addchangegroupfiles(repo, source, revmap, trp, expectedfiles, needfiles):
     revisions = 0
     files = 0