Mercurial > public > mercurial-scm > hg-stable
diff mercurial/obsutil.py @ 39328:5763216ba311
transaction: remember original len(repo) instead of tracking added revs (API)
It's silly to keep updating xrange(len(changelog), len(changelog) + 1) for
each added revision. Instead, let's simply remember the first revision to
be added.
The test output slightly changed as the branch cache is also warmed up by
stream clone, which seems more consistent.
.. api::
``tr.changes['revs']`` is replaced by ``tr.changes['origrepolen']`` which
is the first revision number to be added.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 25 Aug 2018 15:28:48 +0900 |
parents | 52e6171ec822 |
children | 93175cba7edd |
line wrap: on
line diff
--- a/mercurial/obsutil.py Sat Aug 25 15:19:43 2018 +0900 +++ b/mercurial/obsutil.py Sat Aug 25 15:28:48 2018 +0900 @@ -465,13 +465,13 @@ succsmarkers = repo.obsstore.successors.get public = phases.public addedmarkers = tr.changes.get('obsmarkers') - addedrevs = tr.changes['revs'] + origrepolen = tr.changes['origrepolen'] seenrevs = set() obsoleted = set() for mark in addedmarkers: node = mark[0] rev = torev(node) - if rev is None or rev in seenrevs or rev in addedrevs: + if rev is None or rev in seenrevs or rev >= origrepolen: continue seenrevs.add(rev) if phase(repo, rev) == public: