##// END OF EJS Templates
transaction: remember original len(repo) instead of tracking added revs (API)...
Yuya Nishihara -
r39337:5763216b default
parent child Browse files
Show More
@@ -545,19 +545,3 b' class changelog(revlog.revlog):'
545 545 just to access this is costly."""
546 546 extra = self.read(rev)[5]
547 547 return encoding.tolocal(extra.get("branch")), 'close' in extra
548
549 def _addrevision(self, node, rawtext, transaction, *args, **kwargs):
550 # overlay over the standard revlog._addrevision to track the new
551 # revision on the transaction.
552 rev = len(self)
553 node = super(changelog, self)._addrevision(node, rawtext, transaction,
554 *args, **kwargs)
555 revs = transaction.changes.get('revs')
556 if revs is not None:
557 if revs:
558 assert revs[-1] + 1 == rev
559 revs = pycompat.membershiprange(revs[0], rev + 1)
560 else:
561 revs = pycompat.membershiprange(rev, rev + 1)
562 transaction.changes['revs'] = revs
563 return node
@@ -1393,7 +1393,7 b' class localrepository(object):'
1393 1393 releasefn=releasefn,
1394 1394 checkambigfiles=_cachedfiles,
1395 1395 name=desc)
1396 tr.changes['revs'] = pycompat.xrange(0, 0)
1396 tr.changes['origrepolen'] = len(self)
1397 1397 tr.changes['obsmarkers'] = set()
1398 1398 tr.changes['phases'] = {}
1399 1399 tr.changes['bookmarks'] = {}
@@ -1611,7 +1611,7 b' class localrepository(object):'
1611 1611 # later call to `destroyed` will refresh them.
1612 1612 return
1613 1613
1614 if tr is None or tr.changes['revs']:
1614 if tr is None or tr.changes['origrepolen'] < len(self):
1615 1615 # updating the unfiltered branchmap should refresh all the others,
1616 1616 self.ui.debug('updating the branch cache\n')
1617 1617 branchmap.updatecache(self.filtered('served'))
@@ -465,13 +465,13 b' def getobsoleted(repo, tr):'
465 465 succsmarkers = repo.obsstore.successors.get
466 466 public = phases.public
467 467 addedmarkers = tr.changes.get('obsmarkers')
468 addedrevs = tr.changes['revs']
468 origrepolen = tr.changes['origrepolen']
469 469 seenrevs = set()
470 470 obsoleted = set()
471 471 for mark in addedmarkers:
472 472 node = mark[0]
473 473 rev = torev(node)
474 if rev is None or rev in seenrevs or rev in addedrevs:
474 if rev is None or rev in seenrevs or rev >= origrepolen:
475 475 continue
476 476 seenrevs.add(rev)
477 477 if phase(repo, rev) == public:
@@ -1618,13 +1618,13 b' def registersummarycallback(repo, otr, t'
1618 1618 @reportsummary
1619 1619 def reportnewcs(repo, tr):
1620 1620 """Report the range of new revisions pulled/unbundled."""
1621 newrevs = tr.changes.get('revs', pycompat.xrange(0, 0))
1622 if not newrevs:
1621 origrepolen = tr.changes.get('origrepolen', len(repo))
1622 if origrepolen >= len(repo):
1623 1623 return
1624 1624
1625 1625 # Compute the bounds of new revisions' range, excluding obsoletes.
1626 1626 unfi = repo.unfiltered()
1627 revs = unfi.revs('%ld and not obsolete()', newrevs)
1627 revs = unfi.revs('%d: and not obsolete()', origrepolen)
1628 1628 if not revs:
1629 1629 # Got only obsoletes.
1630 1630 return
@@ -1641,13 +1641,13 b' def registersummarycallback(repo, otr, t'
1641 1641 """Report statistics of phase changes for changesets pre-existing
1642 1642 pull/unbundle.
1643 1643 """
1644 newrevs = tr.changes.get('revs', pycompat.xrange(0, 0))
1644 origrepolen = tr.changes.get('origrepolen', len(repo))
1645 1645 phasetracking = tr.changes.get('phases', {})
1646 1646 if not phasetracking:
1647 1647 return
1648 1648 published = [
1649 1649 rev for rev, (old, new) in phasetracking.iteritems()
1650 if new == phases.public and rev not in newrevs
1650 if new == phases.public and rev < origrepolen
1651 1651 ]
1652 1652 if not published:
1653 1653 return
@@ -247,6 +247,7 b' Clone with background file closing enabl'
247 247 sending stream_out command
248 248 1027 files to transfer, 96.3 KB of data
249 249 starting 4 threads for background file closing
250 updating the branch cache
250 251 transferred 96.3 KB in * seconds (*/sec) (glob)
251 252 query 1; heads
252 253 sending batch command
@@ -275,6 +276,7 b' Clone with background file closing enabl'
275 276 1030 files to transfer, 96.4 KB of data
276 277 starting 4 threads for background file closing
277 278 starting 4 threads for background file closing
279 updating the branch cache
278 280 transferred 96.4 KB in * seconds (* */sec) (glob)
279 281 bundle2-input-part: total payload size 112077
280 282 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
@@ -88,6 +88,7 b' Test that we can apply the bundle as a s'
88 88 transferred 1.65 KB in \d\.\d seconds \(.*/sec\) (re)
89 89 bundle2-input-part: total payload size 1840
90 90 bundle2-input-bundle: 0 parts total
91 updating the branch cache
91 92 finished applying clone bundle
92 93 query 1; heads
93 94 sending batch command
@@ -142,6 +143,7 b' Test that we can apply the bundle as a s'
142 143 transferred 1.65 KB in *.* seconds (*/sec) (glob)
143 144 bundle2-input-part: total payload size 1840
144 145 bundle2-input-bundle: 0 parts total
146 updating the branch cache
145 147 finished applying clone bundle
146 148 query 1; heads
147 149 sending batch command
General Comments 0
You need to be logged in to leave comments. Login now