Comments
Patch
@@ -22,11 +22,20 @@
workingctx: a context that represents the working directory and can
be committed,
memctx: a context that represents changes in-memory and can also
be committed."""
def __new__(cls, repo, changeid='', *args, **kwargs):
- return super(context, cls).__new__(cls)
+ if isinstance(changeid, context):
+ return changeid
+
+ o = super(context, cls).__new__(cls)
+
+ o._repo = repo
+ o._rev = nullrev
+ o._node = nullid
+
+ return o
class changectx(context):
"""A changecontext object makes access to data related to a particular
changeset convenient. It represents a read-only context already presnt in
the repo."""