[PATCH 2 of 6 events v3] localrepo: add events support to localrepository

Gregory Szorc gregory.szorc at gmail.com
Sun Sep 28 16:01:40 CDT 2014


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1408423487 25200
#      Mon Aug 18 21:44:47 2014 -0700
# Node ID 9fbeb3c3c9d508813398d6fc800b253cd1698407
# Parent  d513c232aeba16137b291456536adee0d88a040f
localrepo: add events support to localrepository

The first logical place to add events support is the localrepository
class. This patch adds a skeleton for events there.

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -296,8 +296,10 @@ class localrepository(object):
         # - working directory parent change,
         # - bookmark changes
         self.filteredrevcache = {}
 
+        self.events = localrepoevents(repo=self)
+
     def close(self):
         pass
 
     def _restrictcapabilities(self, caps):
@@ -1777,4 +1779,7 @@ def instance(ui, path, create):
     return localrepository(ui, util.urllocalpath(path), create)
 
 def islocal(path):
     return True
+
+class localrepoevents(util.eventmanager):
+    '''Defines events for localrepository instances.'''


More information about the Mercurial-devel mailing list