##// END OF EJS Templates
largefiles: optimize status when files are specified (issue3144)...
largefiles: optimize status when files are specified (issue3144) This fixes a performance issue with 'hg status' when files are specified on the command-line. Previously, a large amount of largefiles code was executed, even if files were specified on the command-line and those files were not largefiles. This patch fixes the problem by first checking if non-largefiles were specified on the command-line and, just letting the normal status function handle the case if they were. On a brand new machine, the execution time for 'hg status filename' on a repository with largefiles was: real 0m0.636s user 0m0.512s sys 0m0.120s versus the following (the same repository, with largefiles disabled): real 0m0.215s user 0m0.180s sys 0m0.032s After this patch, the performance of 'hg status filename' on the same repository, with largefiles enabled is: real 0m0.228s user 0m0.189s sys 0m0.036s This performance boost is also true when patterns (rather than specific files) are specified on the command-line. In the case where patterns are specified in addition to a file list, we just defer to the normal codepath in order to not spend extra time expanding the patterns to just risk having to expand them again later.

File last commit:

r15447:9910f60a default
r15653:93c77d5b default
Show More
test-notify-changegroup.t
126 lines | 2.9 KiB | text/troff | Tads3Lexer
/ tests / test-notify-changegroup.t
$ cat <<EOF >> $HGRCPATH
> [extensions]
> notify=
>
> [hooks]
> changegroup.notify = python:hgext.notify.hook
>
> [notify]
> sources = push
> diffstat = False
> maxsubject = 10
>
> [usersubs]
> foo@bar = *
>
> [reposubs]
> * = baz
> EOF
$ hg init a
clone
$ hg --traceback clone a b
updating to branch default
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo a > b/a
commit
$ hg --traceback --cwd b commit -Ama
adding a
$ echo a >> b/a
commit
$ hg --traceback --cwd b commit -Amb
push
$ hg --traceback --cwd b push ../a 2>&1 |
> python -c 'import sys,re; print re.sub("\n\t", " ", sys.stdin.read()),'
pushing to ../a
searching for changes
adding changesets
adding manifests
adding file changes
added 2 changesets with 2 changes to 1 files
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Date: * (glob)
Subject: * (glob)
From: test
X-Hg-Notification: changeset cb9a9f314b8b
Message-Id: <*> (glob)
To: baz, foo@bar
changeset cb9a9f314b8b in $TESTTMP/a (glob)
details: $TESTTMP/a?cmd=changeset;node=cb9a9f314b8b
summary: a
changeset ba677d0156c1 in $TESTTMP/a (glob)
details: $TESTTMP/a?cmd=changeset;node=ba677d0156c1
summary: b
diffs (6 lines):
diff -r 000000000000 -r ba677d0156c1 a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/a Thu Jan 01 00:00:00 1970 +0000
@@ -0,0 +1,2 @@
+a
+a
$ hg --cwd a rollback
repository tip rolled back to revision -1 (undo push)
unbundle with unrelated source
$ hg --cwd b bundle ../test.hg ../a
searching for changes
2 changesets found
$ hg --cwd a unbundle ../test.hg
adding changesets
adding manifests
adding file changes
added 2 changesets with 2 changes to 1 files
(run 'hg update' to get a working copy)
$ hg --cwd a rollback
repository tip rolled back to revision -1 (undo unbundle)
unbundle with correct source
$ hg --config notify.sources=unbundle --cwd a unbundle ../test.hg 2>&1 |
> python -c 'import sys,re; print re.sub("\n\t", " ", sys.stdin.read()),'
adding changesets
adding manifests
adding file changes
added 2 changesets with 2 changes to 1 files
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Date: * (glob)
Subject: * (glob)
From: test
X-Hg-Notification: changeset cb9a9f314b8b
Message-Id: <*> (glob)
To: baz, foo@bar
changeset cb9a9f314b8b in $TESTTMP/a (glob)
details: $TESTTMP/a?cmd=changeset;node=cb9a9f314b8b
summary: a
changeset ba677d0156c1 in $TESTTMP/a (glob)
details: $TESTTMP/a?cmd=changeset;node=ba677d0156c1
summary: b
diffs (6 lines):
diff -r 000000000000 -r ba677d0156c1 a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/a Thu Jan 01 00:00:00 1970 +0000
@@ -0,0 +1,2 @@
+a
+a
(run 'hg update' to get a working copy)