comparison hgext/convert/darcs.py @ 11134:33010ff1fd6f

convert: merge sources getmode() into getfile()
author Patrick Mezard <pmezard@gmail.com>
date Sun, 09 May 2010 21:52:34 +0200
parents 9f6731b03906
children 4481f8a93c7a
comparison
equal deleted inserted replaced
11133:d7b6aab612b4 11134:33010ff1fd6f
155 return sorted(changes), copies 155 return sorted(changes), copies
156 156
157 def getfile(self, name, rev): 157 def getfile(self, name, rev):
158 if rev != self.lastrev: 158 if rev != self.lastrev:
159 raise util.Abort(_('internal calling inconsistency')) 159 raise util.Abort(_('internal calling inconsistency'))
160 return open(os.path.join(self.tmppath, name), 'rb').read() 160 path = os.path.join(self.tmppath, name)
161 161 data = open(path, 'rb').read()
162 def getmode(self, name, rev): 162 mode = os.lstat(path).st_mode
163 mode = os.lstat(os.path.join(self.tmppath, name)).st_mode 163 mode = (mode & 0111) and 'x' or ''
164 return (mode & 0111) and 'x' or '' 164 return data, mode
165 165
166 def gettags(self): 166 def gettags(self):
167 return self.tags 167 return self.tags