From owner-svn-src-head@FreeBSD.ORG Thu May 15 03:47:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 918CAD5B; Thu, 15 May 2014 03:47:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FB472B69; Thu, 15 May 2014 03:47:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4F3lqTx035437; Thu, 15 May 2014 03:47:52 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4F3lqkC035436; Thu, 15 May 2014 03:47:52 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201405150347.s4F3lqkC035436@svn.freebsd.org> From: Rui Paulo Date: Thu, 15 May 2014 03:47:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266115 - head/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 03:47:52 -0000 Author: rpaulo Date: Thu May 15 03:47:52 2014 New Revision: 266115 URL: http://svnweb.freebsd.org/changeset/base/266115 Log: Add a new target cscope-hook. This adds a Mercurial hook to automatically update the cscope data base every time you pull, switch branch, or update. Modified: head/sys/Makefile Modified: head/sys/Makefile ============================================================================== --- head/sys/Makefile Thu May 15 03:30:03 2014 (r266114) +++ head/sys/Makefile Thu May 15 03:47:52 2014 (r266115) @@ -47,6 +47,25 @@ ${.CURDIR}/cscope.files: .PHONY cscope-clean: rm -f cscope.files cscope.out cscope.in.out cscope.po.out +# +# Installs SCM hooks to update the cscope database every time the source tree +# is updated. +# cscope understands incremental updates, so it's considerably faster when only +# a few files have changed. +# +HG_DIR=${.CURDIR}/../.hg +HG_HOOK=if [ \$$HG_ERROR -eq 0 ]; then cd sys && make -m ../share/mk cscope; fi +cscope-hook: + @if [ -d ${HG_DIR} ]; then \ + if [ "`grep hooks ${HG_DIR}/hgrc`" = "" ]; then \ + echo "[hooks]" >> ${HG_DIR}/hgrc; \ + echo "update = ${HG_HOOK}" >> ${HG_DIR}/hgrc; \ + echo "Hook installed in ${HG_DIR}/hgrc"; \ + else \ + echo "Mercurial update hook already exists."; \ + fi; \ + fi + # You need the devel/global and one of editor/emacs* ports for that. TAGS ${.CURDIR}/TAGS: ${.CURDIR}/cscope.files rm -f ${.CURDIR}/TAGS