##// END OF EJS Templates
hg merge: some getchangegroup fixups...
mpm@selenic.com -
r324:ce81bdd9 default
parent child Browse files
Show More
@@ -723,38 +723,49 b' class localrepository:'
723 if not unknown:
723 if not unknown:
724 self.ui.status("nothing to do!\n")
724 self.ui.status("nothing to do!\n")
725 return None
725 return None
726
726
727 rep = {}
728 reqcnt = 0
729
727 unknown = remote.branches(unknown)
730 unknown = remote.branches(unknown)
728 while unknown:
731 while unknown:
729 n = unknown.pop(0)
732 r = []
730 seen[n[0]] = 1
733 while unknown:
731
734 n = unknown.pop(0)
732 self.ui.debug("examining %s:%s\n" % (short(n[0]), short(n[1])))
735 if n[0] in seen:
733 if n == nullid: break
736 continue
734 if n in seenbranch:
737 seen[n[0]] = 1
735 self.ui.debug("branch already found\n")
736 continue
737 if n[1] and n[1] in m: # do we know the base?
738 self.ui.debug("found incomplete branch %s:%s\n"
739 % (short(n[0]), short(n[1])))
740 search.append(n) # schedule branch range for scanning
741 seenbranch[n] = 1
742 else:
743 if n[2] in m and n[3] in m:
744 if n[1] not in fetch:
745 self.ui.debug("found new changeset %s\n" %
746 short(n[1]))
747 fetch.append(n[1]) # earliest unknown
748 continue
749
738
750 r = []
739 self.ui.debug("examining %s:%s\n" % (short(n[0]), short(n[1])))
751 for a in n[2:4]:
740 if n[0] == nullid:
752 if a not in seen: r.append(a)
741 break
753
742 if n[1] in seenbranch:
754 if r:
743 self.ui.debug("branch already found\n")
755 self.ui.debug("requesting %s\n" %
744 continue
756 " ".join(map(short, r)))
745 if n[1] and n[1] in m: # do we know the base?
757 for b in remote.branches(r):
746 self.ui.debug("found incomplete branch %s:%s\n"
747 % (short(n[0]), short(n[1])))
748 search.append(n) # schedule branch range for scanning
749 seenbranch[n[1]] = 1
750 else:
751 if n[1] not in seen and n[1] not in fetch:
752 if n[2] in m and n[3] in m:
753 self.ui.debug("found new changeset %s\n" %
754 short(n[1]))
755 fetch.append(n[1]) # earliest unknown
756 continue
757
758 for a in n[2:4]:
759 if a not in rep:
760 r.append(a)
761 rep[a] = 1
762
763 if r:
764 reqcnt += 1
765 self.ui.debug("request %d: %s\n" %
766 (reqcnt, " ".join(map(short, r))))
767 for p in range(0, len(r), 10):
768 for b in remote.branches(r[p:p+10]):
758 self.ui.debug("received %s:%s\n" %
769 self.ui.debug("received %s:%s\n" %
759 (short(b[0]), short(b[1])))
770 (short(b[0]), short(b[1])))
760 if b[0] not in m and b[0] not in seen:
771 if b[0] not in m and b[0] not in seen:
@@ -762,6 +773,7 b' class localrepository:'
762
773
763 while search:
774 while search:
764 n = search.pop(0)
775 n = search.pop(0)
776 reqcnt += 1
765 l = remote.between([(n[0], n[1])])[0]
777 l = remote.between([(n[0], n[1])])[0]
766 p = n[0]
778 p = n[0]
767 f = 1
779 f = 1
@@ -785,6 +797,8 b' class localrepository:'
785 self.ui.note("adding new changesets starting at " +
797 self.ui.note("adding new changesets starting at " +
786 " ".join([short(f) for f in fetch]) + "\n")
798 " ".join([short(f) for f in fetch]) + "\n")
787
799
800 self.ui.debug("%d total queries\n" % reqcnt)
801
788 return remote.changegroup(fetch)
802 return remote.changegroup(fetch)
789
803
790 def changegroup(self, basenodes):
804 def changegroup(self, basenodes):
General Comments 0
You need to be logged in to leave comments. Login now