sapling/tests
FUJIWARA Katsunori 1af26da10d gitdirstate: show pattern error in hgignore file as expected
Before this revision, invalid pattern in hgignore file causes
unintentional failure for UnboundLocalError of ignorefunc, if hggit is
used with Mercurial 3.5 or later.

In such case:

  - checking source of invalid pattern at failure uses "pats" list for
    hgignore files, but

  - "pats" list is empty, if ignoremod is None (= Mercurial 3.5 or later)

  - therefore, checking with matchmod.match() overlooks invalid pattern

Then, "return ignorefunc" is executed without assignment to
ignorefunc, and causes UnboundLocalError.

To show pattern error in hgignore file as expected even with Mercurial
3.5 or later, this revision puts '(FILE, ["include: FILE"])' tuples
into "pats" (to avoid code duplication, putting into allpats is
shared, too).

This makes checking source of invalid pattern at failure work as
expected for hgignore files.

Fixes #197
2017-08-05 02:13:11 +09:00
..
commitextra.py commands: update to use registrar 2017-05-22 15:45:54 -07:00
heredoctest.py tests: add support for inline python 2014-08-31 06:27:46 -07:00
hghave tests: pull in hghave 2012-10-28 21:05:51 -04:00
hghave.py tests: pull in hghave 2012-10-28 21:05:51 -04:00
killdaemons.py tests: upgrade run-tests.py 2014-02-19 21:49:06 -08:00
latin-1-encoding tests: use fn_git_commit in test-encoding.t 2012-11-03 22:36:13 -04:00
run-tests.py tests: upgrade run-tests.py 2014-02-19 21:49:06 -08:00
test-bookmark-workflow.t tests: update tests for new git output, sigh 2015-05-12 16:43:33 -07:00
test-branch-bookmark-suffix.t git_handler: don't store rename source if branch info is stored 2015-02-26 22:14:44 -08:00
test-clone.t import_git_commit: skip hgsubstate logic if file was deleted 2015-06-13 18:03:34 -07:00
test-conflict-1.t tests: update for new merge output 2015-10-16 16:14:51 -07:00
test-conflict-2.t tests: update for new merge output 2015-10-16 16:14:51 -07:00
test-convergedmerge.t git_handler: mark source for rename info as Git or Mercurial 2014-12-02 14:17:09 -08:00
test-empty-working-tree.t git_handler: mark source for rename info as Git or Mercurial 2014-12-02 14:17:09 -08:00
test-encoding.t tests: stop filtering out bookmark output 2015-03-12 10:29:58 -07:00
test-extra.t git_handler: use remote HEAD for cloned bookmark (BC) 2016-01-08 14:02:20 -08:00
test-file-removal.t tests: stop filtering out bookmark output 2015-03-12 10:29:58 -07:00
test-git-clone.t ssh: unban the use of pipe character in hostname 2017-08-10 14:19:04 -04:00
test-git-submodules.t tests: stop filtering out bookmark output 2015-03-12 10:29:58 -07:00
test-git-tags.t tests: stop filtering out bookmark output 2015-03-12 10:29:58 -07:00
test-git-workflow.t tests: stop filtering out bookmark output 2015-03-12 10:29:58 -07:00
test-gitignore.t gitdirstate: show pattern error in hgignore file as expected 2017-08-05 02:13:11 +09:00
test-help.t test-help: fix for Mercurial 3.7 2016-02-01 16:56:54 -08:00
test-hg-author.t git_handler: use remote HEAD for cloned bookmark (BC) 2016-01-08 14:02:20 -08:00
test-hg-branch.t tests: stop filtering out bookmark output 2015-03-12 10:29:58 -07:00
test-hg-tags-invalid.t tests: stop filtering out bookmark output 2015-03-12 10:29:58 -07:00
test-hg-tags.t tests: stop filtering out bookmark output 2015-03-12 10:29:58 -07:00
test-http.t tests: glob out server address for hg 4.2+ 2017-07-24 16:03:22 -05:00
test-illegal-contents.t git_handler: detect and reject nested Mercurial repositories 2016-02-04 13:33:32 +01:00
test-incoming.t tests: stop filtering out bookmark output 2015-03-12 10:29:58 -07:00
test-keywords.t revset_gitnode: allow abbreviated hashes 2016-10-06 10:11:14 +02:00
test-merge.t push: add more output about what was added (issue #64) 2013-01-06 01:46:57 -05:00
test-octopus.t git_handler: mark source for rename info as Git or Mercurial 2014-12-02 14:17:09 -08:00
test-outgoing.t tests: stop filtering out bookmark output 2015-03-12 10:29:58 -07:00
test-pull-after-strip.t tests: stop filtering out bookmark output 2015-03-12 10:29:58 -07:00
test-pull.t ssh: unban the use of pipe character in hostname 2017-08-10 14:19:04 -04:00
test-push-r.t tests: fix file modes 2014-10-29 19:34:36 -07:00
test-push.t ssh: unban the use of pipe character in hostname 2017-08-10 14:19:04 -04:00
test-renames.t tests: add tests for git.findcopiesharder 2016-12-17 17:24:17 -08:00
test-subrepos.t test-subrepos: update to account for newer git output 2016-09-12 07:40:42 -07:00
test-timezone.t test-timezone.t: add missing (but needed) trailing whitespace 2013-12-13 12:42:55 -05:00
test-tree-decomposition.t test-tree-decomposition: work around git command format changes 2013-08-28 11:27:13 -04:00
test-url-parsing.py tests: add check for dulwich in test-url-parsing.py 2012-10-30 23:16:07 -04:00
test-url-parsing.py.out test-url-parsing.py: add a test for a username that starts with a number 2012-04-20 21:16:32 -05:00
test-verify-fail.t verify: add new command to verify the contents of a Mercurial rev 2014-02-26 14:19:24 -08:00
testutil testutil: clean up compat cruft 2015-12-31 13:02:34 -08:00