diff mercurial/commit.py @ 46371:0903d6b9b1df

repository: introduce register_changeset callback The new callback is called whenever a changeset is added to the repository (commit, unbundle or exchange). Since the bulk operations already parse the changeset (readfiles or full changesetrevision), always use the latter to avoid redundant lookups. The first consumer of the new interface needs to look at extra. Differential Revision: https://phab.mercurial-scm.org/D9780
author Joerg Sonnenberger <joerg@bec.de>
date Tue, 19 Jan 2021 00:20:53 +0100
parents 72f5280e33b6
children e2f7b2695ba1
line wrap: on
line diff
--- a/mercurial/commit.py	Fri Jan 15 01:30:08 2021 +0100
+++ b/mercurial/commit.py	Tue Jan 19 00:20:53 2021 +0100
@@ -97,6 +97,9 @@
             extra,
         )
         rev = repo[n].rev()
+        if oldtip != repo.changelog.tiprev():
+            repo.register_changeset(rev, repo.changelog.changelogrevision(rev))
+
         xp1, xp2 = p1.hex(), p2 and p2.hex() or b''
         repo.hook(
             b'pretxncommit',