##// END OF EJS Templates
bundle: don't send too many changesets (Issue1704)...
Peter Arrenbrecht -
r9820:0b999aec default
parent child Browse files
Show More
@@ -1564,7 +1564,8 class localrepository(repo.repository):
1564
1564
1565 if revs is None:
1565 if revs is None:
1566 # use the fast path, no race possible on push
1566 # use the fast path, no race possible on push
1567 cg = self._changegroup(common.keys(), 'push')
1567 nodes = self.changelog.findmissing(common.keys())
1568 cg = self._changegroup(nodes, 'push')
1568 else:
1569 else:
1569 cg = self.changegroupsubset(update, revs, 'push')
1570 cg = self.changegroupsubset(update, revs, 'push')
1570 return cg, remote_heads
1571 return cg, remote_heads
@@ -1622,28 +1623,26 class localrepository(repo.repository):
1622 the linkrev.
1623 the linkrev.
1623 """
1624 """
1624
1625
1626 # Set up some initial variables
1627 # Make it easy to refer to self.changelog
1628 cl = self.changelog
1629 # msng is short for missing - compute the list of changesets in this
1630 # changegroup.
1631 if not bases:
1632 bases = [nullid]
1633 msng_cl_lst, bases, heads = cl.nodesbetween(bases, heads)
1634
1625 if extranodes is None:
1635 if extranodes is None:
1626 # can we go through the fast path ?
1636 # can we go through the fast path ?
1627 heads.sort()
1637 heads.sort()
1628 allheads = self.heads()
1638 allheads = self.heads()
1629 allheads.sort()
1639 allheads.sort()
1630 if heads == allheads:
1640 if heads == allheads:
1631 common = []
1641 return self._changegroup(msng_cl_lst, source)
1632 # parents of bases are known from both sides
1633 for n in bases:
1634 for p in self.changelog.parents(n):
1635 if p != nullid:
1636 common.append(p)
1637 return self._changegroup(common, source)
1638
1642
1643 # slow path
1639 self.hook('preoutgoing', throw=True, source=source)
1644 self.hook('preoutgoing', throw=True, source=source)
1640
1645
1641 # Set up some initial variables
1642 # Make it easy to refer to self.changelog
1643 cl = self.changelog
1644 # msng is short for missing - compute the list of changesets in this
1645 # changegroup.
1646 msng_cl_lst, bases, heads = cl.nodesbetween(bases, heads)
1647 self.changegroupinfo(msng_cl_lst, source)
1646 self.changegroupinfo(msng_cl_lst, source)
1648 # Some bases may turn out to be superfluous, and some heads may be
1647 # Some bases may turn out to be superfluous, and some heads may be
1649 # too. nodesbetween will return the minimal set of bases and heads
1648 # too. nodesbetween will return the minimal set of bases and heads
@@ -1903,7 +1902,7 class localrepository(repo.repository):
1903 # to avoid a race we use changegroupsubset() (issue1320)
1902 # to avoid a race we use changegroupsubset() (issue1320)
1904 return self.changegroupsubset(basenodes, self.heads(), source)
1903 return self.changegroupsubset(basenodes, self.heads(), source)
1905
1904
1906 def _changegroup(self, common, source):
1905 def _changegroup(self, nodes, source):
1907 """Compute the changegroup of all nodes that we have that a recipient
1906 """Compute the changegroup of all nodes that we have that a recipient
1908 doesn't. Return a chunkbuffer object whose read() method will return
1907 doesn't. Return a chunkbuffer object whose read() method will return
1909 successive changegroup chunks.
1908 successive changegroup chunks.
@@ -1911,12 +1910,11 class localrepository(repo.repository):
1911 This is much easier than the previous function as we can assume that
1910 This is much easier than the previous function as we can assume that
1912 the recipient has any changenode we aren't sending them.
1911 the recipient has any changenode we aren't sending them.
1913
1912
1914 common is the set of common nodes between remote and self"""
1913 nodes is the set of nodes to send"""
1915
1914
1916 self.hook('preoutgoing', throw=True, source=source)
1915 self.hook('preoutgoing', throw=True, source=source)
1917
1916
1918 cl = self.changelog
1917 cl = self.changelog
1919 nodes = cl.findmissing(common)
1920 revset = set([cl.rev(n) for n in nodes])
1918 revset = set([cl.rev(n) for n in nodes])
1921 self.changegroupinfo(nodes, source)
1919 self.changegroupinfo(nodes, source)
1922
1920
@@ -146,4 +146,23 cd b
146 hg -R ../all.hg diff -r tip
146 hg -R ../all.hg diff -r tip
147 cd ..
147 cd ..
148
148
149 echo "====== bundle single branch"
150 hg init branchy
151 cd branchy
152 echo a >a
153 hg ci -Ama
154 echo b >b
155 hg ci -Amb
156 echo b1 >b1
157 hg ci -Amb1
158 hg up 0
159 echo c >c
160 hg ci -Amc
161 echo c1 >c1
162 hg ci -Amc1
163 hg clone -q .#tip part
164 echo "== bundling via incoming"
165 hg in -R part --bundle incoming.hg --template "{node}\n" .
166 echo "== bundling"
167 hg bundle bundle.hg part --debug
149
168
@@ -326,3 +326,23 diff -r 836ac62537ab anotherfile
326 -1
326 -1
327 -2
327 -2
328 -3
328 -3
329 ====== bundle single branch
330 adding a
331 adding b
332 adding b1
333 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
334 adding c
335 created new head
336 adding c1
337 == bundling via incoming
338 comparing with .
339 searching for changes
340 d2ae7f538514cd87c17547b0de4cea71fe1af9fb
341 5ece8e77363e2b5269e27c66828b72da29e4341a
342 == bundling
343 searching for changes
344 common changesets up to c0025332f9ed
345 2 changesets found
346 list of changesets:
347 d2ae7f538514cd87c17547b0de4cea71fe1af9fb
348 5ece8e77363e2b5269e27c66828b72da29e4341a
@@ -174,7 +174,7 searching for changes
174 adding changesets
174 adding changesets
175 adding manifests
175 adding manifests
176 adding file changes
176 adding file changes
177 added 2 changesets with 0 changes to 1 files
177 added 2 changesets with 0 changes to 0 files
178 Content-Type: text/plain; charset="us-ascii"
178 Content-Type: text/plain; charset="us-ascii"
179 MIME-Version: 1.0
179 MIME-Version: 1.0
180 Content-Transfer-Encoding: 7bit
180 Content-Transfer-Encoding: 7bit
General Comments 0
You need to be logged in to leave comments. Login now