tests/test-contrib-check-commit.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Wed, 02 Oct 2019 17:53:47 -0400
changeset 43257 675c776fbcd1
parent 43112 24a07347aa60
permissions -rw-r--r--
sidedatacopies: directly fetch copies information from sidedata When using the sidedata mode, we don't need a complicated and expensive `context` object. Instead we directly fetch copies information from the sidedata (through a changelogrevision object). More optimisations coming. revision: large amount; added files: large amount; rename small amount; c3b14617fbd7 9ba6ab77fd29 filelog: ! wall 3.679613 comb 3.680000 user 3.580000 sys 0.100000 (median of 3) base: ! wall 8.884369 comb 8.880000 user 8.850000 sys 0.030000 (median of 3) before: ! wall 4.681985 comb 4.680000 user 4.640000 sys 0.040000 (median of 3) after: ! wall 3.955894 comb 3.950000 user 3.940000 sys 0.010000 (median of 3) revision: large amount; added files: small amount; rename small amount; c3b14617fbd7 f650a9b140d2 filelog: ! wall 0.003357 comb 0.010000 user 0.010000 sys 0.000000 (median of 781) base: ! wall 12.398524 comb 12.400000 user 12.330000 sys 0.070000 (median of 3) before: ! wall 6.459592 comb 6.470000 user 6.390000 sys 0.080000 (median of 3) after: ! wall 5.505774 comb 5.500000 user 5.410000 sys 0.090000 (median of 3) revision: large amount; added files: large amount; rename large amount; 08ea3258278e d9fa043f30c0 filelog: ! wall 2.754687 comb 2.760000 user 2.650000 sys 0.110000 (median of 4) base: ! wall 1.423166 comb 1.420000 user 1.400000 sys 0.020000 (median of 8) before: ! wall 0.961048 comb 0.960000 user 0.940000 sys 0.020000 (median of 11) after: ! wall 0.882950 comb 0.880000 user 0.880000 sys 0.000000 (median of 11) revision: small amount; added files: large amount; rename large amount; df6f7a526b60 a83dc6a2d56f filelog: ! wall 1.552293 comb 1.550000 user 1.510000 sys 0.040000 (median of 6 base: ! wall 0.022662 comb 0.020000 user 0.020000 sys 0.000000 (median of 128) before: ! wall 0.021649 comb 0.020000 user 0.020000 sys 0.000000 (median of 135) after: ! wall 0.020951 comb 0.020000 user 0.020000 sys 0.000000 (median of 141) revision: small amount; added files: large amount; rename small amount; 4aa4e1f8e19a 169138063d63 filelog: ! wall 1.500983 comb 1.500000 user 1.420000 sys 0.080000 (median of 7) base: ! wall 0.006956 comb 0.010000 user 0.010000 sys 0.000000 (median of 392) before: ! wall 0.004022 comb 0.000000 user 0.000000 sys 0.000000 (median of 735) after: ! wall 0.003988 comb 0.000000 user 0.000000 sys 0.000000 (median of 736) revision: small amount; added files: small amount; rename small amount; 4bc173b045a6 964879152e2e filelog: ! wall 0.011745 comb 0.020000 user 0.020000 sys 0.000000 (median of 250) base: ! wall 0.000156 comb 0.000000 user 0.000000 sys 0.000000 (median of 17180) before: ! wall 0.000118 comb 0.000000 user 0.000000 sys 0.000000 (median of 19170) after: ! wall 0.000097 comb 0.000000 user 0.000000 sys 0.000000 (median of 27276) revision: medium amount; added files: large amount; rename medium amount; c95f1ced15f2 2c68e87c3efe filelog: ! wall 3.228230 comb 3.230000 user 3.110000 sys 0.120000 (median of 4) base: ! wall 0.997640 comb 1.000000 user 0.980000 sys 0.020000 (median of 10) before: ! wall 0.679500 comb 0.680000 user 0.680000 sys 0.000000 (median of 15) after: ! wall 0.596779 comb 0.600000 user 0.600000 sys 0.000000 (median of 17) revision: medium amount; added files: medium amount; rename small amount; d343da0c55a8 d7746d32bf9d filelog: ! wall 1.052501 comb 1.060000 user 1.040000 sys 0.020000 (median of 10 base: ! wall 0.214519 comb 0.220000 user 0.220000 sys 0.000000 (median of 45) before: ! wall 0.149675 comb 0.150000 user 0.150000 sys 0.000000 (median of 66) after: ! wall 0.130786 comb 0.130000 user 0.130000 sys 0.000000 (median of 75) Differential Revision: https://phab.mercurial-scm.org/D7072
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
27700
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
     4
