tests/test-check-flake8.t
author Boris Feld <boris.feld@octobus.net>
Fri, 19 May 2017 18:43:21 +0200
changeset 2446 4b2f4da124a2
parent 2121 01ee3e155726
child 3390 b3dbba6e34c9
permissions -rw-r--r--
effectflag: allow to save effect of change in obsmarkers Obsmarkers lack a precious information, what are the changes between the source and the destination. This could be several thing: - The description has changed, with a amend -e for example - The parent has changed, with a rebase for example - The content has changed, with a amend for example - The meta, like the user, has change, with a amend -u for example Or any combination of them. We hijack the createobsmarkers in order to compute the modification and store the effect flag which is basically a bitfield of the changes list above and we store it in the metadata for the moment. The advantage of computing the flag just before creating the obs marker is that all commands will immediately be compatible and we can start working on the UI display of the flag. As a future optimization, the commands will be able to pass the flag directly or data to help computing them, for example amend knows if the description has changed or rebase now if the parent has changed, virtually removing the overhead. To start simple, this patch add the detection and storage of the effect flag when the description has changed. And hide it behind an experimental flag disabled by default 'experimental.evolution.effect-flags'. More flag will follow.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2038
a4b09789117a tests: split pyflake and flake8 tests
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2037
diff changeset
     1
#require test-repo
a4b09789117a tests: split pyflake and flake8 tests
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2037
diff changeset
     2
a4b09789117a tests: split pyflake and flake8 tests
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2037
diff changeset
     3
  $ checkflake8() {
a4b09789117a tests: split pyflake and flake8 tests
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2037
diff changeset
     4
  >   if ! (which flake8 > /dev/null); then
a4b09789117a tests: split pyflake and flake8 tests
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2037
diff changeset
     5
  >     echo skipped: missing tool: flake8;
a4b09789117a tests: split pyflake and flake8 tests
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2037
diff changeset
     6
  >     exit 80;
a4b09789117a tests: split pyflake and flake8 tests
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2037
diff changeset
     7
  >   fi;
a4b09789117a tests: split pyflake and flake8 tests
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2037
diff changeset
     8
  > };
a4b09789117a tests: split pyflake and flake8 tests
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2037
diff changeset
     9
  $ checkflake8
1930
b82769fd703b tests: add pyflakes test
Sean Farley <sean@farley.io>
parents:
diff changeset
    10
b82769fd703b tests: add pyflakes test
Sean Farley <sean@farley.io>
parents:
diff changeset
    11
Copied from Mercurial core (60ee2593a270)
b82769fd703b tests: add pyflakes test
Sean Farley <sean@farley.io>
parents:
diff changeset
    12
b82769fd703b tests: add pyflakes test
Sean Farley <sean@farley.io>
parents:
diff changeset
    13
  $ cd "`dirname "$TESTDIR"`"
b82769fd703b tests: add pyflakes test
Sean Farley <sean@farley.io>
parents:
diff changeset
    14
2002
053190199959 tests: add flake8 check
Sean Farley <sean@farley.io>
parents: 1930
diff changeset
    15
run flake8 if it exists; if it doesn't, then just skip
053190199959 tests: add flake8 check
Sean Farley <sean@farley.io>
parents: 1930
diff changeset
    16
2121
01ee3e155726 checks: correct the shebang line filtering for python files
Matt Harbison <matt_harbison@yahoo.com>
parents: 2108
diff changeset
    17
  $ hg files -0 'set:(**.py or grep("^#!.*python")) - removed()' 2>/dev/null \
2108
206066375dcb checks: update pyflakes matching too
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2038
diff changeset
    18
  > | xargs -0 flake8