[PATCH 2 of 2] largefiles: drop the unused lfcommands._addchangeset()

Matt Harbison matt_harbison at yahoo.com
Thu May 28 14:32:57 CDT 2015


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1432836851 14400
#      Thu May 28 14:14:11 2015 -0400
# Node ID b4347707e5d39f8302e6f94490e80d71fffc4671
# Parent  f587c4efdb86aea17bb8c44f0a21aa1efb780444
largefiles: drop the unused lfcommands._addchangeset()

diff --git a/hgext/largefiles/lfcommands.py b/hgext/largefiles/lfcommands.py
--- a/hgext/largefiles/lfcommands.py
+++ b/hgext/largefiles/lfcommands.py
@@ -170,60 +170,6 @@
             # we failed, remove the new directory
             shutil.rmtree(rdst.root)
 
-def _addchangeset(ui, rsrc, rdst, ctx, revmap):
-    # Convert src parents to dst parents
-    parents = _convertparents(ctx, revmap)
-
-    # Generate list of changed files
-    files = _getchangedfiles(ctx, parents)
-
-    def getfilectx(repo, memctx, f):
-        if lfutil.standin(f) in files:
-            # if the file isn't in the manifest then it was removed
-            # or renamed, raise IOError to indicate this
-            try:
-                fctx = ctx.filectx(lfutil.standin(f))
-            except error.LookupError:
-                return None
-            renamed = fctx.renamed()
-            if renamed:
-                renamed = lfutil.splitstandin(renamed[0])
-
-            hash = fctx.data().strip()
-            path = lfutil.findfile(rsrc, hash)
-
-            # If one file is missing, likely all files from this rev are
-            if path is None:
-                cachelfiles(ui, rsrc, ctx.node())
-                path = lfutil.findfile(rsrc, hash)
-
-                if path is None:
-                    raise util.Abort(
-                        _("missing largefile \'%s\' from revision %s")
-                         % (f, node.hex(ctx.node())))
-
-            data = ''
-            fd = None
-            try:
-                fd = open(path, 'rb')
-                data = fd.read()
-            finally:
-                if fd:
-                    fd.close()
-            return context.memfilectx(repo, f, data, 'l' in fctx.flags(),
-                                      'x' in fctx.flags(), renamed)
-        else:
-            return _getnormalcontext(repo, ctx, f, revmap)
-
-    dstfiles = []
-    for file in files:
-        if lfutil.isstandin(file):
-            dstfiles.append(lfutil.splitstandin(file))
-        else:
-            dstfiles.append(file)
-    # Commit
-    _commitcontext(rdst, parents, ctx, dstfiles, getfilectx, revmap)
-
 def _lfconvert_addchangeset(rsrc, rdst, ctx, revmap, lfiles, normalfiles,
         matcher, size, lfiletohash):
     # Convert src parents to dst parents


More information about the Mercurial-devel mailing list