tests/test-merge-revert.out
author mason@suse.com
Fri, 12 Aug 2005 07:10:21 -0800
changeset 879 953ccddd57bd
parent 839 9c918287d10b
child 862 d70c1c31fd45
child 866 6d6095823b82
child 894 62ec665759f2
child 895 77b52b864249
permissions -rw-r--r--
dirstate walking optimizations The repo walking code introduces a number of calls to dirstate.map.copy(), significantly slowing down the walk on large trees. When a list of files is passed to the walking code, we should only look at map entries relevant to the file list passed in. dirstate.filterfiles() is added to return a subset of the dirstate map. The subset includes in files passed in, and if one of the files requested is actually a directory, it includes any files inside that directory tree. This brings the time for hg diff Makefile down from 1.7s to .3s on a linux kernel repo. Also, the diff command was unconditionally calling makewalk, leading to an extra pass through repo.changes. This patch avoids the call to makewalk when commands.diff isn't given a list of patterns, cutting the time for hg diff (with no args) in half. Index: mine/mercurial/hg.py ===================================================================

+ hg init
+ hg add file1 file2
+ hg commit -m added file1 and file2 -d 0 0 -u user
+ hg commit -m changed file1 -d 0 0 -u user
+ hg -q log
1:3aa14bbc23d90e3f8b5b639b4a43d76509bae76c
0:8633637036c18f021d771208e16ae3508ab81d28
+ hg id
3aa14bbc23d9 tip
+ hg update -C 0
+ hg id
8633637036c1
+ hg id
8633637036c1+
+ hg revert
+ hg diff
+ hg status
+ hg id
8633637036c1
+ hg update
+ hg diff
+ hg status
+ hg id
3aa14bbc23d9 tip
+ hg update -C 0
+ hg update
merging file1
+ hg diff
FIXME: This is a known bug:
+ hg status
+ hg id
3aa14bbc23d9 tip
+ hg revert
+ hg diff
+ hg status
+ hg id
3aa14bbc23d9 tip
+ hg revert -r tip
+ hg diff
+ hg status
+ hg id
3aa14bbc23d9 tip
+ hg update -C
+ hg diff
+ hg status
+ hg id
3aa14bbc23d9 tip