Mercurial > public > mercurial-scm > hg-stable
diff mercurial/context.py @ 21480:d19f491e5d5b
workingctx: use inheritance for _buildstatus while keeping the fastpath
This patch maintains the fast path for workingctx which is to not build a
manifest if the working directory is being compared to its parent since, in
this case, we can just copy the parent manifest.
author | Sean Farley <sean.michael.farley@gmail.com> |
---|---|
date | Thu, 24 Apr 2014 08:34:44 -0500 |
parents | 466964bdf4c1 |
children | 2f1567ef70ba |
line wrap: on
line diff
--- a/mercurial/context.py Tue Apr 22 19:06:37 2014 -0500 +++ b/mercurial/context.py Thu Apr 24 08:34:44 2014 -0500 @@ -1327,6 +1327,21 @@ return [modified, added, removed, deleted, unknown, ignored, clean] + def _buildstatus(self, other, s, match, listignored, listclean, + listunknown): + """build a status with respect to another context + + This includes logic for maintaining the fast path of status when + comparing the working directory against its parent, which is to skip + building a new manifest if self (working directory) is not comparing + against its parent (repo['.']). + """ + if other != self._repo['.']: + s = super(workingctx, self)._buildstatus(other, s, match, + listignored, listclean, + listunknown) + return s + def status(self, ignored=False, clean=False, unknown=False, match=None): """Explicit status query Unless this method is used to query the working copy status, the