tests/test-remotefilelog-bad-configs.t
author Anton Shestakov <av6@dwimlabs.net>
Sat, 06 Jun 2020 19:19:27 +0800
changeset 44952 a4438263b228
parent 40722 0800d9e6e216
permissions -rw-r--r--
tests: skip pyflakes for mercurial/thirdparty/ The current version of pyflakes (2.2.0) correctly detects one issue: mercurial/thirdparty/selectors2.py:335:40 '...'.format(...) has unused arguments at position(s): 1 But we're not interested in fixing lint errors in third-party code, so we need to exclude at least selectors2.py. And in the discussion for this patch it was decided to just skip the entire thirdparty directory. Differential Revision: https://phab.mercurial-scm.org/D8619

#require no-windows

  $ . "$TESTDIR/remotefilelog-library.sh"

  $ hg init master
  $ cd master
  $ cat >> .hg/hgrc <<EOF
  > [remotefilelog]
  > server=True
  > EOF
  $ echo x > x
  $ echo y > y
  $ echo z > z
  $ hg commit -qAm xy

  $ cd ..

  $ hgcloneshallow ssh://user@dummy/master shallow -q
  3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over *s (glob)
  $ cd shallow

Verify error message when noc achepath specified
  $ hg up -q null
  $ cp $HGRCPATH $HGRCPATH.bak
  $ grep -v cachepath < $HGRCPATH.bak > tmp
  $ mv tmp $HGRCPATH
  $ hg up tip
  abort: could not find config option remotefilelog.cachepath
  [255]
  $ mv $HGRCPATH.bak $HGRCPATH

Verify error message when no fallback specified

  $ hg up -q null
  $ rm .hg/hgrc
  $ clearcache
  $ hg up tip
  3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over *s (glob)
  abort: no remotefilelog server configured - is your .hg/hgrc trusted?
  [255]