##// END OF EJS Templates
Add a function to calculate the outgoing changegroup
Matt Mackall -
r621:004e811f default
parent child Browse files
Show More
@@ -854,11 +854,10 b' class localrepository:'
854
854
855 return nl
855 return nl
856
856
857 def findincoming(self, remote):
857 def findincoming(self, remote, base={}):
858 m = self.changelog.nodemap
858 m = self.changelog.nodemap
859 search = []
859 search = []
860 fetch = []
860 fetch = []
861 base = {}
862 seen = {}
861 seen = {}
863 seenbranch = {}
862 seenbranch = {}
864
863
@@ -875,6 +874,8 b' class localrepository:'
875 for h in heads:
874 for h in heads:
876 if h not in m:
875 if h not in m:
877 unknown.append(h)
876 unknown.append(h)
877 else:
878 base[h] = 1
878
879
879 if not unknown:
880 if not unknown:
880 return None
881 return None
@@ -970,6 +971,30 b' class localrepository:'
970
971
971 return fetch
972 return fetch
972
973
974 def findoutgoing(self, remote):
975 base = {}
976 findincoming(self, remote, base)
977 remain = dict.fromkeys(self.changelog.nodemap)
978
979 # prune everything remote has from the tree
980 remove = base.keys()
981 while remove:
982 n = remove.pop(0)
983 if n in remain:
984 del remain[n]
985 for p in self.changelog.parents(n):
986 remain.append(p)
987
988 # find every node whose parents have been pruned
989 subset = []
990 for n in remain:
991 p1, p2 = self.changelog.parents(n)
992 if p1 not in remain and p2 not in remain:
993 subset.append(n)
994
995 # this is the set of all roots we have to push
996 return subset
997
973 def changegroup(self, basenodes):
998 def changegroup(self, basenodes):
974 nodes = self.newer(basenodes)
999 nodes = self.newer(basenodes)
975
1000
General Comments 0
You need to be logged in to leave comments. Login now