changeset 32774:5ffb138d7b1a

obsstore: do not load all markers to detect duplication This will make duplication detection something like O(newmarkers) instead of O(obsstore).
author Jun Wu <quark@fb.com>
date Fri, 02 Jun 2017 20:49:42 -0700
parents d25802b0eef5
children 59a41b0002c3
files mercurial/obsolete.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/obsolete.py	Sat Jun 10 11:33:57 2017 -0700
+++ b/mercurial/obsolete.py	Fri Jun 02 20:49:42 2017 -0700
@@ -635,10 +635,11 @@
         if self._readonly:
             raise error.Abort(_('creating obsolete markers is not enabled on '
                               'this repo'))
-        known = set(self._all)
+        known = set()
+        getsuccessors = self.successors.get
         new = []
         for m in markers:
-            if m not in known:
+            if m not in getsuccessors(m[0], ()) and m not in known:
                 known.add(m)
                 new.append(m)
         if new: