[PATCH 4 of 5] Comuting a new range to look through after pruning to save time

Eric Hopper hopper at omnifarious.org
Fri Sep 30 12:10:57 CDT 2005


# HG changeset patch
# User Eric Hopper <hopper at omnifarious.org>
# Node ID 1328dfafa399b51a3e6452f0cb84335131c90fcc
# Parent  d41c5138f6bdb8ebaf7a2caa5eb1c2ffb455d1ba
Comuting a new range to look through after pruning to save time.

diff -r d41c5138f6bd -r 1328dfafa399 mercurial/localrepo.py
--- a/mercurial/localrepo.py	Fri Sep 30 16:44:37 2005
+++ b/mercurial/localrepo.py	Fri Sep 30 17:06:30 2005
@@ -740,7 +740,7 @@
                 continue
             lowestrev = min(lowestrev, cl.rev(n))
 
-        self.ui.debug('%u:%u\n' % (lowestrev, targetrev))
+        self.ui.debug('revrange: %u:%u\n' % (lowestrev, targetrev))
         selected = {targetnode: 1}
         prunedset = selected.copy()
         for i in xrange(targetrev, lowestrev, -1):
@@ -751,13 +751,20 @@
                         prunedset[p] = 1
         self.ui.debug('prunedset contains %u nodes.\n' % (len(prunedset),))
         sendany = False
+        # Recompute the lowest rev based on removing base nodes not in
+        # the pruned set.
+        lowestrev = targetrev
         for n in nodes:
             if n in prunedset:
                 sendany = True
                 selected[n] = 1
+                i = cl.rev(n)
+                if i < lowestrev:
+                    lowestrev = i
         if not sendany:
             self.ui.debug("No outgoing nodes needed.\n")
             return []
+        self.ui.debug('pruned revrange: %u:%u\n' % (lowestrev, targetrev))
 
         orderedselected = []
         for i in xrange(lowestrev, targetrev):


More information about the Mercurial mailing list