annotate tests/mockblackbox.py @ 26206:ab1c6e4efda4

add: pass full=False to dirstate walk Previously cmdutil.add would call wctx.walk(), which under the hood calls dirstate.walk with full=True. This means it returns all of the clean files (which we don't need when computing the add set), as well as the unclean files. This results in 1) a lot more work being done and 2) this code path circumventing the hgwatchman extension, resulting in worse performance in hgwatchman environments ('hg add .' went from 9s to 1.8s).
author Durham Goode <durham@fb.com>
date Wed, 09 Sep 2015 09:07:27 -0700
parents 0ead0a07ed9c
children ac49ecb2a897
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
24705
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
1 from mercurial import util
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
2
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
3 def makedate():
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
4 return 0, 0
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
5 def getuser():
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
6 return 'bob'
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
7
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
8 # mock the date and user apis so the output is always the same
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
9 def uisetup(ui):
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
10 util.makedate = makedate
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
11 util.getuser = getuser