changeset 3928:4df475e22248

Sync with -stable
author Matt Mackall <mpm@selenic.com>
date Sun, 17 Dec 2006 21:48:22 -0600
parents a8bd7280330f (current diff) 93e5f07baf75 (diff)
children 33988aaa1652
files mercurial/localrepo.py mercurial/revlog.py
diffstat 6 files changed, 32 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/.hgsigs	Sun Dec 17 18:45:46 2006 -0800
+++ b/.hgsigs	Sun Dec 17 21:48:22 2006 -0600
@@ -1,3 +1,4 @@
 35fb62a3a673d5322f6274a44ba6456e5e4b3b37 0 iD8DBQBEYmO2ywK+sNU5EO8RAnaYAKCO7x15xUn5mnhqWNXqk/ehlhRt2QCfRDfY0LrUq2q4oK/KypuJYPHgq1A=
 2be3001847cb18a23c403439d9e7d0ace30804e9 0 iD8DBQBExUbjywK+sNU5EO8RAhzxAKCtyHAQUzcTSZTqlfJ0by6vhREwWQCghaQFHfkfN0l9/40EowNhuMOKnJk=
 36a957364b1b89c150f2d0e60a99befe0ee08bd3 0 iD8DBQBFfL2QywK+sNU5EO8RAjYFAKCoGlaWRTeMsjdmxAjUYx6diZxOBwCfY6IpBYsKvPTwB3oktnPt5Rmrlys=
+27230c29bfec36d5540fbe1c976810aefecfd1d2 0 iD8DBQBFheweywK+sNU5EO8RAt7VAKCrqJQWT2/uo2RWf0ZI4bLp6v82jACgjrMdsaTbxRsypcmEsdPhlG6/8F4=
--- a/.hgtags	Sun Dec 17 18:45:46 2006 -0800
+++ b/.hgtags	Sun Dec 17 21:48:22 2006 -0600
@@ -13,3 +13,4 @@
 35fb62a3a673d5322f6274a44ba6456e5e4b3b37 0.9
 2be3001847cb18a23c403439d9e7d0ace30804e9 0.9.1
 36a957364b1b89c150f2d0e60a99befe0ee08bd3 0.9.2
+27230c29bfec36d5540fbe1c976810aefecfd1d2 0.9.3
--- a/mercurial/localrepo.py	Sun Dec 17 18:45:46 2006 -0800
+++ b/mercurial/localrepo.py	Sun Dec 17 21:48:22 2006 -0600
@@ -1284,7 +1284,7 @@
                 newheads = list(heads)
                 for r in remote_heads:
                     if r in self.changelog.nodemap:
-                        desc = self.changelog.heads(r)
+                        desc = self.changelog.heads(r, heads)
                         l = [h for h in heads if h in desc]
                         if not l:
                             newheads.append(r)
--- a/mercurial/revlog.py	Sun Dec 17 18:45:46 2006 -0800
+++ b/mercurial/revlog.py	Sun Dec 17 21:48:22 2006 -0600
@@ -716,15 +716,19 @@
         assert heads
         return (orderedout, roots, heads)
 
-    def heads(self, start=None):
+    def heads(self, start=None, stop=None):
         """return the list of all nodes that have no children
 
         if start is specified, only heads that are descendants of
         start will be returned
-
+        if stop is specified, it will consider all the revs from stop
+        as if they had no children
         """
         if start is None:
             start = nullid
+        if stop is None:
+            stop = []
+        stoprevs = dict.fromkeys([self.rev(n) for n in stop])
         startrev = self.rev(start)
         reachable = {startrev: 1}
         heads = {startrev: 1}
@@ -733,10 +737,12 @@
         for r in xrange(startrev + 1, self.count()):
             for p in parentrevs(r):
                 if p in reachable:
-                    reachable[r] = 1
+                    if r not in stoprevs:
+                        reachable[r] = 1
                     heads[r] = 1
-                if p in heads:
+                if p in heads and p not in stoprevs:
                     del heads[p]
+
         return [self.node(r) for r in heads]
 
     def children(self, node):
--- a/tests/test-push-warn	Sun Dec 17 18:45:46 2006 -0800
+++ b/tests/test-push-warn	Sun Dec 17 21:48:22 2006 -0600
@@ -54,4 +54,9 @@
 hg push -f -r 3 -r 4 ../c; echo $?
 hg push -r 5 ../c; echo $?
 
+# issue 450
+hg init ../e
+hg push -r 0 ../e ; echo $?
+hg push -r 1 ../e ; echo $?
+
 exit 0
--- a/tests/test-push-warn.out	Sun Dec 17 18:45:46 2006 -0800
+++ b/tests/test-push-warn.out	Sun Dec 17 21:48:22 2006 -0600
@@ -62,3 +62,17 @@
 adding file changes
 added 1 changesets with 1 changes to 1 files (-1 heads)
 0
+pushing to ../e
+searching for changes
+adding changesets
+adding manifests
+adding file changes
+added 1 changesets with 1 changes to 1 files
+0
+pushing to ../e
+searching for changes
+adding changesets
+adding manifests
+adding file changes
+added 1 changesets with 1 changes to 1 files
+0