config/makefiles/rcs.mk

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/config/makefiles/rcs.mk	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,54 @@
     1.4 +# -*- makefile -*-
     1.5 +# vim:set ts=8 sw=8 sts=8 noet:
     1.6 +#
     1.7 +# This Source Code Form is subject to the terms of the Mozilla Public
     1.8 +# License, v. 2.0. If a copy of the MPL was not distributed with this file,
     1.9 +# You can obtain one at http://mozilla.org/MPL/2.0/.
    1.10 +#
    1.11 +
    1.12 +ifdef USE_RCS_MK #{
    1.13 +
    1.14 +ifndef INCLUDED_RCS_MK #{
    1.15 +
    1.16 +MOZ_RCS_TYPE_HG ?= $(notdir $(wildcard $(topsrcdir)/.hg))
    1.17 +MOZ_RCS_TYPE_GIT ?= $(notdir $(wildcard $(topsrcdir)/.git))
    1.18 +
    1.19 +
    1.20 +###########################################################################
    1.21 +# HAVE_MERCURIAL_RCS
    1.22 +###########################################################################
    1.23 +ifeq (.hg,$(MOZ_RCS_TYPE_HG)) #{
    1.24 +
    1.25 +# Intent: Retrieve the http:// repository path for a directory.
    1.26 +# Usage: $(call getSourceRepo[,repo_dir|args])
    1.27 +# Args:
    1.28 +#   path (optional): repository to query.  Defaults to $(topsrcdir)
    1.29 +getSourceRepo = \
    1.30 +  $(call FUNC_getSourceRepo,$(if $(1),cd $(1) && hg,hg --repository $(topsrcdir)))
    1.31 +
    1.32 +# return: http://hg.mozilla.org/mozilla-central
    1.33 +FUNC_getSourceRepo = \
    1.34 +  $(strip \
    1.35 +    $(patsubst %/,%,\
    1.36 +    $(patsubst ssh://%,http://%,\
    1.37 +    $(firstword $(shell $(getargv) showconfig paths.default))\
    1.38 +    )))
    1.39 +
    1.40 +#} HAVE_MERCURIAL_RCS
    1.41 +
    1.42 +###########################################################################
    1.43 +# HAVE_GIT_RCS
    1.44 +###########################################################################
    1.45 +else ifeq (.git,$(MOZ_RCS_TYPE_GIT)) #{
    1.46 +
    1.47 +GIT ?= git
    1.48 +getSourceRepo = \
    1.49 +  $(shell cd $(topsrcdir) && $(GIT) rev-parse --verify HEAD)
    1.50 +
    1.51 +endif #} HAVE_GIT_RCS
    1.52 +
    1.53 +
    1.54 +INCLUDED_RCS_MK := 1
    1.55 +endif #}
    1.56 +
    1.57 +endif #}

mercurial