tests/test-check-commit.t
author Pulkit Goyal <7895pulkit@gmail.com>
Sun, 18 Jun 2017 03:23:46 +0530
changeset 2624 fd602980f7ee
parent 2335 f7ce3b9167d6
child 2672 a08bd434a19b
permissions -rw-r--r--
topics: make sure we commit on new parents while changing topics (issue5441) While changing topics of a set of linear commits, we used to commit our new changesets with new topic on parents of its predecessor i.e. changeset before the topic change. If the topic of parent was also changed, that parent will become obsolete and hence resulting the cnew commit in unstable state. For a set of linear commits this repeats and we end up in a tree state as mentioned in the bug. This patch fixes the bug by checking whether the parent was obsoleted and if yes, commit on the new parent.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2335
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     1
#require test-repo
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     2
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     3
Enable obsolescence to avoid the warning issue when obsmarker are found
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     4
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     5
  $ cat << EOF >> $HGRCPATH
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     6
  > [experimental]
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     7
  > evolution=all
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     8
  > EOF
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     9
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    10
Go back in the hg repo
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    11
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    12
  $ cd $TESTDIR/..
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    13
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    14
  $ for node in `hg log --rev 'not public() and ::. and not desc("# no-check-commit")' --template '{node|short}\n'`; do
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    15
  >    hg export $node | ${RUNTESTDIR}/../contrib/check-commit > ${TESTTMP}/check-commit.out
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    16
  >    if [ $? -ne 0 ]; then
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    17
  >        echo "Revision $node does not comply with rules"
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    18
  >        echo '------------------------------------------------------'
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    19
  >        cat ${TESTTMP}/check-commit.out
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    20
  >        echo
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    21
  >   fi
f7ce3b9167d6 tests: add the commit style checker from Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    22
  > done