diff --git a/tests/test-treemanifest-treeonly.t b/tests/test-treemanifest-treeonly.t --- a/tests/test-treemanifest-treeonly.t +++ b/tests/test-treemanifest-treeonly.t @@ -190,7 +190,7 @@ $ echo x >> subdir/x $ hg commit -qAm 'modify subdir/x' $ hg log -r tip -T '{manifest}' - 1:d9920715ba88 (no-eol) + d9920715ba88cbc7962c4dac9f20004aafd94ac8 (no-eol) $ cd ../client $ hg pull @@ -254,6 +254,10 @@ | ~ +Test {manifest} template + $ hg log -r . -T '{manifest}' + 0ab0ab59dd6ab41bda558ad2fd4c665da69323ab (no-eol) + Test turning treeonly off and making sure we can still commit on top of treeonly commits $ echo >> subdir/x diff --git a/tests/test-treemanifest.t b/tests/test-treemanifest.t --- a/tests/test-treemanifest.t +++ b/tests/test-treemanifest.t @@ -118,8 +118,8 @@ rebasing 4:f096b21e165f "modify subdir/y again" (tip) saved backup bundle to $TESTTMP/client/.hg/strip-backup/6a2476258ba5-a90056a1-rebase.hg (glob) $ hg log -r '.^::.' -T '{manifest}\n' - 3:0d05c20bb7eb - 4:8289b85c6a30 + 0d05c20bb7eb53dbfe91f834ed3f0c26ca6ca655 + 8289b85c6a307a5a64ffe3bd80bd7998775c787a $ hg debugdatapack .hg/store/packs/manifests/5a5fb42e99986c90ac86b57d184561c44238b7b7.datapack .hg/store/packs/manifests/5a5fb42e99986c90ac86b57d184561c44238b7b7: subdir: diff --git a/treemanifest/__init__.py b/treemanifest/__init__.py --- a/treemanifest/__init__.py +++ b/treemanifest/__init__.py @@ -82,6 +82,7 @@ repair, revlog, sshserver, + templatekw, util, wireproto, ) @@ -153,6 +154,16 @@ extensions.wrapfunction(bundle2, 'getrepocaps', getrepocaps) _registerbundle2parts() + extensions.wrapfunction(templatekw, 'showmanifest', showmanifest) + templatekw.keywords['manifest'] = templatekw.showmanifest + +def showmanifest(orig, **args): + # The normal manifest template shows a rev number, which we don't have. + # Let's just print the node. Note, this breaks the ability for us to do + # '{manifest % "{node} {rev}"}' but that's fine, since we can only show + # the node now anyway. + return hex(args[r'ctx'].manifestnode()) + def getrepocaps(orig, repo, *args, **kwargs): caps = orig(repo, *args, **kwargs) if treeenabled(repo.ui):