hgext/largefiles/lfcommands.py
changeset 17424 e7cfe3587ea4
parent 17299 e51d4aedace9
child 17430 e841ecc03765
equal deleted inserted replaced
17406:fc14953e8e34 17424:e7cfe3587ea4
    63         # which can't change.
    63         # which can't change.
    64         dstwlock = rdst.wlock()
    64         dstwlock = rdst.wlock()
    65         dstlock = rdst.lock()
    65         dstlock = rdst.lock()
    66 
    66 
    67         # Get a list of all changesets in the source.  The easy way to do this
    67         # Get a list of all changesets in the source.  The easy way to do this
    68         # is to simply walk the changelog, using changelog.nodesbewteen().
    68         # is to simply walk the changelog, using changelog.nodesbetween().
    69         # Take a look at mercurial/revlog.py:639 for more details.
    69         # Take a look at mercurial/revlog.py:639 for more details.
    70         # Use a generator instead of a list to decrease memory usage
    70         # Use a generator instead of a list to decrease memory usage
    71         ctxs = (rsrc[ctx] for ctx in rsrc.changelog.nodesbetween(None,
    71         ctxs = (rsrc[ctx] for ctx in rsrc.changelog.nodesbetween(None,
    72             rsrc.heads())[0])
    72             rsrc.heads())[0])
    73         revmap = {node.nullid: node.nullid}
    73         revmap = {node.nullid: node.nullid}
   175     dstfiles = []
   175     dstfiles = []
   176     for f in files:
   176     for f in files:
   177         if f not in lfiles and f not in normalfiles:
   177         if f not in lfiles and f not in normalfiles:
   178             islfile = _islfile(f, ctx, matcher, size)
   178             islfile = _islfile(f, ctx, matcher, size)
   179             # If this file was renamed or copied then copy
   179             # If this file was renamed or copied then copy
   180             # the lfileness of its predecessor
   180             # the largefile-ness of its predecessor
   181             if f in ctx.manifest():
   181             if f in ctx.manifest():
   182                 fctx = ctx.filectx(f)
   182                 fctx = ctx.filectx(f)
   183                 renamed = fctx.renamed()
   183                 renamed = fctx.renamed()
   184                 renamedlfile = renamed and renamed[0] in lfiles
   184                 renamedlfile = renamed and renamed[0] in lfiles
   185                 islfile |= renamedlfile
   185                 islfile |= renamedlfile
   387 
   387 
   388     for lfile in lfiles:
   388     for lfile in lfiles:
   389         # If we are mid-merge, then we have to trust the standin that is in the
   389         # If we are mid-merge, then we have to trust the standin that is in the
   390         # working copy to have the correct hashvalue.  This is because the
   390         # working copy to have the correct hashvalue.  This is because the
   391         # original hg.merge() already updated the standin as part of the normal
   391         # original hg.merge() already updated the standin as part of the normal
   392         # merge process -- we just have to udpate the largefile to match.
   392         # merge process -- we just have to update the largefile to match.
   393         if (getattr(repo, "_ismerging", False) and
   393         if (getattr(repo, "_ismerging", False) and
   394              os.path.exists(repo.wjoin(lfutil.standin(lfile)))):
   394              os.path.exists(repo.wjoin(lfutil.standin(lfile)))):
   395             expectedhash = lfutil.readstandin(repo, lfile)
   395             expectedhash = lfutil.readstandin(repo, lfile)
   396         else:
   396         else:
   397             expectedhash = repo[node][lfutil.standin(lfile)].data().strip()
   397             expectedhash = repo[node][lfutil.standin(lfile)].data().strip()