changectx: increase perf of walk function
When running 'hg cat -r . <file>' it was doing an expensive ctx.walk(m) which
applied the regex to every file in the manifest.
This changes changectx.walk to iterate over just the files in the regex, if no
other patterns are specified. This cuts hg cat time by 50% in our repo and
probably benefits a few other commands as well.
hg debuginstall
$ hg debuginstall
checking encoding (ascii)...
checking Python lib (*lib*)... (glob)
checking installed modules (*mercurial)... (glob)
checking templates (*mercurial?templates)... (glob)
checking commit editor...
checking username...
no problems detected
hg debuginstall with no username
$ HGUSER= hg debuginstall
checking encoding (ascii)...
checking Python lib (*lib*)... (glob)
checking installed modules (*mercurial)... (glob)
checking templates (*mercurial?templates)... (glob)
checking commit editor...
checking username...
no username supplied (see "hg help config")
(specify a username in your configuration file)
1 problems detected, please check your install!
[1]