tests/test-check-commit.t
author Adam Simpkins <simpkins@fb.com>
Tue, 27 Jun 2017 17:24:31 -0700
changeset 33116 6c113a7dec52
parent 32380 5db6d70fd30b
child 33204 ddd65b4f3ae6
permissions -rw-r--r--
tests: use the system hg for examining the local repository Most test scripts use "hg" to interact with a temporary test repository. However a few tests also want to run hg commands to interact with the local repository containing the mercurial source code. Notably, many of the test-check-* tests want to check local files and commit messages. These tests were previously using the version of hg being tested to query the source repository. However, this will fail if the source repository requires extensions or other settings not supported by the version of mercurial being tested. The source repository was typically initially cloned using the system hg installation, so we should use the system hg installation to query it. There was already a helpers-testrepo.sh script designed to help cope with different requirements for the source repository versus the test repositories. However, it only handled the evolve extension. This new behavior works with any extensions that are different between the system installation and the test installation.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22067
14306a686e71 test-check-commit-hg.t: automatically test all 'draft() and ::.' changesets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     1
#require test-repo
14306a686e71 test-check-commit-hg.t: automatically test all 'draft() and ::.' changesets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     2
14306a686e71 test-check-commit-hg.t: automatically test all 'draft() and ::.' changesets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     3
Enable obsolescence to avoid the warning issue when obsmarker are found
14306a686e71 test-check-commit-hg.t: automatically test all 'draft() and ::.' changesets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     4
29219
3c9066ed557c tests: silence test-repo obsolete warning
timeless <timeless@mozdev.org>
parents: 28293
diff changeset
     5
  $ . "$TESTDIR/helpers-testrepo.sh"
22067
14306a686e71 test-check-commit-hg.t: automatically test all 'draft() and ::.' changesets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     6
14306a686e71 test-check-commit-hg.t: automatically test all 'draft() and ::.' changesets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     7
Go back in the hg repo
14306a686e71 test-check-commit-hg.t: automatically test all 'draft() and ::.' changesets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     8
14306a686e71 test-check-commit-hg.t: automatically test all 'draft() and ::.' changesets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     9
  $ cd $TESTDIR/..
14306a686e71 test-check-commit-hg.t: automatically test all 'draft() and ::.' changesets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    10
33116
6c113a7dec52 tests: use the system hg for examining the local repository
Adam Simpkins <simpkins@fb.com>
parents: 32380
diff changeset
    11
  $ for node in `syshg log --rev 'not public() and ::. and not desc("# no-check-commit")' --template '{node|short}\n'`; do
6c113a7dec52 tests: use the system hg for examining the local repository
Adam Simpkins <simpkins@fb.com>
parents: 32380
diff changeset
    12
  >    syshg export --git $node | contrib/check-commit > ${TESTTMP}/check-commit.out
22067
14306a686e71 test-check-commit-hg.t: automatically test all 'draft() and ::.' changesets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    13
  >    if [ $? -ne 0 ]; then
28293
a22b6fa5a844 tests: minor grammar change for check-commit
timeless <timeless@mozdev.org>
parents: 27756
diff changeset
    14
  >        echo "Revision $node does not comply with rules"
22067
14306a686e71 test-check-commit-hg.t: automatically test all 'draft() and ::.' changesets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    15
  >        echo '------------------------------------------------------'
14306a686e71 test-check-commit-hg.t: automatically test all 'draft() and ::.' changesets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    16
  >        cat ${TESTTMP}/check-commit.out
14306a686e71 test-check-commit-hg.t: automatically test all 'draft() and ::.' changesets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    17
  >        echo
14306a686e71 test-check-commit-hg.t: automatically test all 'draft() and ::.' changesets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    18
  >   fi
14306a686e71 test-check-commit-hg.t: automatically test all 'draft() and ::.' changesets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    19
  > done
14306a686e71 test-check-commit-hg.t: automatically test all 'draft() and ::.' changesets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    20
14306a686e71 test-check-commit-hg.t: automatically test all 'draft() and ::.' changesets
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    21