##// END OF EJS Templates
basectx: return a copied context if changeid is already a basectx...
Sean Farley -
r19538:049d6b5a default
parent child Browse files
Show More
@@ -24,7 +24,16 b' class basectx(object):'
24 memctx: a context that represents changes in-memory and can also
24 memctx: a context that represents changes in-memory and can also
25 be committed."""
25 be committed."""
26 def __new__(cls, repo, changeid='', *args, **kwargs):
26 def __new__(cls, repo, changeid='', *args, **kwargs):
27 return super(basectx, cls).__new__(cls)
27 if isinstance(changeid, basectx):
28 return changeid
29
30 o = super(basectx, cls).__new__(cls)
31
32 o._repo = repo
33 o._rev = nullrev
34 o._node = nullid
35
36 return o
28
37
29 class changectx(basectx):
38 class changectx(basectx):
30 """A changecontext object makes access to data related to a particular
39 """A changecontext object makes access to data related to a particular
General Comments 0
You need to be logged in to leave comments. Login now