comparison mercurial/localrepo.py @ 6739:c9fbd6ec3489

context: avoid using None for working parent
author Matt Mackall <mpm@selenic.com>
date Wed, 25 Jun 2008 17:35:20 -0500
parents 369ddc9c0339
children b148e9099133
comparison
equal deleted inserted replaced
6738:336fda65759a 6739:c9fbd6ec3489
481 def file(self, f): 481 def file(self, f):
482 if f[0] == '/': 482 if f[0] == '/':
483 f = f[1:] 483 f = f[1:]
484 return filelog.filelog(self.sopener, f) 484 return filelog.filelog(self.sopener, f)
485 485
486 def changectx(self, changeid=None): 486 def changectx(self, changeid):
487 if changeid == None:
488 raise "nope!"
487 return context.changectx(self, changeid) 489 return context.changectx(self, changeid)
488 490
489 def workingctx(self): 491 def workingctx(self):
490 return context.workingctx(self) 492 return context.workingctx(self)
491 493
1016 # are we comparing working dir against its parent? 1018 # are we comparing working dir against its parent?
1017 if compareworking: 1019 if compareworking:
1018 if lookup: 1020 if lookup:
1019 fixup = [] 1021 fixup = []
1020 # do a full compare of any files that might have changed 1022 # do a full compare of any files that might have changed
1021 ctx = self.changectx() 1023 ctx = self.changectx('')
1022 mexec = lambda f: 'x' in ctx.fileflags(f) 1024 mexec = lambda f: 'x' in ctx.fileflags(f)
1023 mlink = lambda f: 'l' in ctx.fileflags(f) 1025 mlink = lambda f: 'l' in ctx.fileflags(f)
1024 is_exec = util.execfunc(self.root, mexec) 1026 is_exec = util.execfunc(self.root, mexec)
1025 is_link = util.linkfunc(self.root, mlink) 1027 is_link = util.linkfunc(self.root, mlink)
1026 def flags(f): 1028 def flags(f):