##// END OF EJS Templates
largefiles: drop the unused lfcommands._addchangeset()
Matt Harbison -
r25326:238e5cd9 default
parent child Browse files
Show More
@@ -170,60 +170,6 b' def lfconvert(ui, src, dest, *pats, **op'
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
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
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
General Comments 0
You need to be logged in to leave comments. Login now