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

login
register
mail settings
Submitter Gregory Szorc
Date Sept. 28, 2014, 9:01 p.m.
Message ID <9fbeb3c3c9d508813398.1411938100@vm-ubuntu-main.gateway.sonic.net>
Download mbox | patch
Permalink /patch/6014/
State Changes Requested
Headers show

Comments

Gregory Szorc - Sept. 28, 2014, 9:01 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@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.

Patch

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.'''