changeset 670:ab3c64db47d8

gitnodekw: use githandler from repo Since a fresh GitHandler is no longer created for every commit, this speeds up the {gitnode} template massively. For a repo with over 50,000 commits, the command hg log -l 10 --template '{gitnode}\n' speeds up from 2.4 seconds to 0.3.
author Siddharth Agarwal <sid0@fb.com>
date Wed, 19 Feb 2014 15:23:36 -0800
parents b8fff2f4e963
children 71fb5dd678bc
files hggit/__init__.py
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hggit/__init__.py	Wed Feb 19 15:22:54 2014 -0800
+++ b/hggit/__init__.py	Wed Feb 19 15:23:36 2014 -0800
@@ -225,8 +225,7 @@
     """:gitnode: String.  The Git changeset identification hash, as a 40 hexadecimal digit string."""
     node = args['ctx']
     repo = args['repo']
-    git = GitHandler(repo, repo.ui)
-    gitnode = git.map_git_get(node.hex())
+    gitnode = repo.githandler.map_git_get(node.hex())
     if gitnode is None:
         gitnode = ''
     return gitnode