##// END OF EJS Templates
changegroupsubset: accept list of per-revlog nodes to include...
Alexis S. L. Carvalho -
r5908:afa1e612 default
parent child Browse files
Show More
@@ -1510,7 +1510,7 b' class localrepository(repo.repository):'
1510 for node in nodes:
1510 for node in nodes:
1511 self.ui.debug("%s\n" % hex(node))
1511 self.ui.debug("%s\n" % hex(node))
1512
1512
1513 def changegroupsubset(self, bases, heads, source):
1513 def changegroupsubset(self, bases, heads, source, extranodes=None):
1514 """This function generates a changegroup consisting of all the nodes
1514 """This function generates a changegroup consisting of all the nodes
1515 that are descendents of any of the bases, and ancestors of any of
1515 that are descendents of any of the bases, and ancestors of any of
1516 the heads.
1516 the heads.
@@ -1520,7 +1520,15 b' class localrepository(repo.repository):'
1520 is non-trivial.
1520 is non-trivial.
1521
1521
1522 Another wrinkle is doing the reverse, figuring out which changeset in
1522 Another wrinkle is doing the reverse, figuring out which changeset in
1523 the changegroup a particular filenode or manifestnode belongs to."""
1523 the changegroup a particular filenode or manifestnode belongs to.
1524
1525 The caller can specify some nodes that must be included in the
1526 changegroup using the extranodes argument. It should be a dict
1527 where the keys are the filenames (or 1 for the manifest), and the
1528 values are lists of (node, linknode) tuples, where node is a wanted
1529 node and linknode is the changelog node that should be transmitted as
1530 the linkrev.
1531 """
1524
1532
1525 self.hook('preoutgoing', throw=True, source=source)
1533 self.hook('preoutgoing', throw=True, source=source)
1526
1534
@@ -1713,6 +1721,15 b' class localrepository(repo.repository):'
1713 return msngset[fnode]
1721 return msngset[fnode]
1714 return lookup_filenode_link
1722 return lookup_filenode_link
1715
1723
1724 # Add the nodes that were explicitly requested.
1725 def add_extra_nodes(name, nodes):
1726 if not extranodes or name not in extranodes:
1727 return
1728
1729 for node, linknode in extranodes[name]:
1730 if node not in nodes:
1731 nodes[node] = linknode
1732
1716 # Now that we have all theses utility functions to help out and
1733 # Now that we have all theses utility functions to help out and
1717 # logically divide up the task, generate the group.
1734 # logically divide up the task, generate the group.
1718 def gengroup():
1735 def gengroup():
@@ -1728,6 +1745,7 b' class localrepository(repo.repository):'
1728 # The list of manifests has been collected by the generator
1745 # The list of manifests has been collected by the generator
1729 # calling our functions back.
1746 # calling our functions back.
1730 prune_manifests()
1747 prune_manifests()
1748 add_extra_nodes(1, msng_mnfst_set)
1731 msng_mnfst_lst = msng_mnfst_set.keys()
1749 msng_mnfst_lst = msng_mnfst_set.keys()
1732 # Sort the manifestnodes by revision number.
1750 # Sort the manifestnodes by revision number.
1733 msng_mnfst_lst.sort(cmp_by_rev_func(mnfst))
1751 msng_mnfst_lst.sort(cmp_by_rev_func(mnfst))
@@ -1743,6 +1761,13 b' class localrepository(repo.repository):'
1743 msng_mnfst_lst = None
1761 msng_mnfst_lst = None
1744 msng_mnfst_set.clear()
1762 msng_mnfst_set.clear()
1745
1763
1764 if extranodes:
1765 for fname in extranodes:
1766 if isinstance(fname, int):
1767 continue
1768 add_extra_nodes(fname,
1769 msng_filenode_set.setdefault(fname, {}))
1770 changedfiles[fname] = 1
1746 changedfiles = changedfiles.keys()
1771 changedfiles = changedfiles.keys()
1747 changedfiles.sort()
1772 changedfiles.sort()
1748 # Go through all our files in order sorted by name.
1773 # Go through all our files in order sorted by name.
General Comments 0
You need to be logged in to leave comments. Login now