##// END OF EJS Templates
largefiles: check file in the repo store before checking remotely (issue5257)...
largefiles: check file in the repo store before checking remotely (issue5257) Problem was files to check were gathered in the repository where the verify was launched but verification was done on the remote store. It was observed when user committed in cloned repository and ran verify before pushing - committed files were marked as non existing. This commit fixes this by checking in the remote store only files that are not existing in the repository store where verify was launched. Solution is similiar to fd288d118074

File last commit:

r28013:e529b5f1 default
r29421:ecbbf4d5 default
Show More
test-contrib-check-commit.t
115 lines | 4.2 KiB | text/troff | Tads3Lexer
/ tests / test-contrib-check-commit.t
Pierre-Yves David
check-commit: add a test for the patch checking script in contrib...
r27328 Test the 'check-commit' script
==============================
Matt Mackall
tests: extend check-commit self-tests...
r27700 A fine patch:
Pierre-Yves David
check-commit: add a test for the patch checking script in contrib...
r27328
$ cat > patch-with-long-header.diff << EOF
> # HG changeset patch
> # User timeless <timeless@mozdev.org>
> # Date 1448911706 0
> # Mon Nov 30 19:28:26 2015 +0000
> # Node ID c41cb6d2b7dbd62b1033727f8606b8c09fc4aa88
> # Parent 42aa0e570eaa364a622bc4443b0bcb79b1100a58
> # ClownJoke This is a veryly long header that should not be warned about because its not the description
Matt Mackall
tests: extend check-commit self-tests...
r27700 > bundle2: use Oxford comma (issue123) (BC)
>
> diff --git a/hgext/transplant.py b/hgext/transplant.py
> --- a/hgext/transplant.py
> +++ b/hgext/transplant.py
> @@ -599,7 +599,7 @@
> return
> if not (opts.get('source') or revs or
> opts.get('merge') or opts.get('branch')):
> - raise error.Abort(_('no source URL, branch revision or revision '
> + raise error.Abort(_('no source URL, branch revision, or revision '
> 'list provided'))
> if opts.get('all'):
>
> + def blahblah(x):
> + pass
> EOF
$ cat patch-with-long-header.diff | $TESTDIR/../contrib/check-commit
A patch with lots of errors:
$ cat > patch-with-long-header.diff << EOF
> # HG changeset patch
> # User timeless
> # Date 1448911706 0
> # Mon Nov 30 19:28:26 2015 +0000
> # Node ID c41cb6d2b7dbd62b1033727f8606b8c09fc4aa88
> # Parent 42aa0e570eaa364a622bc4443b0bcb79b1100a58
> # ClownJoke This is a veryly long header that should not be warned about because its not the description
> transplant/foo: this summary is way too long use Oxford comma (bc) (bug123) (issue 244)
Pierre-Yves David
check-commit: add a test for the patch checking script in contrib...
r27328 >
> diff --git a/hgext/transplant.py b/hgext/transplant.py
> --- a/hgext/transplant.py
> +++ b/hgext/transplant.py
> @@ -599,7 +599,7 @@
> return
> if not (opts.get('source') or revs or
> opts.get('merge') or opts.get('branch')):
> - raise error.Abort(_('no source URL, branch revision or revision '
> + raise error.Abort(_('no source URL, branch revision, or revision '
> 'list provided'))
> if opts.get('all'):
> EOF
$ cat patch-with-long-header.diff | $TESTDIR/../contrib/check-commit
timeless
check-commit: sort errors by line number
r27783 1: username is not an email address
# User timeless
7: summary keyword should be most user-relevant one-word command or topic
Matt Mackall
tests: extend check-commit self-tests...
r27700 transplant/foo: this summary is way too long use Oxford comma (bc) (bug123) (issue 244)
timeless
check-commit: sort errors by line number
r27783 7: (BC) needs to be uppercase
Matt Mackall
tests: extend check-commit self-tests...
r27700 transplant/foo: this summary is way too long use Oxford comma (bc) (bug123) (issue 244)
7: use (issueDDDD) instead of bug
transplant/foo: this summary is way too long use Oxford comma (bc) (bug123) (issue 244)
timeless
check-commit: sort errors by line number
r27783 7: no space allowed between issue and number
Matt Mackall
tests: extend check-commit self-tests...
r27700 transplant/foo: this summary is way too long use Oxford comma (bc) (bug123) (issue 244)
7: summary line too long (limit is 78)
transplant/foo: this summary is way too long use Oxford comma (bc) (bug123) (issue 244)
[1]
A patch with other errors:
$ cat > patch-with-long-header.diff << EOF
> # HG changeset patch
> # User timeless
> # Date 1448911706 0
> # Mon Nov 30 19:28:26 2015 +0000
> # Node ID c41cb6d2b7dbd62b1033727f8606b8c09fc4aa88
> # Parent 42aa0e570eaa364a622bc4443b0bcb79b1100a58
> # ClownJoke This is a veryly long header that should not be warned about because its not the description
> This has no topic and ends with a period.
>
> diff --git a/hgext/transplant.py b/hgext/transplant.py
> --- a/hgext/transplant.py
> +++ b/hgext/transplant.py
> @@ -599,7 +599,7 @@
> if opts.get('all'):
>
Matt Mackall
check-commit: check for double-addition of blank lines...
r28013 >
> +
> + some = otherjunk
> +
Matt Mackall
tests: extend check-commit self-tests...
r27700 > +
> + def blah_blah(x):
> + pass
> +
>
> EOF
$ cat patch-with-long-header.diff | $TESTDIR/../contrib/check-commit
1: username is not an email address
# User timeless
timeless
check-commit: sort errors by line number
r27783 7: don't capitalize summary lines
Matt Mackall
tests: extend check-commit self-tests...
r27700 This has no topic and ends with a period.
timeless
check-commit: sort errors by line number
r27783 7: summary line doesn't start with 'topic: '
Matt Mackall
tests: extend check-commit self-tests...
r27700 This has no topic and ends with a period.
7: don't add trailing period on summary line
This has no topic and ends with a period.
timeless
check-commit: sort errors by line number
r27783 19: adds double empty line
+
Matt Mackall
check-commit: check for double-addition of blank lines...
r28013 20: adds a function with foo_bar naming
+ def blah_blah(x):
23: adds double empty line
+
Matt Mackall
tests: extend check-commit self-tests...
r27700 [1]