##// END OF EJS Templates
Improve pruning of branches in outstanding changeset algorithm...
mpm@selenic.com -
r148:c32286d0 default
parent child Browse files
Show More
@@ -509,6 +509,8 b' class localrepository:'
509 unknown = [tip]
509 unknown = [tip]
510 search = []
510 search = []
511 fetch = []
511 fetch = []
512 seen = {}
513 seenbranch = {}
512
514
513 if tip[0] in m:
515 if tip[0] in m:
514 self.ui.note("nothing to do!\n")
516 self.ui.note("nothing to do!\n")
@@ -516,10 +518,18 b' class localrepository:'
516
518
517 while unknown:
519 while unknown:
518 n = unknown.pop(0)
520 n = unknown.pop(0)
521 seen[n[0]] = 1
522
523 self.ui.debug("examining %s:%s\n" % (short(n[0]), short(n[1])))
519 if n == nullid: break
524 if n == nullid: break
525 if n in seenbranch:
526 self.ui.debug("branch already found\n")
527 continue
520 if n[1] and n[1] in m: # do we know the base?
528 if n[1] and n[1] in m: # do we know the base?
521 self.ui.debug("found incomplete branch %s\n" % short(n[1]))
529 self.ui.debug("found incomplete branch %s:%s\n"
530 % (short(n[0]), short(n[1])))
522 search.append(n) # schedule branch range for scanning
531 search.append(n) # schedule branch range for scanning
532 seenbranch[n] = 1
523 else:
533 else:
524 if n[2] in m and n[3] in m:
534 if n[2] in m and n[3] in m:
525 if n[1] not in fetch:
535 if n[1] not in fetch:
@@ -527,9 +537,19 b' class localrepository:'
527 short(n[1]))
537 short(n[1]))
528 fetch.append(n[1]) # earliest unknown
538 fetch.append(n[1]) # earliest unknown
529 continue
539 continue
530 for b in remote.branches([n[2], n[3]]):
540
531 if b[0] not in m:
541 r = []
532 unknown.append(b)
542 for a in n[2:4]:
543 if a not in seen: r.append(a)
544
545 if r:
546 self.ui.debug("requesting %s\n" %
547 " ".join(map(short, r)))
548 for b in remote.branches(r):
549 self.ui.debug("received %s:%s\n" %
550 (short(b[0]), short(b[1])))
551 if b[0] not in m and b[0] not in seen:
552 unknown.append(b)
533
553
534 while search:
554 while search:
535 n = search.pop(0)
555 n = search.pop(0)
@@ -783,7 +803,7 b' class remoterepository:'
783 def branches(self, nodes):
803 def branches(self, nodes):
784 n = " ".join(map(hex, nodes))
804 n = " ".join(map(hex, nodes))
785 d = self.do_cmd("branches", nodes=n).read()
805 d = self.do_cmd("branches", nodes=n).read()
786 br = [ map(bin, b.split(" ")) for b in d.splitlines() ]
806 br = [ tuple(map(bin, b.split(" "))) for b in d.splitlines() ]
787 return br
807 return br
788
808
789 def between(self, pairs):
809 def between(self, pairs):
General Comments 0
You need to be logged in to leave comments. Login now