tests/test-devel-warnings.t
changeset 25630 c88082baf693
parent 25300 678d0bfdd31a
child 27270 ba5f20450b10
equal deleted inserted replaced
25629:52e5f68d8363 25630:c88082baf693
     1 
     1 
     2   $ cat << EOF > buggylocking.py
     2   $ cat << EOF > buggylocking.py
     3   > """A small extension that acquire locks in the wrong order
     3   > """A small extension that acquire locks in the wrong order
     4   > """
     4   > """
     5   > 
     5   > 
     6   > from mercurial import cmdutil, repair
     6   > from mercurial import cmdutil, repair, revset
     7   > 
     7   > 
     8   > cmdtable = {}
     8   > cmdtable = {}
     9   > command = cmdutil.command(cmdtable)
     9   > command = cmdutil.command(cmdtable)
    10   > 
    10   > 
    11   > @command('buggylocking', [], '')
    11   > @command('buggylocking', [], '')
    45   >     tr = repo.transaction('foobar')
    45   >     tr = repo.transaction('foobar')
    46   >     try:
    46   >     try:
    47   >         repair.strip(repo.ui, repo, [repo['.'].node()])
    47   >         repair.strip(repo.ui, repo, [repo['.'].node()])
    48   >     finally:
    48   >     finally:
    49   >         lo.release()
    49   >         lo.release()
       
    50   > 
       
    51   > def oldstylerevset(repo, subset, x):
       
    52   >     return list(subset)
       
    53   > 
       
    54   > revset.symbols['oldstyle'] = oldstylerevset
    50   > EOF
    55   > EOF
    51 
    56 
    52   $ cat << EOF >> $HGRCPATH
    57   $ cat << EOF >> $HGRCPATH
    53   > [extensions]
    58   > [extensions]
    54   > buggylocking=$TESTTMP/buggylocking.py
    59   > buggylocking=$TESTTMP/buggylocking.py
   104   saved backup bundle to $TESTTMP/lock-checker/.hg/strip-backup/cb9a9f314b8b-cc5ccb0b-backup.hg (glob)
   109   saved backup bundle to $TESTTMP/lock-checker/.hg/strip-backup/cb9a9f314b8b-cc5ccb0b-backup.hg (glob)
   105   abort: programming error: cannot strip from inside a transaction
   110   abort: programming error: cannot strip from inside a transaction
   106   (contact your extension maintainer)
   111   (contact your extension maintainer)
   107   [255]
   112   [255]
   108 
   113 
       
   114   $ hg log -r "oldstyle()" -T '{rev}\n'
       
   115   devel-warn: revset "oldstyle" use list instead of smartset, (upgrade your code) at: */mercurial/revset.py:* (mfunc) (glob)
       
   116   0
       
   117 
   109   $ cd ..
   118   $ cd ..