comparison mercurial/context.py @ 41995:6fef387af1da

memfilectx: override copysource() instead of using dummy nodeid The "_copied" property in basefilectx is used by renamed() and copysource(). committablefilectx (which memfilectx subclasses) overrides renamed() and writes it in terms of copysource() instead of _copied. That means that the nodeid part of "_copied" is memfilectx is unused. Let's instead override copysource() too so we don't need the "_copied". Differential Revision: https://phab.mercurial-scm.org/D6159
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 19 Mar 2019 23:00:07 -0700
parents 550a172a603b
children b63b8b7ca5fa
comparison
equal deleted inserted replaced
41994:550a172a603b 41995:6fef387af1da
2391 self._flags = 'l' 2391 self._flags = 'l'
2392 elif isexec: 2392 elif isexec:
2393 self._flags = 'x' 2393 self._flags = 'x'
2394 else: 2394 else:
2395 self._flags = '' 2395 self._flags = ''
2396 self._copied = None 2396 self._copysource = copysource
2397 if copysource: 2397
2398 self._copied = (copysource, nullid) 2398 def copysource(self):
2399 return self._copysource
2399 2400
2400 def cmp(self, fctx): 2401 def cmp(self, fctx):
2401 return self.data() != fctx.data() 2402 return self.data() != fctx.data()
2402 2403
2403 def data(self): 2404 def data(self):