Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/context.py @ 3964:2308c39b9521
make it possible to use changectx to create a filectx
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Mon, 25 Dec 2006 17:43:44 +0100 |
parents | 2b8825c94c5a |
children | 2e5161335e65 |
comparison
equal
deleted
inserted
replaced
3963:ba45041827a2 | 3964:2308c39b9521 |
---|---|
123 """changeid can be a changeset revision, node, or tag. | 123 """changeid can be a changeset revision, node, or tag. |
124 fileid can be a file revision or node.""" | 124 fileid can be a file revision or node.""" |
125 self._repo = repo | 125 self._repo = repo |
126 self._path = path | 126 self._path = path |
127 | 127 |
128 assert changeid is not None or fileid is not None | 128 assert (changeid is not None |
129 or fileid is not None | |
130 or changectx is not None) | |
129 | 131 |
130 if filelog: | 132 if filelog: |
131 self._filelog = filelog | 133 self._filelog = filelog |
132 if changectx: | |
133 self._changectx = changectx | |
134 self._changeid = changectx.node() | |
135 | 134 |
136 if fileid is None: | 135 if fileid is None: |
137 self._changeid = changeid | 136 if changectx is None: |
137 self._changeid = changeid | |
138 else: | |
139 self._changectx = changectx | |
138 else: | 140 else: |
139 self._fileid = fileid | 141 self._fileid = fileid |
140 | 142 |
141 def __getattr__(self, name): | 143 def __getattr__(self, name): |
142 if name == '_changectx': | 144 if name == '_changectx': |