Impact of repo.status() calls
Steve Borho
steve at borho.org
Fri Nov 12 22:58:04 UTC 2010
On Fri, Nov 12, 2010 at 4:51 PM, Greg Ward <greg at gerg.ca> wrote:
> On Fri, Nov 12, 2010 at 5:38 PM, Steve Borho <steve at borho.org> wrote:
>> Would you care to re-run those tests while dumping tracebacks for each
>> call? I'm curious myself where the multiple calls are coming from.
>
> Good idea!
>
> Clicking on a single changeset calls repo.status() twice:
>
> """
> [...]
> File "/home/gward/src/tortoisehg/tortoisehg/hgtk/hgtk.py", line 346, in gtkrun
> gtk.main()
> File "/home/gward/src/tortoisehg/tortoisehg/hgtk/logview/treeview.py",
> line 588, in _on_selection_changed
> self.emit('revision-selected')
> File "/home/gward/src/tortoisehg/tortoisehg/hgtk/history.py", line
> 665, in selection_changed
> self.changeview.load_details(self.currevid)
> File "/home/gward/src/tortoisehg/tortoisehg/hgtk/changeset.py", line
> 172, in load_details
> modified, added, removed = self.repo.status(parent, ctx.node())[:3]
> File "/home/gward/lib/python/mercurial/localrepo.py", line 1029, in status
> traceback.print_stack()
> localrepo.status(fe158005fdb5:38797da2d0a9) ... 0.37 s
>
> [...]
> File "/home/gward/src/tortoisehg/tortoisehg/hgtk/hgtk.py", line 346, in gtkrun
> gtk.main()
> File "/home/gward/src/tortoisehg/tortoisehg/hgtk/logview/treeview.py",
> line 588, in _on_selection_changed
> self.emit('revision-selected')
> File "/home/gward/src/tortoisehg/tortoisehg/hgtk/history.py", line
> 665, in selection_changed
> self.changeview.load_details(self.currevid)
> File "/home/gward/src/tortoisehg/tortoisehg/hgtk/changeset.py", line
> 193, in load_details
> self._filesel.select_path((1,))
> File "/home/gward/src/tortoisehg/tortoisehg/hgtk/changeset.py", line
> 275, in filelist_rowchanged
> self.append_diff(self.curfile)
> File "/home/gward/src/tortoisehg/tortoisehg/hgtk/changeset.py", line
> 362, in append_diff
> for s in patch.diff(self.repo, n1, n2, match=m, opts=opts):
> File "/home/gward/lib/python/mercurial/patch.py", line 1451, in diff
> changes = repo.status(ctx1, ctx2, match=match)
> File "/home/gward/lib/python/mercurial/localrepo.py", line 1029, in status
> traceback.print_stack()
> localrepo.status(fe158005fdb5:38797da2d0a9) ... 0.28 s
> """
>
> The stack trace is the same up to gtkrun(), so I figured leaving off
> the beginning was safe.
>
> Now I click on "[All Files]" for a changeset that modifies 7 files,
> and get 7 calls to repo.status(). It looks like all 7 have the exact
> same stack trace:
>
> """
> [...]
> File "/home/gward/src/tortoisehg/tortoisehg/hgtk/hgtk.py", line 346, in gtkrun
> gtk.main()
> File "/home/gward/src/tortoisehg/tortoisehg/hgtk/changeset.py", line
> 278, in filelist_rowchanged
> self.append_diff(f)
> File "/home/gward/src/tortoisehg/tortoisehg/hgtk/changeset.py", line
> 362, in append_diff
> for s in patch.diff(self.repo, n1, n2, match=m, opts=opts):
> File "/home/gward/lib/python/mercurial/patch.py", line 1451, in diff
> changes = repo.status(ctx1, ctx2, match=match)
> File "/home/gward/lib/python/mercurial/localrepo.py", line 1029, in status
> traceback.print_stack()
> localrepo.status(fe158005fdb5:38797da2d0a9) ... 0.28 s
> """
>
> Greg
>
Wow, patch.diff() calls repo.status(). Who knew? :)
Surely that's improvable.
--
Steve Borho
More information about the Mercurial-devel
mailing list