Mercurial > public > mercurial-scm > hg-stable
diff mercurial/localrepo.py @ 7090:7b5c063b0b94
diff: pass contexts to status
Allow status() to take contexts as well as nodes. This lets us avoid
unpacking manifests multiple times and intelligently unpack manifests
in revision order. Also, we can avoid unpacking manifests at all when
there are no changes in the working directory.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 12 Oct 2008 15:21:08 -0500 |
parents | ccbd39cad3c3 |
children | b801d6e5dc83 |
line wrap: on
line diff
--- a/mercurial/localrepo.py Sun Oct 12 15:21:08 2008 -0500 +++ b/mercurial/localrepo.py Sun Oct 12 15:21:08 2008 -0500 @@ -965,13 +965,24 @@ del mf[fn] return mf - ctx1 = self[node1] - ctx2 = self[node2] + if isinstance(node1, context.changectx): + ctx1 = node1 + else: + ctx1 = self[node1] + if isinstance(node2, context.changectx): + ctx2 = node2 + else: + ctx2 = self[node2] + working = ctx2 == self[None] parentworking = working and ctx1 == self['.'] match = match or match_.always(self.root, self.getcwd()) listignored, listclean, listunknown = ignored, clean, unknown + # load earliest manifest first for caching reasons + if not working and ctx2.rev() < ctx1.rev(): + ctx2.manifest() + if not parentworking: def bad(f, msg): if f not in ctx1: