Makefile
author Pulkit Goyal <7895pulkit@gmail.com>
Thu, 29 Mar 2018 16:43:28 +0530
changeset 3642 319b1f0f4de2
parent 2270 b53343c8d692
permissions -rw-r--r--
evolve: add a `--abort` flag for `hg evolve` command This patch adds a new flag `--abort` to `hg evolve` command which will abort the interrupted evolve going on undoes the changes created by the evolve command till now. The changes are bookmark movements, creation of evolved commits, obsolete the old commits in favor of evolved commits. In case when user changed things while the interrupted evolve, like did some actions which created a new commit on top of evolved commits, or changed phase of evolved commits to public, the evolve fails to abort as we should not strip out the new commit formed by user neither we can strip the public changeset. The abort fails and tell user to use `hg evolve --stop` instead. Right now bookmark movement is broken, and will be fixed in upcoming patches. Tests are added for the new flag.

VERSION=$(shell python setup.py --version)

PYTHON=python

all: help

deb-prepare:
	python setup.py sdist --dist-dir ..
	mv -f ../hg-evolve-$(VERSION).tar.gz ../mercurial-evolve_$(VERSION).orig.tar.gz
	tar xf ../mercurial-evolve_$(VERSION).orig.tar.gz
	rm -rf ../mercurial-evolve_$(VERSION).orig
	mv hg-evolve-$(VERSION) ../mercurial-evolve_$(VERSION).orig
	cp -r debian/ ../mercurial-evolve_$(VERSION).orig/
	@cd ../mercurial-evolve_$(VERSION).orig && echo 'debian build directory ready at' `pwd`

install-home:
	$(PYTHON) setup.py install --home="$(HOME)" --prefix="" --force

# test targets
TESTFLAGS ?= $(shell echo $$HGTESTFLAGS)

HGTESTS=$(HGROOT)/tests

help:
	@echo 'Commonly used make targets:'
	@echo '  deb-prepare        - prepare the build of a debian package'
	@echo '  tests              - run all tests in the automatic test suite'
	@echo '  all-version-tests - run all tests against many hg versions'
	@echo '  tests-%s           - run all tests in the specified hg version'

all: help

_check_hgroot:
ifeq ($(HGROOT),)
	$(error HGROOT is not set to the root of the hg source tree)
endif

tests: _check_hgroot
	cd tests && $(PYTHON) $(HGTESTS)/run-tests.py $(TESTFLAGS)

# /!\ run outside of the compatibility branch output test will likely fails

test-%: _check_hgroot
	cd tests && $(PYTHON) $(HGTESTS)/run-tests.py $(TESTFLAGS) $@

tests-%: _check_hgroot
	hg -R $(HGROOT) checkout $$(echo $@ | sed s/tests-//) && \
	(cd $(HGROOT) ; $(MAKE) clean ) && \
	cd tests && $(PYTHON) $(HGTESTS)/run-tests.py $(TESTFLAGS)

# build a script to extract declared version
all-version-tests: tests-@

.PHONY: tests all-version-tests