# HG changeset patch # User Jun Wu # Date 1496461782 25200 # Node ID 5ffb138d7b1a82e7de9a394be756afeda6801789 # Parent d25802b0eef5537dcaa479852d08a9d41d431855 obsstore: do not load all markers to detect duplication This will make duplication detection something like O(newmarkers) instead of O(obsstore). diff -r d25802b0eef5 -r 5ffb138d7b1a mercurial/obsolete.py --- 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: