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