comparison hgext/largefiles/lfcommands.py @ 25326:238e5cd94bbc

largefiles: drop the unused lfcommands._addchangeset()
author Matt Harbison <matt_harbison@yahoo.com>
date Thu, 28 May 2015 14:14:11 -0400
parents fcd2f9b06629
children b8fd605b0c88
comparison
equal deleted inserted replaced
25325:fcd2f9b06629 25326:238e5cd94bbc
167 rdst.dirstate.clear() 167 rdst.dirstate.clear()
168 release(dstlock, dstwlock) 168 release(dstlock, dstwlock)
169 if not success: 169 if not success:
170 # we failed, remove the new directory 170 # we failed, remove the new directory
171 shutil.rmtree(rdst.root) 171 shutil.rmtree(rdst.root)
172
173 def _addchangeset(ui, rsrc, rdst, ctx, revmap):
174 # Convert src parents to dst parents
175 parents = _convertparents(ctx, revmap)
176
177 # Generate list of changed files
178 files = _getchangedfiles(ctx, parents)
179
180 def getfilectx(repo, memctx, f):
181 if lfutil.standin(f) in files:
182 # if the file isn't in the manifest then it was removed
183 # or renamed, raise IOError to indicate this
184 try:
185 fctx = ctx.filectx(lfutil.standin(f))
186 except error.LookupError:
187 return None
188 renamed = fctx.renamed()
189 if renamed:
190 renamed = lfutil.splitstandin(renamed[0])
191
192 hash = fctx.data().strip()
193 path = lfutil.findfile(rsrc, hash)
194
195 # If one file is missing, likely all files from this rev are
196 if path is None:
197 cachelfiles(ui, rsrc, ctx.node())
198 path = lfutil.findfile(rsrc, hash)
199
200 if path is None:
201 raise util.Abort(
202 _("missing largefile \'%s\' from revision %s")
203 % (f, node.hex(ctx.node())))
204
205 data = ''
206 fd = None
207 try:
208 fd = open(path, 'rb')
209 data = fd.read()
210 finally:
211 if fd:
212 fd.close()
213 return context.memfilectx(repo, f, data, 'l' in fctx.flags(),
214 'x' in fctx.flags(), renamed)
215 else:
216 return _getnormalcontext(repo, ctx, f, revmap)
217
218 dstfiles = []
219 for file in files:
220 if lfutil.isstandin(file):
221 dstfiles.append(lfutil.splitstandin(file))
222 else:
223 dstfiles.append(file)
224 # Commit
225 _commitcontext(rdst, parents, ctx, dstfiles, getfilectx, revmap)
226 172
227 def _lfconvert_addchangeset(rsrc, rdst, ctx, revmap, lfiles, normalfiles, 173 def _lfconvert_addchangeset(rsrc, rdst, ctx, revmap, lfiles, normalfiles,
228 matcher, size, lfiletohash): 174 matcher, size, lfiletohash):
229 # Convert src parents to dst parents 175 # Convert src parents to dst parents
230 parents = _convertparents(ctx, revmap) 176 parents = _convertparents(ctx, revmap)