comparison tests/test-commandserver.t @ 42620:d98ec36be808

convert: add a config option to help doing identity hg->hg conversion I want to change the computation of the list of files modified by a commit. In principle, this would simply change a cache. But since this information is stored in commits rather than a cache, changing it means changing commit hashes (going forward). Some users rely on the convert extension from hg to hg not changing hashes when nothing changes (usually). Allow these users to preserve hashes despite changes to the changelog files computation by reusing these files lists when the manifest is unchanged (since these files list are derived from the manifest). Differential Revision: https://phab.mercurial-scm.org/D6643
author Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
date Sat, 13 Jul 2019 23:45:32 -0400
parents e7110f44ee2d
children 34a46d48d24e
comparison
equal deleted inserted replaced
42619:20d0e59be79b 42620:d98ec36be808
915 > ) 915 > )
916 > def fail(tr): 916 > def fail(tr):
917 > raise error.Abort(b'fail after finalization') 917 > raise error.Abort(b'fail after finalization')
918 > def reposetup(ui, repo): 918 > def reposetup(ui, repo):
919 > class failrepo(repo.__class__): 919 > class failrepo(repo.__class__):
920 > def commitctx(self, ctx, error=False): 920 > def commitctx(self, ctx, error=False, origctx=None):
921 > if self.ui.configbool(b'failafterfinalize', b'fail'): 921 > if self.ui.configbool(b'failafterfinalize', b'fail'):
922 > # 'sorted()' by ASCII code on category names causes 922 > # 'sorted()' by ASCII code on category names causes
923 > # invoking 'fail' after finalization of changelog 923 > # invoking 'fail' after finalization of changelog
924 > # using "'cl-%i' % id(self)" as category name 924 > # using "'cl-%i' % id(self)" as category name
925 > self.currenttransaction().addfinalize(b'zzzzzzzz', fail) 925 > self.currenttransaction().addfinalize(b'zzzzzzzz', fail)
926 > return super(failrepo, self).commitctx(ctx, error) 926 > return super(failrepo, self).commitctx(ctx, error, origctx)
927 > repo.__class__ = failrepo 927 > repo.__class__ = failrepo
928 > EOF 928 > EOF
929 929
930 $ hg init repo3 930 $ hg init repo3
931 $ cd repo3 931 $ cd repo3