[Bug 4529] New: hg status --copies foo.txt is extremely slow

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Wed Feb 4 15:55:55 CST 2015


          Priority: normal
            Bug ID: 4529
                CC: mercurial-devel at selenic.com
          Assignee: bugzilla at selenic.com
           Summary: hg status --copies foo.txt is extremely slow
          Severity: bug
    Classification: Unclassified
                OS: Mac OS
          Reporter: durham at fb.com
          Hardware: PC
            Status: UNCONFIRMED
           Version: 3.3
         Component: Mercurial
           Product: Mercurial

In the Mercurial repo, run "hg status --copies --rev 0 Makefile".  Notice that
it takes 73 seconds.  A profile shows that all of the time is spent in

| 97.9%  copies.py:      _tracefile                line 174:  ofctx =
_tracefile(b[f], am, limit)
| 97.5%  context.py:     ancestors                 line 133:  for f in
| 95.8%  context.py:     parents                   line 936:  for parent in
| 94.3%  context.py:     _adjustlinkrev            line 815:  rev =
_adjustlinkrev(self._repo, path...
 \ 84.1%  ancestor.py:    __contains__             line 46:  if lkr not in anc:
   | 30.0%  changelog.py:   parentrevs             line 344:  for parent in
   |  8.9%  revlog.py:      parentrevs             line 219:  return
super(changelog, self).parentr...
 \  9.0%  changelog.py:   read                     line 48:  ac = cl.read(a) #
get changeset data ...
   |  6.5%  revlog.py:      revision               line 312:  text =
Sample count: 3363
Total time: 73.980000 seconds

This is because status traces the history of every file in the working copy,
not just the desired file.

This affects the performance of double clicking files in commits in IntelliJ
because it runs 'hg status --copies foo.txt'.

You are receiving this mail because:
You are on the CC list for the bug.

More information about the Mercurial-devel mailing list