# HG changeset patch # User Benoit Boissinot # Date 2006-12-25 16:43:44 # Node ID 2308c39b95218f63b1756cea8bc072bbbadc8bfe # Parent ba45041827a2b7380186016ac681b24a8c562ae7 make it possible to use changectx to create a filectx diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -125,16 +125,18 @@ class filectx(object): self._repo = repo self._path = path - assert changeid is not None or fileid is not None + assert (changeid is not None + or fileid is not None + or changectx is not None) if filelog: self._filelog = filelog - if changectx: - self._changectx = changectx - self._changeid = changectx.node() if fileid is None: - self._changeid = changeid + if changectx is None: + self._changeid = changeid + else: + self._changectx = changectx else: self._fileid = fileid