comparison mercurial/localrepo.py @ 1457:518da3c3b6ce

This implements the nodesbetween method, and it removes the newer method and replaces it with calls to nodesbetween. nodesbetween calculates all the changesets needed to have a complete revision graph between a given set of base nodes and a given set of head nodes.
author Eric Hopper <hopper@omnifarious.org>
date Fri, 07 Oct 2005 10:48:27 -0700
parents d729850d52fa
children 1033892bbb87
comparison
equal deleted inserted replaced
1389:9b3ef6f3cef5 1457:518da3c3b6ce
698 698
699 r.append(l) 699 r.append(l)
700 700
701 return r 701 return r
702 702
703 def newer(self, nodes):
704 m = {}
705 nl = []
706 pm = {}
707 cl = self.changelog
708 t = l = cl.count()
709
710 # find the lowest numbered node
711 for n in nodes:
712 l = min(l, cl.rev(n))
713 m[n] = 1
714
715 for i in xrange(l, t):
716 n = cl.node(i)
717 if n in m: # explicitly listed
718 pm[n] = 1
719 nl.append(n)
720 continue
721 for p in cl.parents(n):
722 if p in pm: # parent listed
723 pm[n] = 1
724 nl.append(n)
725 break
726
727 return nl
728
729 def findincoming(self, remote, base=None, heads=None): 703 def findincoming(self, remote, base=None, heads=None):
730 m = self.changelog.nodemap 704 m = self.changelog.nodemap
731 search = [] 705 search = []
732 fetch = {} 706 fetch = {}
733 seen = {} 707 seen = {}
920 894
921 def changegroup(self, basenodes): 895 def changegroup(self, basenodes):
922 genread = util.chunkbuffer 896 genread = util.chunkbuffer
923 897
924 def gengroup(): 898 def gengroup():
925 nodes = self.newer(basenodes) 899 nodes = self.changelog.nodesbetween(basenodes)[0]
926 900
927 # construct the link map 901 # construct the link map
928 linkmap = {} 902 linkmap = {}
929 for n in nodes: 903 for n in nodes:
930 linkmap[self.changelog.rev(n)] = n 904 linkmap[self.changelog.rev(n)] = n