comparison mercurial/context.py @ 8812:859f841937d0

subrepo: introduce basic state parsing
author Matt Mackall <mpm@selenic.com>
date Mon, 15 Jun 2009 02:45:38 -0500
parents e8de59577257
children db3c1ab0e632
comparison
equal deleted inserted replaced
8811:8b35b08724eb 8812:859f841937d0
5 # This software may be used and distributed according to the terms of the 5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2, incorporated herein by reference. 6 # GNU General Public License version 2, incorporated herein by reference.
7 7
8 from node import nullid, nullrev, short, hex 8 from node import nullid, nullrev, short, hex
9 from i18n import _ 9 from i18n import _
10 import ancestor, bdiff, error, util 10 import ancestor, bdiff, error, util, subrepo
11 import os, errno 11 import os, errno
12 12
13 propertycache = util.propertycache 13 propertycache = util.propertycache
14 14
15 class changectx(object): 15 class changectx(object):
70 def _parents(self): 70 def _parents(self):
71 p = self._repo.changelog.parentrevs(self._rev) 71 p = self._repo.changelog.parentrevs(self._rev)
72 if p[1] == nullrev: 72 if p[1] == nullrev:
73 p = p[:-1] 73 p = p[:-1]
74 return [changectx(self._repo, x) for x in p] 74 return [changectx(self._repo, x) for x in p]
75
76 @propertycache
77 def substate(self):
78 return subrepo.state(self)
75 79
76 def __contains__(self, key): 80 def __contains__(self, key):
77 return key in self._manifest 81 return key in self._manifest
78 82
79 def __getitem__(self, key): 83 def __getitem__(self, key):