A fine patch:
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
     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
27700
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    14
  > bundle2: use Oxford comma (issue123) (BC)
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    15
  > 
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    16
  > diff --git a/hgext/transplant.py b/hgext/transplant.py
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    17
  > --- a/hgext/transplant.py
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    18
  > +++ b/hgext/transplant.py
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    19
  > @@ -599,7 +599,7 @@
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    20
  >              return
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    21
  >          if not (opts.get('source') or revs or
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    22
  >                  opts.get('merge') or opts.get('branch')):
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    23
  > -            raise error.Abort(_('no source URL, branch revision or revision '
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    24
  > +            raise error.Abort(_('no source URL, branch revision, or revision '
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    25
  >                                 'list provided'))
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    26
  >          if opts.get('all'):
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    27
  > 
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    28
  > + def blahblah(x):
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    29
  > +     pass
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    30
  > EOF
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    31
  $ cat patch-with-long-header.diff | $TESTDIR/../contrib/check-commit
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    32
30843
2fb3ae89e4e1 contrib: fix check-commit to not reject commits from `hg sign` and `hg tag`
Augie Fackler <augie@google.com>
parents: 28013
diff changeset
    33
This would normally be against the rules, but it's okay because that's
2fb3ae89e4e1 contrib: fix check-commit to not reject commits from `hg sign` and `hg tag`
Augie Fackler <augie@google.com>
parents: 28013
diff changeset
    34
what tagging and signing looks like:
2fb3ae89e4e1 contrib: fix check-commit to not reject commits from `hg sign` and `hg tag`
Augie Fackler <augie@google.com>
parents: 28013
diff changeset
    35
2fb3ae89e4e1 contrib: fix check-commit to not reject commits from `hg sign` and `hg tag`
Augie Fackler <augie@google.com>
parents: 28013
diff changeset
    36
  $ cat > creates-a-tag.diff << EOF
2fb3ae89e4e1 contrib: fix check-commit to not reject commits from `hg sign` and `hg tag`
Augie Fackler <augie@google.com>
parents: 28013
diff changeset
    37
  > # HG changeset patch
2fb3ae89e4e1 contrib: fix check-commit to not reject commits from `hg sign` and `hg tag`
Augie Fackler <augie@google.com>
parents: 28013
diff changeset
    38
  > # User Augie Fackler <raf@durin42.com>
2fb3ae89e4e1 contrib: fix check-commit to not reject commits from `hg sign` and `hg tag`
Augie Fackler <augie@google.com>
parents: 28013
diff changeset
    39
  > # Date 1484787778 18000
2fb3ae89e4e1 contrib: fix check-commit to not reject commits from `hg sign` and `hg tag`
Augie Fackler <augie@google.com>
parents: 28013
diff changeset
    40
  > #      Wed Jan 18 20:02:58 2017 -0500
2fb3ae89e4e1 contrib: fix check-commit to not reject commits from `hg sign` and `hg tag`
Augie Fackler <augie@google.com>
parents: 28013
diff changeset
    41
  > # Branch stable
2fb3ae89e4e1 contrib: fix check-commit to not reject commits from `hg sign` and `hg tag`
Augie Fackler <augie@google.com>
parents: 28013
diff changeset
    42
  > # Node ID c177635e4acf52923bc3aa9f72a5b1ad1197b173
2fb3ae89e4e1 contrib: fix check-commit to not reject commits from `hg sign` and `hg tag`
Augie Fackler <augie@google.com>
parents: 28013
diff changeset
    43
  > # Parent  a1dd2c0c479e0550040542e392e87bc91262517e
2fb3ae89e4e1 contrib: fix check-commit to not reject commits from `hg sign` and `hg tag`
Augie Fackler <augie@google.com>
parents: 28013
diff changeset
    44
  > Added tag 4.1-rc for changeset a1dd2c0c479e
2fb3ae89e4e1 contrib: fix check-commit to not reject commits from `hg sign` and `hg tag`
Augie Fackler <augie@google.com>
parents: 28013
diff changeset
    45
  > 
2fb3ae89e4e1 contrib: fix check-commit to not reject commits from `hg sign` and `hg tag`
Augie Fackler <augie@google.com>
parents: 28013
diff changeset
    46
  > diff --git a/.hgtags b/.hgtags
2fb3ae89e4e1 contrib: fix check-commit to not reject commits from `hg sign` and `hg tag`
Augie Fackler <augie@google.com>
parents: 28013
diff changeset
    47
  > --- a/.hgtags
2fb3ae89e4e1 contrib: fix check-commit to not reject commits from `hg sign` and `hg tag`
Augie Fackler <augie@google.com>
parents: 28013
diff changeset
    48
  > +++ b/.hgtags
2fb3ae89e4e1 contrib: fix check-commit to not reject commits from `hg sign` and `hg tag`
Augie Fackler <augie@google.com>
parents: 28013
diff changeset
    49
  > @@ -150,3 +150,4 @@ 438173c415874f6ac653efc1099dec9c9150e90f
2fb3ae89e4e1 contrib: fix check-commit to not reject commits from `hg sign` and `hg tag`
Augie Fackler <augie@google.com>
parents: 28013
diff changeset
    50
  >  eab27446995210c334c3d06f1a659e3b9b5da769 4.0
2fb3ae89e4e1 contrib: fix check-commit to not reject commits from `hg sign` and `hg tag`
Augie Fackler <augie@google.com>
parents: 28013
diff changeset
    51
  >  b3b1ae98f6a0e14c1e1ba806a6c18e193b6dae5c 4.0.1
2fb3ae89e4e1 contrib: fix check-commit to not reject commits from `hg sign` and `hg tag`
Augie Fackler <augie@google.com>
parents: 28013
diff changeset
    52
  >  e69874dc1f4e142746ff3df91e678a09c6fc208c 4.0.2
2fb3ae89e4e1 contrib: fix check-commit to not reject commits from `hg sign` and `hg tag`
Augie Fackler <augie@google.com>
parents: 28013
diff changeset
    53
  > +a1dd2c0c479e0550040542e392e87bc91262517e 4.1-rc
2fb3ae89e4e1 contrib: fix check-commit to not reject commits from `hg sign` and `hg tag`
Augie Fackler <augie@google.com>
parents: 28013
diff changeset
    54
  > EOF
2fb3ae89e4e1 contrib: fix check-commit to not reject commits from `hg sign` and `hg tag`
Augie Fackler <augie@google.com>
parents: 28013
diff changeset
    55
  $ $TESTDIR/../contrib/check-commit < creates-a-tag.diff
2fb3ae89e4e1 contrib: fix check-commit to not reject commits from `hg sign` and `hg tag`
Augie Fackler <augie@google.com>
parents: 28013
diff changeset
    56
27700
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    57
A patch with lots of errors:
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    58
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    59
  $ cat > patch-with-long-header.diff << EOF
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    60
  > # HG changeset patch
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    61
  > # User timeless
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    62
  > # Date 1448911706 0
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    63
  > #      Mon Nov 30 19:28:26 2015 +0000
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    64
  > # Node ID c41cb6d2b7dbd62b1033727f8606b8c09fc4aa88
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    65
  > # Parent  42aa0e570eaa364a622bc4443b0bcb79b1100a58
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    66
  > # ClownJoke This is a veryly long header that should not be warned about because its not the description
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    67
  > transplant/foo: this summary is way too long use Oxford comma (bc) (bug123) (issue 244)
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
    68
  > 
96dc6664fa9c check-commit: add a test for the patch checking script in contrib
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    69
  > 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
    70
  > --- 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
    71
  > +++ 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
    72
  > @@ -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
    73
  >              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
    74
  >          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
    75
  >                  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
    76
  > -            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
    77
  > +            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
    78
  >                                 '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
    79
  >          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
    80
  > 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
    81
  $ cat patch-with-long-header.diff | $TESTDIR/../contrib/check-commit
27783
1d095371de47 check-commit: sort errors by line number
timeless <timeless@mozdev.org>
parents: 27782
diff changeset
    82
  1: username is not an email address
1d095371de47 check-commit: sort errors by line number
timeless <timeless@mozdev.org>
parents: 27782
diff changeset
    83
   # User timeless
1d095371de47 check-commit: sort errors by line number
timeless <timeless@mozdev.org>
parents: 27782
diff changeset
    84
  7: summary keyword should be most user-relevant one-word command or topic
27700
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    85
   transplant/foo: this summary is way too long use Oxford comma (bc) (bug123) (issue 244)
27783
1d095371de47 check-commit: sort errors by line number
timeless <timeless@mozdev.org>
parents: 27782
diff changeset
    86
  7: (BC) needs to be uppercase
27700
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    87
   transplant/foo: this summary is way too long use Oxford comma (bc) (bug123) (issue 244)
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    88
  7: use (issueDDDD) instead of bug
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    89
   transplant/foo: this summary is way too long use Oxford comma (bc) (bug123) (issue 244)
27783
1d095371de47 check-commit: sort errors by line number
timeless <timeless@mozdev.org>
parents: 27782
diff changeset
    90
  7: no space allowed between issue and number
27700
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    91
   transplant/foo: this summary is way too long use Oxford comma (bc) (bug123) (issue 244)
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    92
  7: summary line too long (limit is 78)
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    93
   transplant/foo: this summary is way too long use Oxford comma (bc) (bug123) (issue 244)
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    94
  [1]
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    95
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    96
A patch with other errors:
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    97
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    98
  $ cat > patch-with-long-header.diff << EOF
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
    99
  > # HG changeset patch
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
   100
  > # User timeless
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
   101
  > # Date 1448911706 0
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
   102
  > #      Mon Nov 30 19:28:26 2015 +0000
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
   103
  > # Node ID c41cb6d2b7dbd62b1033727f8606b8c09fc4aa88
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
   104
  > # Parent  42aa0e570eaa364a622bc4443b0bcb79b1100a58
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
   105
  > # ClownJoke This is a veryly long header that should not be warned about because its not the description
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
   106
  > This has no topic and ends with a period.
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
   107
  > 
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
   108
  > diff --git a/hgext/transplant.py b/hgext/transplant.py
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
   109
  > --- a/hgext/transplant.py
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
   110
  > +++ b/hgext/transplant.py
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
   111
  > @@ -599,7 +599,7 @@
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
   112
  >          if opts.get('all'):
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
   113
  >  
28013
e529b5f1b9e3 check-commit: check for double-addition of blank lines
Matt Mackall <mpm@selenic.com>
parents: 27783
diff changeset
   114
  > 
e529b5f1b9e3 check-commit: check for double-addition of blank lines
Matt Mackall <mpm@selenic.com>
parents: 27783
diff changeset
   115
  > +
e529b5f1b9e3 check-commit: check for double-addition of blank lines
Matt Mackall <mpm@selenic.com>
parents: 27783
diff changeset
   116
  > + some = otherjunk
e529b5f1b9e3 check-commit: check for double-addition of blank lines
Matt Mackall <mpm@selenic.com>
parents: 27783
diff changeset
   117
  > +
27700
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
   118
  > +
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
   119
  > + def blah_blah(x):
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
   120
  > +     pass
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
   121
  > +
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
   122
  >  
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
   123
  > EOF
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
   124
  $ cat patch-with-long-header.diff | $TESTDIR/../contrib/check-commit
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
   125
  1: username is not an email address
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
   126
   # User timeless
27783
1d095371de47 check-commit: sort errors by line number
timeless <timeless@mozdev.org>
parents: 27782
diff changeset
   127
  7: don't capitalize summary lines
27700
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
   128
   This has no topic and ends with a period.
27783
1d095371de47 check-commit: sort errors by line number
timeless <timeless@mozdev.org>
parents: 27782
diff changeset
   129
  7: summary line doesn't start with 'topic: '
27700
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
   130
   This has no topic and ends with a period.
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
   131
  7: don't add trailing period on summary line
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
   132
   This has no topic and ends with a period.
374fad80ce69 tests: extend check-commit self-tests
Matt Mackall <mpm@selenic.com>
parents: 27328
diff changeset
   133
  [1]