mercurial/commands.py
changeset 19394 4da845cd854f
parent 19379 83d0df2ddf3f
child 19400 61c93ef8302e
--- a/mercurial/commands.py	Tue Jul 16 11:13:18 2013 -0500
+++ b/mercurial/commands.py	Mon Jul 15 15:19:43 2013 -0700
@@ -5480,18 +5480,8 @@
         ui.write(_('commit: %s\n') % t.strip())
 
     # all ancestors of branch heads - all ancestors of parent = new csets
-    new = [0] * len(repo)
-    cl = repo.changelog
-    for a in [cl.rev(n) for n in bheads]:
-        new[a] = 1
-    for a in cl.ancestors([cl.rev(n) for n in bheads]):
-        new[a] = 1
-    for a in [p.rev() for p in parents]:
-        if a >= 0:
-            new[a] = 0
-    for a in cl.ancestors([p.rev() for p in parents]):
-        new[a] = 0
-    new = sum(new)
+    new = len(repo.changelog.findmissing([ctx.node() for ctx in parents],
+                                         bheads))
 
     if new == 0:
         # i18n: column positioning for "hg summary"