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

login
register
mail settings
Submitter Gregory Szorc
Date July 12, 2014, 8:12 p.m.
Message ID <ab912eb22894240c60ff.1405195941@vm-ubuntu-main.gateway.sonic.net>
Download mbox | patch
Permalink /patch/5149/
State Accepted
Commit a2ca9dcb4b77bb7b740955ba9f4f9ceb8786a4cc
Headers show

Comments

Gregory Szorc - July 12, 2014, 8:12 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1405187578 25200
#      Sat Jul 12 10:52:58 2014 -0700
# Node ID ab912eb22894240c60ff757db60e06e343fef6a7
# Parent  ba3bc6474bbf3a29e5fa16d13ff44b9c0848043c
localrepo: document localrepo.hook()
Matt Mackall - July 14, 2014, 10:15 p.m.
On Sat, 2014-07-12 at 13:12 -0700, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc@gmail.com>
> # Date 1405187578 25200
> #      Sat Jul 12 10:52:58 2014 -0700
> # Node ID ab912eb22894240c60ff757db60e06e343fef6a7
> # Parent  ba3bc6474bbf3a29e5fa16d13ff44b9c0848043c
> localrepo: document localrepo.hook()

Queued this first patch, thanks.

Patch

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={},