Patchwork [01,of,11,sparse,V3] sparse: remove custom hash matcher

login
register
mail settings
Submitter Gregory Szorc
Date July 7, 2017, 1:18 a.m.
Message ID <310f7bcab50bc92d6ff9.1499390302@ubuntu-vm-main>
Download mbox | patch
Permalink /patch/22074/
State Accepted
Headers show

Comments

Gregory Szorc - July 7, 2017, 1:18 a.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1499387493 25200
#      Thu Jul 06 17:31:33 2017 -0700
# Node ID 310f7bcab50bc92d6ff93ee1c6b055a636925123
# Parent  d2d4b210a0409032368aee07012bb5412ea66289
sparse: remove custom hash matcher

With the recent change to always use repr(), this function was
functionally identical to the version in fsmonitor it was
replacing. So remove it.

Patch

diff --git a/hgext/sparse.py b/hgext/sparse.py
--- a/hgext/sparse.py
+++ b/hgext/sparse.py
@@ -116,14 +116,6 @@  def extsetup(ui):
     _setuplog(ui)
     _setupadd(ui)
     _setupdirstate(ui)
-    # if fsmonitor is enabled, tell it to use our hash function
-    try:
-        fsmonitor = extensions.find('fsmonitor')
-        def _hashignore(orig, ignore):
-            return _hashmatcher(ignore)
-        extensions.wrapfunction(fsmonitor, '_hashignore', _hashignore)
-    except KeyError:
-        pass
 
 def reposetup(ui, repo):
     if not util.safehasattr(repo, 'dirstate'):
@@ -982,8 +974,3 @@  class negatematcher(object):
 
     def __repr__(self):
         return ('<negatematcher matcher=%r>' % self._matcher)
-
-def _hashmatcher(matcher):
-    sha1 = hashlib.sha1()
-    sha1.update(repr(matcher))
-    return sha1.hexdigest()