sapling/tests/test-debuginhibit.t
Arun Kulshreshtha d7c143274c debuginhibit: add debuginhibit extension
Summary: Add a new extension to assist with debugging issues with the inhibit extension. Adds the `hg debuginhibit` and `hg debugdeinhibit` commands to manually inhibit/deinhibit commits as well as config options to print out the nodes being inhibited and truncated stack traces of each call site. I mostly made this into an extension so that it would be easy to debug inhibit issues from any user by just asking them to run their command with the appropriate `--config` flag.

Test Plan: See test file. Enabling the `debuginhibit.printnodes` and `debuginhibit.printstack` functions should result in the relevant nodes and stack traces to be printed whenever nodes are inhibited and deinhibited.

Reviewers: durham, rmcelroy, #mercurial, mitrandir, simonfar

Reviewed By: simonfar

Subscribers: mitrandir, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D4485659

Signature: t1:4485659:1485985964:e6920b67450942c706c9523e9df48b4093b26d69
2017-02-01 15:17:04 -08:00

52 lines
1.3 KiB
Perl

Set up test environment.
$ . $TESTDIR/require-ext.sh directaccess evolve inhibit
$ extpath=`dirname $TESTDIR`
$ cp $extpath/hgext3rd/debuginhibit.py $TESTTMP
$ cat >> $HGRCPATH << EOF
> [extensions]
> debuginhibit=$TESTTMP/debuginhibit.py
> directaccess=
> evolve=
> inhibit=
> [debuginhibit]
> printnodes = true
> printstack = true
> stackdepth = 1
> [experimental]
> evolution = createmarkers
> EOF
$ showgraph() {
> hg log --graph -T "{rev}:{node|short} {desc|firstline}"
> }
Test manually inhibiting and deinhibiting nodes.
$ hg init allowunstable && cd allowunstable
$ hg debugbuilddag "+3 *3"
$ showgraph
o 3:6100d3090acf r3
|
| o 2:01241442b3c2 r2
| |
| o 1:66f7d451a68b r1
|/
o 0:1ea73414a91b r0
$ hg debugobsolete 66f7d451a68b85ed82ff5fcc254daf50c74144bd 6100d3090acf50ed11ec23196cec20f5bd7323aa --config "debuginhibit.printstack=false"
Inhibiting: ['66f7d451a68b']
$ hg log -r 'unstable()'
$ hg debuginhibit -d 1
Deinhibiting: ['66f7d451a68b']
Context:
[debuginhibit.py:*] debuginhibit() (glob)
$ hg log -r 'unstable()'
changeset: 2:01241442b3c2
user: debugbuilddag
date: Thu Jan 01 00:00:02 1970 +0000
trouble: unstable
summary: r2
$ hg debuginhibit 1
Inhibiting: ['66f7d451a68b']
Context:
[debuginhibit.py:*] debuginhibit() (glob)