make it possible to use changectx to create a filectx
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Mon, 25 Dec 2006 17:43:44 +0100
changeset 3964 2308c39b9521
parent 3963 ba45041827a2
child 3965 2e5161335e65
make it possible to use changectx to create a filectx
mercurial/context.py
tests/test-git-export
--- a/mercurial/context.py	Mon Dec 25 13:37:00 2006 +0100
+++ b/mercurial/context.py	Mon Dec 25 17:43:44 2006 +0100
@@ -125,16 +125,18 @@
         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