comparison mercurial/patch.py @ 14531:b88368a3ade4

patch: remove redundant islink() call
author Patrick Mezard <pmezard@gmail.com>
date Sun, 05 Jun 2011 13:27:06 +0200
parents 1ffeeb91c55d
children aa12e1bbde10
comparison
equal deleted inserted replaced
14530:cd31a1cc1521 14531:b88368a3ade4
394 394
395 def getfile(self, fname): 395 def getfile(self, fname):
396 path = self._join(fname) 396 path = self._join(fname)
397 if os.path.islink(path): 397 if os.path.islink(path):
398 return (os.readlink(path), (True, False)) 398 return (os.readlink(path), (True, False))
399 isexec, islink = False, False 399 isexec = False
400 try: 400 try:
401 isexec = os.lstat(path).st_mode & 0100 != 0 401 isexec = os.lstat(path).st_mode & 0100 != 0
402 islink = os.path.islink(path)
403 except OSError, e: 402 except OSError, e:
404 if e.errno != errno.ENOENT: 403 if e.errno != errno.ENOENT:
405 raise 404 raise
406 return (self.opener.read(fname), (islink, isexec)) 405 return (self.opener.read(fname), (False, isexec))
407 406
408 def setfile(self, fname, data, mode, copysource): 407 def setfile(self, fname, data, mode, copysource):
409 islink, isexec = mode 408 islink, isexec = mode
410 if data is None: 409 if data is None:
411 util.setflags(self._join(fname), islink, isexec) 410 util.setflags(self._join(fname), islink, isexec)