tests/test-contrib-check-commit.t
author Pierre-Yves David <pierre-yves.david@fb.com>
Fri, 11 Dec 2015 12:21:26 +0000
changeset 27328 96dc6664fa9c
child 27700 374fad80ce69
permissions -rw-r--r--
check-commit: add a test for the patch checking script in contrib This introduces a test for the change introduced in 8f5735b4aca5.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
27328
96dc6664fa9c check-commit: add a test for the patch checking script in contrib
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     1
Test the 'check-commit' script
96dc6664fa9c check-commit: add a test for the patch checking script in contrib
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     2
==============================
96dc6664fa9c check-commit: add a test for the patch checking script in contrib
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     3
96dc6664fa9c check-commit: add a test for the patch checking script in contrib
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     4
Test long lines in header (should not be reported as too long description)
96dc6664fa9c check-commit: add a test for the patch checking script in contrib
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     5
96dc6664fa9c check-commit: add a test for the patch checking script in contrib
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     6
  $ cat > patch-with-long-header.diff << EOF
96dc6664fa9c check-commit: add a test for the patch checking script in contrib
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     7
  > # HG changeset patch
96dc6664fa9c check-commit: add a test for the patch checking script in contrib
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     8
  > # User timeless <timeless@mozdev.org>
96dc6664fa9c check-commit: add a test for the patch checking script in contrib
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     9
  > # Date 1448911706 0
96dc6664fa9c check-commit: add a test for the patch checking script in contrib
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    10
  > #      Mon Nov 30 19:28:26 2015 +0000
96dc6664fa9c check-commit: add a test for the patch checking script in contrib
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    11
  > # Node ID c41cb6d2b7dbd62b1033727f8606b8c09fc4aa88
96dc6664fa9c check-commit: add a test for the patch checking script in contrib
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    12
  > # Parent  42aa0e570eaa364a622bc4443b0bcb79b1100a58
96dc6664fa9c check-commit: add a test for the patch checking script in contrib
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    13
  > # ClownJoke This is a veryly long header that should not be warned about because its not the description
96dc6664fa9c check-commit: add a test for the patch checking script in contrib
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    14
  > transplant: use Oxford comma
96dc6664fa9c check-commit: add a test for the patch checking script in contrib
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    15
  > 
96dc6664fa9c check-commit: add a test for the patch checking script in contrib
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    16
  > diff --git a/hgext/transplant.py b/hgext/transplant.py
96dc6664fa9c check-commit: add a test for the patch checking script in contrib
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    17
  > --- a/hgext/transplant.py
96dc6664fa9c check-commit: add a test for the patch checking script in contrib
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    18
  > +++ b/hgext/transplant.py
96dc6664fa9c check-commit: add a test for the patch checking script in contrib
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    19
  > @@ -599,7 +599,7 @@
96dc6664fa9c check-commit: add a test for the patch checking script in contrib
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    20
  >              return
96dc6664fa9c check-commit: add a test for the patch checking script in contrib
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    21
  >          if not (opts.get('source') or revs or
96dc6664fa9c check-commit: add a test for the patch checking script in contrib
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    22
  >                  opts.get('merge') or opts.get('branch')):
96dc6664fa9c check-commit: add a test for the patch checking script in contrib
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    23
  > -            raise error.Abort(_('no source URL, branch revision or revision '
96dc6664fa9c check-commit: add a test for the patch checking script in contrib
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    24
  > +            raise error.Abort(_('no source URL, branch revision, or revision '
96dc6664fa9c check-commit: add a test for the patch checking script in contrib
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    25
  >                                 'list provided'))
96dc6664fa9c check-commit: add a test for the patch checking script in contrib
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    26
  >          if opts.get('all'):
96dc6664fa9c check-commit: add a test for the patch checking script in contrib
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    27
  > EOF
96dc6664fa9c check-commit: add a test for the patch checking script in contrib
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    28
  $ cat patch-with-long-header.diff | $TESTDIR/../contrib/check-commit