tests/test-extension.t
changeset 38534 b86664c81833
parent 38162 bdf344aea0ee
child 38787 5199c5b6fd29
equal deleted inserted replaced
38532:9ee202679a76 38534:b86664c81833
     7   > command = registrar.command(cmdtable)
     7   > command = registrar.command(cmdtable)
     8   > configtable = {}
     8   > configtable = {}
     9   > configitem = registrar.configitem(configtable)
     9   > configitem = registrar.configitem(configtable)
    10   > configitem(b'tests', b'foo', default=b"Foo")
    10   > configitem(b'tests', b'foo', default=b"Foo")
    11   > def uisetup(ui):
    11   > def uisetup(ui):
       
    12   >     ui.debug(b"uisetup called [debug]\\n")
    12   >     ui.write(b"uisetup called\\n")
    13   >     ui.write(b"uisetup called\\n")
       
    14   >     ui.status(b"uisetup called [status]\\n")
    13   >     ui.flush()
    15   >     ui.flush()
    14   > def reposetup(ui, repo):
    16   > def reposetup(ui, repo):
    15   >     ui.write(b"reposetup called for %s\\n" % os.path.basename(repo.root))
    17   >     ui.write(b"reposetup called for %s\\n" % os.path.basename(repo.root))
    16   >     ui.write(b"ui %s= repo.ui\\n" % (ui == repo.ui and b"=" or b"!"))
    18   >     ui.write(b"ui %s= repo.ui\\n" % (ui == repo.ui and b"=" or b"!"))
    17   >     ui.flush()
    19   >     ui.flush()
    38 
    40 
    39   $ echo '[extensions]' >> $HGRCPATH
    41   $ echo '[extensions]' >> $HGRCPATH
    40   $ echo "foobar = $abspath" >> $HGRCPATH
    42   $ echo "foobar = $abspath" >> $HGRCPATH
    41   $ hg foo
    43   $ hg foo
    42   uisetup called
    44   uisetup called
       
    45   uisetup called [status]
    43   reposetup called for a
    46   reposetup called for a
    44   ui == repo.ui
    47   ui == repo.ui
    45   reposetup called for a (chg !)
    48   reposetup called for a (chg !)
    46   ui == repo.ui (chg !)
    49   ui == repo.ui (chg !)
    47   Foo
    50   Foo
       
    51   $ hg foo --quiet
       
    52   uisetup called (no-chg !)
       
    53   reposetup called for a (chg !)
       
    54   ui == repo.ui
       
    55   Foo
       
    56   $ hg foo --debug
       
    57   uisetup called [debug] (no-chg !)
       
    58   uisetup called (no-chg !)
       
    59   uisetup called [status] (no-chg !)
       
    60   reposetup called for a (chg !)
       
    61   ui == repo.ui
       
    62   Foo
    48 
    63 
    49   $ cd ..
    64   $ cd ..
    50   $ hg clone a b
    65   $ hg clone a b
    51   uisetup called (no-chg !)
    66   uisetup called (no-chg !)
       
    67   uisetup called [status] (no-chg !)
    52   reposetup called for a
    68   reposetup called for a
    53   ui == repo.ui
    69   ui == repo.ui
    54   reposetup called for b
    70   reposetup called for b
    55   ui == repo.ui
    71   ui == repo.ui
    56   updating to branch default
    72   updating to branch default
    57   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
    73   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
    58 
    74 
    59   $ hg bar
    75   $ hg bar
    60   uisetup called (no-chg !)
    76   uisetup called (no-chg !)
       
    77   uisetup called [status] (no-chg !)
    61   Bar
    78   Bar
    62   $ echo 'foobar = !' >> $HGRCPATH
    79   $ echo 'foobar = !' >> $HGRCPATH
    63 
    80 
    64 module/__init__.py-style
    81 module/__init__.py-style
    65 
    82 
    66   $ echo "barfoo = $barfoopath" >> $HGRCPATH
    83   $ echo "barfoo = $barfoopath" >> $HGRCPATH
    67   $ cd a
    84   $ cd a
    68   $ hg foo
    85   $ hg foo
    69   uisetup called
    86   uisetup called
       
    87   uisetup called [status]
    70   reposetup called for a
    88   reposetup called for a
    71   ui == repo.ui
    89   ui == repo.ui
    72   reposetup called for a (chg !)
    90   reposetup called for a (chg !)
    73   ui == repo.ui (chg !)
    91   ui == repo.ui (chg !)
    74   Foo
    92   Foo