tests/test-config.t
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Tue, 01 Oct 2013 00:35:07 +0900
branchstable
changeset 19849 e7fa36d2ad3a
parent 19087 7d82ad4b3727
child 22275 d9a8017dce10
child 22316 816be4ca4ae2
permissions -rw-r--r--
rebase: catch RepoLookupError at restoring rebase state for summary Before this patch, "hg summary" may fail, when there is inconsistent rebase state: for example, the root of rebase destination revisions recorded in rebase state file is already stripped manually. Mercurial earlier than 2.7 allows users to do anything other than starting new rebase, even though current rebase is not finished or aborted yet. So, such inconsistent rebase states may be left and forgotten in repositories. This patch catches RepoLookupError at restoring rebase state for summary hook, and treat such state as "broken".

hide outer repo
  $ hg init

Test case sensitive configuration

  $ echo '[Section]' >> $HGRCPATH
  $ echo 'KeY = Case Sensitive' >> $HGRCPATH
  $ echo 'key = lower case' >> $HGRCPATH

  $ hg showconfig Section
  Section.KeY=Case Sensitive
  Section.key=lower case

Test "%unset"

  $ cat >> $HGRCPATH <<EOF
  > [unsettest]
  > local-hgrcpath = should be unset (HGRCPATH)
  > %unset local-hgrcpath
  > 
  > global = should be unset (HGRCPATH)
  > 
  > both = should be unset (HGRCPATH)
  > 
  > set-after-unset = should be unset (HGRCPATH)
  > EOF

  $ cat >> .hg/hgrc <<EOF
  > [unsettest]
  > local-hgrc = should be unset (.hg/hgrc)
  > %unset local-hgrc
  > 
  > %unset global
  > 
  > both = should be unset (.hg/hgrc)
  > %unset both
  > 
  > set-after-unset = should be unset (.hg/hgrc)
  > %unset set-after-unset
  > set-after-unset = should be set (.hg/hgrc)
  > EOF

  $ hg showconfig unsettest
  unsettest.set-after-unset=should be set (.hg/hgrc)