##// END OF EJS Templates
repository: introduce register_changeset callback...
Joerg Sonnenberger -
r47083:0903d6b9 default
parent child Browse files
Show More
@@ -323,7 +323,10 b' class cg1unpacker(object):'
323 cgnodes.append(node)
323 cgnodes.append(node)
324
324
325 def onchangelog(cl, node):
325 def onchangelog(cl, node):
326 efilesset.update(cl.readfiles(node))
326 rev = cl.rev(node)
327 ctx = cl.changelogrevision(rev)
328 efilesset.update(ctx.files)
329 repo.register_changeset(rev, ctx)
327
330
328 self.changelogheader()
331 self.changelogheader()
329 deltas = self.deltaiter()
332 deltas = self.deltaiter()
@@ -97,6 +97,9 b' def commitctx(repo, ctx, error=False, or'
97 extra,
97 extra,
98 )
98 )
99 rev = repo[n].rev()
99 rev = repo[n].rev()
100 if oldtip != repo.changelog.tiprev():
101 repo.register_changeset(rev, repo.changelog.changelogrevision(rev))
102
100 xp1, xp2 = p1.hex(), p2 and p2.hex() or b''
103 xp1, xp2 = p1.hex(), p2 and p2.hex() or b''
101 repo.hook(
104 repo.hook(
102 b'pretxncommit',
105 b'pretxncommit',
@@ -372,6 +372,8 b' def _processchangesetdata(repo, tr, objs'
372 # so we can set the linkrev accordingly when manifests are added.
372 # so we can set the linkrev accordingly when manifests are added.
373 manifestnodes[rev] = revision.manifest
373 manifestnodes[rev] = revision.manifest
374
374
375 repo.register_changeset(rev, revision)
376
375 nodesbyphase = {phase: set() for phase in phases.phasenames.values()}
377 nodesbyphase = {phase: set() for phase in phases.phasenames.values()}
376 remotebookmarks = {}
378 remotebookmarks = {}
377
379
@@ -1641,6 +1641,14 b' class ilocalrepositorymain(interfaceutil'
1641 def revbranchcache():
1641 def revbranchcache():
1642 pass
1642 pass
1643
1643
1644 def register_changeset(rev, changelogrevision):
1645 """Extension point for caches for new nodes.
1646
1647 Multiple consumers are expected to need parts of the changelogrevision,
1648 so it is provided as optimization to avoid duplicate lookups. A simple
1649 cache would be fragile when other revisions are accessed, too."""
1650 pass
1651
1644 def branchtip(branchtip, ignoremissing=False):
1652 def branchtip(branchtip, ignoremissing=False):
1645 """Return the tip node for a given branch."""
1653 """Return the tip node for a given branch."""
1646
1654
@@ -2062,6 +2062,9 b' class localrepository(object):'
2062 self._revbranchcache = branchmap.revbranchcache(self.unfiltered())
2062 self._revbranchcache = branchmap.revbranchcache(self.unfiltered())
2063 return self._revbranchcache
2063 return self._revbranchcache
2064
2064
2065 def register_changeset(self, rev, changelogrevision):
2066 pass
2067
2065 def branchtip(self, branch, ignoremissing=False):
2068 def branchtip(self, branch, ignoremissing=False):
2066 """return the tip node for a given branch
2069 """return the tip node for a given branch
2067
2070
General Comments 0
You need to be logged in to leave comments. Login now