Show More
@@ -1564,7 +1564,8 b' class localrepository(repo.repository):' | |||
|
1564 | 1564 | |
|
1565 | 1565 | if revs is None: |
|
1566 | 1566 | # use the fast path, no race possible on push |
|
1567 |
|
|
|
1567 | nodes = self.changelog.findmissing(common.keys()) | |
|
1568 | cg = self._changegroup(nodes, 'push') | |
|
1568 | 1569 | else: |
|
1569 | 1570 | cg = self.changegroupsubset(update, revs, 'push') |
|
1570 | 1571 | return cg, remote_heads |
@@ -1622,28 +1623,26 b' class localrepository(repo.repository):' | |||
|
1622 | 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 | 1635 | if extranodes is None: |
|
1626 | 1636 | # can we go through the fast path ? |
|
1627 | 1637 | heads.sort() |
|
1628 | 1638 | allheads = self.heads() |
|
1629 | 1639 | allheads.sort() |
|
1630 | 1640 | if heads == allheads: |
|
1631 | common = [] | |
|
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) | |
|
1641 | return self._changegroup(msng_cl_lst, source) | |
|
1638 | 1642 | |
|
1643 | # slow path | |
|
1639 | 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 | 1646 | self.changegroupinfo(msng_cl_lst, source) |
|
1648 | 1647 | # Some bases may turn out to be superfluous, and some heads may be |
|
1649 | 1648 | # too. nodesbetween will return the minimal set of bases and heads |
@@ -1903,7 +1902,7 b' class localrepository(repo.repository):' | |||
|
1903 | 1902 | # to avoid a race we use changegroupsubset() (issue1320) |
|
1904 | 1903 | return self.changegroupsubset(basenodes, self.heads(), source) |
|
1905 | 1904 | |
|
1906 |
def _changegroup(self, |
|
|
1905 | def _changegroup(self, nodes, source): | |
|
1907 | 1906 | """Compute the changegroup of all nodes that we have that a recipient |
|
1908 | 1907 | doesn't. Return a chunkbuffer object whose read() method will return |
|
1909 | 1908 | successive changegroup chunks. |
@@ -1911,12 +1910,11 b' class localrepository(repo.repository):' | |||
|
1911 | 1910 | This is much easier than the previous function as we can assume that |
|
1912 | 1911 | the recipient has any changenode we aren't sending them. |
|
1913 | 1912 | |
|
1914 |
|
|
|
1913 | nodes is the set of nodes to send""" | |
|
1915 | 1914 | |
|
1916 | 1915 | self.hook('preoutgoing', throw=True, source=source) |
|
1917 | 1916 | |
|
1918 | 1917 | cl = self.changelog |
|
1919 | nodes = cl.findmissing(common) | |
|
1920 | 1918 | revset = set([cl.rev(n) for n in nodes]) |
|
1921 | 1919 | self.changegroupinfo(nodes, source) |
|
1922 | 1920 |
@@ -146,4 +146,23 b' cd b' | |||
|
146 | 146 | hg -R ../all.hg diff -r tip |
|
147 | 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 b' diff -r 836ac62537ab anotherfile' | |||
|
326 | 326 | -1 |
|
327 | 327 | -2 |
|
328 | 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 b' searching for changes' | |||
|
174 | 174 | adding changesets |
|
175 | 175 | adding manifests |
|
176 | 176 | adding file changes |
|
177 |
added 2 changesets with 0 changes to |
|
|
177 | added 2 changesets with 0 changes to 0 files | |
|
178 | 178 | Content-Type: text/plain; charset="us-ascii" |
|
179 | 179 | MIME-Version: 1.0 |
|
180 | 180 | Content-Transfer-Encoding: 7bit |
General Comments 0
You need to be logged in to leave comments.
Login now