comparison 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
comparison
equal deleted inserted replaced
46370:cad17d50736c 46371:0903d6b9b1df
95 user, 95 user,
96 ctx.date(), 96 ctx.date(),
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',
103 throw=True, 106 throw=True,
104 node=hex(n), 107 node=hex(n),