[PATCH 1 of 6] localrepo: document localrepo.hook()

Gregory Szorc gregory.szorc at gmail.com
Sat Jul 12 15:12:21 CDT 2014


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1405187578 25200
#      Sat Jul 12 10:52:58 2014 -0700
# Node ID ab912eb22894240c60ff757db60e06e343fef6a7
# Parent  ba3bc6474bbf3a29e5fa16d13ff44b9c0848043c
localrepo: document localrepo.hook()

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -477,8 +477,14 @@ class localrepository(object):
     def url(self):
         return 'file:' + self.root
 
     def hook(self, name, throw=False, **args):
+        """Call a hook, passing this repo instance.
+
+        This a convenience method to aid invoking hooks. Extensions likely
+        won't call this unless they have registered a custom hook or are
+        replacing code that is expected to call a hook.
+        """
         return hook.hook(self.ui, self, name, throw, **args)
 
     @unfilteredmethod
     def _tag(self, names, node, message, local, user, date, extra={},


More information about the Mercurial-devel mailing list