comparison mercurial/context.py @ 19539:79671c46bb46

changectx: if passing a basectx then exit __init__ immediately
author Sean Farley <sean.michael.farley@gmail.com>
date Tue, 06 Aug 2013 16:42:41 -0500
parents 049d6b5a4a59
children 7b864da00e21
comparison
equal deleted inserted replaced
19538:049d6b5a4a59 19539:79671c46bb46
39 """A changecontext object makes access to data related to a particular 39 """A changecontext object makes access to data related to a particular
40 changeset convenient. It represents a read-only context already presnt in 40 changeset convenient. It represents a read-only context already presnt in
41 the repo.""" 41 the repo."""
42 def __init__(self, repo, changeid=''): 42 def __init__(self, repo, changeid=''):
43 """changeid is a revision number, node, or tag""" 43 """changeid is a revision number, node, or tag"""
44
45 # since basectx.__new__ already took care of copying the object, we
46 # don't need to do anything in __init__, so we just exit here
47 if isinstance(changeid, basectx):
48 return
49
44 if changeid == '': 50 if changeid == '':
45 changeid = '.' 51 changeid = '.'
46 self._repo = repo 52 self._repo = repo
47 53
48 if isinstance(changeid, int): 54 if isinstance(changeid, int):